Drain HP state

Discussion in 'RPG Maker MV' started by Blair Pendragon, Dec 24, 2016.

  1. Blair Pendragon

    Blair Pendragon Veteran Veteran

    Messages:
    91
    Likes Received:
    41
    First Language:
    English
    I usually find work arounds for most things, but currently I'm looking to mimic the effect of giving a party member a "Drain HP" effect mid combat, to all abilities.
    For now, Im going to settle for something different. (I'm going to try my hardest to not use any plugins. Half the time I'm told it cant be done w/o plugins, I end up finding a very easy way to do it with the default system, with little to no work)

    Currently, Im thinking of giving the player a state that doesnt actually grant an Absorbtion of HP. Instead, this state is going to try and trigger another effect, which grants HP to the user. (even if it must be done at the end of the turn, rather than after an attack.)
    The last thing I tried, was a State that gave the player the Trait "Attack, Attack State, Apply: NAME-HERE"
    This buff would apply a buff that lasts till end of turn, and heals them that turn, but only when they attack with a basic attack.

    But it didnt quite give them the buff, so unless im doing somethign wrong, I assume its actually applying the state to the enemy.

    So now im thinking the State needs to have your attacks give the enemy a state, which the game looks for, to then heal you, while also removing the state that turn, until applied again.

    I havnt gotten it to work quite yet, but I am curious to learn how to make other attacks gain this effect.
    I know the game demonstrates a dual attack, and double attack.
    Do these also count as your "skill id1" attack option? what would i need to do, to make other weapon based attacks also apply this effect?
    if there is a way to do that, what happens when i apply it to magical attacks? is the magical attack considered phsyical dmg now? or both physical and magical?

    Also, any other ideas on how to gain a similar effect to what Im trying to do w/o plugins?
     
    #1
  2. M.I.A.

    M.I.A. Goofball Extraordinaire Veteran

    Messages:
    823
    Likes Received:
    621
    Location:
    Seattle
    First Language:
    English
    Look into Yanfly's Plug-in's. Lots of useful stuff there.. something like THIS maybe? :)


    Also, Yanfly's Tip's & Tricks has a Leech Seed, I believe.


    -Mia
     
    Last edited by a moderator: Dec 24, 2016
    #2
  3. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,969
    Location:
    Philippines
    First Language:
    Tagalog
    Yes, attack state means state to be put onto the target when the actor with that trait attacks.


    How do you want the state to be put into the actor? Is it a state placed by another actor? I don't really get why you needed a state that gives attack state trait just to try to give the actor the HP drain state, when the original state can simply be the HP drain state itself.


    Anyway, a plugin free method is to make all skills run a common event in which if the user has this state, it heals it. Problem is saving the user and damage if needed.


    An easier way will be to use the damage formula. Assuming the heal is based on the damage done, you do the damage calculation and save it into a variable, then check if the user has the HP drain state, then you heal him based on the saved damage value, and return the damage value. I can't give the exact damge formula code for it but it should look something like


    x=actual_damage_formula;if(user has state){a.hp+=x*factor};x




    you'd need to do this to every skill that can be affected by the HP drain state. 
     
    #3
  4. Blair Pendragon

    Blair Pendragon Veteran Veteran

    Messages:
    91
    Likes Received:
    41
    First Language:
    English
    @Engr. AdiktuzmikoIm a little confused where you said "I don't really get why you needed a state that gives attack state trait just to try to give the actor the HP drain state, when the original state can simply be the HP drain state itself."

    Did you mean there is an option in the States to give drain? or were u asking why didnt I just stick to the initial state given to check for an drain?
    If the second, then yeah, it could possibly work with the formula taking it into consideration.
    Though I know the formulas tend to only fit so much, so im also trying to avoid adding too much to formulas for this sort of thing. (Not that im against it, as it IS an option I can use if nothing else works)
     
    #4
  5. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,969
    Location:
    Philippines
    First Language:
    Tagalog


    Yes, I was asking why you seem to have used two states instead of one...


    If it doesn't fit into the formula box, you can always make a js file and put the formula as a function there then call it in the damage formula of your skill.


    something like


    var Damage = {};
    Damage.formula = function(a,b) {x=actual_formula;if(user has state){a.hp+=x*factor};returnx};


    then on your damage formula in the skill tab, just put Damage.formula(a,b)


    Else, Yanfly probably has his lunatic states already ported to MV so you can easily make a state that causes drain using that.
     
    Last edited by a moderator: Dec 25, 2016
    #5

Share This Page