#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
alias :xr_sd_set_hp :hp=
def hp=(hp)
hp = self.damage.is_a?(Numeric) && self.damage > 0 ? share_damage : hp
xr_sd_set_hp(hp)
@recipient = false
end
#--------------------------------------------------------------------------
def share_damage
target_actor = share_object
result = !!target_actor && target_actor.can_take_damage?
if result
@recipient = true
self.damage = self.damage / $game_variables[666]
target_actor.damage = self.damage
@@dividingly=self.damage if self.index < target_actor.index
target_actor.hp -= self.damage
if self.index > target_actor.index and @aoeofenemy
target_actor.damage+=@@dividingly;self.damage+=@@dividingly;@aoeofenemy=false
end
end
return @hp - self.damage
end
def share_object
f = [] ; ($game_party.actors + $game_troop.enemies).each {|i| f.push(i) if i.state?(100)}
return f.size > 1
$game_variables[666] = f.size
end
#--------------------------------------------------------------------------
def can_take_damage?
return !@recipient && exist?
end
end
#--------------------------------------------------------------------------------------------------
class Scene_Battle
alias xr_sd_update_phase4_step5 update_phase4_step5
def update_phase4_step5
$game_party.actors.each{|a| a.damage_pop = !a.damage.nil?}
xr_sd_update_phase4_step5
end
end