State = Win32API.new('user32','GetKeyState',['i'],'i')
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
USED_KEYS = [Mouse_Left, Mouse_Right]
module_function
def self.getstate(key)
return true unless State.call(key).between?(0, 1)
return false
end
def self.testkey(key)
Key.call(key) & 0x01 == 1
end
def self.update
@keys = []
@keys.push(Input::Mouse_Left) if self.testkey(Input::Mouse_Left)
@keys.push(Input::Mouse_Right) if self.testkey(Input::Mouse_Right)
@keys.push(Input::Back) if self.testkey(Input::Back)
@keys.push(Input::Tab) if self.testkey(Input::Tab)
@keys.push(Input::Enter) if self.testkey(Input::Enter)
@keys.push(Input::Shift) if self.testkey(Input::Shift)
@keys.push(Input::Ctrl) if self.testkey(Input::Ctrl)
@keys.push(Input::Alt) if self.testkey(Input::Alt)
@keys.push(Input::Esc) if self.testkey(Input::Esc)
for key in Input::Letters.values
@keys.push(key) if self.testkey(key)
end
for key in Input::Numberkeys.values
@keys.push(key) if self.testkey(key)
end
for key in Input::Numberpad.values
@keys.push(key) if self.testkey(key)
end
for key in Input::Fkeys.values
@keys.push(key) if self.testkey(key)
end
@keys.push(Input::Collon) if self.testkey(Input::Collon)
@keys.push(Input::Equal) if self.testkey(Input::Equal)
@keys.push(Input::Comma) if self.testkey(Input::Comma)
@keys.push(Input::Underscore) if self.testkey(Input::Underscore)
@keys.push(Input::Dot) if self.testkey(Input::Dot)
@keys.push(Input::Backslash) if self.testkey(Input::Backslash)
@keys.push(Input::Lb) if self.testkey(Input::Lb)
@keys.push(Input::Rb) if self.testkey(Input::Rb)
@keys.push(Input::Quote) if self.testkey(Input::Quote)
@keys.push(Input::Space) if self.testkey(Input::Space)
@keys.push(Input::LT) if self.testkey(Input::LT)
@keys.push(Input::UPs) if self.testkey(Input::UPs)
@keys.push(Input::RT) if self.testkey(Input::RT)
@keys.push(Input::DN) if self.testkey(Input::DN)
@pressed = []
@pressed.push(Input::Space) if self.getstate(Input::Space)
@pressed.push(Input::Mouse_Left) if self.getstate(Input::Mouse_Left)
@pressed.push(Input::Mouse_Right) if self.getstate(Input::Mouse_Right)
@pressed.push(Input::Back) if self.getstate(Input::Back)
@pressed.push(Input::Tab) if self.getstate(Input::Tab)
@pressed.push(Input::Enter) if self.getstate(Input::Enter)
@pressed.push(Input::Shift) if self.getstate(Input::Shift)
@pressed.push(Input::Ctrl) if self.getstate(Input::Ctrl)
@pressed.push(Input::Alt) if self.getstate(Input::Alt)
@pressed.push(Input::Esc) if self.getstate(Input::Esc)
@pressed.push(Input::LT) if self.getstate(Input::LT)
@pressed.push(Input::UPs) if self.getstate(Input::UPs)
@pressed.push(Input::RT) if self.getstate(Input::RT)
@pressed.push(Input::DN) if self.getstate(Input::DN)
for key in Input::Numberkeys.values
@pressed.push(key) if self.getstate(key)
end
for key in Input::Numberpad.values
@pressed.push(key) if self.getstate(key)
end
for key in Input::Letters.values
@pressed.push(key) if self.getstate(key)
end
for key in Input::Fkeys.values
@pressed.push(key) if self.getstate(key)
end
@pressed.push(Input::Collon) if self.getstate(Input::Collon)
@pressed.push(Input::Equal) if self.getstate(Input::Equal)
@pressed.push(Input::Comma) if self.getstate(Input::Comma)
@pressed.push(Input::Underscore) if self.getstate(Input::Underscore)
@pressed.push(Input::Dot) if self.getstate(Input::Dot)
@pressed.push(Input::Backslash) if self.getstate(Input::Backslash)
@pressed.push(Input::Lb) if self.getstate(Input::Lb)
@pressed.push(Input::Rb) if self.getstate(Input::Rb)
@pressed.push(Input::Quote) if self.getstate(Input::Quote)
end
def self.triggerd?(key)
return true if @keys.include?(key)
return false
end
def self.pressed?(key)
return true if @pressed.include?(key)
return false
end
def self.dir4
return 2 if self.pressed?(Input::DN)
return 4 if self.pressed?(Input::LT)
return 6 if self.pressed?(Input::RT)
return 8 if self.pressed?(Input::UPs)
return 0
end
def trigger?(key)
Inputed?(key,"trigger")
end
def repeat?(key)
Inputed?(key,"repeat")
end
def press?(key)
Inputed?(key,"press")
end
def Inputed?(key,type)
keys = []
case key
when Input::DOWN
keys.push(Input::DN)
when Input::UP
keys.push(Input::UPs)
when Input::LEFT
keys.push(Input::LT)
when Input::RIGHT
keys.push(Input::RT)
when Input::A
keys.push(Input::Shift)
when Input::B
keys.push(Input::Esc, Input::Numberpad[0], Input::Letters["X"])
when Input::C
keys.push(Input::Space, Input::Enter)
when Input::L
keys.push(Input::Letters["Q"])
when Input::R
keys.push(Input::Letters["W"])
when Input::X
keys.push(Input::Letters["A"])
when Input::Y
keys.push(Input::Letters["S"])
when Input::Z
keys.push(Input::Letters["D"])
when Input::F5
keys.push(Input::Fkeys[5])
when Input::F6
keys.push(Input::Fkeys[6])
when Input::F7
keys.push(Input::Fkeys[7])
when Input::F8
keys.push(Input::Fkeys[8])
when Input::F9
keys.push(Input::Fkeys[9])
when Input::CTRL
keys.push(Input::Ctrl)
when Input::ALT
keys.push(Input::Alt)
else
keys.push(key)
end
case type
when "trigger"
for k in keys
if Input.triggerd?(k)
return true
end
end
when "repeat"
for k in keys
if Input.triggerd?(k)
return true
end
end
when "press"
for k in keys
if self.pressed?(k)
return true
end
end
end
return false
end
def check(key)
Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(key) & 0x01 == 1
end
def mouse_update
@used_i = []
for i in USED_KEYS
x = check(i)
if x == true
@used_i.push(i)
end
end
end
def self.name?(num)
return "MOUSE LEFT" if num==1
return "MOUSE RIGHT" if num==2
return "MOUSE MIDDLE" if num==4
return "MOUSE 4TH" if num==5
return "MOUSE 5TH" if num==6
return "BACKSPACE" if num==8
return "TAB" if num==9
return "RETURN" if num==13
return "SHIFT" if num==16
return "CTLR" if num==17
return "ALT" if num==18
return "CAPS LOCK" if num==20
return "ESCAPE" if num==27
return "SPACE" if num==32
return "PGUP" if num==33
return "PGDN" if num==34
return "END" if num==35
return "HOME" if num==36
return "LEFT" if num==37
return "UP" if num==38
return "RIGHT" if num==39
return "DOWN" if num==40
return "SNAPSHOT" if num==44
return "INSERT" if num==45
return "DELETE" if num==46
return "0" if num==48
return "1" if num==49
return "2" if num==50
return "3" if num==51
return "4" if num==52
return "5" if num==53
return "6" if num==54
return "7" if num==55
return "8" if num==56
return "9" if num==57
return "A" if num==65
return "B" if num==66
return "C" if num==67
return "D" if num==68
return "E" if num==69
return "F" if num==70
return "G" if num==71
return "H" if num==72
return "I" if num==73
return "J" if num==74
return "K" if num==75
return "L" if num==76
return "M" if num==77
return "N" if num==78
return "O" if num==79
return "P" if num==80
return "Q" if num==81
return "R" if num==82
return "S" if num==83
return "T" if num==84
return "U" if num==85
return "V" if num==86
return "W" if num==87
return "X" if num==88
return "Y" if num==89
return "Z" if num==90
return "LWIN" if num==91
return "RWIN" if num==92
return "APPS" if num==93
return "0" if num==96
return "1" if num==97
return "2" if num==98
return "3" if num==99
return "4" if num==100
return "5" if num==101
return "6" if num==102
return "7" if num==103
return "8" if num==104
return "9" if num==105
return "*" if num==106
return "+" if num==107
return "-" if num==109
return "." if num==110
return "/" if num==111
return "F1" if num==112
return "F2" if num==113
return "F3" if num==114
return "F4" if num==115
return "F5" if num==116
return "F6" if num==117
return "F7" if num==118
return "F8" if num==119
return "F9" if num==120
return "F10" if num==121
return "F11" if num==122
return "F12" if num==123
return "NUM LOCK" if num==144
return "SCROLL LOCK" if num==145
return "LEFT SHIFT" if num==160
return "RIGHT SHIFT" if num==161
return "LEFT CTRL" if num==162
return "RIGHT CTRL" if num==163
return "LEFT ALT" if num==164
return "RIGHT ALT" if num==165
return ";" if num==186
return "=" if num==187
return "," if num==188
return "_" if num==189
return "." if num==190
return "/" if num==191
return "`" if num==192
return "[" if num==219
return " \\ " if num==220
return "]" if num==221
return "'" if num==222
return "??? - " + "#{num}"
end
end
#==============================================================================
# High Priority
#==============================================================================
module AntiLag
def self.high_priority=(valor)
return if @@high_priority == valor
@@high_priority = valor
if @@high_priority
SPC.call(-1, 0x90)
return
end
SPC.call(-1, 0x10)
end
def change?
if @enemy.actor.dead? or @enemy.in_battle == false
dispose
return false
end
return true if @old_x != @enemy.screen_x-(self.bitmap.width/2)
return true if @old_y != @enemy.screen_y
end
#------------------------------------------------------------------------------#==============================================================================
class Requiem_BossBar < Sprite
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias requiem_sbabs_enemyhp_smap_start start
alias requiem_sbabs_enemyhp_smap_update update
alias requiem_sbabs_enemyhp_smap_terminate terminate
def start
requiem_sbabs_enemyhp_smap_start
@enemys_hp = {}
end
def update
requiem_sbabs_enemyhp_smap_update
for event in $game_map.events.values
if event.in_battle
if event.boss == true
@boss_hud = Requiem_BossBar.new(event.id,@spriteset.viewport3) if @boss_hud == nil and !event.actor.dead?
@boss_hud.update if @boss_hud != nil and !event.actor.dead?
@boss_hud.dispose if @boss_hud != nil and event.actor.dead?
@boss_hud = nil if @boss_hud != nil and event.actor.dead?
else
if $game_player.in_range?($game_player,event,5)
next if event.show_bar or event.object == true or event.puzzle == true or Requiem_SBABS::Show_Enemies_HP_Bars == false
@enemys_hp[event.id] = Requiem_EnemyHPBars.new(event,@spriteset.viewport3)
event.show_bar = true
elsif event.show_bar and @enemys_hp[event.id] != nil
@enemys_hp[event.id].dispose if !@enemys_hp[event.id].disposed?
@enemys_hp[event.id] = nil
event.show_bar = false
end
end
end
end
for bar in @enemys_hp.values
next if bar.nil? or bar.disposed?
bar.update
end
end
def terminate
requiem_sbabs_enemyhp_smap_terminate
@boss_hud.dispose if @boss_hud != nil
@boss_hud = nil
for bar in @enemys_hp.values
next if bar.nil? or bar.disposed?
bar.dispose
end
for event in $game_map.events.values
if event.in_battle
event.show_bar = false
end
end
end
end
#==============================================================================
# Requiem SBABS Ultimate Version
#==============================================================================
#------------------------------------------------------------------------------
# Credits: Vlad
# Email: [email protected]
#------------------------------------------------------------------------------
# To create an enemy, put the following comments in a event on map:
# Enemy ID - Change ID for a ID of a monster in Database;
# Die Erase - Erase the enemy when it dies;
# Die Self Switch A - Turn On the Self Switch A when enemy dies;
# Die Self Switch B - Turn On the Self Switch B when enemy dies;
# Die Self Switch C - Turn On the Self Switch C when enemy dies;
# Die Self Switch D - Turn On the Self Switch D when enemy dies;
# Die Self Switch X - Turn On the Switch X when enemy dies;
# Die Variable X - Increase +1 to variable X;
# Follow X - Change X for range of sight of the enemy, to it follow the player automatically
# Kill With Weapon X - The enemy will die only if be attacked with weapon X
# Kill With Skill X - The enemy will die only if be attacked with skill X
# Kill With Item X - The enemy will die only if be attacked with item X
# Divide EXP - Makes the EXP of enemy be divided by all members of the group in equal proportion
# Object - Makes the enemy be an object, and impossible to kill
# Puzzle - Makes the enemy be an puzzle, it can be killed but allies don't follow it, the damage and hp bar is not showed
# Boss - Shows the Boss HP Bar
#------------------------------------------------------------------------------
# GENERAL CONFIGURATIONS
#------------------------------------------------------------------------------
module Requiem_SBABS
#------------------------------------------------------------------------------
# ATTACK CONFIGURATIONS:
# Right hand attack key:
Right_Attack_Button = Input::Letters["A"]
# Left hand and Shield key:
Left_Attack_and_Shield_Button = Input::Letters["S"]
# Skills keys:
Skill_Buttons = [Input::Numberkeys[1], Input::Numberkeys[2], Input::Numberkeys[3]]
# Conjure Skills keys:
Conjure_Buttons = [Input::Numberkeys[4], Input::Numberkeys[5], Input::Numberkeys[6]]
# Items keys:
Item_Buttons = [Input::Numberkeys[7], Input::Numberkeys[8], Input::Numberkeys[9]]
# Text fysplayed when memorize skill or item in a key
Memorize_Text = "设定成功!"
# Attack delay for hero and allies (in frames)
Hero_Attack_Time = 60
# Attack delay for enemies (in frames)
Enemy_Attack_Time = 90
# Divide the size of Animation by:
Animations_Divide_By = 3
# Use animations in weapons? (true = yes / false = no)
Use_Weapons_Animations = true
# Move in 8 directions? (true = yes / false = no)
Eight_Dir_Movement = true
#------------------------------------------------------------------------------
# ALLIES CONFIGURATIONS:
# Use alies sytem? (true = yes / false = no)
Use_Allies = true
# Allow key to change the group order? (true = yes / false = no)
Change_Group_Order = true
# Key to change the group order:
Change_Group_Order_Button = Input::Letters["G"]
# Change the group order automatically if the main member die? (true = yes / false = no)
Next_if_Dead = true
# If the ally be in defensive mode, don't change it's map when teleport? (true = yes / false = no)
Defend_Dont_Transfer = true
# Allies sight range:
Ally_Sight = 5
# Divide the EXP for all members of the group in equal proportion? (true = yes / false = no)
# If not, only who kills the enemy, will gain the EXP
Divide_EXP = false
# Dead allies graphics:
Dead_Graphic = {}
# Copy: Dead_Graphics[A] = ["B",C] and change: A:Char ID, B:Dead Graphic, C:Graphic Index
Dead_Graphic[1] = ["Deads",0]
Dead_Graphic[2] = ["Deads",1]
Dead_Graphic[3] = ["Deads",2]
Dead_Graphic[4] = ["Deads",3]
#------------------------------------------------------------------------------
# DISTANCE WEAPONS CONFIGURATIONS:
# To create a distance weapon, copy: Distance_Weapons[A] = [B, C, D, E, F, G, H] and change:
# A:Weapon ID, B:Char, C:Char Index, D:Speed, E:Distance, F:Delay, G:Ammunition 1, H:Ammunition 2
Distance_Weapons = {}
Distance_Weapons[4] = ["$Arrow",0,6,5,45,22,23]
# CONJURE SKILLS CONFIGURATIONS:
# To create a skill what needs to conjure, copy: Conjure_Skills[A] = [B,C] and change:
# A:Skill ID, B:Time to Conjure (in frames), C:Delay
Conjure_Skills = {}
Conjure_Skills[60] = [250,100]
Conjure_Skills[64] = [250,100]
# EXPLOSIVE ITEMS CONFIGURATIONS:
# To create a item explosiv0, copy: Explode_Items[A] = [B, C, D, E, F, G] and change:
# A:ID da skill, B:Char, C:Char Index, D:Speed, E:Distancia, F:Explosion range (in tiles), G:Delay
Explode_Items = {}
Explode_Items[16] = ["Energy Ball", 0, 4, 5, 3, 60]
Explode_Items[18] = ["Energy Ball", 7, 4, 5, 3, 60]
Explode_Items[20] = ["Energy Ball", 3, 4, 5, 3, 60]
# BOMBS CONFIGURATIONS:
# To create a bomb, copy: Bomb_Items[A] = [B,C] and change:
# A:Item ID, B:Explosion range (in tiles), C:Time to explode
Bomb_Items = {}
Bomb_Items[24] = [2,300]
#Tic-Tac Boms SE (Put "" if you don't want sound)
Bomb_TicTac_SE = "Tic-Tac"
#------------------------------------------------------------------------------
# BLOW SOUND CONFIGURATIONS:
# To create a weapon with sound, copy: Weapon_Blow_SE[A] = ["B"] and change:
# A:Weapon ID, B:Sound name in SE folder
# Various sounds can be added, like so: Weapon_Blow_SE[A] = ["B","C","D"]
Weapon_Blow_SE = {}
Weapon_Blow_SE[4] = ["Blow7"]
# SOM AO USAR SKILL:
# To create a skill with sound, copy: Skill_Cast_SE[A] = "B" and change:
# A:Skill ID, B:Sound name in SE folder
Skill_Cast_SE = {}
Skill_Cast_SE[59] = "Fire1"
Skill_Cast_SE[63] = "Ice1"
Skill_Cast_SE[67] = "Thunder1"
Skill_Cast_SE[71] = "Water1"
Skill_Cast_SE[73] = "Earth1"
Skill_Cast_SE[75] = "Wind1"
Skill_Cast_SE[77] = "Saint7"
Skill_Cast_SE[79] = "Darkness4"
Skill_Cast_SE[81] = "Explosion1"
Skill_Cast_SE[82] = "Explosion1"
# SOM AO USAR ITEM:
# To create a item with sound, copy: Item_Cast_SE[A] = "B" and change:
# A:Item ID, B:Sound name in SE folder
Item_Cast_SE = {}
Item_Cast_SE[15] = "Fire1"
Item_Cast_SE[16] = "Fire1"
Item_Cast_SE[17] = "Ice1"
Item_Cast_SE[18] = "Ice1"
Item_Cast_SE[19] = "Thunder1"
Item_Cast_SE[20] = "Thunder1"
#------------------------------------------------------------------------------
# SHIELDS CONFIGURATIONS:
# Use shields? (trus = sim / false = n?o)
Use_Shields = true
# Defense rate (in %)
Defense_Rate = 75
#------------------------------------------------------------------------------
# LEVEL-UP CONFIGURATIONS:
# Change 40 for animation ID
LevelUp_Animation = 40
# Recovery HP and MP when level-up? (true = yes / false = no)
Restaure_When_UpLevel = true
#------------------------------------------------------------------------------
# ENEMIES CONFIGURATIONS:
# Copy: Enemy_animations[A] = [B, C, D] and change:
# A:Enemy ID, B:Enemy attack animation, C:Animation when enemy dies, D:SE when enemy dies
Enemy_animations = {}
Enemy_animations[0] = [0,0,""]
# Shows enemies HP bar? (true = yes / false = no)
Show_Enemies_HP_Bars = true
#------------------------------------------------------------------------------
# DROP CONFIGURATIONS:
# Index of the Gold icon:
Gold_Drop_Graphic = 147
# Gold drop rate (in %)
Gold_Drop_Rate = 75
# Time to dropped item auto-erase:
Drop_Duration_Time = 450
# Sound when gold is dropped:
Drop_Money_SE = "DropMoney"
# Sound when item is dropped:
Drop_Item_SE = "DropItem"
# Sound when get item or gold:
Get_Reward_SE = "GetReward"
#------------------------------------------------------------------------------
# STATUS CONFIGURATIONS:
# To create an animation for a state, copy: States_Animation[A] = [B] and change:
# A:State ID, B:Animation ID
States_Animation = {}
States_Animation[2] = 50
States_Animation[3] = 51
States_Animation[4] = 52
States_Animation[5] = 53
States_Animation[6] = 54
States_Animation[7] = 55
# Status that makes the target stay immobile:
States_Freeze = [5,7]
# Status that makes the target walk slow
States_Slower = [6,8]
# Status that makes the target walk fast
States_Faster = []
#------------------------------------------------------------------------------
# COMBO CONFIGURATIONS:
# Use combo? (true = yes / false = no)
Combo_Damage = true
# Hits quantity to have a combo damage:
Combo_Hits = 5
# Rate to have a combo damage (in %)
Combo_Percent = 75
#------------------------------------------------------------------------------
# DAMAGE CONFIGURATIONS:
Damage_Properties = []
Damage_Properties[1] = "Georgia" # Damage font
Damage_Properties[2] = 22 # Damage font size
Damage_Properties[3] = false # Font in bold? (true = yes / false = no)
Damage_Properties[4] = true # Font in italic? (true = yes / false = no)
Damage_Properties[5] = "Critical" # Critical damage text
Damage_Properties[6] = "Miss" # Miss damage text
Damage_Properties[7] = "Hits" # Hits text
Damage_Properties[8] = "Times New Roman" # Hits font
Damage_Properties[9] = 26 # Hits font size
Damage_Properties[10] = true # Font in bold? (true = yes / false = no)
Damage_Properties[11] = true # Font in italic? (true = yes / false = no)
Damage_Properties[12] = "Combo" # Combo damage text
Damage_Properties[13] = Color.new(255,255,255) # Damage font color
Damage_Properties[14] = Color.new(125,200,115) # Recovery font color
Damage_Properties[15] = Color.new(255,255,128) # Critical damage font color
Damage_Properties[16] = Color.new(245,150,120) # Combo damage font color
Damage_Properties[17] = Color.new(210,160,210) # Hits font color
Damage_Properties[18] = "Guard" # Defense text
Damage_Properties[19] = "Level Up" # Level-Up text
#------------------------------------------------------------------------------
end
#==============================================================================
#------------------------------------------------------------------------------
# Game Battler
#------------------------------------------------------------------------------
class Game_Battler
attr_accessor :combo
attr_accessor :state_turns
alias requiem_sbabs_gbattler_execute_damage execute_damage
def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2
damage = 0 if damage < 0
damage *= elements_max_rate(attacker.element_set)
damage /= 100
if damage == 0
damage = rand(2)
elsif damage > 0
@critical = (rand(100) < attacker.cri)
@critical = false if prevent_critical
damage *= 2 if @critical
@percent = rand(100)
if $game_player.hits >= Requiem_SBABS::Combo_Hits and Requiem_SBABS::Combo_Damage == true and @percent <= Requiem_SBABS::Combo_Percent
@combo = true
else
@combo = false
end
damage *= 3 if @combo
damage = apply_variance(damage,20)
damage = apply_guard(damage)
@hp_damage = damage
end
end
def remove_state(state_id)
return unless state?(state_id)
@states.delete(state_id)
@state_turns.delete(state_id)
end
end
#------------------------------------------------------------------------------
# Game Actor
#------------------------------------------------------------------------------
class Game_Actor
alias requiem_sbabs_gactor_initialize initialize
alias requiem_sbabs_gactor_setup setup
def initialize(actor_id)
requiem_sbabs_gactor_initialize(actor_id)
reset_keys
end
def setup(actor_id)
requiem_sbabs_gactor_setup(actor_id)
@ally = $game_player
end
def display_level_up(new_skills)
for i in 0...$game_party.members.size
if @actor_id == $game_party.members[0].id and Requiem_SBABS::LevelUp_Animation > 0
$game_player.animation_id = Requiem_SBABS::LevelUp_Animation
if Requiem_SBABS::Restaure_When_UpLevel == true
$game_player.actor.hp = $game_player.actor.maxhp
$game_player.actor.mp = $game_player.actor.maxmp
end
else
for ally in $game_allies
next if ally.nil?
if @actor_id == ally.actor_id and Requiem_SBABS::LevelUp_Animation > 0
ally.animation_id = Requiem_SBABS::LevelUp_Animation
if !ally.actor.dead? and Requiem_SBABS::Restaure_When_UpLevel == true
ally.actor.hp = ally.actor.maxhp
ally.actor.mp = ally.actor.maxmp
end
end
end
end
end
end
def atk_animation_id2
if two_swords_style
return weapons[1].nil? ? 1 : weapons[1].animation_id
else
return 1
end
end
def reset_keys
skil_key = {}
key_skil = []
for s in Requiem_SBABS::Skill_Buttons
key_skil.push(s)
skil_key = 0
end
@skill_hotkeys = skil_key
conjure_key = {}
key_conjure = []
for c in Requiem_SBABS::Conjure_Buttons
key_conjure.push(c)
conjure_key[c] = 0
end
@conjure_hotkeys = conjure_key
item_key = {}
key_item = []
for i in Requiem_SBABS::Item_Buttons
key_item.push(i)
item_key = 0
end
@item_hotkeys = item_key
end
end
#------------------------------------------------------------------------------
# Game Party
#------------------------------------------------------------------------------
class Game_Party < Game_Unit
alias requiem_sbabs_gparty_remove_actor remove_actor
alias requiem_sbabs_gparty_setup_starting_members setup_starting_members
def setup_starting_members
requiem_sbabs_gparty_setup_starting_members
if Requiem_SBABS::Use_Allies == true
for i in [email protected]
next if @actors.nil?
$game_allies = Game_Ally.new(i)
end
end
end
def add_actor(actor_id)
if @actors.size < MAX_MEMBERS and not @actors.include?(actor_id)
@actors.push(actor_id)
$game_player.refresh
id = @actors.size-1
if Requiem_SBABS::Use_Allies == true and id > 0
$game_allies[id] = Game_Ally.new(id)
$game_allies[id].moveto($game_player.x,$game_player.y)
$scene.add_ally($game_allies[id]) if $scene.is_a?(Scene_Map)
$game_allies[id].move_random
end
end
end
def remove_actor(actor_id)
requiem_sbabs_gparty_remove_actor(actor_id)
if Requiem_SBABS::Use_Allies == true
for ally in $game_allies
next if ally.nil?
if actor_id == ally.actor.id
$game_allies.delete(ally)
end
end
$scene.refresh_sprites if $scene.is_a?(Scene_Map)
end
end
def change_group_order
for ally in $game_allies
next if ally.nil? or ally.map_id == $game_map.map_id
return
end
return if @actors.size == 1
actor = @actors[0]
@actors.delete(actor)
@actors.compact
if all_dead?
@actors.insert(0,actor)
return
end
@actors.push(actor)
for a in members
next if a.nil?
if a.dead?
ally = a
@actors.delete(a)
@actors.push(a)
else
for i in $game_allies
next if i.nil? or i.actor != a
ally = i
end
break
end
end
allies = []
for a in $game_allies
next if a.nil?
allies.push(a)
end
allies.delete(ally)
allies.push($game_player)
allies.compact
for i in [email protected]
next if @actors.nil?
$game_allies = Game_Ally.new(i)
$game_allies.moveto(allies[i-1].x,allies[i-1].y)
if !allies[i-1].is_a?(Game_Player)
$game_allies.map_id = allies[i-1].map_id
else
$game_allies.map_id = $game_map.map_id
end
end
$game_player.moveto(ally.x,ally.y)
$game_player.refresh
$scene.refresh_sprites if $scene.is_a?(Scene_Map)
end
end
#------------------------------------------------------------------------------
# Game Map
#------------------------------------------------------------------------------
class Game_Map
def passable?(x, y, flag = 0x01)
for ally in $game_allies
next if ally.nil? or ally.actor.dead? or ally.map_id != $game_map.map_id
return false if ally.x == x and ally.y == y
end
all_passable?(x, y, flag)
end
def hero_passable?(x, y, flag = 0x01)
all_passable?(x, y, flag)
end
def range_passable?(x, y, flag = 0x01)
return true if @passages[@map.data[x,y,0]] == 9
all_passable?(x, y, flag)
end
def all_passable?(x, y, flag = 0x01)
for drop in $game_drop
next if drop.nil?
return false if drop.x == x and drop.y == y
end
for bomb in $game_bomb
next if bomb.nil?
return false if bomb.x == x and bomb.y == y
end
for event in events_xy(x, y)
next if event.tile_id == 0
next if event.priority_type > 0
next if event.through
pass = @passages[event.tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
for i in [2, 1, 0]
tile_id = @map.data[x, y, i]
return false if tile_id.nil?
pass = @passages[tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
return false
end
end
#------------------------------------------------------------------------------
# Game Character
#------------------------------------------------------------------------------
class Game_Character
alias requiem_sbabs_gchar_initialize initialize
alias requiem_sbabs_gchar_update update
def update
requiem_sbabs_gchar_update
return if $game_party.members.size <= 0
decrease_counters
death_control
end
def death_control
if Requiem_SBABS::Next_if_Dead == true
$game_temp.next_scene = "gameover" if $game_party.all_dead?
$game_party.change_group_order if $game_party.members[0].dead? and !$game_party.all_dead?
else
$game_temp.next_scene = "gameover" if $game_party.members[0].dead?
end
end
def decrease_counters
@ani_time -= 1 if @ani_time > 0
@weapon1_attack_time -= 1 if @weapon1_attack_time > 0
@weapon2_attack_time -= 1 if @weapon2_attack_time > 0
@skill_attack_time -= 1 if @skill_attack_time > 0
@item_attack_time -= 1 if @item_attack_time > 0
@recovery_time -= 1 if @recovery_time > 0
@anime_attack -= 1 if @anime_attack > 0
if @damaged == true
@damage_time += 1
@damaged = false if @damage_time >= 60
else
@damage_time = 0
end
if @anime_attack <= 0
@right_attack_on = false
@left_attack_on = false
end
end
def auto_recovery
if self.actor.auto_hp_recover and self.recovery_time <= 0
hp_percent = (self.actor.maxhp/10)
self.actor.hp += hp_percent
self.recovery_time = 1800
end
end
def anime_states
@state_id = 0
for state in @actor.states
return if state.nil? or state == 0
@state_id = state.id
end
end
def remove_state
return if @state_id.nil? or @state_id == 0
if @state_time < @actor.state_turns[@state_id] * 60
@state_time += 1
elsif @state_time >= @actor.state_turns[@state_id] * 60
for i in Requiem_SBABS::States_Freeze
@freeze = false if @state_id == i
end
for i in Requiem_SBABS::States_Slower
@move_speed = @original_move_speed if @state_id == i
if self.is_a?(Game_Ally)
@move_speed = 4
end
end
for i in Requiem_SBABS::States_Faster
@move_speed = @original_move_speed if @state_id == i
if self.is_a?(Game_Ally)
@move_speed = 4
end
end
@actor.remove_state(@state_id)
@state_time = 0
end
end
def states_effects
for state in @actor.states
for i in Requiem_SBABS::States_Freeze
@freeze = true if state.id == i
end
for i in Requiem_SBABS::States_Slower
@move_speed = 2 if state.id == i
end
for i in Requiem_SBABS::States_Faster
@move_speed = 5 if state.id == i
end
if self.is_a?(Game_Event) and @actor.slip_damage? and Graphics.frame_count % (60) == 0
@actor.hp -= (@actor.maxhp / 10)
end
end
end
def in_range?(parent, target, range)
x = (parent.x - target.x) * (parent.x - target.x)
y = (parent.y - target.y) * (parent.y - target.y)
r = x + y
return true if r <= (range * range)
return false
end
def in_direction?(parent, target)
return true if parent.direction == 2 and target.y >= parent.y and target.x == parent.x
return true if parent.direction == 4 and target.x <= parent.x and target.y == parent.y
return true if parent.direction == 6 and target.x >= parent.x and target.y == parent.y
return true if parent.direction == 8 and target.y <= parent.y and target.x == parent.x
return false
end
def in_front?(parent,target)
return true if parent.direction == 2 and parent.x == target.x and (parent.y+1) == target.y
return true if parent.direction == 4 and (parent.x-1) == target.x and parent.y == target.y
return true if parent.direction == 6 and (parent.x+1) == target.x and parent.y == target.y
return true if parent.direction == 8 and parent.x == target.x and (parent.y-1) == target.y
return false
end
def guard?(parent,target)
return true if parent.direction == 2 and target.direction == 8
return true if parent.direction == 4 and target.direction == 6
return true if parent.direction == 6 and target.direction == 4
return true if parent.direction == 8 and target.direction == 2
return false
end
def movable?
return false if moving?
return false if @move_route_forcing
return true
end
def move_toward(target)
sx = distance_x_from(target)
sy = distance_y_from(target)
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_left : move_right
if @move_failed and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if @move_failed and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
def move_to_back
case @direction
when 2; move_up(false)
when 4; move_right(false)
when 6; move_left(false)
when 8; move_down(false)
end
end
def turn_toward(target)
sx = distance_x_from(target)
sy = distance_y_from(target)
if sx.abs > sy.abs
sx > 0 ? turn_left : turn_right
elsif sx.abs < sy.abs
sy > 0 ? turn_up : turn_down
end
end
def distance_x_from(target)
sx = @x - target.x
if $game_map.loop_horizontal?
if sx.abs > $game_map.width / 2
sx -= $game_map.width
end
end
return sx
end
def distance_y_from(target)
sy = @y - target.y
if $game_map.loop_vertical?
if sy.abs > $game_map.height / 2
sy -= $game_map.height
end
end
return sy
end
end
#------------------------------------------------------------------------------
# Game Event
#------------------------------------------------------------------------------
class Game_Event < Game_Character
alias requiem_sbabs_gevent_initialize initialize
alias requiem_sbabs_gevent_setup setup
alias requiem_sbabs_gevent_update update
alias requiem_sbabs_gevent_refresh refresh
def setup(new_page)
requiem_sbabs_gevent_setup(new_page)
self.original_move_speed = @move_speed
end
def update
requiem_sbabs_gevent_update
if @in_battle
states_effects
anime_states
remove_state
end
if @in_battle and !self.actor.dead?
make_attack($data_enemies[@enemy_id])
elsif @in_battle and self.actor.dead?
kill_enemy
erasing
end
if self.target.is_a?(Game_Ally) and self.target.actor.dead?
self.target = $game_player
end
end
def make_attack(enemy)
return if $game_map.interpreter.running?
return if $game_player.in_vehicle? or $game_player.in_airship?
for action in enemy.actions
@ranting = action.rating if self.weapon1_attack_time <= 0
next if enemy_pre_attack(self.actor, action)
case action.kind
when 0
case action.basic
when 0
attack_normal
when 1
self.deffending = true
end
when 1
return if self.weapon1_attack_time > 0
self.assigned_skill = $data_skills[action.skill_id].id
return if self.assigned_skill == nil
case $data_skills[self.assigned_skill].scope
when 1..6
if Requiem_SBABS::Distance_Skills.include?(action.skill_id)
if in_direction?(self,$game_player)
skill_range
elsif action.rating == 10
skill_range
end
for ally in $game_allies
next if ally.nil? or ally.actor.dead?
if in_direction?(self,ally)
skill_range
end
end
else
skill_normal
end
when 7..11
skill_recover
end
end
end
end
def enemy_pre_attack(enemy, action)
case action.condition_type
when 1
n = $game_troop.turn_count
a = action.condition_param1
b = action.condition_param2
return false if (b == 0 and n != a)
return false if (b > 0 and (n < 1 or n < a or n % b != a % b))
when 2
hp_rate = enemy.hp * 100.0 / enemy.maxhp
return false if hp_rate < action.condition_param1
return false if hp_rate > action.condition_param2
when 3
mp_rate = enemy.mp * 100.0 / enemy.maxmp
return false if mp_rate < action.condition_param1
return false if mp_rate > action.condition_param2
when 4
return false unless state?(action.condition_param1)
when 5
return false if $game_party.max_level < action.condition_param1
when 6
switch_id = action.condition_param1
return false if $game_switches[switch_id] == false
end
r = rand(11)
return true if action.rating < r
return false
end
def attack_normal
if in_front?(self,$game_player) and self.weapon1_attack_time <= 0
return if $game_player.actor.nil?
if Requiem_SBABS::Enemy_animations[@enemy_id] != nil and Requiem_SBABS::Enemy_animations[@enemy_id][0] != 0
$game_player.animation_id = Requiem_SBABS::Enemy_animations[@enemy_id][0]
else
$game_player.animation_id = 1
end
probability = rand(100)
if $game_player.deffending == true and $game_player.guard?(self,$game_player) and probability <= Requiem_SBABS::Defense_Rate
$game_player.damage = Requiem_SBABS::Damage_Properties[18]
else
$game_player.actor.attack_effect(self.actor)
if $game_player.actor.hp_damage > 0
$game_player.damage = $game_player.actor.hp_damage
$game_player.critical = true if $game_player.actor.critical
else
$game_player.damage = Requiem_SBABS::Damage_Properties[6]
end
$game_player.jump(0,0)
$game_player.damaged = true
end
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
for ally in $game_allies
next if ally.nil? or ally.actor.dead? or ally.actor.nil?
if in_front?(self,ally) and self.weapon1_attack_time <= 0
if Requiem_SBABS::Enemy_animations[@enemy_id] != nil and Requiem_SBABS::Enemy_animations[@enemy_id][0] != 0
ally.animation_id = Requiem_SBABS::Enemy_animations[@enemy_id][0]
else
ally.animation_id = 1
end
probability = rand(100)
if ally.deffending == true and ally.guard?(self,ally) and probability <= Requiem_SBABS::Defense_Rate
ally.damage = Requiem_SBABS::Damage_Properties[18]
else
ally.actor.attack_effect(self.actor)
if ally.actor.hp_damage > 0
ally.damage = ally.actor.hp_damage
ally.critical = true if ally.actor.critical
else
ally.damage = Requiem_SBABS::Damage_Properties[6]
end
end
ally.jump(0,0)
ally.target = self
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
end
end
def skill_normal
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and in_front?(self,$game_player) and self.weapon1_attack_time <= 0
return if $game_player.actor.nil?
self.actor.mp -= $data_skills[self.assigned_skill].mp_cost
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_player.animation_id = $data_skills[self.assigned_skill].animation_id
probability = rand(100)
if $game_player.deffending == true and $game_player.guard?(self,$game_player) and !$data_skills[self.assigned_skill].ignore_defense and probability <= Requiem_SBABS::Defense_Rate
$game_player.damage = Requiem_SBABS::Damage_Properties[18]
else
$game_party.members[0].skill_effect(self.actor, $data_skills[self.assigned_skill])
if $game_party.members[0].hp_damage > 0
$game_player.damage = $game_party.members[0].hp_damage
else
$game_player.damage = Requiem_SBABS::Damage_Properties[6]
end
$game_player.jump(0,0)
$game_player.damaged = true
end
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
for ally in $game_allies
next if ally.nil? or ally.actor.dead? or ally.actor.nil?
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and in_front?(self,ally) and self.weapon1_attack_time <= 0
self.actor.mp -= $data_skills[self.assigned_skill].mp_cost
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
ally.animation_id = $data_skills[self.assigned_skill].animation_id
probability = rand(100)
if ally.deffending == true and ally.guard?(self,ally) and probability <= Requiem_SBABS::Defense_Rate
ally.damage = Requiem_SBABS::Damage_Properties[18]
else
ally.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if ally.actor.hp_damage > 0
ally.damage = ally.actor.hp_damage
else
ally.damage = Requiem_SBABS::Damage_Properties[6]
end
end
ally.jump(0,0)
ally.target = self
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
end
end
def skill_range
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.weapon1_attack_time <= 0
self.actor.mp -= $data_skills[self.assigned_skill].mp_cost
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Skills[self.assigned_skill][0],Requiem_SBABS::Distance_Skills[self.assigned_skill][1],Requiem_SBABS::Distance_Skills[self.assigned_skill][2],Requiem_SBABS::Distance_Skills[self.assigned_skill][3],3))
self.weapon1_attack_time = Requiem_SBABS::Distance_Skills[self.assigned_skill][4]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[self.assigned_skill],80,100) if Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != nil and Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != ""
end
end
def skill_recover
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.actor.hp <= ((self.actor.maxhp*25)/100) and self.weapon1_attack_time <= 0
self.actor.mp -= $data_skills[self.assigned_skill].mp_cost
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
@animation_id = $data_skills[self.assigned_skill].animation_id
self.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
elsif self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
end
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
for event in $game_map.events.values
if event.in_battle and in_range?(self,event,5)
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and event.actor.hp <= ((event.actor.maxhp*25)/100) and self.weapon1_attack_time <= 0
self.actor.mp -= $data_skills[self.assigned_skill].mp_cost
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
event.animation_id = $data_skills[self.assigned_skill].animation_id
event.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if event.actor.hp_damage < 0
event.damage = event.actor.hp_damage
elsif self.actor.mp_damage < 0
event.damage = event.actor.mp_damage
end
self.weapon1_attack_time = Requiem_SBABS::Enemy_Attack_Time
end
end
end
end
def kill_enemy
if @killed == false
give_exp
make_drop
die_animation
@killed = true
end
if @opacity <= 0 or self.puzzle == true
desactive_enemy
@in_battle = false
self.show_bar = false
$game_player.hits = 0
for ally in $game_allies
next if ally.nil? or ally.actor.dead?
ally.lock_follow = false
ally.move_for
end
end
end
def give_exp
total_exp = self.actor.exp
if Requiem_SBABS::Divide_EXP == true or @divide_exp == true
for actor in $game_party.members
exp = (total_exp / $game_party.members.size)
exp = 1 if exp < 1
actor.gain_exp(exp, 1)
end
else
self.target.actor.gain_exp(self.actor.exp, 1)
end
end
def die_animation
return if self.puzzle == true
if Requiem_SBABS::Enemy_animations[@enemy_id] != nil and Requiem_SBABS::Enemy_animations[@enemy_id][1] != 0
@animation_id = Requiem_SBABS::Enemy_animations[@enemy_id][1]
end
if Requiem_SBABS::Enemy_animations[@enemy_id] != nil and Requiem_SBABS::Enemy_animations[@enemy_id][2] != ""
Audio.se_play("Audio/SE/"+Requiem_SBABS::Enemy_animations[@enemy_id][2],80,100)
else
Sound.play_enemy_collapse
end
end
def desactive_enemy
if @erase == true
self.erase
elsif @switch_local_a == true
key = [$game_map.map_id, self.id, "A"]
if $game_self_switches[key] == false
$game_self_switches[key] = true
elsif $game_self_switches[key] == true
$game_self_switches[key] = false
end
elsif @switch_local_b == true
key = [$game_map.map_id, self.id, "B"]
if $game_self_switches[key] == false
$game_self_switches[key] = true
elsif $game_self_switches[key] == true
$game_self_switches[key] = false
end
elsif @switch_local_c == true
key = [$game_map.map_id, self.id, "C"]
if $game_self_switches[key] == false
$game_self_switches[key] = true
elsif $game_self_switches[key] == true
$game_self_switches[key] = false
end
elsif @switch_local_d == true
key = [$game_map.map_id, self.id, "D"]
if $game_self_switches[key] == false
$game_self_switches[key] = true
elsif $game_self_switches[key] == true
$game_self_switches[key] = false
end
elsif @switch > 0 and
if $game_switches[@switch] == false
$game_switches[@switch] = true
elsif $game_switches[@switch] == true
$game_switches[@switch] = false
end
elsif @variable > 0
$game_variables[@variable] += 1
end
$game_map.need_refresh = true
end
def erasing
return if self.puzzle == true
@blend_type = 2
@opacity -= 5
end
def make_drop
for item in make_items1
next if item.nil?
case item
when RPG::Item
$game_drop.push(Game_Drop.new(self,$data_items[item.id].icon_index,[item],0))
when RPG::Weapon
$game_drop.push(Game_Drop.new(self,$data_weapons[item.id].icon_index,[item],0))
when RPG::Armor
$game_drop.push(Game_Drop.new(self,$data_armors[item.id].icon_index,[item],0))
end
end
for item in make_items2
next if item.nil?
case item
when RPG::Item
$game_drop.push(Game_Drop.new(self,$data_items[item.id].icon_index,[item],0))
when RPG::Weapon
$game_drop.push(Game_Drop.new(self,$data_weapons[item.id].icon_index,[item],0))
when RPG::Armor
$game_drop.push(Game_Drop.new(self,$data_armors[item.id].icon_index,[item],0))
end
end
@gold_percent = rand(100)
if self.actor.gold > 0 and @gold_percent <= Requiem_SBABS::Gold_Drop_Rate
$game_drop.push(Game_Drop.new(self,Requiem_SBABS::Gold_Drop_Graphic,[],self.actor.gold))
end
end
def make_items1
drop_items = []
for i in [self.actor.drop_item1]
next if i.kind == 0
next if rand(i.denominator) != 0
if i.kind == 1
drop_items.push($data_items[i.item_id])
elsif i.kind == 2
drop_items.push($data_weapons[i.weapon_id])
elsif i.kind == 3
drop_items.push($data_armors[i.armor_id])
end
end
return drop_items
end
def make_items2
drop_items = []
for i in [self.actor.drop_item2]
next if i.kind == 0
next if rand(i.denominator) != 0
if i.kind == 1
drop_items.push($data_items[i.item_id])
elsif i.kind == 2
drop_items.push($data_weapons[i.weapon_id])
elsif i.kind == 3
drop_items.push($data_armors[i.armor_id])
end
end
return drop_items
end
def update_self_movement
return if self.freeze
if @in_battle and in_range?(self,self.target,@follow_distance) and @stop_count > 30 * (5 - @move_frequency)
return unless movable?
move_toward(self.target)
elsif @stop_count > 30 * (5 - @move_frequency)
case @move_type
when 1
move_type_random
when 2
move_type_toward_player
when 3
move_type_custom
end
end
end
def check_comment(comentario)
com = comentario.downcase
return 0 if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0].downcase =~ /#{com}[ ]?(\d+)?/
return $1.to_i
end
end
end
return 0
end
def check_com(comentario)
return false if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0].downcase.include?(comentario.downcase)
return true
end
end
end
end
end
#------------------------------------------------------------------------------
# Game Player
#------------------------------------------------------------------------------
class Game_Player < Game_Character
alias requiem_sbabs_gplayer_initialize initialize
alias requiem_sbabs_gplayer_update update
alias requiem_sbabs_gplayer_perform_transfer perform_transfer
alias requiem_sbabs_gplayer_get_off_vehicle get_off_vehicle
alias requiem_sbabs_gplayer_move_by_input move_by_input
def update
self.actor = $game_party.members[0]
requiem_sbabs_gplayer_update
return if $game_map.interpreter.running?
if Input.trigger?(Requiem_SBABS::Change_Group_Order_Button) and
Requiem_SBABS::Change_Group_Order == true and !Input.press?(Input::CTRL)
$game_party.change_group_order
end
return if self.actor.nil?
attack_with_weapon
attack_with_skill
attack_with_item
conjuring_skill
auto_recovery
anime_states
remove_state
states_effects
@hits = 0 if @hit_time <= 0 or @hits >= Requiem_SBABS::Combo_Hits
@hit_time -= 1 if @hit_time > 0
@conjure_delay -= 1 if @conjure_delay > 0
@min_conjure_time = 0 if @conjuring == false
end
def hit_count
return if !Requiem_SBABS::Combo_Damage
@hits += 1
@hit = "#{@hits}"
end
def attack_with_weapon
if Input.trigger?(Requiem_SBABS::Right_Attack_Button) and self.weapon1_attack_time <= 0 and self.deffending == false
@attack_weapon = self.actor.weapon_id
play_attack_se
self.anime_attack = 20
self.right_attack_on = true
self.left_attack_on = false
if Requiem_SBABS::Distance_Weapons.include?(@attack_weapon) and @attack_weapon != 0
range_attack_right
self.weapon1_attack_time = Requiem_SBABS::Distance_Weapons[@attack_weapon][4]
else
normal_attack_right
self.weapon1_attack_time = Requiem_SBABS::Hero_Attack_Time
@hit_time = self.weapon1_attack_time + 15
end
end
if Input.press?(Requiem_SBABS::Left_Attack_and_Shield_Button)
if !self.actor.two_swords_style or !self.actor.two_hands_legal? and self.actor.armor1_id > 0 and Requiem_SBABS::Use_Shields == true
self.deffending = true
end
else
self.deffending = false
end
if Input.trigger?(Requiem_SBABS::Left_Attack_and_Shield_Button) and self.weapon2_attack_time <= 0 and self.deffending == false
if self.actor.two_swords_style
@attack_weapon_and_Shield = self.actor.armor1_id
else
@attack_weapon_and_Shield = self.actor.weapon_id
end
play_attack_se
self.anime_attack = 20
self.right_attack_on = false
self.left_attack_on = true
if Requiem_SBABS::Distance_Weapons.include?(@attack_weapon_and_Shield) and @attack_weapon_and_Shield != 0
range_attack_left
self.weapon2_attack_time = Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][4]
elsif self.actor.two_swords_style
normal_attack_left
self.weapon2_attack_time = Requiem_SBABS::Hero_Attack_Time
@hit_time = self.weapon1_attack_time + 15
end
end
end
def attack_with_skill
return if @conjuring == true
for button in self.actor.skill_hotkeys.keys
if Input.trigger?(button) and self.actor.skill_hotkeys[button] != nil and self.actor.skill_hotkeys[button] != 0
self.assigned_skill = self.actor.skill_hotkeys[button]
if $data_skills[self.assigned_skill].scope == 2
skill_attack_all
elsif Requiem_SBABS::Distance_Skills.include?(self.assigned_skill)
skill_attack_range
elsif Requiem_SBABS::Explode_Skills.include?(self.assigned_skill)
skill_exlpode_range
elsif $data_skills[self.assigned_skill].scope >= 7
skill_recover
else
skill_attack_normal
end
end
end
end
def attack_with_item
return if @conjuring == true
for button in self.actor.item_hotkeys.keys
if Input.trigger?(button) and self.actor.item_hotkeys[button] != nil and self.actor.item_hotkeys[button] != 0
@assigned_item = self.actor.item_hotkeys[button]
if Requiem_SBABS::Distance_Items.include?(@assigned_item)
item_attack_range
elsif Requiem_SBABS::Explode_Items.include?(@assigned_item)
item_attack_explode
elsif Requiem_SBABS::Bomb_Items.include?(@assigned_item)
item_attack_bomb
else
case $data_items[@assigned_item].scope
when 1
item_normal_attack
when 2
item_attack_all
when 3...6
item_normal_attack
when 7..11
item_recover
end
end
end
end
end
def normal_attack_right
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object == true
event.animation_id = self.actor.atk_animation_id
hit_count
if event.deffending == true and guard?(self,event) or
event.kill_with_weapon > 0 and @attack_weapon != event.kill_with_weapon or
event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
end
end
end
end
def range_attack_right
if $game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon][5]])
$game_party.consume_item($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon][5]])
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Weapons[@attack_weapon][0],Requiem_SBABS::Distance_Weapons[@attack_weapon][1],Requiem_SBABS::Distance_Weapons[@attack_weapon][2],Requiem_SBABS::Distance_Weapons[@attack_weapon][3],1))
end
end
def normal_attack_left
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object == true
event.animation_id = self.actor.atk_animation_id2
hit_count
if event.deffending == true and guard?(self,event) or
event.kill_with_weapon > 0 and @attack_weapon_and_Shield != event.kill_with_weapon or
event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
end
end
end
end
def range_attack_left
if $game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][6]])
$game_party.consume_item($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][6]])
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][0],Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][1],Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][2],Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][3],2))
end
end
def skill_attack_normal
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event) and self.skill_attack_time <= 0
return if event.actor.dead? or event.object == true
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
event.animation_id = $data_skills[self.assigned_skill].animation_id
if event.deffending == true and guard?(self,event) and !$data_skills[self.assigned_skill].ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and event.kill_with_skill != self.assigned_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
end
def skill_attack_range
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Skills[self.assigned_skill][0],Requiem_SBABS::Distance_Skills[self.assigned_skill][1],Requiem_SBABS::Distance_Skills[self.assigned_skill][2],Requiem_SBABS::Distance_Skills[self.assigned_skill][3],3))
self.skill_attack_time = Requiem_SBABS::Distance_Skills[self.assigned_skill][4]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[self.assigned_skill],80,100) if Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != nil and Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != ""
end
end
def skill_attack_all
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
for event in $game_map.events.values
if event.in_battle
return if event.actor.dead? or event.object == true
event.animation_id = $data_skills[self.assigned_skill].animation_id
if event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and event.kill_with_skill != self.assigned_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
def skill_exlpode_range
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Explode_Skills[self.assigned_skill][0],Requiem_SBABS::Explode_Skills[self.assigned_skill][1],Requiem_SBABS::Explode_Skills[self.assigned_skill][2],Requiem_SBABS::Explode_Skills[self.assigned_skill][3],4))
self.skill_attack_time = Requiem_SBABS::Explode_Skills[self.assigned_skill][5]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[self.assigned_skill],80,100) if Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != nil and Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != ""
end
end
def skill_recover
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
self.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
elsif self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
end
@animation_id = $data_skills[self.assigned_skill].animation_id
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
def item_normal_attack
for event in $game_map.events.values
if event.in_battle == true
if in_front?(self,event) and self.item_attack_time <= 0
return if event.actor.dead? or event.object == true
if $game_party.has_item?($data_items[@assigned_item]) and self.item_attack_time <= 0
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
event.animation_id = $data_items[@assigned_item].animation_id
if event.deffending == true and guard?(self,event) and !$data_items[@assigned_item].ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_skill > 0 or
event.kill_with_item > 0 and event.kill_with_item != self.assigned_item
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.item_effect(self.actor, $data_items[@assigned_item])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.item_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
end
def item_attack_range
if $game_party.has_item?($data_items[@assigned_item]) and self.item_attack_time <= 0
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Items[@assigned_item][0],Requiem_SBABS::Distance_Items[@assigned_item][1],Requiem_SBABS::Distance_Items[@assigned_item][2],Requiem_SBABS::Distance_Items[@assigned_item][3],5))
self.item_attack_time = Requiem_SBABS::Distance_Items[@assigned_item][4]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Item_Cast_SE[@assigned_item],80,100) if Requiem_SBABS::Item_Cast_SE[@assigned_item] != nil and Requiem_SBABS::Item_Cast_SE[@assigned_item] != ""
end
end
def item_attack_explode
if $game_party.has_item?($data_items[@assigned_item]) and self.item_attack_time <= 0
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Explode_Items[@assigned_item][0],Requiem_SBABS::Explode_Items[@assigned_item][1],Requiem_SBABS::Explode_Items[@assigned_item][2],Requiem_SBABS::Explode_Items[@assigned_item][3],6))
self.item_attack_time = Requiem_SBABS::Explode_Items[@assigned_item][5]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Item_Cast_SE[@assigned_item],80,100) if Requiem_SBABS::Item_Cast_SE[@assigned_item] != nil and Requiem_SBABS::Item_Cast_SE[@assigned_item] != ""
end
end
def item_attack_bomb
if $game_party.has_item?($data_items[@assigned_item]) and @bomb_already == false
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
$game_bomb.push(Game_Bomb.new(self,$data_items[self.assigned_item],$data_items[self.assigned_item].icon_index,Requiem_SBABS::Bomb_Items[@assigned_item][0],Requiem_SBABS::Bomb_Items[@assigned_item][1]))
end
end
def item_recover
if $game_party.has_item?($data_items[@assigned_item]) and self.item_attack_time <= 0
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
self.actor.item_effect(self.actor, $data_items[@assigned_item])
if self.actor.mp_damage < 0
self.damage = self.actor.mp_damage
elsif self.actor.hp_damage < 0
self.damage = self.actor.hp_damage
end
@animation_id = $data_items[@assigned_item].animation_id
self.item_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
def item_attack_all
if $game_party.has_item?($data_items[@assigned_item]) and self.item_attack_time <= 0
$game_party.consume_item($data_items[@assigned_item])
$game_temp.common_event_id = $data_items[@assigned_item].common_event_id if $data_items[@assigned_item].common_event_id > 0
for event in $game_map.events.values
if event.in_battle
return if event.actor.dead? or event.object == true
event.animation_id = $data_items[self.assigned_item].animation_id
if event.kill_with_weapon > 0 or event.kill_with_skill > 0 or
event.kill_with_item > 0 and event.kill_with_item != self.assigned_item
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.item_effect(self.actor, $data_items[self.assigned_item])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.item_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
def conjuring_skill
return if self.actor.conjure_hotkeys.nil?
for button in self.actor.conjure_hotkeys.keys
if Requiem_SBABS::Conjure_Skills.include?(self.actor.conjure_hotkeys[button])
if @min_conjure_time >= @max_conjure_time and @max_conjure_time > 0
@conjuring = false
@min_conjure_time = 0
@max_conjure_time = 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
@conjure_delay = Requiem_SBABS::Conjure_Skills[self.assigned_skill][1]
conjure_effect($data_skills[self.assigned_skill])
elsif Input.press?(button) and !moving? and @conjure_delay <= 0 and self.damaged == false
self.assigned_skill = self.actor.conjure_hotkeys[button]
return if self.actor.mp < $data_skills[self.assigned_skill].mp_cost
@max_conjure_time = Requiem_SBABS::Conjure_Skills[self.assigned_skill][0]
@min_conjure_time += 1
@conjuring = true
end
end
end
end
def conjure_effect(skill)
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[skill.id],80,100) if Requiem_SBABS::Skill_Cast_SE[skill.id] != nil and Requiem_SBABS::Skill_Cast_SE[skill.id] != ""
if Requiem_SBABS::Distance_Skills.include?(skill.id)
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Skills[self.assigned_skill][0],Requiem_SBABS::Distance_Skills[skill.id][1],Requiem_SBABS::Distance_Skills[skill.id][2],Requiem_SBABS::Distance_Skills[skill.id][3],3))
elsif Requiem_SBABS::Explode_Skills.include?(skill.id)
$game_range.push(Game_Range.new(self,Requiem_SBABS::Explode_Skills[skill.id][0],Requiem_SBABS::Explode_Skills[skill.id][1],Requiem_SBABS::Explode_Skills[skill.id][2],Requiem_SBABS::Explode_Skills[skill.id][3],4))
elsif skill.scope == 1
skill_attack_normal
elsif skill.scope == 2
skill_attack_all
elsif skill.scope >= 3 and skill.scope <= 6
skill_attack_normal
elsif skill.scope >= 7 and skill.scope <= 11
skill_recovery
end
end
def play_attack_se
for i in Requiem_SBABS::Weapon_Blow_SE
if i.include?(@attack_weapon) and self.weapon1_attack_time <= 0
return if Requiem_SBABS::Distance_Weapons.include?(@attack_weapon) and !$game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon][5]])
sel = (Requiem_SBABS::Weapon_Blow_SE[@attack_weapon].size != 0 ? rand(Requiem_SBABS::Weapon_Blow_SE[@attack_weapon].size) : 0)
Audio.se_play("Audio/SE/"+Requiem_SBABS::Weapon_Blow_SE[@attack_weapon][sel],100,100)
elsif i.include?(@attack_weapon_and_Shield) and self.weapon2_attack_time <= 0
return if Requiem_SBABS::Distance_Weapons.include?(@attack_weapon_and_Shield) and !$game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[@attack_weapon_and_Shield][6]])
sel = (Requiem_SBABS::Weapon_Blow_SE[@attack_weapon_and_Shield].size != 0 ? rand(Requiem_SBABS::Weapon_Blow_SE[@attack_weapon_and_Shield].size) : 0)
Audio.se_play("Audio/SE/"+Requiem_SBABS::Weapon_Blow_SE[@attack_weapon_and_Shield][sel],100,100)
end
end
end
def perform_transfer
requiem_sbabs_gplayer_perform_transfer
for ally in $game_allies
next if ally.nil? or ally.actor.dead?
if ally.command == 2 and Requiem_SBABS::Defend_Dont_Transfer == true or ally.actor.dead?
ally.character_name = ""
next
end
ally.map_id = @new_map_id
ally.moveto(@new_x, @new_y)
ally.move_random
ally.lock_follow = false
end
for range in $game_range
next if range.nil?
range.destroy = true
end
for drop in $game_drop
next if drop.nil?
drop.destroy = true
end
$game_map.need_refresh = true
end
def get_off_vehicle
requiem_sbabs_gplayer_get_off_vehicle
for ally in $game_allies
next if ally.nil? or ally.command == 2 or ally.actor.dead?
ally.moveto(@x,@y)
ally.move_random
ally.target = self
end
end
def map_passable?(x, y)
case @vehicle_type
when 0
return $game_map.boat_passable?(x, y)
when 1
return $game_map.ship_passable?(x, y)
when 2
return true
else
return $game_map.hero_passable?(x, y)
end
end
def move_by_input
return if self.freeze or self.right_attack_on or self.left_attack_on
if Requiem_SBABS::Eight_Dir_Movement
return unless movable?
return if $game_map.interpreter.running?
if Input.press?(Input::DOWN) and Input.press?(Input::LEFT)
move_lower_left
elsif Input.press?(Input::DOWN) and Input.press?(Input::RIGHT)
move_lower_right
elsif Input.press?(Input::UP) and Input.press?(Input::LEFT)
move_upper_left
elsif Input.press?(Input::UP) and Input.press?(Input::RIGHT)
move_upper_right
elsif Input.press?(Input::DOWN)
move_down
elsif Input.press?(Input::LEFT)
move_left
elsif Input.press?(Input::RIGHT)
move_right
elsif Input.press?(Input::UP)
move_up
end
end
requiem_sbabs_gplayer_move_by_input
end
end
#------------------------------------------------------------------------------
# Game Ally
#------------------------------------------------------------------------------
class Game_Ally < Game_Character
def update
change_graphics
return if self.actor.nil? or self.actor.dead? or $game_player.in_vehicle?
move_for
make_action
anime_states
remove_state
states_effects
auto_recovery
deffend
super
end
def change_graphics
if $game_player.in_vehicle? and @command != 2
@character_name = ""
elsif self.actor.dead?
if Requiem_SBABS::Dead_Graphic[@actor_id] != nil and @map_id == $game_map.map_id
@character_name = Requiem_SBABS::Dead_Graphic[@actor_id][0]
@character_index = Requiem_SBABS::Dead_Graphic[@actor_id][1]
else
@character_name = ""
end
elsif @map_id != $game_map.map_id
@character_name = ""
else
@character_name = self.actor.character_name
@character_index = self.actor.character_index
end
end
def make_action
return if $game_map.interpreter.running?
return if @command == 2 or self.actor.dead?
if @command == 0
if Requiem_SBABS::Distance_Weapons.include?(self.actor.weapon_id) and self.weapon1_attack_time <= 0
weapon_range_attack
else
if self.actor.two_swords_style
hand = rand(100)
if self.weapon1_attack_time <= 0 and hand <= 50
right_weapon_normal_attack
elsif self.weapon1_attack_time <= 0 and hand > 50
left_weapon_normal_attack
end
elsif self.weapon1_attack_time <= 0
right_weapon_normal_attack
end
end
elsif @command == 1
return if self.skill_attack_time > 0
skl = rand(self.actor.skills.size)
self.assigned_skill = self.actor.skills[skl].id
case $data_skills[self.assigned_skill].scope
when 1
if Requiem_SBABS::Distance_Skills.include?(self.assigned_skill)
skill_attack_range
elsif Requiem_SBABS::Explode_Skills.include?(self.assigned_skill)
skill_exlpode_range
else
skill_attack_normal
end
when 2
skill_attack_all
when 3..6
if Requiem_SBABS::Distance_Skills.include?(self.assigned_skill)
skill_attack_range
elsif Requiem_SBABS::Explode_Skills.include?(self.assigned_skill)
skill_exlpode_range
else
skill_attack_normal
end
when 7..8
skill_recover
when 9..10
skill_revive
when 11
skill_recover
end
elsif @command == 3
for skill in self.actor.skills
self.assigned_skill = skill.id
case $data_skills[self.assigned_skill].scope
when 7..8
skill_recover
when 9..10
skill_revive
when 11
skill_recover
end
end
end
end
def right_weapon_normal_attack
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object == true
play_attack_se
self.anime_attack = 20
self.right_attack_on = true
self.left_attack_on = false
event.animation_id = self.actor.atk_animation_id
if event.deffending == true and guard?(self,event) or event.kill_with_weapon > 0 or event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.weapon1_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
def left_weapon_normal_attack
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event)
return if event.actor.dead? or event.object == true
play_attack_se
self.anime_attack = 20
self.right_attack_on = false
self.left_attack_on = true
event.animation_id = self.actor.atk_animation_id2
if event.deffending == true and guard?(self,event) or event.kill_with_weapon > 0 or event.kill_with_skill > 0 or event.kill_with_item > 0
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.attack_effect(self.actor)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
event.critical = true if event.actor.critical
event.combo = true if event.actor.combo
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.weapon1_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
def weapon_range_attack
for event in $game_map.events.values
if event.in_battle
see_range = Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][3]
if $game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][5]]) and self.weapon1_attack_time <= 0
if in_direction?(self,event) and in_range?(self,event,see_range)
return if event.actor.dead? or event.object == true
play_attack_se
self.anime_attack = 20
ammo = rand(100)
if ammo >=50
$game_party.consume_item($data_items[Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][5]])
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][0],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][1],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][2],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][3],1))
elsif ammo < 50
$game_party.consume_item($data_items[Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][6]])
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][0],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][1],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][2],Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][3],2))
end
self.weapon1_attack_time = Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][4]
end
end
end
end
end
def play_attack_se
for i in Requiem_SBABS::Weapon_Blow_SE
if i.include?(self.actor.weapon_id) and self.weapon1_attack_time <= 0
return if Requiem_SBABS::Distance_Weapons.include?(self.actor.weapon_id) and !$game_party.has_item?($data_items[Requiem_SBABS::Distance_Weapons[self.actor.weapon_id][5]])
sel = (Requiem_SBABS::Weapon_Blow_SE[self.actor.weapon_id].size != 0 ? rand(Requiem_SBABS::Weapon_Blow_SE[self.actor.weapon_id].size) : 0)
Audio.se_play("Audio/SE/"+Requiem_SBABS::Weapon_Blow_SE[self.actor.weapon_id][sel],100,100)
end
end
end
def skill_attack_normal
for event in $game_map.events.values
if event.in_battle
if in_front?(self,event) and self.skill_attack_time <= 0
return if event.actor.dead? or event.object == true
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
dmg = event.actor.make_obj_damage_value(self.actor, $data_skills[self.assigned_skill])
event.animation_id = $data_skills[self.assigned_skill].animation_id
if event.deffending == true and guard(self,event) and !$data_skills[self.assigned_skill].ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and !event.kill_with_skill != self.assigned_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
end
def skill_attack_range
for event in $game_map.events.values
if event.in_battle
see_range = Requiem_SBABS::Distance_Skills[self.assigned_skill][3]
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
if in_direction?(self,event) and in_range?(self,event,see_range)
return if event.actor.dead? or event.object == true
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Distance_Skills[self.assigned_skill][0],Requiem_SBABS::Distance_Skills[self.assigned_skill][1],Requiem_SBABS::Distance_Skills[self.assigned_skill][2],Requiem_SBABS::Distance_Skills[self.assigned_skill][3],3))
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[self.assigned_skill],80,100) if Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != nil or Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != ""
self.skill_attack_time = Requiem_SBABS::Distance_Skills[self.assigned_skill][4]
end
end
end
end
end
def skill_exlpode_range
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_range.push(Game_Range.new(self,Requiem_SBABS::Explode_Skills[self.assigned_skill][0],Requiem_SBABS::Explode_Skills[self.assigned_skill][1],Requiem_SBABS::Explode_Skills[self.assigned_skill][2],Requiem_SBABS::Explode_Skills[self.assigned_skill][3],4))
self.skill_attack_time = Requiem_SBABS::Explode_Skills[self.assigned_skill][5]
Audio.se_play("Audio/SE/"+Requiem_SBABS::Skill_Cast_SE[self.assigned_skill],80,100) if Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != nil and Requiem_SBABS::Skill_Cast_SE[self.assigned_skill] != ""
end
end
def skill_attack_all
for event in $game_map.events.values
if event.in_battle
return if event.actor.dead? or event.object == true
if self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
dmg = event.actor.make_obj_damage_value(self.actor, $data_skills[self.assigned_skill])
event.animation_id = $data_skills[self.assigned_skill].animation_id
if event.deffending == true and guard(self,event) and !$data_skills[self.assigned_skill].ignore_defense or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and !event.kill_with_skill != self.assigned_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
event.target = self
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
end
def skill_recover
if $game_party.members[0].hp <= (($game_party.members[0].maxhp*25)/100) and self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
$game_party.members[0].skill_effect(self.actor, $data_skills[self.assigned_skill])
if $game_party.members[0].hp_damage < 0
$game_player.damage = $game_party.members[0].hp_damage
elsif $game_party.members[0].mp_damage < 0
@damage = $game_party.members[0].mp_damage
end
$game_player.animation_id = $data_skills[self.assigned_skill].animation_id
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
if self.actor.hp <= ((self.actor.maxhp*25)/100) and self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
self.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if self.actor.hp_damage < 0
@damage = self.actor.hp_damage
elsif ally.actor.mp_damage < 0
@damage = self.actor.mp_damage
end
@animation_id = $data_skills[self.assigned_skill].animation_id
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
for ally in $game_allies
next if ally.nil? or ally.actor.dead? or ally.map_id != @map_id
if ally.actor.hp <= ((ally.actor.maxhp*25)/100) and self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
ally.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if ally.actor.hp_damage < 0
ally.damage = ally.actor.hp_damage
elsif ally.actor.mp_damage < 0
ally.damage = ally.actor.mp_damage
end
ally.animation_id = $data_skills[self.assigned_skill].animation_id
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
def skill_revive
for ally in $game_allies
next if ally.nil? or !ally.actor.dead? or ally.map_id != @map_id
if ally.actor.dead? and self.actor.mp >= $data_skills[self.assigned_skill].mp_cost and self.skill_attack_time <= 0
self.actor.mp -= self.actor.calc_mp_cost($data_skills[self.assigned_skill])
$game_temp.common_event_id = $data_skills[self.assigned_skill].common_event_id if $data_skills[self.assigned_skill].common_event_id > 0
ally.actor.skill_effect(self.actor, $data_skills[self.assigned_skill])
if ally.actor.hp_damage < 0
ally.damage = ally.actor.hp_damage
elsif ally.actor.mp_damage < 0
ally.damage = ally.actor.mp_damage
end
ally.animation_id = $data_skills[self.assigned_skill].animation_id
self.skill_attack_time = Requiem_SBABS::Hero_Attack_Time
end
end
end
def deffend
if @command == 2
self.deffending = true
else
self.deffending = false
end
end
def move_for
return unless movable?
return if @command == 2 or self.freeze == true
return if $game_map.interpreter.running?
if $game_player.dash?
@move_speed = 5
else
@move_speed = self.original_move_speed
end
if @target == nil
self.target = $game_player
elsif @command == 3
self.target = $game_player
else
for event in $game_map.events.values
if event.in_battle and in_range?(self,event,Requiem_SBABS::Ally_Sight) and @lock_follow == false and @command != 2
next if event.object == true or event.puzzle == true
self.target = event
@lock_follow = true
elsif @lock_follow == false
self.target = $game_player
end
end
end
move_toward(self.target)
end
def moveto(x, y)
super
end
def check_event_trigger_touch(x, y)
end
end
#------------------------------------------------------------------------------
# Game Range
#------------------------------------------------------------------------------
class Game_Range < Game_Character
def initialize(parent,chara_name="",chara_index=0,speed=4,range=0,type=0)
super()
@parent = parent
@character_name = chara_name
@character_index = chara_index
@move_speed = speed
@range = range
@type = type
@step = 0
@destroy = false
@draw = false
moveto(@parent.x,@parent.y)
case @parent.direction
when 2
turn_down
when 4
turn_left
when 6
turn_right
when 8
turn_up
end
end
def update
return @destroy = true if @step > @range
move_route
super
end
def move_route
return unless movable?
move_forward
@step += 1
end
def check_event_trigger_touch(x,y)
return if @destroy == true
for event in $game_map.events.values
if event.in_battle == true
for ally in $game_allies
next if ally.nil?
if ally.pos?(x,y) and @parent.is_a?(Game_Event)
hurt_ally(ally)
end
end
hurt_hero if $game_player.pos?(x,y) and @parent.is_a?(Game_Event)
hurt_enemy_weapon_right(event) if event.pos?(x,y) and @type == 1 and @parent.is_a?(Game_Player)
hurt_enemy_weapon_left(event) if event.pos?(x,y) and @type == 2 and @parent.is_a?(Game_Player)
hurt_enemy_skill(event) if event.pos?(x,y) and @type == 3 and @parent.is_a?(Game_Player)
hurt_enemy_skill_explode if event.pos?(x,y) and @type == 4 and @parent.is_a?(Game_Player)
hurt_enemy_item(event) if event.pos?(x,y) and @type == 5 and @parent.is_a?(Game_Player)
hurt_enemy_item_explode if event.pos?(x,y) and @type == 6 and @parent.is_a?(Game_Player)
hurt_enemy_weapon_right(event) if event.pos?(x,y) and @type == 1 and @parent.is_a?(Game_Ally)
hurt_enemy_weapon_left(event) if event.pos?(x,y) and @type == 2 and @parent.is_a?(Game_Ally)
hurt_enemy_skill(event) if event.pos?(x,y) and @type == 3 and @parent.is_a?(Game_Ally)
hurt_enemy_skill_explode if event.pos?(x,y) and @type == 4 and @parent.is_a?(Game_Ally)
end
end
end
def hurt_hero
@destroy = true
$game_player.animation_id = $data_skills[@parent.assigned_skill].animation_id
probability = rand(100)
if $game_player.deffending == true and guard?($game_player,@parent) and !$data_skills[@parent.assigned_skill].ignore_defense and probability <= Requiem_SBABS::Defense_Rate
$game_player.damage = Requiem_SBABS::Damage_Properties[18]
else
$game_party.members[0].skill_effect(@parent.actor, $data_skills[@parent.assigned_skill])
if $game_party.members[0].hp_damage > 0
$game_player.damage = $game_party.members[0].hp_damage
else
$game_player.damage = Requiem_SBABS::Damage_Properties[6]
end
$game_player.jump(0,0)
$game_player.damaged = true
end
end
def hurt_ally(ally)
@destroy = true
return if ally.actor.dead?
ally.animation_id = $data_skills[@parent.assigned_skill].animation_id
probability = rand(100)
if ally.deffending == true and ally.guard?(self,ally) and probability <= Requiem_SBABS::Defense_Rate
ally.damage = Requiem_SBABS::Damage_Properties[18]
else
ally.actor.skill_effect(@parent.actor, $data_skills[@parent.assigned_skill])
if ally.actor.hp_damage > 0
ally.damage = ally.actor.hp_damage
else
ally.damage = Requiem_SBABS::Damage_Properties[6]
end
end
ally.target = @parent
ally.jump(0,0)
end
def hurt_enemy_weapon_right(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object == true
actor = @parent.actor
enemy.target = @parent
enemy.animation_id = $data_items[Requiem_SBABS::Distance_Weapons[actor.weapon_id][5]].animation_id
if enemy.deffending == true and guard?(self, enemy) or
enemy.kill_with_weapon > 0 and actor.weapon_id != enemy.kill_with_weapon or
enemy.kill_with_skill > 0 or enemy.kill_with_item > 0
enemy.damage = Requiem_SBABS::Damage_Properties[18]
else
enemy.actor.attack_effect(actor)
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_SBABS::Damage_Properties[6]
end
enemy.jump(0,0)
end
end
def hurt_enemy_weapon_left(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object == true
actor = @parent.actor
enemy.target = @parent
if actor.two_swords_style
@weapon = actor.armor1_id
else
@weapon = actor.weapon_id
end
enemy.animation_id = $data_items[Requiem_SBABS::Distance_Weapons[@weapon][6]].animation_id
if enemy.deffending == true and guard?(self, enemy) or
enemy.kill_with_weapon > 0 and @weapon != enemy.kill_with_weapon or
enemy.kill_with_skill > 0 or enemy.kill_with_item > 0
enemy.damage = Requiem_SBABS::Damage_Properties[18]
else
enemy.actor.attack_effect($game_party.members[0])
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_SBABS::Damage_Properties[6]
end
enemy.jump(0,0)
end
end
def hurt_enemy_skill(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object == true
actor = @parent.actor
skl = @parent.assigned_skill
enemy.target = @parent
enemy.animation_id = $data_skills[skl].animation_id
if enemy.deffending == true and guard?(self, enemy) or
enemy.kill_with_weapon > 0 or enemy.kill_with_item > 0 or
enemy.kill_with_skill > 0 and skl != enemy.kill_with_skill
enemy.damage = Requiem_SBABS::Damage_Properties[18]
else
enemy.actor.skill_effect(actor,$data_skills[skl])
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_SBABS::Damage_Properties[6]
end
enemy.jump(0,0)
end
end
def hurt_enemy_item(enemy)
@destroy = true
return if enemy.actor.dead? or enemy.object == true
actor = @parent.actor
itm = @parent.assigned_item
enemy.animation_id = $data_items[itm].animation_id
if enemy.deffending == true and guard?(self, enemy) or
enemy.kill_with_weapon > 0 or enemy.kill_with_skill > 0 or
enemy.kill_with_item > 0 and $game_player.assigned_item != enemy.kill_with_item
enemy.damage = Requiem_SBABS::Damage_Properties[18]
else
enemy.actor.item_effect(actor,$data_items[itm])
if enemy.actor.hp_damage > 0
enemy.damage = enemy.actor.hp_damage
else
enemy.damage = Requiem_SBABS::Damage_Properties[6]
end
enemy.jump(0,0)
end
end
def hurt_enemy_skill_explode
@destroy = true
for event in $game_map.events.values
if event.in_battle == true
actor = @parent.actor
skl = @parent.assigned_skill
event.target = @parent
if in_range?(self,event,Requiem_SBABS::Explode_Skills[skl][4])
return if event.actor.dead? or event.object == true
event.animation_id = $data_skills[skl].animation_id
if event.deffending == true and guard?(self,event) or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and skl != event.kill_with_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.skill_effect(actor,$data_skills[skl])
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
end
end
end
end
def hurt_enemy_item_explode
@destroy = true
for event in $game_map.events.values
if event.in_battle == true and in_range?(self,event,Requiem_SBABS::Explode_Items[$game_player.assigned_item][4])
actor = @parent.actor
itm = @parent.assigned_item
return if event.actor.dead? or event.object == true
event.animation_id = $data_items[itm].animation_id
if event.deffending == true and guard?(self, event) or
event.kill_with_weapon > 0 or event.kill_with_item > 0 or
event.kill_with_skill > 0 and itm != event.kill_with_skill
event.damage = Requiem_SBABS::Damage_Properties[18]
else
event.actor.item_effect(actor,$data_items[itm])
event.jump(0,0)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
end
end
end
end
def map_passable?(x, y)
return $game_map.range_passable?(x, y)
end
end
#------------------------------------------------------------------------------
# Game Bomb
#------------------------------------------------------------------------------
class Game_Bomb < Game_Character
def initialize(parent,item,graph_index=0,range=0,time=0)
super()
@parent = parent
@item = item
@graphic_name = "IconSet"
@graphic_index = graph_index
@range = range
@time = time
case @parent.direction
when 2
moveto(@parent.x,@parent.y+1)
when 4
moveto(@parent.x-1,@parent.y)
when 6
moveto(@parent.x+1,@parent.y)
when 8
moveto(@parent.x,@parent.y-1)
end
Audio.se_play("Audio/SE/"+Requiem_SBABS::Drop_Item_SE,100,100) if Requiem_SBABS::Drop_Item_SE != ""
@destroy = false
@draw = false
$game_player.bomb_already = true
move_random if !moving? and !$game_map.passable?(@x,@y) or !moving? and $game_map.events_xy(@x,@y)
jump(0,0)
end
def update
return if @destroy == true
if Requiem_SBABS::Bomb_TicTac_SE != "" and Graphics.frame_count % 60 <= 0
Audio.se_play("Audio/SE/"+Requiem_SBABS::Bomb_TicTac_SE,100,100)
end
@time -= 1 if @time > 0
explode if @time <= 0
super
end
def explode
self.animation_id = @item.animation_id
if in_range?(self,$game_player,@range)
$game_player.actor.item_effect(@parent.actor,@item)
if $game_player.actor.hp_damage > 0
$game_player.damage = $game_player.actor.hp_damage
else
$game_player.damage = Requiem_SBABS::Damage_Properties[6]
end
$game_player.jump(0,0)
end
for ally in $game_allies
next if ally.nil?
if in_range?(self,ally,@range)
ally.actor.item_effect(@parent.actor,@item)
if ally.actor.hp_damage > 0
ally.damage = ally.actor.hp_damage
else
ally.damage = Requiem_SBABS::Damage_Properties[6]
end
ally.jump(0,0)
end
end
for event in $game_map.events.values
if event.in_battle and in_range?(self,event,@range)
event.actor.item_effect(@parent.actor,@item)
if event.actor.hp_damage > 0
event.damage = event.actor.hp_damage
else
event.damage = Requiem_SBABS::Damage_Properties[6]
end
event.jump(0,0)
end
end
$game_player.bomb_already = false
@destroy = true
end
def check_event_trigger_touch(x, y)
end
end
#------------------------------------------------------------------------------
# Game Drop
#------------------------------------------------------------------------------
class Game_Drop < Game_Character
def initialize(parent,graph_index=0,items=[],gold=0)
super()
@graphic_name = "IconSet"
@graphic_index = graph_index
@items = items
@gold = gold
@drop_time = Requiem_SBABS::Drop_Duration_Time
moveto(parent.x,parent.y)
move_random if !moving?
Audio.se_play("Audio/SE/"+Requiem_SBABS::Drop_Item_SE,100,100) if Requiem_SBABS::Drop_Item_SE != "" and @items != nil
Audio.se_play("Audio/SE/"+Requiem_SBABS::Drop_Money_SE,100,100) if Requiem_SBABS::Drop_Money_SE != "" and @gold > 0
@destroy = false
@draw = false
jump(0,0)
end
def update
return if @destroy == true
if Input.trigger?(Input::C)
if in_range?($game_player,self,1) and in_direction?($game_player,self)
get_reward
end
end
@drop_time -= 1 if @drop_time > 0
@destroy = true if @drop_time <= 0
super
end
def get_reward
Audio.se_play("Audio/SE/"+Requiem_SBABS::Get_Reward_SE,100,100) if Requiem_SBABS::Get_Reward_SE != ""
$game_party.gain_gold(@gold) if @gold > 0
$Reward = "$ #{@gold}" if @gold > 0
for item in @items
case item
when RPG::Item
$game_party.gain_item($data_items[item.id],1)
$Reward = "#{$data_items[item.id].name}"
when RPG::Weapon
$game_party.gain_item($data_weapons[item.id],1)
$Reward = "#{$data_weapons[item.id].name}"
when RPG::Armor
$game_party.gain_item($data_armors[item.id],1)
$Reward = "#{$data_armors[item.id].name}"
end
end
@destroy = true
end
def check_event_trigger_touch(x, y)
end
end
#------------------------------------------------------------------------------
# Sprite Base
#------------------------------------------------------------------------------
class Sprite_Base
#------------------------------------------------------------------------------
# Sprite Character
#------------------------------------------------------------------------------
class Sprite_Character < Sprite_Base
alias requiem_sbabs_spchar_initialize initialize
alias requiem_sbabs_spchar_update update
alias requiem_sbabs_spchar_dispose dispose
def initialize(viewport, character = nil)
@character = character
@_damage_duration = 0
@_hit_duration = 0
requiem_sbabs_spchar_initialize(viewport,@character)
end
def update
requiem_sbabs_spchar_update
update_show_dmg
update_show_hit
update_show_state_ani
end
def dispose
requiem_sbabs_spchar_dispose
dispose_damage
dispose_hit
end
def update_show_dmg
if @_damage_duration > 0
@_damage_duration -=1
@_damage_sprite.y -= 1
@_damage_sprite.opacity -= 5 if @_damage_duration <= 30
@_damage_sprite.x = self.x
if @_damage_duration <= 0
dispose_damage
end
end
if @character != nil and @character.damage != nil
if @character.is_a?(Game_Event)
if @character.puzzle == true
return
end
end
damage(@character.damage, @character.critical, @character.combo)
@character.damage = nil
@character.critical = false
@character.combo = false
end
end
def update_show_hit
dispose_hit
end
if @character != nil and @character.hit != nil
hit(@character.hit)
@character.hit = nil
end
end
def update_show_state_ani
if @character.state_id > 0 and Requiem_SBABS::States_Animation[@character.state_id] != 0 and Requiem_SBABS::States_Animation[@character.state_id] != nil
if @character.ani_time <= 0
@character.animation_id = Requiem_SBABS::States_Animation[@character.state_id]
@character.ani_time = $data_animations[@character.animation_id].frame_max * 4 + 1
end
end
end
def damage(value, critical, combo)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160,100)
bitmap.font.name = Requiem_SBABS::Damage_Properties[1]
bitmap.font.size = Requiem_SBABS::Damage_Properties[2]
bitmap.font.bold = Requiem_SBABS::Damage_Properties[3]
bitmap.font.italic = Requiem_SBABS::Damage_Properties[4]
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,(Requiem_SBABS::Damage_Properties[2]*2)+5,160,Requiem_SBABS::Damage_Properties[2]+2,damage_string,1)
if value.is_a?(Numeric) and value <= 0
bitmap.font.color = Requiem_SBABS::Damage_Properties[14]
else
bitmap.font.color = Requiem_SBABS::Damage_Properties[13]
end
bitmap.draw_text(0,(Requiem_SBABS::Damage_Properties[2]*2)+4,160,Requiem_SBABS::Damage_Properties[2]+2,damage_string,1)
if critical
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,Requiem_SBABS::Damage_Properties[2]+5,160,Requiem_SBABS::Damage_Properties[2]+2,Requiem_SBABS::Damage_Properties[5],1)
bitmap.font.color = Requiem_SBABS::Damage_Properties[15]
bitmap.draw_text(0,Requiem_SBABS::Damage_Properties[2]+4,160,Requiem_SBABS::Damage_Properties[2]+2,Requiem_SBABS::Damage_Properties[5],1)
end
if combo
bitmap.font.color.set(0,0,0)
bitmap.draw_text(1,1,160,Requiem_SBABS::Damage_Properties[2]+2,Requiem_SBABS::Damage_Properties[12],1)
bitmap.font.color = Requiem_SBABS::Damage_Properties[16]
bitmap.draw_text(0,0,160,Requiem_SBABS::Damage_Properties[2]+2,Requiem_SBABS::Damage_Properties[12],1)
end
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y-self.oy/2-60
@_damage_sprite.z += 99999
@_damage_duration = 60
end
def dispose_damage
if @_damage_sprite != nil
@_damage_sprite.dispose
@_damage_sprite = nil
end
end
def dispose_hit
if @_hit_sprite != nil
@_hit_sprite.dispose
@_hit_sprite = nil
end
end
#------------------------------------------------------------------------------
# Sprite Drop
#------------------------------------------------------------------------------
class Sprite_Drop < Sprite_Base
attr_accessor :character
def initialize(viewport, character = nil)
super(viewport)
@character = character
update
end
def update
super
update_bitmap
self.visible = (not @character.transparent)
update_src_rect
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
start_animation(animation)
@character.animation_id = 0
end
if @character.balloon_id != 0
@balloon_id = @character.balloon_id
start_balloon
@character.balloon_id = 0
end
end
def update_bitmap
if @tile_id != @character.tile_id or
@graphic_name != @character.graphic_name or
@graphic_index != @character.graphic_index
@tile_id = @character.tile_id
@graphic_name = @character.graphic_name
@graphic_index = @character.graphic_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
end
end
def update_src_rect
if @tile_id == 0
index = @character.graphic_index
sx = index % 16 * 24
sy = index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end
end
#------------------------------------------------------------------------------
# Sprite Shield
#------------------------------------------------------------------------------
class Sprite_Weapon < Sprite_Base
def initialize(viewport, character = nil)
super(viewport)
@character = character
update
end
def update
super
return unless Requiem_SBABS::Use_Weapons_Animations
if @character.anime_attack > 0
self.visible = true
else
self.visible = false
end
update_bitmap
update_src_rect
change_direction
end
def update_bitmap
if @tile_id != @character.tile_id or @graphic_name != "Iconset" or @graphic_index != weapon_index
@tile_id = @character.tile_id
@graphic_name = "Iconset"
@graphic_index = weapon_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
self.zoom_x = 0.80
self.zoom_y = 0.80
end
end
def update_src_rect
if @tile_id == 0
sx = weapon_index % 16 * 24
sy = weapon_index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end
def change_direction
case @character.direction
when 2
self.x = @character.screen_x+10
self.z = @character.screen_z+1
self.mirror = false
change_angle(45,90,135)
when 4
self.x = @character.screen_x-10
self.z = @character.screen_z+1
self.mirror = false
change_angle(-45,0,45)
when 6
self.x = @character.screen_x+10
self.z = @character.screen_z-1
self.mirror = true
change_angle(45,0,-45)
when 8
self.x = @character.screen_x+10
self.z = @character.screen_z-1
self.mirror = true
change_angle(45,0,-45)
end
self.y = @character.screen_y-4
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
end
def change_angle(a,b,c)
if @character.anime_attack >= 20
self.angle = a
elsif @character.anime_attack >= 15
self.angle = b
elsif @character.anime_attack >= 10
self.angle = c
end
end
def weapon_index
return 0 if @character.actor.nil?
if @character.actor.is_a?(Game_Actor) and @character.right_attack_on == true and @character.actor.weapon_id > 0
return $data_weapons[@character.actor.weapon_id].icon_index
elsif @character.actor.is_a?(Game_Actor) and @character.left_attack_on == true
if @character.actor.two_swords_style and @character.actor.armor1_id > 0
return $data_weapons[@character.actor.armor1_id].icon_index
elsif @character.actor.two_hands_legal? and @character.actor.weapon_id > 0 and Requiem_SBABS::Distance_Weapons.include?(@character.actor.weapon_id)
return $data_weapons[@character.actor.weapon_id].icon_index
else
return 0
end
end
return 0
end
end
#------------------------------------------------------------------------------
# Sprite Shield
#------------------------------------------------------------------------------
class Sprite_Shield < Sprite_Base
def initialize(viewport, character = nil)
super(viewport)
@character = character
update
end
def update
super
return if Requiem_SBABS::Use_Shields == false and @character.is_a?(Game_Player)
return if @character.is_a?(Game_Ally) and @character.map_id != $game_map.map_id
update_bitmap
self.visible = (@character.deffending)
update_src_rect
case @character.direction
when 2
self.mirror = true
self.x = @character.screen_x+6
self.z = @character.screen_z+1
when 4
self.mirror = false
self.x = @character.screen_x-6
self.z = @character.screen_z+1
when 6
self.mirror = true
self.x = @character.screen_x+6
self.z = @character.screen_z-1
when 8
self.mirror = false
self.x = @character.screen_x-6
self.z = @character.screen_z-1
end
self.y = @character.screen_y
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.moving?
self.wave_amp = 1
self.wave_length = 1
self.wave_speed = 6
else
self.wave_amp = 0
end
end
def update_bitmap
if @tile_id != @character.tile_id or @graphic_name != "Iconset" or @graphic_index != shield_index
@tile_id = @character.tile_id
@graphic_name = "Iconset"
@graphic_index = shield_index
if @tile_id > 0
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(0, 0, 24, 24)
else
self.bitmap = Cache.system(@graphic_name)
@cw = 24
@ch = 24
end
self.ox = @cw / 2
self.oy = @ch
self.zoom_x = 0.80
self.zoom_y = 0.80
end
end
def update_src_rect
if @tile_id == 0
sx = shield_index % 16 * 24
sy = shield_index / 16 * 24
self.src_rect.set(sx, sy, @cw, @ch)
end
end
def shield_index
return 0 if @character.actor.nil?
if @character.actor.is_a?(Game_Actor) and [email protected]_swords_style and @character.actor.armor1_id > 0
return $data_armors[@character.actor.armor1_id].icon_index
else
return 0
end
end
end
#------------------------------------------------------------------------------
# Spriteset Map
#------------------------------------------------------------------------------
class Spriteset_Map
attr_accessor :viewport3
alias requiem_sbabs_sp_map_create_characters create_characters
alias requiem_sbabs_sp_map_update_characters update_characters
alias requiem_sbabs_sp_map_dispose_characters dispose_characters
def create_characters
@ally_sprites = []
for ally in $game_allies
next if ally.nil?
@ally_sprites.push(Sprite_Character.new(@viewport1,ally))
end
@range_sprites = []
for range in $game_range
next if range.nil?
@range_sprites.push(Sprite_Character.new(@viewport1,range))
end
@bomb_sprites = []
for bomb in $game_bomb
next if bomb.nil?
@bomb_sprites.push(Sprite_Drop.new(@viewport1,bomb))
end
@drop_sprites = []
for drop in $game_drop
next if drop.nil?
@drop_sprites.push(Sprite_Drop.new(@viewport1,drop))
end
@weapon_sprites = []
@weapon_sprites.push(Sprite_Weapon.new(@viewport1,$game_player))
@shield_sprites = []
@shield_sprites.push(Sprite_Shield.new(@viewport1,$game_player))
for ally in $game_allies
next if ally.nil?
@weapon_sprites.push(Sprite_Weapon.new(@viewport1,ally))
@shield_sprites.push(Sprite_Shield.new(@viewport1,ally))
end
requiem_sbabs_sp_map_create_characters
end
def update_characters
requiem_sbabs_sp_map_update_characters
for ally in @ally_sprites
next if ally.nil?
ally.update
end
for range in @range_sprites
next if range.nil?
range.update
end
for bomb in @bomb_sprites
next if bomb.nil?
bomb.update
end
for drop in @drop_sprites
next if drop.nil?
drop.update
end
for weapon in @weapon_sprites
next if weapon.nil?
weapon.update
end
for shield in @shield_sprites
next if shield.nil?
shield.update
end
for ally in $game_allies
next if ally.nil?
if ally.draw == false
@ally_sprites.push(Sprite_Character.new(@viewport1,ally))
@weapon_sprites.push(Sprite_Weapon.new(@viewport1,ally))
@shield_sprites.push(Sprite_Shield.new(@viewport1,ally))
ally.draw = true
end
end
for range in $game_range
next if range.nil?
if range.draw == false
@range_sprites.push(Sprite_Character.new(@viewport1,range))
range.draw = true
end
if range.destroy == true
$game_range.delete(range)
range.character_name = ""
end
end
for bomb in $game_bomb
next if bomb.nil?
if bomb.draw == false
@bomb_sprites.push(Sprite_Drop.new(@viewport1,bomb))
bomb.draw = true
end
if bomb.destroy == true
$game_bomb.delete(bomb)
bomb.graphic_name = ""
end
end
for drop in $game_drop
next if drop.nil?
if drop.draw == false
@drop_sprites.push(Sprite_Drop.new(@viewport1,drop))
drop.draw = true
end
if drop.destroy == true
$game_drop.delete(drop)
drop.graphic_name = ""
end
end
end
def dispose_characters
requiem_sbabs_sp_map_dispose_characters
for ally in @ally_sprites
next if ally.nil?
ally.dispose
end
for range in @range_sprites
next if range.nil?
range.dispose
end
for bomb in @bomb_sprites
next if bomb.nil?
bomb.dispose
end
for drop in @drop_sprites
next if drop.nil?
drop.dispose
end
for weapon in @weapon_sprites
next if weapon.nil?
weapon.dispose
end
for shield in @shield_sprites
next if shield.nil?
shield.dispose
end
end
def add_ally(ally)
@ally_sprites.push(Sprite_Character.new(@viewport1, ally))
@weapon_sprites.push(Sprite_Weapon.new(@viewport1,ally))
@shield_sprites.push(Sprite_Shield.new(@viewport1,ally))
end
def refresh_allies
dispose_characters
create_characters
end
end
#------------------------------------------------------------------------------
# Conjure Bar
#------------------------------------------------------------------------------
class Conjure_Bar < Sprite
def change?
return true if @min != $game_player.min_conjure_time
if $game_player.conjuring = false
dispose
return false
end
return true if @old_x != $game_player.screen_x-(@bmp.width/2)
return true if @old_y != $game_player.screen_y
end
#------------------------------------------------------------------------------
# Window Base
#------------------------------------------------------------------------------
class Window_Base < Window
#------------------------------------------------------------------------------
# Scene Title
#------------------------------------------------------------------------------
class Scene_Title < Scene_Base
alias requiem_sbabs_scenetitle_command_new_game command_new_game
alias requiem_sbabs_scenetitle_create_game_objects create_game_objects
def command_new_game
requiem_sbabs_scenetitle_command_new_game
for ally in $game_allies
next if ally.nil?
ally.moveto($data_system.start_x, $data_system.start_y)
ally.map_id = $game_map.map_id
ally.move_random
end
end
end
#------------------------------------------------------------------------------
# Scene Map
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias requiem_sbabs_smap_update update
alias requiem_sbabs_smap_terminate terminate
def update
requiem_sbabs_smap_update
update_conjure_bar
for ally in $game_allies
next if ally.nil?
ally.update
end
for range in $game_range
next if range.nil?
range.update
end
for bomb in $game_bomb
next if bomb.nil?
bomb.update
end
for drop in $game_drop
next if drop.nil?
drop.update
end
end
def terminate
requiem_sbabs_smap_terminate
@bar.dispose if @bar != nil and [email protected]?
end
def add_ally(ally)
@spriteset.add_ally(ally)
@spriteset.refresh_allies
end
def refresh_sprites
@spriteset.refresh_allies
Cache.clear
end
def update_conjure_bar
if $game_player.conjuring == true and $game_player.show_bar == false
@bar = Conjure_Bar.new(@spriteset.viewport3)
$game_player.show_bar = true
elsif $game_player.conjuring == false and $game_player.show_bar == true
@bar.dispose if [email protected]?
@bar = nil
$game_player.show_bar = false
end
@bar.update if @bar != nil and [email protected]?
end
def update_encounter
end
end
#------------------------------------------------------------------------------
# Scene Item
#------------------------------------------------------------------------------
class Window_Item < Window_Selectable
def update_help
if $scene.is_a?(Scene_Item) and $scene.message != nil
@help_window.set_text($scene.message)
else
@help_window.set_text(item == nil ? "" : item.description)
end
end
end
#------------------------------------------------------------------------------
class Scene_Item < Scene_Base
attr_accessor :message
attr_accessor :delay
alias requiem_sbabs_sitem_start start
alias requiem_sbabs_sitem_update update
alias requiem_sbabs_sitem_update_item_selection update_item_selection
def update
requiem_sbabs_sitem_update
if @delay <= 0
@message = nil
else
@delay -= 1
end
end
def update_item_selection
requiem_sbabs_sitem_update_item_selection
for button in @actor.item_hotkeys.keys
if Input.trigger?(button)
Sound.play_decision
@actor.item_hotkeys[button] = @item_window.item.id
@message = Requiem_SBABS::Memorize_Text
@delay = 120
end
end
end
end
#------------------------------------------------------------------------------
# Scene Skill
#------------------------------------------------------------------------------
class Window_Skill < Window_Selectable
def update_help
if $scene.is_a?(Scene_Skill) and $scene.message != nil
@help_window.set_text($scene.message)
else
@help_window.set_text(skill == nil ? "" : skill.description)
end
end
end
#------------------------------------------------------------------------------
class Scene_Skill < Scene_Base
attr_accessor :message
attr_accessor :delay
alias requiem_sbabs_sskill_start start
alias requiem_sbabs_sskill_update update
alias requiem_sbabs_sskill_update_skill_selection update_skill_selection
def start
requiem_sbabs_sskill_start
@message = nil
@delay = 0
end
def update
requiem_sbabs_sskill_update
if @delay <= 0
@message = nil
else
@delay -= 1
end
end
def update_skill_selection
requiem_sbabs_sskill_update_skill_selection
for button in @actor.skill_hotkeys.keys
if Input.trigger?(button)
if !Requiem_SBABS::Conjure_Skills.include?(@skill_window.skill.id)
Sound.play_decision
@actor.skill_hotkeys[button] = @skill_window.skill.id
@message = "Memorizada!"
@delay = 120
else
Sound.play_buzzer
end
end
end
for button in @actor.conjure_hotkeys.keys
if Input.trigger?(button)
if Requiem_SBABS::Conjure_Skills.include?(@skill_window.skill.id)
Sound.play_decision
@actor.conjure_hotkeys[button] = @skill_window.skill.id
@message = Requiem_SBABS::Memorize_Text
@delay = 120
else
Sound.play_buzzer
end
end
end
end
end
#------------------------------------------------------------------------------
# Scene File
#------------------------------------------------------------------------------
class Scene_File < Scene_Base
alias requiem_sbabs_sfile_write_save_data write_save_data
alias requiem_sbabs_sfile_read_save_data read_save_data
#------------------------------------------------------------------------------
# End of SBABS
#------------------------------------------------------------------------------
#==============================================================================
# Requiem Group Command
#==============================================================================
class Window_RequiemGroupCommand < Window_Base
attr_accessor :index
attr_accessor :max_index
def initialize
super(0,480,64,64)
@index = 1
end
def update
return if $game_party.members.size < 0
@max_index = $game_party.members.size-1
return if @index <= 0 or @max_index <= 0
self.contents.clear
draw_actor_head($game_party.members[@index],0,4,$ally_action_enbl)
end
end
#------------------------------------------------------------------------------
class Window_RequiemGroupActions < Window_Base
def initialize
super(-64,360,56,56)
end
def update
return if $game_party.members.size < 0
self.contents.clear
case $ally_action
when 0
draw_icon(2,0,0,$ally_action_enbl)
when 1
draw_icon(119,0,0,$ally_action_enbl)
when 2
draw_icon(52,0,0,$ally_action_enbl)
when 3
draw_icon(128,0,0,$ally_action_enbl)
end
end
end
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias requiem_group_command_start start
alias requiem_group_command_update update
alias requiem_group_command_terminate terminate
def update
requiem_group_command_update
@group_window.update
@group_action.update
verify_allies
call_control_allies_window
end
def terminate
requiem_group_command_terminate
@group_window.dispose
@group_action.dispose
end
def call_control_allies_window
return if @group_window.max_index <= 0
if Input.press?(Input::CTRL)
@group_window.active = true
@group_action.active = true
@group_window.y -= 5 if @group_window.y > (416-@group_window.height)
@group_action.x += 5 if @group_action.x < @group_window.width
update_allies_window
update_allies_actions
else
@group_window.y += 5 if @group_window.y < (416+@group_window.height)
@group_action.x -= 5 if @group_action.x > -@group_window.width
@group_window.active = false
@group_action.active = false
end
end
def update_allies_window
if Input.trigger?(Input::C) and @group_window.active
if @group_window.max_index == 1
Sound.play_buzzer
else
Sound.play_cursor
end
if @group_window.index < @group_window.max_index
@group_window.index += 1
else
@group_window.index = 1
end
end
end
def update_allies_actions
return if $game_allies[@group_window.index].nil?
if Input.trigger?(Input::Tab) and @group_action.active
if $ally_action_enbl == true
Sound.play_cursor
else
Sound.play_buzzer
return
end
if $game_allies[@group_window.index].command < 3
$game_allies[@group_window.index].command += 1
else
$game_allies[@group_window.index].command = 0
end
end
end
def verify_allies
return if $game_allies[@group_window.index].nil?
$ally_action = $game_allies[@group_window.index].command
if $game_allies[@group_window.index].actor.dead? or $game_allies[@group_window.index].map_id != $game_map.map_id
$ally_action_enbl = false
else
$ally_action_enbl = true
end
end