I have this snippet for Yanfly's Lunatic State script. It has been inserted at line 188 (default line number) i.e. just above where it says, "Stop editing past this point." So I'm sure it's in the right place.
The instructions for using this snippet are:
#===NOTETAGS===================================================================
#---> States <---
#
# <transfer x to_hero y>
# <transfer x% to_hero y>
I have put the following note tag in a new State slot in the database.
<transfer 50% to_hero 3>
I then gave this state as a passive to actor 2.
However, when that actor receives damage, nothing is transferred to actor 3 and she takes the full 100%
Can anyone advise me what it is I've done incorrectly?
Thanks
EDIT
For the sake of clarity, I should mention that as well as giving it as a passive state, I have also tried inflicting it on Actor 2 at the beginning of battle. Makes no difference.
Code:
when /TRANSFER[ ](\d+)[ ]TO_HERO[ ](.+)/i
@pool = $game_party.battle_members
@pool.delete(user)
@pool = @pool.sample
if $2.to_s.upcase == "RAND"
@hero = @pool
else
@hero = $game_actors[$2.to_i]
end # if
return unless $game_party.battle_members.include?(@hero)
return if @result.hp_damage <= 0
dmg = [@result.hp_damage, $1.to_i].min
@result.hp_damage = [@result.hp_damage - $1.to_i, 0].max
@hero.hp -= dmg
if $imported["YEA-BattleEngine"]
text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_dmg], dmg.group)
@hero.create_popup(text, "HP_DMG")
end # if
@hero.perform_collapse_effect if @hero.hp <= 0
when /TRANSFER[ ](\d+)%[ ]TO_HERO[ ](\d+)/i
@pool = $game_party.battle_members
@pool.delete(user)
@pool = @pool.sample
if $2.to_s.upcase == "RAND"
@hero = @pool
else
@hero = $game_actors[$2.to_i]
end # if
return unless $game_party.battle_members.include?(@hero)
return if @result.hp_damage <= 0
return if @hero.dead?
dmg = (@result.hp_damage * $1.to_i * 0.01).round
@result.hp_damage = (@result.hp_damage * (100 - $1.to_i) * 0.01).round
@hero.hp -= dmg
The instructions for using this snippet are:
#===NOTETAGS===================================================================
#---> States <---
#
# <transfer x to_hero y>
# <transfer x% to_hero y>
I have put the following note tag in a new State slot in the database.
<transfer 50% to_hero 3>
I then gave this state as a passive to actor 2.
However, when that actor receives damage, nothing is transferred to actor 3 and she takes the full 100%
Can anyone advise me what it is I've done incorrectly?
Thanks
EDIT
For the sake of clarity, I should mention that as well as giving it as a passive state, I have also tried inflicting it on Actor 2 at the beginning of battle. Makes no difference.
Last edited:





