STATE_ACTION_EVERYTURN ={}
# 每回合持有指定状态者行动时让状态施加者对持有者发动指定技能
# 例:STATE_ACTION_EVERYTURN[22] = 2 #持有状态22的角色每回合行动后都会受到状态施加者以2号技能的攻击
# 状态施加者和持有者不可以是同一方的
# * 现在可以了 2011 05 03
STATE_ACTION_EVERYTURN[58] = 292 #铁轮
#STATE_ACTION_EVERYTURN[238] = 171 #恋心舞踏
#STATE_ACTION_EVERYTURN[231] = 163 #博士爆炸
#STATE_ACTION_EVERYTURN[123] = 217
#STATE_ACTION_EVERYTURN[140] = 705
#STATE_ACTION_EVERYTURN[359] = 1209
STATE_ADDITIONAL_ACTION_EVERYTURN = {}
# 持有指定状态的角色有一定几率被追加一次攻击,要先定义STATE_ACTION_EVERYTURN才有效
# 例:RANDOM_ADDITIONAL_ACTION[140] = 30 #持有140状态角色有30%概率被连续第二次触发指定技能
#同时也会打断原本的当前行动
#STATE_ADDITIONAL_ACTION_EVERYTURN[140] = 15
#========================================================================
# ■ Game_Battler (分割定義 1)
#========================================================================
class Game_Battler
attr_accessor :action_recorded
#--------------------------------------------------------------------------
# ● 获取状态施加者
#--------------------------------------------------------------------------
def get_state_maker(state_id)
return self unless state?(state_id)
return self if @state_makers[state_id].nil?
return @state_makers[state_id]
end
#--------------------------------------------------------------------------
# ● 记录当前行动状态
#--------------------------------------------------------------------------
def record_action(rewrite = false)
return if @action_recorded and rewrite == false
@action_recorded = true
@record_old_action = self.current_action.clone
@record_rt = [self.rt,self.rtp]
end
#--------------------------------------------------------------------------
# ● 恢复记录的行动状态
#--------------------------------------------------------------------------
def resume_action
return unless @action_recorded
self.current_action = @record_old_action.clone
self.rt = @record_rt[0]
self.rtp = @record_rt[1]
@action_recorded = false
end
#--------------------------------------------------------------------------
# ● 强制技能行动
#--------------------------------------------------------------------------
def make_attack_against_enemy(target,skill = 0)
index = -2
kind = 0
basic = 0
skill_id = 0
if target.is_a?(Game_Actor)
index = $game_party.ordinal(target)
else
index = $game_troop.ordinal(target)
end
index -= 1
if skill.nil? or skill == 0
kind = 0
basic = 0
else
kind = 1
skill_id = skill
end
force_action2(kind,basic,skill_id,index,1)
end
end
#==============================================================================
# ■ Scene_Battle (分割定義 4)
#------------------------------------------------------------------------------
# バトル画面の処理を行うクラスです。
#==============================================================================
# アニメに強さ0のフラッシュが存在した場合、
# 赤:倍率 緑:+スキル?アイテムID でダメージ計算を行う。
class Scene_Battle
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias action_update_phase4_step6_zunk20101124 update_phase4_step6
def update_phase4_step6(battler)
for state_id in STATE_ACTION_EVERYTURN.keys
if battler.state?(state_id)
user = battler.get_state_maker(state_id)
next unless user.exist?
user.record_action
user.make_attack_against_enemy(battler,STATE_ACTION_EVERYTURN[state_id])
if STATE_ADDITIONAL_ACTION_EVERYTURN[state_id] != nil
if rand(100) < STATE_ADDITIONAL_ACTION_EVERYTURN[state_id]
user.record_action(true)
user.make_attack_against_enemy(battler,STATE_ACTION_EVERYTURN[state_id])
###追加行动
end
end
end
end
action_update_phase4_step6_zunk20101124(battler)
end
end