alias counter_attack_effect_zunk20100813 attack_effect
def attack_effect(attacker)
if attacker.counter_flag and attacker.counter_damage > 0
attacker.animation.push([attacker.counter_animation_id,true]) unless attacker.counter_animation_id == nil
end
counter_attack_effect_zunk20100813(attacker)
end
#--------------------------------------------------------------------------
# ● スキルの効果適用
# user : スキルの使用者 (バトラー)
# skill : スキル
#--------------------------------------------------------------------------
alias counter_damage_effect_20100712 damage_effect
def damage_effect(battler, item, skill)
unless item == 2 or self.damage[battler].class == String
if battler.counter_flag and battler.counter_damage > 0
counter_bonus = battler.counter_times
unless counter_bonus == 0
if self.critical[battler] and battler.is_a?(Game_Actor)
counter_bonus += self.critical_bonus[battler]
end
end
counter_hurt = battler.counter_damage * counter_bonus
####妖梦EX白楼观翼斩
if battler.weapon_id == 64
counter_hurt *= 2
end
self.damage[battler] += counter_hurt.round
battler.counter_damage = 0
end
end
counter_damage_effect_20100712(battler, item, skill)
unless item == 2 or self.damage[battler].class == String
#避免向自己人反击
return if battler.is_a?(Game_Actor) and self.is_a?(Game_Actor)
return if battler.is_a?(Game_Enemy) and self.is_a?(Game_Enemy)
####################洛熙的热感应追踪
#判断反击
if battler.state?(159) and $game_actors[5].state?(674)#and self.damage[battler]>0
if $game_actors[5].movable? and !is_counter_penetrative(battler, skill)
@luoxi_flag = true
if counter_flag
@counter_damage += (self.damage[battler])
@counter_times = COUNTER_STATES[1024][2]
end
if counter_flag != true and battler.counter_flag != true
#unless $game_actors[5].rtp > 0 and COUNTER_STATES[1024][6] == false
@counter_flag = true
@counter_target = [battler,skill]
@counter_rate = COUNTER_STATES[1024][0]
@counter_pre_animation_id = COUNTER_STATES[1024][3]
$game_actors[5].animation.push([@counter_pre_animation_id,true]) unless @counter_pre_animation_id == nil
@counter_animation_id = COUNTER_STATES[1024][4]
@counter_skill = COUNTER_STATES[1024][5]
#@old_atp = [self.atp,self.at,self.rtp,self.rt]
@counter_old_action = $game_actors[5].current_action.clone #if @counter_old_action.nil?
@counter_rt = [$game_actors[5].rt,$game_actors[5].rtp] if @counter_rt.nil?
@counter_damage = self.damage[battler]
if battler.is_a?(Game_Actor)
@counter_times = COUNTER_STATES[1024][2]
else
@counter_times = (COUNTER_STATES[1024][1])
end
#@old_action = self.current_action.dup
#end #unless
end
end
else #state
###################
#判断反击
if self.damage[battler] > (self.hp/100) or (self.damage[battler] >= 0 and @parry_flag) and !is_counter_penetrative(battler, skill)
for key in COUNTER_STATES.keys.reverse
if self.state?(key)
if counter_flag
@counter_damage += (self.damage[battler])
if battler.is_a?(Game_Actor)
@counter_times = COUNTER_STATES[key][2]
else
@counter_times = (COUNTER_STATES[key][1])
end
end
if counter_flag != true and battler.counter_flag != true
unless self.rtp > 0 and COUNTER_STATES[key][6] == false
@counter_flag = true
@counter_target = [battler,skill]
@counter_rate = COUNTER_STATES[key][0]
@counter_pre_animation_id = COUNTER_STATES[key][3]
self.animation.push([@counter_pre_animation_id,true]) unless @counter_pre_animation_id == nil
@counter_animation_id = COUNTER_STATES[key][4]
@counter_skill = COUNTER_STATES[key][5]
if COUNTER_STATES[key][5] == 1342 #恋恋反击
case rand(100)
when 0..19
@counter_skill = 1336
when 20..34
@counter_skill = 1337
when 35..49
@counter_skill = 1338
when 50..64
@counter_skill = 1339
when 65..79
@counter_skill = 1341
when 80..89
@counter_skill = 1343
else
@counter_skill = 1342
end
end
#@old_atp = [self.atp,self.at,self.rtp,self.rt]
@counter_old_action = self.current_action.clone #if @counter_old_action.nil?
@counter_rt = [self.rt,self.rtp] if @counter_rt.nil?
@counter_damage = self.damage[battler]
if battler.is_a?(Game_Actor)
@counter_times = COUNTER_STATES[key][2]
else
@counter_times = (COUNTER_STATES[key][1])
end
#@old_action = self.current_action.dup
end
end
break
end
end
end
end
#p battler.counter_damage
#p self.damage[battler]
end #state luoxi
if @counter_flag == true and rand(100) < counter_rate and self.exist?
@counter_performed = true
#unless $洛熙反击flag.nil?
#if $洛熙反击flag != true
self.make_counter_attack(@counter_target[0],@counter_target[1])
else
#p "clear_counter"
clear_counter(false)
end
end
def is_counter_penetrative(battler, skill)
for state_id in CONTER_PENETRATIVE_STATES
if battler.state?(state_id)
return true
end
end
if skill.nil?
set = battler.element_set
else
set = skill.element_set
end
if set.include?(CONTER_PENETRATIVE_ELEMENT)
return true
else
return false
end
end
#--------------------------------------------------------------------------
# ● 强制反击行动
#--------------------------------------------------------------------------
def make_counter_attack(target,counter_skill)
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
return if index.nil?
index -= 1
if @counter_skill.nil? or @counter_skill == 0
kind = 0
basic = 0
else
kind = 1
skill_id = @counter_skill
end
#这里是阉割的部分,又事件发动改为强制行动
if self.luoxi_flag == true
self.luoxi_flag = false
#p "25"
for battler in $game_party.actors
if battler.id == 5
battler.force_action2(kind,basic,skill_id,index,1)
end
end
else
class Scene_Battle
attr_accessor :counter_list # 反击角色列表
alias counter_update_phase4_zunk20100712 update_phase4
def update_phase4
@counter_list = [] if @counter_list.nil?
unless @counter_list.empty? or $game_temp.forcing_battler != nil
actor = @counter_list.shift
if synthe?(actor).nil?
unless actor.counter_performed
#unless actor.luoxi_flag == true
actor.counter_attack
else
@counter_list.push(actor)
end
else
actor.clear_counter(false)
end
end
#if $game_actors[5].exist? and $game_actors[5].movable? and $game_actors[5].state?(674)
# if synthe?($game_actors[5]).nil?
# unless $game_actors[5].counter_performed
# $game_actors[5].counter_attack
# else
# @counter_list.push($game_actors[5])
# end
# else
# $game_actors[5].clear_counter(false)
# end
#end
counter_update_phase4_zunk20100712
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias counter_update_phase4_step6_zunk20100712 update_phase4_step6
def update_phase4_step6(battler)
@counter_list = [] if @counter_list.nil?
for each in $game_party.actors + $game_troop.enemies
next if each.nil?
@counter_list.push(each) if each.counter_flag
end
for each in $game_party.actors + $game_troop.enemies#battler.target# 更新格挡标记
next if each.nil?
each.clear_parry
###清除不死标记
each.force_alive = -1
end
#if battler.counter_flag == true
#p battler.name
# battler.clear_counter(true) # 清除反击标记
#end
counter_update_phase4_step6_zunk20100712(battler)
#if battler.counter_flag
# counter_attack(battler.counter_target[0],battler.counter_target[1])
# battler.clear_counter # 清除反击标记
#end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias counter_refresh_phase_zunk20101001 refresh_phase
def refresh_phase(battler)
counter_refresh_phase_zunk20101001(battler)
##########################################
# 强制行动后恢复
if battler.action_recorded
battler.resume_action
end
##########################################
if battler.counter_flag == true
#p battler.name
battler.clear_counter(true) # 清除反击标记
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
#--------------------------------------------------------------------------
alias counter_start_phase3_zunk20100712 start_phase3
def start_phase3
counter_start_phase3_zunk20100712
$game_switches[1085] = false#后排窗口展开
@active_actor.clear_counter(false)
end
###