LSP Punishment

Last Updated: 2011.12.30
Download Link
Github Link

This is a script for Lunatic States Package Effects with punishment themed effects. Included in it are effects that make battlers undead (take damage whenever they are healed), make battlers whenever they execute physical or magical attacks, make battlers take damage based on the original caster of the state’s stats, and an effect that heals the original caster of the state whenever the battler takes HP or MP damage.

Install this script under YEA – Lunatic States. Then, proceed to use the proper effects notetags to apply the proper LSP Punishment item desired. Look within the script for more instructions on how to use each effect.

Punish Effect No.1: Undead HP

Best used with react effect. This causes any HP healing done to become reversed and deal HP damage to the healed target.

<react effect: undead hp>

Punish Effect No.2: Undead MP

Best used with react effect. This causes any MP healing done to become reversed and deal MP damage to the healed target.

<react effect: undead mp>

Punish Effect No.3: Physical Backfire

Best used with while effect. Whenever the affected battler uses a physical attack, that battler will take HP damage equal to its own stats after finishing the current action. Battler cannot die from this effect.

<while effect: physical backfire stat x%>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK. Replace x with the stat multiplier to affect damage dealt.

Punish Effect No.4: Magical Backfire

Best used with while effect. Whenever the affected battler uses a magical attack, that battler will take HP damage equal to its own stats after finishing the current action. Battler cannot die from this effect.

<while effect: magical backfire stat x%>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK. Replace x with the stat multiplier to affect damage dealt.

Punish Effect No.5: Stat Slip Damage

Best used with close effect. At the end of the turn, the affected battler will take HP slip damage based on the stat of the of one who casted the status effect onto the battler. Battler cannot die from this effect.

<close effect: stat slip damage x%>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK. Replace x with the stat multiplier to affect damage dealt.

Punish Effect No.6: Stat Slip Heal

Best used with close effect. At the end of the turn, the affected battler will heal HP  based on the stat of the of one who casted the status effect onto the battler.

<close effect: stat slip heal x%>

Replace “stat” with MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, or LUK. Replace x with the stat multiplier to affect damage dealt.

Punish Effect No.7: Drain HP

Best used with shock effect. Whenever user takes HP damage, the original caster of the state will recover HP based on HP damage dealt.

<shock effect: drain hp x%>

Punish Effect No.8: Drain MP

Best used with shock effect. Whenever user takes MP damage, the original caster of the state will recover MP based on MP damage dealt.

<shock effect: drain mp x%>

And that’s all, folks!

