# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
#===============================================================================
# BATTLER / SENSOR RANGE / PLAYER COMMANDS / ENEMY COMMANDS
#===============================================================================
# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
#===============================================================================
# ■ SENSOR
#===============================================================================
module XRXS_EnemySensor
#--------------------------------------------------------------------------
# ● Update Sensor
#--------------------------------------------------------------------------
def update_sensor
return if self.dead? or self.erased or self.tool_id > 0
if self.battler.is_a?(Game_Actor)
enemy_sensor = 4
else
enemy_sensor = XAS_BA_ENEMY::ENEMY_SENSOR[self.battler.id]
end
if self.battler != nil and self.battler.sensor_range > 0
@sensor_range = enemy_sensor
else
@sensor_range = $game_variables[XAS_BA_ENEMY::DEFAULT_ENEMY_SENSOR_VARIABLE_ID]
end
@sensor_range = -1 if self.battler != nil and cancel_sensor?
distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
enable = (distance <= @sensor_range)
key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
last_enable = $game_self_switches[key]
last_enable = false if last_enable == nil
if enable
self.range_type = 0
else
self.range_type = 1
end
if enable != last_enable
self.action_times = 0
$game_self_switches[key] = enable
attack_off if self.battler != nil
self.refresh
end
end
#--------------------------------------------------------------------------
# ● Cancel Sensor
#--------------------------------------------------------------------------
def cancel_sensor?
return true if @actor == nil
return true if self.knockbacking?
return true if self.throw_active
return true if self.battler.e_passive
return true if self.battler.stop
return true if self.battler.state_sleep
if self.battler.sensor_range < 15
return true if self.battler.state_cancel_sensor
return true if $game_player.battler.state_cancel_sensor
end
return false
end
end
#===============================================================================
# ■ Game_Event
#===============================================================================
class Game_Event < Game_Character
include XRXS_EnemySensor
end
#===============================================================================
# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
# CT METER
# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
#===============================================================================
#===============================================================================
# ■ GAME_PLAYER
#===============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● Update CT Meter Speed
#--------------------------------------------------------------------------
def update_ct_meter_speed
return if $game_switches[XAS::CT_DISABLE_SWITCH]
if self.battler.state_ctdown
ct_meter_limit = XAS::CT_METER_SPEED * XAS::CT_POWER
else
ct_meter_limit = XAS::CT_METER_SPEED
end
$game_system.action_meter_refresh += 1
$game_system.action_meter_refresh = 0 if $game_system.action_meter_refresh > ct_meter_limit
if self.battler.state_ctup
ct_speed_down = 1
ct_speed_up = XAS::CT_POWER
ct_speed_up = 0 if $game_temp.xas_charge_time > 5
elsif self.battler.state_ctdown
ct_speed_down = XAS::CT_POWER
ct_speed_up = 1
ct_speed_up = 0 if $game_temp.xas_charge_time > 5
else
ct_speed_down = 1
ct_speed_up = 1
ct_speed_up = 0 if $game_temp.xas_charge_time > 5
end
if Input.press?(XAS_COMMAND::DASH_BUTTON) or can_shield?(0)
if $game_system.action_meter_refresh == 0
$game_system.action_meter -= ct_speed_down if $game_player.action == nil
end
else
if $game_system.action_meter_refresh == 0 and not can_shield?(1)
$game_system.action_meter += ct_speed_up
end
end
end
end
# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
#===============================================================================
# COMMAND
#===============================================================================
# ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(XAS_COMMAND::ATTACK_ACTION1)
active_attack #ATTACK
elsif Input.trigger?(XAS_COMMAND::SKILL_ACTION) or $command_skill != 0
active_skill #SKILL
elsif Input.trigger?(XAS_COMMAND::ATTACK_ACTION2)
active_shield #SHIELD
elsif Input.trigger?(XAS_COMMAND::ITEM_ACTION) or $command_item != 0
active_item #ITEM
elsif Input.trigger?(XAS_COMMAND::DASH_BUTTON)
active_dodge #DODGE
elsif Input.trigger?(XAS_COMMAND::SKILL_CHANGE)
if $game_system.quick_menu and can_call_menu? #Quik Menu Skill
$scene = Quick_Menu_Skill.new
else
active_change_skill #Change Skill
end
elsif Input.trigger?(XAS_COMMAND::ITEM_CHANGE)
if $game_system.quick_menu and can_call_menu?
$scene = Quick_Menu_Item.new #Quik Menu Item
else
active_change_item #Change Item
end
end
end
#--------------------------------------------------------------------------
# ● Can Action
#--------------------------------------------------------------------------
def can_action?
return false if self.action != nil
return false if self.knockbacking?
return false if $game_temp.xas_charge_time >= 10
return false if $game_temp.cast_time > 0
return false if jumping?
return false if $game_switches[XAS_COMMAND::COMMAND_DISABLE_SWITCH] == true
return false if $game_temp.lock_command
return false if $game_system.fly
return false if @swimming
return false if @pickup_lock
return false if @pickup_lock_time > 0
return false if terrain_tag == XAS::FALL_TERRAIN and @fall_safe_time == 0
return false if terrain_tag == XAS::SLIP_TERRAIN
return false unless $game_temp.hook_x == 0 and $game_temp.hook_y == 0
return true
end
#--------------------------------------------------------------------------
# ● Check Combo
#--------------------------------------------------------------------------
def check_combo(action_id,type)
combo_id = Database_Bullet::LINK_ACTION_ID[action_id]
return false if combo_id == 0
combo_time = Database_Bullet::SUFLAGS[action_id] + XAS_SKILL::COMBO_TIME
case type
when 1 #Attack
$game_temp.xas_combo_attack_id = combo_id
$game_temp.xas_combo_attack_time = combo_time
$game_temp.xas_combo_skill_id = 0
$game_temp.xas_combo_skill_time = 0
$game_temp.xas_combo_item_id = 0
$game_temp.xas_combo_item_time = 0
when 2 #Skill
$game_temp.xas_combo_attack_id = 0
$game_temp.xas_combo_attack_time = 0
$game_temp.xas_combo_skill_id = combo_id
$game_temp.xas_combo_skill_time = combo_time
$game_temp.xas_combo_item_id = 0
$game_temp.xas_combo_item_time = 0
when 3 #Item
$game_temp.xas_combo_attack_id = 0
$game_temp.xas_combo_attack_time = 0
$game_temp.xas_combo_skill_id = 0
$game_temp.xas_combo_skill_time = 0
$game_temp.xas_combo_item_id = combo_id
$game_temp.xas_combo_item_time = combo_time
end
end
#--------------------------------------------------------------------------
# ● Cast Action ?
#--------------------------------------------------------------------------
def cast_action?(action_id,type)
cast_time = Database_Bullet::PLAYER_CAST_TIME[action_id]
return false if cast_time <= 0
return false if $game_temp.cast_skill_id != 0
return false if $game_temp.force_action_now_id != 0 or $game_temp.force_action_id != 0
$game_temp.cast_type = type
skill_id = action_id
skill = skill_id == nil ? nil : $data_skills[skill_id]
sp_cost = skill.sp_cost
if @actor.sp >= skill.sp_cost
$game_player.animation_id = XAS_SKILL::DEFAULT_CAST_ANIMATION_ID
end
$game_temp.cast_skill_id = action_id
$game_temp.cast_time = 10 * cast_time
return true
end
#--------------------------------------------------------------------------
# ● Can Target?
#--------------------------------------------------------------------------
def update_shoot_on_target
return if $game_temp.xas_target_time == 0
return if $game_temp.xas_target_shoot_id == 0
return if $game_temp.xas_target_x == 0 and $game_temp.xas_target_y == 0
$game_temp.xas_target_time -= 1
if $game_temp.xas_target_time == 0
self.shoot($game_temp.xas_target_shoot_id)
$game_temp.xas_target_shoot_id = 0
end
end
#--------------------------------------------------------------------------
# ● XAS - Button SKILL
#--------------------------------------------------------------------------
def active_skill
type = 2
if seal_state?(type)
seal_text
return
end
if $game_temp.xas_combo_skill_time > 0
action_id = $game_temp.xas_combo_skill_id
else
if $command_skill != 0
action_id = $command_skill;$command_skill = 0
else
action_id = $game_system.xas_skill_id
end
end
return false unless check_action_exist?(action_id)
check_combo(action_id,type)
return if cast_action?(action_id,type)
self.shoot(action_id)
end
#--------------------------------------------------------------------------
# ● XAS - Button Attack
#--------------------------------------------------------------------------
def active_attack
type = 1
if seal_state?(type)
seal_text
return
end
if $game_temp.xas_combo_attack_time > 0
action_id = $game_temp.xas_combo_attack_id
else
action_id = $game_system.xas_action_slash_id
end
return false unless check_action_exist?(action_id)
check_combo(action_id,type)
return if cast_action?(action_id,type)
self.shoot(action_id)
end
#--------------------------------------------------------------------------
# ● XAS - Button Shield
#--------------------------------------------------------------------------
def active_shield
type = 1
if seal_state?(type)
seal_text
return
end
action_id = $game_system.xas_action_slash_id2
return false unless check_action_exist?(action_id)
return if cast_action?(action_id,type)
self.shoot(action_id)
$game_temp.clear_setting3
end
#--------------------------------------------------------------------------
# ● XAS - Button Item
#--------------------------------------------------------------------------
def active_item
type = 3
return if ($mog_rgss_xas_extra_skill != nil and Input.press?(Input::L))
if seal_state?(type)
seal_text
return
end
if $game_temp.xas_combo_item_time > 0
action_id = $game_temp.xas_combo_item_id
else
if $command_item != 0
action_id = $command_item;$command_item = 0
else
action_id = item_tool_id = XAS::XASITEM_ID[$game_system.xas_item_id]
end
end
return false unless check_action_exist?(action_id)
check_combo(action_id,type)
return if cast_action?(action_id,type)
self.shoot(action_id)
end
#--------------------------------------------------------------------------
# ● XAS - Dodge Efect
#------------------------------------------------ --------------------------
def dodge_effect
jump(0,0)
@need_refresh_pose = true
$game_temp.dodge_time_real = 15
$game_temp.lock_command = true
$game_system.se_play(XAS::SE_DODGE)
$game_system.action_meter -= XAS::DODGE_COST
$game_player.animation_id = XAS::DODGE_ANIMATION_ID
power = XAS::DODGE_RANGE
power.times do
move_backward
end
end
#--------------------------------------------------------------------------
# ● XAS - DODGE
#--------------------------------------------------------------------------
def active_dodge
return if XAS::DODGE_SYSTEM == false
return if $game_switches[XAS::CT_DISABLE_SWITCH]
if $game_temp.dodge_time > 0
if $game_system.action_meter > XAS::DASH_ACTIVE_PERC
dodge_effect
else
$game_system.se_play($data_system.buzzer_se)
end
$game_temp.clear_setting2
else
$game_temp.dodge_time = 15
$game_temp.dodge = true
end
end
#--------------------------------------------------------------------------
# ● XAS - CAST TIME
#--------------------------------------------------------------------------
def update_release_cast_action
if $game_temp.cast_time == 0 and $game_temp.cast_skill_id != 0
if seal_state?($game_temp.cast_type)
seal_text
return
end
action_id = $game_temp.cast_skill_id
force_move = Database_Bullet::FORCE_MOVE[action_id]
@actor.hit_it = 1 if force_move != nil
self.shoot(action_id)
$game_temp.clear_setting2
end
end
#--------------------------------------------------------------------------
# ● XAS - Change Skill
#--------------------------------------------------------------------------
def active_change_skill
@data = []
for i in [email]0...@actor.skills.size[/email]
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
if skill == nil
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.xas_skill_index += 1
if $game_system.xas_skill_index == @data.size
$game_system.xas_skill_index = 0
end
skill = @data[$game_system.xas_skill_index]
skill_action = skill.id
$game_system.xas_skill_id = skill.id
$game_system.se_play($data_system.cursor_se)
end
#--------------------------------------------------------------------------
# ● XAS - Change Item
#--------------------------------------------------------------------------
def active_change_item
@data2 = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0 and $game_party.item_can_use?(i)
@data2.push($data_items[i])
end
end
item = @data2[$game_system.xas_item_index]
if item == nil
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.xas_item_index += 1
if $game_system.xas_item_index == @data2.size
$game_system.xas_item_index = 0
end
item = @data2[$game_system.xas_item_index]
item_action = item.id
$game_system.xas_item_id = item.id
$game_system.se_play($data_system.cursor_se)
end
#--------------------------------------------------------------------------
# ● XAS - Force_Action_Now
#--------------------------------------------------------------------------
def update_force_action
if $game_temp.force_action_now_id != 0 and not
(self.knockbacking? or @actor.state_sleep or @actor.stop)
if seal_state?(0)
seal_text
return false
end
action_id = $game_temp.force_action_now_id
self.shoot(action_id)
elsif self.action == nil and $game_temp.force_action_id != 0 and not
(self.knockbacking? or @actor.state_sleep or @actor.stop)
if seal_state?(0)
seal_text
return false
end
action_id = $game_temp.force_action_id
self.shoot(action_id)
end
end
#--------------------------------------------------------------------------
# ● Can Charge?
#--------------------------------------------------------------------------
def can_charge?
return false if $game_temp.cast_time > 0
return false if seal_state?(0)
return false if $game_switches[XAS_COMMAND::COMMAND_DISABLE_SWITCH]
return false if @wp_tool_id == nil
return false if @pickup_lock
return false if @swimming
return true
end
#--------------------------------------------------------------------------
# ● XAS - CHARGE
#--------------------------------------------------------------------------
def update_charge_button
unless self.action != nil or self.knockbacking?
if Input.press?(XAS_COMMAND::SKILL_CHARGE) and can_charge?
if $game_temp.xas_charge_time > 10
if MOG::FIXED_DIRECTION_SKILL.include?(@wp_tool_id)
@direction_fix = true
@action_move_speed = -1
else
@action_move_speed = 0
end
end
@wp_tool_time = WEP_CHARGE_TIME[@wp_id]
if @wp_tool_time != nil
$game_temp.xas_charge_time += @wp_tool_time if $game_temp.xas_charge_time < 100
$game_temp.xas_anime_loop += @wp_tool_time
$game_temp.xas_anime_loop2 += @wp_tool_time
loop = 40 * @wp_tool_time
else
$game_temp.xas_charge_time += DEFAULT_CHARGE_TIME if $game_temp.xas_charge_time < 100
$game_temp.xas_anime_loop += DEFAULT_CHARGE_TIME
$game_temp.xas_anime_loop2 += DEFAULT_CHARGE_TIME
loop = 40 * DEFAULT_CHARGE_TIME
end
if $game_temp.xas_anime_loop > loop
if $game_temp.xas_anime_loop2 >= 100
$game_player.animation_id = XAS_FULL_ANIME
else
$game_player.animation_id = XAS_CHARGE_ANIME
end
$game_temp.xas_anime_loop = 0
end
else
reset_charge_mode(true)
end
end
end
#--------------------------------------------------------------------------
# ● Release Charge Update
#--------------------------------------------------------------------------
def update_release_charge
if $game_temp.xas_charge_time >= 100 and not Input.press?(XAS_COMMAND::SKILL_CHARGE)
unless self.action != nil or self.knockbacking?
action_id = @wp_tool_id if @wp_tool_id != nil
return if action_id == nil or action_id == 0
if seal_state?(1)
seal_text
reset_charge_mode
return
end
self.shoot(action_id) if action_id != nil
end
$game_temp.clear_setting2
reset_charge_mode
end
end
#--------------------------------------------------------------------------
# ● Reset Charge Mode
#--------------------------------------------------------------------------
def reset_charge_mode(max = false)
return if $game_temp.xas_charge_time == 0
if max
$game_temp.xas_charge_time = 0 if $game_temp.xas_charge_time < 100
else
$game_temp.xas_charge_time = 0
end
$game_temp.xas_anime_loop2 = 0
$game_temp.xas_anime_loop = 0
@action_move_speed = 0
@direction_fix = false
@need_refresh_pose = true if @pose_type == "Charge"
end
#--------------------------------------------------------------------------
# ● Shield Direction
#--------------------------------------------------------------------------
def update_shield_direction
if $data_skills[self.action.id].element_set.include?($data_system.elements.index(XAS_ELEMENT::SHIELD_EFFECT))
if self.battler.state_confuse
turn_reverse_direction
else
turn_normal_direction
end
end
end
#--------------------------------------------------------------------------
# ● Turn_normal_direction
#--------------------------------------------------------------------------
def turn_normal_direction
if Input.press?(Input::UP)
turn_up
elsif Input.press?(Input::DOWN)
turn_down
elsif Input.press?(Input::RIGHT)
turn_right
elsif Input.press?(Input::LEFT)
turn_left
end
end
#--------------------------------------------------------------------------
# ● Turn_reverse_direction
#--------------------------------------------------------------------------
def turn_reverse_direction
if Input.press?(Input::UP)
turn_down
elsif Input.press?(Input::DOWN)
turn_up
elsif Input.press?(Input::RIGHT)
turn_left
elsif Input.press?(Input::LEFT)
turn_right
end
end
#--------------------------------------------------------------------------
# ● Direction Fix Update
#--------------------------------------------------------------------------
def update_direction_fix
if $game_temp.xas_combo_attack_time > 15 or
$game_temp.xas_combo_skill_time > 15 or
$game_temp.xas_combo_item_time > 15 or
$game_temp.xas_charge_time > 10 and MOG::FIXED_DIRECTION_SKILL.include?(@wp_tool_id)
@direction_fix = true
else
@direction_fix = false
end
end
#--------------------------------------------------------------------------
# ● Check Equipment ID
#--------------------------------------------------------------------------
def update_check_equipment_id
if @wp_id != @actor.weapon_id
@wp_id = @actor.weapon_id
@wp_tool_id = WEP_CHARGE_ID[@wp_id]
@wp_tool_time = WEP_CHARGE_TIME[@wp_id]
@weapon_tool_id = XAS_SKILL::WEAPON_ID_TOOL[@wp_id]
$game_system.xas_action_slash_id = @weapon_tool_id
end
if @armor_id != @actor.armor1_id
@armor_id = @actor.armor1_id
@armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[@armor_id]
$game_system.xas_action_slash_id2 = @armor_tool_id
end
end
#--------------------------------------------------------------------------
# ● Pressed Button
#--------------------------------------------------------------------------
def pressed_button?
return false if self.knockbacking?
return false if $game_system.map_interpreter.running?
return false if @pickup_lock
return true if Input.press?(XAS_COMMAND::ATTACK_ACTION1)
return true if Input.press?(XAS_COMMAND::ATTACK_ACTION2)
return true if Input.press?(XAS_COMMAND::ITEM_ACTION)
return true if Input.press?(XAS_COMMAND::SKILL_ACTION)
return true if Input.press?(XAS_COMMAND::DASH_BUTTON)
return false
end
#--------------------------------------------------------------------------
# ● Trigger Button
#--------------------------------------------------------------------------
def trigger_button?
return true if Input.trigger?(XAS_COMMAND::ATTACK_ACTION1)
return true if Input.trigger?(XAS_COMMAND::ATTACK_ACTION2)
return true if Input.trigger?(XAS_COMMAND::ITEM_ACTION)
return true if Input.trigger?(XAS_COMMAND::SKILL_ACTION)
return true if Input.trigger?(XAS_COMMAND::DASH_BUTTON)
return false
end
#--------------------------------------------------------------------------
# ● Pressed Check
#--------------------------------------------------------------------------
def update_pressed_check
if pressed_button?
$game_temp.pressed_attack = true
$game_temp.pressed_attack = false if trigger_button?
else
$game_temp.pressed_attack = false
end
end
#--------------------------------------------------------------------------
# ● Call Menu
#--------------------------------------------------------------------------
def can_call_menu?
return false if $game_temp.slow_motion > 0
return true
end
end
#===============================================================================
# ■ Game_Character
#===============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● Passable Hookshot
#--------------------------------------------------------------------------
def passable_hookshot?(x, y, d)
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
unless $game_map.valid?(new_x, new_y)
return false
end
if @through
return true
end
for event in $game_map.events.values
if event.x == new_x and event.y == new_y
if event.character_name == ""
return true
end
unless event.through
if self != $game_player
return false
end
if event.character_name != ""
return false
end
end
end
end
if $game_player.x == new_x and $game_player.y == new_y
unless $game_player.through
if @character_name != ""
return false
end
end
end
return true
end
end
#===============================================================================
# ■ Scene_Save
#===============================================================================
class Scene_Save
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
alias xas_background_on_decision on_decision
def on_decision(filename)
if $game_temp.background_effect_time > 0
$game_temp.background_effect_time = 0
$game_map.panorama_name = $game_temp.pre_panorama_name
$game_map.panorama_hue = $game_temp.pre_panorama_hue
end
xas_background_on_decision(filename)
end
end
#===============================================================================
# ■ XAS_ACTION
#===============================================================================
module XAS_ACTION
#===============================================================================
# ■ Battler Commands
#===============================================================================
#--------------------------------------------------------------------------
# ● Anime
#--------------------------------------------------------------------------
def anime(anime_id)
self.animation_id = anime_id
end
#--------------------------------------------------------------------------
# ● Anime D
#--------------------------------------------------------------------------
def anime_d(u,d,l,r)
if @direction == 2
self.animation_id = d
elsif @direction == 8
self.animation_id = u
elsif @direction == 4
self.animation_id = l
elsif @direction == 6
self.animation_id = r
end
end
#--------------------------------------------------------------------------
# ● Invunerable
#--------------------------------------------------------------------------
def invunerable
return unless check_battler_exist?
self.battler.no_damage = true
end
#--------------------------------------------------------------------------
# ● Vunerable
#--------------------------------------------------------------------------
def vunerable
return unless check_battler_exist?
self.battler.no_damage = false
end
#--------------------------------------------------------------------------
# ● Text
#--------------------------------------------------------------------------
def text(tx,perc)
return unless check_battler_exist?
if rand(100) <= perc
self.battler.damage = tx.to_s
self.battler.damage_pop = true
end
end
#--------------------------------------------------------------------------
# ● Zoom
#--------------------------------------------------------------------------
def zoom(x,y)
return unless check_battler_exist?
self.battler.zoomx = x
self.battler.zoomy = y
end
#--------------------------------------------------------------------------
# ● Zoom fast
#--------------------------------------------------------------------------
def fastzoom(valor)
return unless check_battler_exist?
self.battler.zoom_fast = valor
end
#--------------------------------------------------------------------------
# ● Self Damage
#--------------------------------------------------------------------------
def selfdamage(damage,perc)
return unless check_battler_exist?
if rand(100) <= perc
self.battler.damage = damage.to_i
self.battler.damage_pop = true
self.battler.hp -= damage
if self.battler.hp <= 0
self.battler.gain_exp_act = false
end
end
end
#--------------------------------------------------------------------------
# ● Add State
#--------------------------------------------------------------------------
def addstate(states_id,perc)
return unless check_battler_exist?
if rand(100) <= perc
self.battler.add_state(states_id)
end
end
#--------------------------------------------------------------------------
# ● Counter ON
#--------------------------------------------------------------------------
def counter_on
return unless check_battler_exist?
self.battler.counter_on = true
end
#--------------------------------------------------------------------------
# ● Counter Off
#--------------------------------------------------------------------------
def counter_off
return unless check_battler_exist?
self.battler.counter_on = false
end
#--------------------------------------------------------------------------
# ● LowHP Add State
#--------------------------------------------------------------------------
def lowhp_addstate(states_id,perc)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if rand(100) <= perc
if self.battler.hp <= lowhp
self.battler.add_state(states_id)
end
end
end
#--------------------------------------------------------------------------
# ● LowHP Remove State
#--------------------------------------------------------------------------
def lowhp_removestate(states_id,perc)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if rand(100) <= perc
if self.battler.hp <= lowhp
self.battler.remove_state(states_id)
end
end
end
#--------------------------------------------------------------------------
# ● Remove State
#--------------------------------------------------------------------------
def removestate(states_id,perc)
return unless check_battler_exist?
if rand(100) <= perc
self.battler.remove_state(states_id)
end
end
#--------------------------------------------------------------------------
# ● Recover All
#--------------------------------------------------------------------------
def recoverall(per)
return unless check_battler_exist?
self.battler.damage = "Recover"
self.battler.damage_pop = true
self.battler.recover_all
end
#--------------------------------------------------------------------------
# ● LowHP Recover All
#--------------------------------------------------------------------------
def lowhp_recoverall(per)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
self.battler.damage = "Recover"
self.battler.damage_pop = true
self.battler.recover_all
end
end
#--------------------------------------------------------------------------
# ● Low HP Anime
#--------------------------------------------------------------------------
def lowhp_anime(anime_id)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
self.animation_id = anime_id
end
end
#--------------------------------------------------------------------------
# ● HP Anime
#--------------------------------------------------------------------------
def hp_anime(anime_id1,anime_id2)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp > lowhp
self.animation_id = anime_id1
else
self.animation_id = anime_id2
end
end
#--------------------------------------------------------------------------
# ● Speed
#--------------------------------------------------------------------------
def speed(x)
@base_move_speed = x
end
#--------------------------------------------------------------------------
# ● Freq
#--------------------------------------------------------------------------
def freq(x)
@move_frequency = x
end
#--------------------------------------------------------------------------
# ● LowHP Speed
#--------------------------------------------------------------------------
def lowhp_speed(x)
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
@move_speed = x
end
end
#--------------------------------------------------------------------------
# ● HP Speed
#--------------------------------------------------------------------------
def hp_speed(x1,x2)
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp > lowhp
@move_speed = x1
else
@move_speed = x2
end
end
#--------------------------------------------------------------------------
# ● LowHP Switch
#--------------------------------------------------------------------------
def lowhp_switch(x,on)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
$game_switches[x] = on
$game_map.need_refresh = true if $game_map.need_refresh == false
self.refresh
end
end
#--------------------------------------------------------------------------
# ● Hero LowHP Switch
#--------------------------------------------------------------------------
def hero_lowhp_switch(x,on)
actor = $game_party.actors[0]
lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
if actor.hp <= lowhp
$game_switches[x] = on
$game_map.need_refresh = true if $game_map.need_refresh == false
self.refresh
end
end
#--------------------------------------------------------------------------
# ● Dual Switch
#--------------------------------------------------------------------------
def dual_switch(a,b,perc)
if rand(100) <= perc
if $game_switches[a] == true
$game_switches[a] = false
$game_switches[b] = true
else
$game_switches[a] = true
$game_switches[b] = false
end
end
self.refresh
$game_map.need_refresh = true if $game_map.need_refresh == false
end
#--------------------------------------------------------------------------
# ● Hero Level Switch
#--------------------------------------------------------------------------
def hero_level_switch(x,level,on)
actor = $game_party.actors[0]
if actor.level >= level
$game_switches[x] = on
$game_map.need_refresh = true if $game_map.need_refresh == false
end
end
#--------------------------------------------------------------------------
# ● Hero HP Anime
#--------------------------------------------------------------------------
def hero_hp_anime(anime_id1,anime_id2)
actor = $game_party.actors[0]
lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
if actor.hp > lowhp
self.animation_id = anime_id1
else
self.animation_id = anime_id2
end
end
#--------------------------------------------------------------------------
# ● Hero Level Anime
#--------------------------------------------------------------------------
def hero_level_anime(anime_id1,anime_id2,level)
actor = $game_party.actors[0]
if actor.level >= level
self.animation_id = anime_id1
else
self.animation_id = anime_id2
end
end
#--------------------------------------------------------------------------
# ● Hero Level Speed
#--------------------------------------------------------------------------
def hero_level_speed(x1,x2,level)
actor = $game_party.actors[0]
if actor.level >= level
@move_speed = x1
else
@move_speed = x2
end
end
#--------------------------------------------------------------------------
# ● Hero HP Switch
#--------------------------------------------------------------------------
def hero_hp_switch(x,on)
actor = $game_party.actors[0]
lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
if actor.hp > lowhp
$game_switches[x] = on
$game_map.need_refresh = true
else
if on == true
$game_switches[x] = false
else
$game_switches[x] = true
end
$game_map.need_refresh = true if $game_map.need_refresh == false
end
end
#--------------------------------------------------------------------------
# ● Hero Level Shoot
#--------------------------------------------------------------------------
def hero_level_shoot(x1,x2,level,perc)
if rand(100) <= perc
actor = $game_party.actors[0]
if actor.level >= level
shoot(x1)
else
shoot(x2)
end
end
end
#--------------------------------------------------------------------------
# ● Hero Level Escape
#--------------------------------------------------------------------------
def hero_level_escape(level,perc)
return unless check_battler_exist?
if rand(100) <= perc
actor = $game_party.actors[0]
if actor.level >= level
self.battler.no_damage = true
self.battler.damage = "Escape"
self.battler.damage_pop = true
self.collapse_done = true
$game_system.se_play($data_system.escape_se)
end
end
end
#--------------------------------------------------------------------------
# ● HP Switch
#--------------------------------------------------------------------------
def hp_switch(x,on)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp > lowhp
$game_switches[x] = on
$game_map.need_refresh = true
else
if on == true
$game_switches[x] = false
else
$game_switches[x] = true
end
$game_map.need_refresh = true if $game_map.need_refresh == false
end
end
#--------------------------------------------------------------------------
# ● Escape
#--------------------------------------------------------------------------
def escape(perc)
return unless check_battler_exist?
if rand(100) <= perc
self.battler.damage = XAS_ABS_SETUP::ESCAPE_TEXT
self.battler.damage_pop = true
self.collapse_done = true
$game_system.se_play($data_system.escape_se)
self.erase
end
end
#--------------------------------------------------------------------------
# ● LowHP Escape
#--------------------------------------------------------------------------
def lowhp_escape(perc)
return unless check_battler_exist?
if rand(100) <= perc
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
self.battler.damage = XAS_ABS_SETUP::ESCAPE_TEXT
self.battler.damage_pop = true
self.collapse_done = true
$game_system.se_play($data_system.escape_se)
end
end
end
#--------------------------------------------------------------------------
# ● Shoot Chance
#--------------------------------------------------------------------------
def shoot_chance(action_id,perc)
if rand(100) <= perc
shoot(action_id)
end
end
#--------------------------------------------------------------------------
# ● Jump Org
#--------------------------------------------------------------------------
def jump_org
range_x = org_x - self.x
range_y = org_y - self.y
jump(range_x,range_y)
end
#--------------------------------------------------------------------------
# ● Org Here
#--------------------------------------------------------------------------
def org_here
self.org_x = self.x
self.org_y = self.y
end
#--------------------------------------------------------------------------
# ● Jump Near
#--------------------------------------------------------------------------
def jump_near
if $game_player.x > self.x and
$game_player.y > self.y
range_x = $game_player.x - self.x
range_y = -1 + $game_player.y - self.y
elsif $game_player.x < self.x and
$game_player.y < self.y
range_x = $game_player.x - self.x
range_y = 1 + $game_player.y - self.y
elsif $game_player.x > self.x and
$game_player.y < self.y
range_x = $game_player.x - self.x
range_y = 1 + $game_player.y - self.y
elsif $game_player.x < self.x and
$game_player.y > self.y
range_x = $game_player.x - self.x
range_y = -1 + $game_player.y - self.y
elsif $game_player.x < self.x and
$game_player.y == self.y
range_x = 1 + $game_player.x - self.x
range_y = $game_player.y - self.y
elsif $game_player.x > self.x and
$game_player.y == self.y
range_x = -1 + $game_player.x - self.x
range_y = $game_player.y - self.y
elsif $game_player.x == self.x and
$game_player.y > self.y
range_x = $game_player.x - self.x
range_y = -1 + $game_player.y - self.y
elsif $game_player.x == self.x and
$game_player.y < self.y
range_x = $game_player.x - self.x
range_y = 1 + $game_player.y - self.y
else
range_x = 0
range_y = 0
end
jump(range_x,range_y) unless range_y == 0 and range_x == 0
end
#--------------------------------------------------------------------------
# ● Lowhp Shoot
#--------------------------------------------------------------------------
def lowhp_shoot(action_id,perc)
return unless check_battler_exist?
if rand(100) <= perc
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
shoot(action_id)
end
end
end
#--------------------------------------------------------------------------
# ● Fatal Shoot
#--------------------------------------------------------------------------
def fatal_shoot(action_id,perc)
return unless check_battler_exist?
if rand(100) <= perc
shoot(action_id)
self.battler.damage = self.battler.hp
self.battler.damage_pop = true
self.battler.gain_exp_act = false
self.battler.hp -= self.battler.hp
end
end
#--------------------------------------------------------------------------
# ● Lowhp Fatal Shoot
#--------------------------------------------------------------------------
def lowhp_fatal_shoot(action_id,perc)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
if rand(100) <= perc
shoot(action_id)
self.battler.damage = self.battler.hp
self.battler.damage_pop = true
self.battler.gain_exp_act = false
self.battler.hp -= self.battler.hp
end
end
end
#--------------------------------------------------------------------------
# ● HP Shoot
#--------------------------------------------------------------------------
def hp_shoot(hp_high,hp_low,perc)
return unless check_battler_exist?
if rand(100) <= perc
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp >= lowhp
shoot(hp_high)
else
shoot(hp_low)
end
end
end
#--------------------------------------------------------------------------
# ● Hero LOWHP Shoot
#--------------------------------------------------------------------------
def hero_lowhp_shoot(x,perc)
actor = $game_party.actors[0]
if rand(100) <= perc
lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
if actor.hp <= lowhp
shoot(x)
end
end
end
#--------------------------------------------------------------------------
# ● Hero HP Shoot
#--------------------------------------------------------------------------
def hero_hp_shoot(hp_high,hp_low,perc)
actor = $game_party.actors[0]
if rand(100) <= perc
lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
if actor.hp > lowhp
shoot(hp_high)
else
shoot(hp_low)
end
end
end
#--------------------------------------------------------------------------
# ● Lowhp Rand Shoot
#--------------------------------------------------------------------------
def lowhp_rand_shoot(a,b,c,d,e)
attack_off
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp <= lowhp
case rand(5)
when 0
if a == 0
attack_on
else
shoot(a)
end
when 1
if b == 0
attack_on
else
shoot(b)
end
when 2
if c == 0
attack_on
else
shoot(c)
end
when 3
if d == 0
attack_on
else
shoot(d)
end
when 4
if e == 0
attack_on
else
shoot(e)
end
end
end
end
#--------------------------------------------------------------------------
# ● Rand Shoot
#--------------------------------------------------------------------------
def rand_shoot(a,b,c,d,e)
attack_off
case rand(5)
when 0
if a == 0
attack_on
else
shoot(a)
end
when 1
if b == 0
attack_on
else
shoot(b)
end
when 2
if c == 0
attack_on
else
shoot(c)
end
when 3
if d == 0
attack_on
else
shoot(d)
end
when 4
if e == 0
attack_on
else
shoot(e)
end
end
end
end
#===============================================================================
# ■ Game_Enemy
#===============================================================================
class Game_Battler
attr_accessor :e_object
attr_accessor :e_item
attr_accessor :e_ignore_hero_shield
attr_accessor :e_knockback_disable
attr_accessor :e_jump_hit_disable
attr_accessor :e_breath_effect
attr_accessor :e_zoom_in_effect
attr_accessor :e_zoom_out_effect
attr_accessor :e_only_blow
attr_accessor :e_passive
attr_accessor :e_drain
attr_accessor :e_sp_damage
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias xas_enemy_parameter_initialize initialize
def initialize
xas_enemy_parameter_initialize
@e_object = false
@e_item = false
@e_ignore_hero_shield = false
@e_knockback_disable = false
@e_jump_hit_disable = false
@e_breath_effect = false
@e_zoom_in_effect = false
@e_zoom_out_effect = false
@e_only_blow = false
@e_passive = false
@e_drain = false
@e_sp_damage = false
end
end
#===============================================================================
# ■ Game_Enemy
#===============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias xas_enemy_initialize initialize
def initialize(troop_id, member_index)
xas_enemy_initialize(troop_id, member_index)
for i in 1...$data_system.elements.size
if $data_enemies[@enemy_id].element_ranks[i] != 3
@e_object = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_OBJECT)
@e_item = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ITEM)
@e_ignore_hero_shield = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_IGNORE_HERO_SHIELD)
@e_knockback_disable = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_KNOCKBACK_DISABLE)
@e_jump_hit_disable = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_JUMP_HIT_DISABLE)
@e_breath_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_BREATH_EFFECT)
@e_zoom_in_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ZOOM_IN_EFFECT)
@e_zoom_out_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ZOOM_OUT_EFFECT)
@e_zoom_out_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ONLY_BLOW_TOUCH)
@e_passive = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_PASSIVE)
@e_drain = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_DRAIN)
@e_sp_damage = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_SP_DAMAGE)
end
end
self.gain_exp_act = true
end
end
#===============================================================================
# Game_Player
#===============================================================================
class Game_Player < Game_Character
include XRXS_BattlerAttachment
#--------------------------------------------------------------------------
# ● Battler
#--------------------------------------------------------------------------
def battler
return $game_party.actors[0]
end
#--------------------------------------------------------------------------
# ● Defeat Process
#--------------------------------------------------------------------------
def defeat_process
super
if RPG_FileTest.character_exist?(@actor.character_name + "_HIT")
@character_name = @actor.character_name + "_HIT"
end
if XAS_BA::AUTOGAMEOVER == true
if self.collapse_done
$scene = Scene_Gameover.new rescue nil
end
else
$game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true
$game_map.refresh
end
end
end
#===============================================================================
# ■ Game Event
#===============================================================================
class Game_Event < Game_Character
include XRXS_BattlerAttachment
#--------------------------------------------------------------------------
# ● Battler
#--------------------------------------------------------------------------
def battler
return @battler
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
alias xrxs64c_refresh refresh
def refresh
xrxs64c_refresh
self.battler_recheck
end
#--------------------------------------------------------------------------
# ● Battler Recheck
#--------------------------------------------------------------------------
def battler_recheck
return if @battler != nil
if @page == nil
return
end
if self.event_name =~ /<Actor>/
actor = $game_party.actors[0]
@battler = Game_Actor.new(actor.id)
return
else
@enemy_id = 0
if self.event_name =~ /<Enemy(\d+)>/i
@enemy_id = $1.to_i
end
if @enemy_id == 0
return
end
end
troop_id = -1
member_index = -1
for troop in $data_troops
next if troop == nil
for enemy in troop.members
if enemy.enemy_id == @enemy_id
troop_id = $data_troops.index(troop)
member_index = troop.members.index(enemy)
break
end
end
end
if troop_id != -1 and member_index != -1
@battler = Game_Enemy.new(troop_id, member_index)
end
end
#--------------------------------------------------------------------------
# ● Enemy Id
#--------------------------------------------------------------------------
def enemy_id
self.battler
return @enemy_id
end
#--------------------------------------------------------------------------
# ● update_gained_exp_gold
#--------------------------------------------------------------------------
def update_defeated
return if self.battler == nil
if self.battler.dead? and self.battler.defeated == false
self.battler.defeated = true
defeated_effect
end
end
#--------------------------------------------------------------------------
# ● Defeated Effect
#--------------------------------------------------------------------------
def defeated_effect
self.through = true
last_attack = XAS_BA_ENEMY::ENEMY_FINAL_ATTACK[self.battler.id]
self.battler.last_attack_time = 15 if last_attack != nil
unless self.tool_id > 0 or self.battler.e_item
@actor.exp += self.battler.exp
$game_party.gain_gold(self.battler.gold)
end
id = XAS_BA::DEFEAT_NUMBER_ID
$game_variables[id] += 1 if id != 0
jumpa(0,0,20) if XAS_BA_ENEMY::COLLAPSE_JUMP == true
switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.battler.id]
if switch_id != nil
$game_switches[switch_id] = true
$game_map.refresh
end
end
#--------------------------------------------------------------------------
# ● Treasure Dispose
#--------------------------------------------------------------------------
def treasure_dispose
if self.battler == nil and self.is_a?(Game_Event)
if self.treasure_time > 0 and
self.treasure_time -= 1
if self.alwaly_on_target_id != 0
self.zoom_x = 1.00
elsif self.treasure_time < 100
self.zoom_x -= 0.01 if self.zoom_x > 0.01
$game_map.remove_token(self) if self.treasure_time == 0
end
end
end
end
#--------------------------------------------------------------------------
# ● Hit Reaction ON
#--------------------------------------------------------------------------
def hit_reaction_on
return unless check_battler_exist?
self.hit_reaction = true
end
#--------------------------------------------------------------------------
# ● Hit Reaction Off
#--------------------------------------------------------------------------
def hit_reaction_off
return unless check_battler_exist?
self.hit_reaction = false
end
#--------------------------------------------------------------------------
# ● Hp Hit Reaction
#--------------------------------------------------------------------------
def hp_hit_reaction(on)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp > lowhp
self.hit_reaction = on
else
if on == true
self.hit_reaction = false
else
self.hit_reaction = true
end
end
end
#--------------------------------------------------------------------------
# ● Hero Level Hit Reaction
#--------------------------------------------------------------------------
def hero_level_hit_reaction(level,on)
return unless check_battler_exist?
actor = $game_party.actors[0]
if actor.level >= level
self.hit_reaction = on
else
if on == true
self.hit_reaction = false
else
self.hit_reaction = true
end
end
end
#--------------------------------------------------------------------------
# ● Shield Enable!
#--------------------------------------------------------------------------
def shield_enable!
return unless check_battler_exist?
@shield_disable = nil
self.battler.shield_active = true
end
#--------------------------------------------------------------------------
# ● Shield Disable!
#--------------------------------------------------------------------------
def shield_disable!
return unless check_battler_exist?
@shield_disable = true
self.battler.shield_active = false
end
#--------------------------------------------------------------------------
# ● LowHP Shield
#--------------------------------------------------------------------------
def lowhp_shield(on)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if on == true
@shield_disable = true
elsif on == false
@shield_disable = nil
end
end
#--------------------------------------------------------------------------
# ● Hero HP Shield
#--------------------------------------------------------------------------
def hp_shield(on)
return unless check_battler_exist?
lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
if self.battler.hp > lowhp
if on == true
@shield_disable = nil
else
@shield_disable = true
end
else
if on == true
@shield_disable = true
else
@shield_disable = nil
end
end
end
#--------------------------------------------------------------------------
# ● Hero Level Shield
#--------------------------------------------------------------------------
def hero_level_shield(level,on)
return unless check_battler_exist?
actor = $game_party.actors[0]
if actor.level >= level
if on == true
@shield_disable = nil
else
@shield_disable = true
end
else
if on == true
@shield_disable = true
else
@shield_disable = nil
end
end
end
#--------------------------------------------------------------------------
# ● Shield Directions
#--------------------------------------------------------------------------
def shield_directions
if self.battler.auto_action
set = @shield_disable ? [] : [2,4,6,8]
else
set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_DIRECTIONS[self.enemy_id]
end
set = [] if set == nil
return set
end
#--------------------------------------------------------------------------
# ● Shield Actions
#--------------------------------------------------------------------------
def shield_actions
set = XAS_BA_ENEMY::SHILED_ACTIONS[self.enemy_id]
set = [] if set == nil
return set
end
#--------------------------------------------------------------------------
# ● Knock Back Disable
#--------------------------------------------------------------------------
def knock_back_disable
return self.battler.e_knockback_disable
end
#--------------------------------------------------------------------------
# ● Body Size
#--------------------------------------------------------------------------
def body_size
return XAS_BA_ENEMY::BODY_SQUARE[self.enemy_id].to_i
end
#--------------------------------------------------------------------------
# ● Defeat Process
#--------------------------------------------------------------------------
def defeat_process
super
enemy_defeat_process(self.battler)
end
end
#===============================================================================
# ■ Game Event
#===============================================================================
class Game_Event < Game_Character
attr_reader :collision_attack
#--------------------------------------------------------------------------
# ● Attack ON
#--------------------------------------------------------------------------
def attack_on
return unless check_battler_exist?
if seal_state?(1)
seal_text
@collision_attack = false
return
end
@collision_attack = true
self.animation_id = self.battler.animation1_id
name = @page.graphic.character_name + "_ACT"
if RPG_FileTest.character_exist?(name)
@character_name = name
end
self.refresh
end
#--------------------------------------------------------------------------
# ● Attack Off
#--------------------------------------------------------------------------
def attack_off
return unless check_battler_exist?
@collision_attack = false
return if @page == nil
@character_name = @page.graphic.character_name
self.refresh
end
end
#===============================================================================
# ■ Game_Player
#===============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● Can Touch Damage
#--------------------------------------------------------------------------
def can_touch_damage?(event)
return false if event.erased
return false if event.battler.dead?
return false if event.knockbacking?
return false if event.battler.stop
return false if event.battler.state_sleep
return true
end
#--------------------------------------------------------------------------
# ● Check Event Trigger Touch
#--------------------------------------------------------------------------
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
for event in $game_map.events.values
next unless event.collision_attack
unless [1,2].include?(event.trigger)
if event.battler != nil and event.x == x and event.y == y and
can_touch_damage?(event)
$game_player.attack_effect(event)
end
end
end
end
end
#===============================================================================
# ■ Game_Event
#===============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ● Check Event Trigger Touch
#--------------------------------------------------------------------------
alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
def check_event_trigger_touch(x, y)
xrxs64c_check_event_trigger_touch(x, y)
if $game_system.map_interpreter.running?
return
end
return unless self.collision_attack
if self.battler != nil and x == $game_player.x and y == $game_player.y
$game_player.attack_effect(self)
end
end
end
#===============================================================================
# ■ XAS_BA_BATTLEEVENT_NONPREEMPT
#===============================================================================
module XAS_BA_BATTLEEVENT_NONPREEMPT
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
return if self.battler != nil and $game_system.map_interpreter.running?
super
end
end
#===============================================================================
# ■ Game_Event
#===============================================================================
class Game_Event < Game_Character
include XAS_BA_BATTLEEVENT_NONPREEMPT
end
#===============================================================================
# ■ Game_Character
#===============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● Blow
#--------------------------------------------------------------------------
def blow(d, power = 1)
if self.move_route_forcing and $game_system.map_interpreter.running?
return
end
@need_refresh_pose = true
@pose_type_old = " X "
@knock_back_prespeed = @move_speed if @knock_back_prespeed == nil
return if self.knock_back_disable
reset_pickup if self.battler.is_a?(Game_Actor)
power.times do
if passable?(self.x, self.y, d)
@x += ([3,6,9].include?(d) ? 1 : [1,4,7].include?(d) ? -1 : 0)
@y += ([1,2,3].include?(d) ? 1 : [7,8,9].include?(d) ? -1 : 0)
end
end
if self.battler.is_a?(Game_Enemy)
enemy_knock_duration = XAS_BA_ENEMY::INVICIBLE_DURATION_ENEMY[enemy_id]
if enemy_knock_duration != nil
@knock_back_duration = enemy_knock_duration
else
@knock_back_duration = XAS_BA_ENEMY::DEFAULT_INVICIBLE_DURATION_ENEMY
end
else
@knock_back_duration = XAS_BA::KNOCK_BACK_DURATION_HERO
jump(0,0) if XAS_BA::JUMP_HIT_HERO and self.action == nil
end
@move_speed = XAS_BA::KNOCK_BACK_SPEED
end
#--------------------------------------------------------------------------
# ● knockbacking?
#--------------------------------------------------------------------------
def knockbacking?
return @knock_back_duration != nil
end
#--------------------------------------------------------------------------
# ● Collapsing?
#--------------------------------------------------------------------------
def collapsing?
return self.collapse_duration.to_i > 0
end
#--------------------------------------------------------------------------
# ● update_text_popup
#--------------------------------------------------------------------------
def update_after_text_popup
return if self.battler.after_damage_pop_time == 0
self.battler.after_damage_pop_time -= 1
display_damage(self.battler.after_damage_pop) if self.battler.after_damage_pop_time == 0
end
#--------------------------------------------------------------------------
# ● update after animation
#--------------------------------------------------------------------------
def update_after_animation
return if self.battler.after_animation_time == 0
self.battler.after_animation_time -= 1
self.animation_id = self.battler.after_animation_id if self.battler.after_animation_time == 0
end
#--------------------------------------------------------------------------
# ● update knockbacking
#--------------------------------------------------------------------------
def update_knockbacking
@knock_back_duration = 5 if self.battler.state_sleep
return unless self.knockbacking?
return if self.battler.stop
@pattern = 0 unless @direction_fix
@knock_back_duration -= 1 unless self.throw_active
update_knockbacksprite
if @knock_back_duration <= 0
@knock_back_duration = nil
@knock_back_prespeed = nil
if self.is_a?(Game_Event)
@pose_type = ""
@pose_type_old = @pose_type
@character_name = @page.graphic.character_name
self.refresh
end
end
end
#--------------------------------------------------------------------------
# ● Update Knockback Sprite
#--------------------------------------------------------------------------
def update_knockbacksprite
return if @pose_type == "Refresh"
return if self.is_a?(Game_Player)
@pose_type = "Refresh"
name = @page.graphic.character_name + "_HIT"
if RPG_FileTest.character_exist?(name)
@character_name = name
self.refresh
end
end
#--------------------------------------------------------------------------
# ● Seal State
#--------------------------------------------------------------------------
def seal_state?(type)
case type
when 0 #Mute
return true if self.battler.state_mute
when 1 #Seal Attack
return true if self.battler.state_mute
return true if self.battler.state_seal_attack
when 2 #Seal Skill
return true if self.battler.state_mute
return true if self.battler.state_berserk
return true if self.battler.state_seal_skill
when 3 #Seal Item
return true if self.battler.state_mute
return true if self.battler.state_berserk
return true if self.battler.state_seal_item
end
return false
end
#--------------------------------------------------------------------------
# ● Seal Text
#--------------------------------------------------------------------------
def seal_text
self.battler.damage = XAS::SEALED_TEXT
self.battler.damage_pop = true
$game_system.se_play(XAS::SEALED_SE)
$game_temp.clear_setting2 if self.battler.is_a?(Game_Actor)
end
end
#===============================================================================
# ■ XAS_DamageStop
#===============================================================================
module XAS_DamageStop
#--------------------------------------------------------------------------
# ● Actiong?
#--------------------------------------------------------------------------
def acting?
return (super or self.knockbacking? or self.collapsing?)
end
end
#===============================================================================
# ■ Game_Player
#===============================================================================
class Game_Player < Game_Character
include XAS_DamageStop
end
#===============================================================================
# ■ Game_Event
#===============================================================================
class Game_Event < Game_Character
include XAS_DamageStop
end
#===============================================================================
# ■ Game_Map
#===============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● Starting?
#--------------------------------------------------------------------------
def starting?
if $game_system.map_interpreter.running?
return true
end
for event in $game_map.events.values
return true if event.starting
end
return false
end
end
#===============================================================================
# ■ Interpreter
#===============================================================================
module XAS_ACTION
#--------------------------------------------------------------------------
# ● Xas Z Shoot Bullet
#--------------------------------------------------------------------------
alias xas_z_shoot_bullet shoot_bullet
def shoot_bullet(action_id)
bullet_token = xas_z_shoot_bullet(action_id)
return bullet_token
end
end
#===============================================================================
# ■ Sprite_Battler Fix
#===============================================================================
class Sprite_Battler < RPG::Sprite
alias xas_damage_update update
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
super
if @battler_visible
if @battler.damage_pop
damage(@battler.damage, @battler.critical,@battler.state,@battler.item)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
end
xas_damage_update
end
end