# 特殊效果:追加分散度
if battler.current_action.add_variance > 0 and self.damage[battler].abs > 0
amp = [self.damage[battler].abs * battler.current_action.add_variance / 100, 1].max
self.damage[battler] += rand(amp+1) + rand(amp+1) - amp
end
# 特殊效果:现HP威力
if battler.current_action.hp_rate
self.damage[battler] = self.damage[battler] * battler.hp / battler.maxhp
end
# 特殊效果:现SP威力
if battler.current_action.sp_rate
self.damage[battler] = self.damage[battler] * battler.sp / battler.maxsp
end
# 特殊效果:会心一击
if battler.current_action.critical_hit > 0
if self.critical[battler]
self.critical[battler] = false
self.damage[battler] /= 2
end
# critical重新判定
if rand(100) < battler.current_action.critical_hit
self.critical[battler] = true
self.damage[battler] *= 2
end
end
# 特殊效果:固定伤害
if battler.current_action.fix_damage != 0
self.damage[battler] = battler.current_action.fix_damage.to_i
self.critical[battler] = false
end
#------------------------------------------------------------------------------
# 特殊效果:追加伤害效果类计算
#------------------------------------------------------------------------------
case battler.current_action.special_damage_kind
when 1# 「目标方当前HP比例」
if skill != nil
self.damage[battler] += self.hp * skill.power / 100
else
self.damage[battler] += self.hp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPTA))/100
when 2# 「目标方最大HP比例」
if skill != nil
self.damage[battler] += self.maxhp * skill.power / 100
else
self.damage[battler] += self.maxhp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPTA))/100
when 3# 「目标方HP差值比例」
if skill != nil
self.damage[battler] += (self.maxhp - self.hp) * skill.power / 100
else
self.damage[battler] += (self.maxhp - self.hp) * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPTA))/100
when 4# 「使用者当前HP比例」
if skill != nil
self.damage[battler] += battler.hp * skill.power / 100
else
self.damage[battler] += battler.hp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWHPUS))/100
when 5# 「使用者最大HP比例」
if skill != nil
self.damage[battler] += battler.maxhp * skill.power / 100
else
self.damage[battler] += battler.maxhp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXHPUS))/100
when 6# 「使用者HP差值比例」
if skill != nil
self.damage[battler] += (battler.maxhp - battler.hp) * skill.power / 100
else
self.damage[battler] += (battler.maxhp - battler.hp) * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFHPUS))/100
when 7# 「目标方当前SP比例」
if skill != nil
self.damage[battler] += self.sp * skill.power / 100
else
self.damage[battler] += self.sp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPTA))/100
when 8# 「目标方最大SP比例」
if skill != nil
self.damage[battler] += self.maxsp * skill.power / 100
else
self.damage[battler] += self.maxsp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPTA))/100
when 9# 「目标方SP差值比例」
if skill != nil
self.damage[battler] += (self.maxsp - self.sp) * skill.power / 100
else
self.damage[battler] += (self.maxsp - self.sp) * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPTA))/100
when 10# 「使用者当前SP比例」
if skill != nil
self.damage[battler] += battler.sp * skill.power / 100
else
self.damage[battler] += battler.sp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_NOWSPUS))/100
when 11# 「使用者最大SP比例」
if skill != nil
self.damage[battler] += battler.maxsp * skill.power / 100
else
self.damage[battler] += battler.maxsp * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_MAXSPUS))/100
when 12# 「使用者SP差值比例」
if skill != nil
self.damage[battler] += (battler.maxsp - battler.sp) * skill.power / 100
else
self.damage[battler] += (battler.maxsp - battler.sp) * battler.atk / 10000
end
self.damage[battler] *=self.element_rate(($data_system.elements).index(XRXS19::FIXDAMAGE_DIFSPUS))/100
end
#------------------------------------------------------------------------------
# 特殊效果:AT伤害值(1.03)
if battler.current_action.at_damage != 0
self.at -= battler.current_action.at_damage * self.maxat / 100
self.at = 0 if self.at < 0
self.atp = 100 * self.at / self.maxat
end
# 特殊效果:HP伤害率
if battler.current_action.hp_damage != 0 and battler.current_action.sp_damage == 0
self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
end
# 特殊效果:SP伤害率
if battler.current_action.sp_damage != 0
self.damage_sp[battler] = self.damage[battler] * battler.current_action.sp_damage / 100
self.damage_sp[battler] = self.sp if self.damage_sp[battler] > self.sp
self.damage_sp[battler] = "" if self.sp == 0
self.sp -= self.damage_sp[battler] if self.damage_sp[battler] != ""
if battler.current_action.hp_damage != 0 # 特殊效果:HP伤害率
self.damage[battler] = self.damage[battler] * battler.current_action.hp_damage / 100
else
self.damage[battler] = ""
end
end
#------------------------------------------------------------------------------
# 特殊效果:收招修正(1.03)
battler.hp = battler.current_action.hp_correct.to_i if battler.current_action.hp_correct != 0
battler.sp = battler.current_action.sp_correct.to_i if battler.current_action.sp_correct != 0
#------------------------------------------------------------------------------
# 特殊效果:HP吸收
if battler.current_action.hp_drain != 0
battler.damage[battler] = 0 if battler.damage[battler] == nil
drain_point = -1 * self.damage[battler].to_i * battler.current_action.hp_drain / 100
battler.damage[battler] += drain_point
battler.hp -= drain_point
if battler.damage[battler] == 0
battler.damage[battler] = nil
end
end
# 特殊效果:SP吸收
if battler.current_action.sp_drain != 0
battler.damage_sp[battler] = 0 if battler.damage_sp[battler] == nil
drain_point = -1 * self.damage_sp[battler].to_i * battler.current_action.sp_drain / 100
battler.damage_sp[battler] += drain_point
battler.sp -= drain_point
battler.damage_sp[battler] = drain_point
if battler.damage_sp[battler] == 0
battler.damage_sp[battler] = nil
end
end
# recall
xrxs19co_x1_damage_effect(battler, item)
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#------------------------------------------------------------------------------
# ○ ATB_SETUP (ATB = AT Bar,意思不要和RTAB搞错)(1.03)
#------------------------------------------------------------------------------
alias xrxs19_atb_setup atb_setup
def atb_setup
# recall
xrxs19_atb_setup
# 保存最大AT
for battler in $game_party.actors + $game_troop.enemies
battler.maxat = @max
end
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias xrxs19_main main
def main
# 清空角色的伤害值
for actor in $game_party.actors
actor.damage = nil
end
# recall
xrxs19_main
# 清空角色的特殊效果设置
for actor in $game_party.actors
actor.current_action.clear_xrxs19_special_effect
actor.current_action.nillize_xrxs19_special_effect
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 1 : 准备行动)
#--------------------------------------------------------------------------
alias xrxs19co_x1_update_phase4_step1 update_phase4_step1
def update_phase4_step1(battler)
# 清空行动者的伤害值
battler.damage.clear
# recall
xrxs19co_x1_update_phase4_step1(battler)
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 2 : 开始行动)
#--------------------------------------------------------------------------
alias xrxs19_update_phase4_step2 update_phase4_step2
def update_phase4_step2(battler)
# 清空行动者的伤害值
battler.damage.clear
# recall
xrxs19_update_phase4_step2(battler)
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
#(武器范围定义必须)
#--------------------------------------------------------------------------
def update_phase3_enemy_select
# コマンド選択中に行動不能になった場合
unless @active_actor.inputable?
# カメラを元に戻す
if @camera == "select"
@spriteset.screen_target(0, 0, 1)
end
@active_actor.current_action.clear
command_delete
# 次のアクターのコマンド入力へ
phase3_next_actor
return
end
@active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
@active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
case @active_actor.current_action.scope_force
when 2,4,6,7,8,9,10,11
# アクションを設定
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
# スキルの選択を終了
end_enemy_select
# 次のアクターのコマンド入力へ
phase3_next_actor
when 3
# アクターアローを更新
@actor_arrow.update
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# アクターの選択を終了
end_enemy_select
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アクションを設定
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @actor_arrow.index
# アクターの選択を終了
end_enemy_select
# 次のアクターのコマンド入力へ
phase3_next_actor
end
else
# エネミーアローを更新
@enemy_arrow.update
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# カメラを元に戻す
if @camera == "select"
# カメラの設定
@camera = "command"
plus = ($game_party.actors.size - 1) / 2.0 - @actor_index
y = [(plus.abs - 1.5) * 10 , 0].min
@spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002)
end
# エネミーの選択を終了
end_enemy_select
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アクションを設定
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @enemy_arrow.index
# スキルウィンドウ表示中の場合
if @skill_window != nil
# アクションを再設定
@active_actor.current_action.kind = 1
# スキルの選択を終了
end_skill_select
end
# アイテムウィンドウ表示中の場合
if @item_window != nil
# アクションを再設定
@active_actor.current_action.kind = 2
# アイテムの選択を終了
end_item_select
end
# エネミーの選択を終了
end_enemy_select
# 次のアクターのコマンド入力へ
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# ● 开始选择敌人#(武器范围定义必须)(1.03修正显示BUG)
#--------------------------------------------------------------------------
def start_enemy_select
@active_actor.set_xrxs19_special_scope(@active_actor.equip_element_set) if @skill_window == nil
@active_actor.set_xrxs19_special_scope(@active_actor.skill_element_set(@skill)) if @skill_window != nil
if @active_actor.current_action.scope_force == 3
# 生成敌人箭头
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
# 关联帮助窗口
@actor_arrow.help_window = @help_window
else
# 生成敌人箭头
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
# 关联帮助窗口
@enemy_arrow.help_window = @help_window
end
# 无效化角色指令窗口
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ● 结束选择敌人#武器范围定义必须)
#--------------------------------------------------------------------------
def end_enemy_select
# 释放敌人箭头
@enemy_arrow.dispose if @enemy_arrow != nil
@actor_arrow.dispose if @actor_arrow != nil
@enemy_arrow = nil
@actor_arrow = nil
# 指令为 [战斗] 的情况下
if @actor_command_window.index == 0
# 有效化角色指令窗口
@actor_command_window.active = true
@actor_command_window.visible = true
# 隐藏帮助窗口
@help_window.visible = false
end
end
#--------------------------------------------------------------------------
# ● 基本アクション 準備#(武器范围定义必须)
#--------------------------------------------------------------------------
def make_basic_action_preparation(battler)
# 攻撃の場合
if battler.current_action.basic == 0
# アニメーション ID を設定
battler.anime1 = battler.animation1_id
battler.anime2 = battler.animation2_id
# 行動側バトラーがエネミーの場合
if battler.is_a?(Game_Enemy)
if battler.restriction == 3
target = $game_troop.random_target_enemy
elsif battler.restriction == 2
target = $game_party.random_target_actor
else
index = battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# 行動側バトラーがアクターの場合
battler.set_xrxs19_special_scope(battler.equip_element_set)
if battler.is_a?(Game_Actor)
if battler.restriction == 3
target = $game_party.random_target_actor
elsif battler.restriction == 2
target = $game_troop.random_target_enemy
elsif battler.current_action.scope_force == 3 # 己方单体
index = battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
else
index = battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# 対象側バトラーの配列を設定
case battler.current_action.scope_force
when 2 # 敌方全体
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 4 # 己方全体
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 7 # 使用者
battler.target.push(battler)
when 8 # 全域化
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 9 # 敌方随机
for enemy in $game_troop.enemies
if enemy.exist?
battler.target = [$game_troop.random_target_enemy]
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 10 # 己方随机
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
when 11 #对象随机
battler.target = []
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
else
battler.target = [target]
battler.target.push(battler) if battler.current_action.self_inclusion and
battler.current_action.scope_force != 3 and
battler.restriction != 2 and
battler.restriction != 3
end
return true
end
# 防御の場合
if battler.current_action.basic == 1
# ステップ 3 に移行
battler.phase = 3
return false
end
#===============0.15b(RTAB官方更新)===========================================
# 逃げるの場合
if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
# ステップ 3 に移行
battler.phase = 3
return false
end
#=============================================================================
# 何もしないの場合
if battler.current_action.basic == 3
# ステップ 6 に移行
battler.phase = 6
return false
end
end
#--------------------------------------------------------------------------
# ● 生成基本行动结果
#--------------------------------------------------------------------------
alias xrxs19_make_basic_action_result make_basic_action_result
def make_basic_action_result(battler)
# 攻击的情况
if battler.current_action.basic == 0
# 获取行动者武器附加的战斗特效
if battler.is_a?(Game_Actor)
battler.set_xrxs19_special_effect(battler.equip_element_set)
# 行动时附加自身状态
if battler.current_action.p_state > 0
battler.pp_state(battler,battler.current_action.p_state)
end
# 行动时解除自身状态
if battler.current_action.m_state > 0
battler.remove_state(battler.current_action.m_state)
end
end
end
# recall
xrxs19_make_basic_action_result(battler)
end
#--------------------------------------------------------------------------
# ● スキルまたはアイテムの対象側バトラー設定
# scope : スキルまたはアイテムの効果範囲
# (武器范围定义必须)特技/道具的范围定义
#--------------------------------------------------------------------------
def set_target_battlers(scope, battler)
#行动方战斗者是敌方的情况
if battler.is_a?(Game_Enemy)
# 效果范围的分歧
case scope
when 1 # 敌单体
battler.target.push(battler) if battler.current_action.self_inclusion
index =battler.current_action.target_index
battler.target.push($game_party.smooth_target_actor(index))
when 2 # 敌全体
battler.target.push(battler) if battler.current_action.self_inclusion
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
when 3 # 己方单体
index = battler.current_action.target_index
battler.target.push($game_troop.smooth_target_enemy(index))
when 4 # 己方全体
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 5 # 己方单体 (HP 0)
index = battler.current_action.target_index
enemy = $game_troop.enemies[index]
if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
battler.target.push(enemy)
end
when 6 # 己方全体 (HP 0)
for enemy in $game_troop.enemies
if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 7 # 使用者
battler.target.push(battler)
when 8 # 全域化
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 9 # 敌方随机
battler.target.push(battler) if battler.current_action.self_inclusion
for actor in $game_party.actors
if actor.exist?
battler.target = [$game_party.random_target_actor]
end
end
when 10 # 己方随机
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
when 11 #对象随机
battler.target = []
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
end
end
#行动方战斗者是己方的情况
if battler.is_a?(Game_Actor)
# 效果范围的分歧
case scope
when 1 # 敌单体
index = battler.current_action.target_index
battler.target.push($game_troop.smooth_target_enemy(index))
battler.target.push(battler) if battler.current_action.self_inclusion
when 2 # 敌全体
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 3 # 己方单体
index = battler.current_action.target_index
battler.target.push($game_party.smooth_target_actor(index))
when 4 # 己方全体
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 5 # 己方单体 (HP 0)
index = battler.current_action.target_index
actor = $game_party.actors[index]
if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
battler.target.push(actor)
end
when 6 # 己方全体 (HP 0)
for actor in $game_party.actors
if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 7 # 使用者
battler.target.push(battler)
when 8 # 全域化
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 9 # 敌方随机
for enemy in $game_troop.enemies
if enemy.exist?
battler.target = [$game_troop.random_target_enemy]
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 10 # 己方随机
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
when 11 #对象随机
battler.target = []
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
end
end
end
#--------------------------------------------------------------------------
# ● 生成特技行动结果
#--------------------------------------------------------------------------
alias xrxs19_make_skill_action_result make_skill_action_result
def make_skill_action_result(battler, plus_id)
# 获取特技
@skill = $data_skills[battler.current_action.skill_id + plus_id]
# 获取行动者特技附加的战斗特效
battler.set_xrxs19_special_effect(battler.skill_element_set(@skill))
# 行动时附加自身状态
if battler.current_action.p_state > 0
battler.pp_state(battler,battler.current_action.p_state)
end
# 行动时解除自身状态
if battler.current_action.m_state > 0
battler.remove_state(battler.current_action.m_state)
end
# recall
xrxs19_make_skill_action_result(battler, plus_id)
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 5 : 显示伤害)
#--------------------------------------------------------------------------
alias xrxs19_update_phase4_step5 update_phase4_step5
def update_phase4_step5(battler)
# recall
xrxs19_update_phase4_step5(battler)
# 行动者伤害表示(HP/SP吸收的表示用)
if battler.damage[battler] != nil or
battler.damage_sp[battler] != nil
battler.damage_pop[battler] = true
# 行动者状态栏刷新
status_refresh(battler)
end
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================