Negate Damage if Damage is less than X% of MHP

Discussion in 'RGSS3 Script Requests' started by Vis_Mage, Oct 6, 2019.

  1. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hey! :kaohi:

    I'm wondering if anyone could help me out with a script.

    The title pretty much sums it up, I'm hoping to create an effect that will negate damage from an attack, if the damage dealt would be less than X% of their Max HP (something like <DamageNegate: 20> would negate any attack damage that would deal less than 20% of their MHP), that can ideally be applied to actors, classes, equipment, enemies, and states.

    Hopefully I explained this in a way that makes sense. Let me know if you have any questions.

    Thank you!
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,797
    Likes Received:
    11,504
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Is this looking at the damage value before or after critical and variance are applied?

    What happens if you have a class that has 20 and a weapon that has 15?
     
    #2
  3. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Those are good questions, that I hadn't actually thought about.

    For damage, I'd go for the final damage value only, after any critical hits/elemental resistances/etc have been calculated.

    As for instances where more than 1 notetag is present, I'd just go for the highest notetag present. So an actor with 20 with a weapon with 15 would only factor in the 20.
     
    #3
  4. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,247
    Likes Received:
    507
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    I also have a question: is the mhp intended to be the target mhp or the user's?
     
    #4
  5. Vis_Mage

    Vis_Mage Novice Magician Veteran

    Messages:
    388
    Likes Received:
    141
    Location:
    Ridge Island
    First Language:
    English
    Primarily Uses:
    RMVXA
    Sorry for not clarifying. MHP is refering to the target of the attack. So if Actor1 has the tag, then when they are attacked, it will check Actor1's MHP.

    Thinking about it a bit more, there will probably have to be some way for the script to tell if the target is being healed or damaged, since I'd ideally not have the tag negating healing effects.
     
    #5
  6. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,280
    Likes Received:
    12,504
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Yanfly has a script that does this, under their lunatic scripts. You can set it to block all damage above x%, or even to 0 out any damage that is below a certain percentage.

    I don't have the link to it though, but if you look up their scripts you should find it.
     
    #6

Share This Page