32 comments on “LSP Punishment

  1. i find stat slip damage perfect for poison stat because percentage damage of maxHP seems too much sometimes on bosses for example.

  2. Hm, only noticed it now, but when I combine Undead HP and a state (a Field State, in my case) that enforces a regeneration of sorts like the Slip Heal tag also mentioned in this post, the heal reversal doesn’t seem to happen. Was that intentional or did I actually spot a bug?

  3. Hmm, I can’t get the slip damage to work properly. The battler will *blink* and then no damage gets done nor do I see numbers. I set it to as well and get the same results. No damage dealt.

    • Having a similar problem, Dark Horseman. I installed Lunatic States below the Yanfly Core, then Lunatic Punish below States. Doesn’t work.

  4. Actually, I figured it out. Great scripts! Is there an easy way to change slip damage to be lethal damage? I will experiment with the scripting, but someone pointing me in the right direction would be appreciated ;)

    • Hi Xypher, I tried your change but it didn’t work. The enemy is brought to 1 HP still and doesn’t die to the dot effect.

  5. It seems like the enemy will die, but the collapse animation won’t play. As a result, the graphic of the enemy remains on the screen though technically it is dead and can’t be targeted. Is there any way to play the death animation if they die from the slip damage?

  6. change
    return unless @result.hp_damage < 0
    @result.hp_damage *= -1
    @result.hp_drain *= -1

    to
    return unless @result.hp_damage < 0
    @result.hp_damage *= 0
    @result.hp_drain *= 0

  7. Thank you.

    It appears, that it Works. Great Script btw.
    To prevent an Enemy from healing itself through HP-Drain without a script appears to be impossible.

  8. The drifter 148, it`s not working for me either. I tryed the undead tag at the class section and the char is healing normally. The sequences of the scripts are right.

  9. Is there a way to get the slip damage to take into account the defenders stats? (e.g. If I want to have a DoT do: (a.mat*4 – b.mdf) damage, like it were a skill)
    Also, is there a way to add any level of variance to this damage?

  10. Hello
    with , the script work only with a healing skil but not with an item as a potion! There is a solution ?? Thanks for your work!

  11. So, I’ve got a skill that targets 1 ally, and gives them a state with the tag . Unfortunately, it seems that the targeted ally is the one getting the healing, not the caster.

    I’m wondering if this is a bug, or just outside of the scope of this script.

    • Can’t see which tag, because the comments thing seems to disappear anything in angle brackets. But the drain hp or mp ones are the only ones that should heal the caster, so unless it’s one of them, I think it’s how it’s supposed to work.

  12. I created a state and put “close effect: ATK slip damage 100%>” in the note box
    When the target is supposed to take damage I get an error:

    “Script ‘Yanfly … Punishment’ line 195: NoMethodError occured.
    undefined method ‘ -‘ for #Game_Enemy: 0x7201d987”

    All stats and %s give this same error. I tried redownloading the script, didn’t help.

  13. would it be possible to have a state where any physical damage done to the user also does a percentage of that damage to the attacker?
    For example, if a character covers themselves in flames or spikes it would make sense for anyone who physically attacked them to take some passive damage.
    (it might also be nice to have the option to do the same with incoming magical damage, or the option of a fixed passive damage value)

    • I’ve been trying to make a thorns/firewall spell forever now. The problem is I have next to no experience at scripting. So if you come up with anything please let me know >.<

  14. Whenever my actors gain hp from the “Punish Effect No.6: Stat Slip Heal” it causes the “Actor Damage” sound to play, is there any way to remove that?

  15. Did anyone ever find a solution to the enemies not dying? I took away the 1 like is suggested here in the comments, but it won’t play the death animation. The battler is considered dead (can’t be targeted), but still remains on the field.
    Any suggestions/ideas?

  16. I’m having a completely bizarre bug with the Drain HP function and trying to get to the bottom of it. In short, ALL States that are on any battler that has an HP drain state active are counting as HP drain states of the same amount. Background information below:

    I’m building a character that has several functions built around draining HP; they can apply HP drain states to enemies, force friendly targets to apply them to themselves (which allows those targets to then be healed when they take damage) and apply HP drain states on friends so when enemies hit friendly targets they are healed. All of these effects are working fine and that’s not the issue I’m having.

    The calculation of these effects appears to be very off. At first, it seemed to be always doubling the HP drain effect, as I noticed that in order to have the character be healed 10% of damage dealt to an enemy, the state needed to be marked to drain 5%. The effect to drain from other targets was doubled as well. I later then noticed that when I did the eventing for the ability that forces targeted allies to cast an HP drain on the character, the effect was tripled (a 25% drain was returning 75%).

    This ability made use of several extra/hidden states for the sake of the eventing, and on a whim I decided to look at the calculations for the other two states after applying any state to the battler that is to have their HP drained. I found that additional states, even those not tagged to drain HP, applied to the battler, increased the HP drain effect by the same amount as the HP drain tag.

    This explained why I was seeing the 75% effect from a 25% drain tag; each additional state, even those that are not an HP drain state, that are on a battler with an active HP drain, are adding an additional HP drain
    amount. This is NOT occurring with RPG Maker VX Ace’s latent stacking stat buffs, just custom states that don’t need to have HP drain in them even. I’d like to find a way for this not to occur, and am unsure what I must change/edit in the script to do so. I made one minor edit to Yanfly’s script when I realized that battlers that were inflicted with a Death state were able to come back to life when the drained HP, but I’ve otherwise left it intact:

    when /DRAIN HP[ ](\d+)([%%])/i
    return unless @result.hp_damage > 0
    dmg = (@result.hp_damage * $1.to_i * 0.01).to_i
    if $imported[“YEA-BattleEngine”] && dmg > 0

    text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_heal], dmg.group)

    end
    if
    state_origin.hp > 0
    then
    state_origin.hp += dmg
    end

    • Zach, the problem is Yanfly set it up to loop through the states n^2 times, where n is the number of your states. In the code there is a for each in states do, which calls the lunatic extension, but then inside the lunatic extension there is *another* for each in states do. This results in the lunatic states being applied as many times as the battler has states!

      To see this in action, try setting a character to (from the protection script), then add two states to them in addition to the damage block state. They will block 75 damage, not 25.

      The easy way to fix this is to delete one of the for loops. I did it in my code by deleting the one which called the lunatic state extension.

  17. Hello. Jus wanted to say ive tried this with the pre req scripts, and i cannot get the Undead feature to work. I tried it in an game im working on and also in a NEW project and altho there are no errors with the script. The heal def does not damage the enemy. It jus heals the same old RPG maker way. Any help ? Id love to get this ZOMBIE feature working for other undead creatures in my game.

    On a side note, Great scripts!!!

  18. So I’ve run into an issue where this script doesn’t want to work with GubiD’s Tactical Battle System. I set up the states with the notetags (namely the physical/magical backfire and slip healing/damage tags) and all that happens is the skills apply the states and then nothing happens. They work fine with GTBS disabled, but I mean that’s obviously not a viable solution.

    Any idea what’s going on?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s