class RPG::UsableItem
#--------------------------------------------------------------------------
# ● 目标为队友(包括死亡)
#--------------------------------------------------------------------------
def for_alive_and_dead_friend?
@note =~ /<for\s*alive\s*and\s*dead\s*friends?>/
end
end
class Game_Unit
#--------------------------------------------------------------------------
# ● 决定顺带目标
#--------------------------------------------------------------------------
def alive_and_dead_smooth_target(index)
members[index] ? members[index] : members[0]
end
end
class Game_Action
#--------------------------------------------------------------------------
# ● 目标为队友
#--------------------------------------------------------------------------
alias alive_and_dead_targets_for_friends targets_for_friends
def targets_for_friends
if item.for_alive_and_dead_friend?
if item.for_one?
[friends_unit.alive_and_dead_smooth_target(@target_index)]
else
friends_unit.members
end
else
alive_and_dead_targets_for_friends
end
end
end
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ● 技能/物品的应用测试
#--------------------------------------------------------------------------
alias alive_and_dead_item_test item_test
def item_test(user, item)
if item.for_alive_and_dead_friend?
return true if $game_party.in_battle
return true if item.for_opponent?
return true if item.damage.recover? && item.damage.to_hp? && hp < mhp
return true if item.damage.recover? && item.damage.to_mp? && mp < mmp
return true if item_has_any_valid_effects?(user, item)
return false
else
alive_and_dead_item_test(user, item)
end
end
end