Buff yourself after a skill?

Discussion in 'RPG Maker MV' started by omfgkevin, Nov 2, 2015.

  1. omfgkevin

    omfgkevin Veteran Veteran

    Messages:
    35
    Likes Received:
    2
    First Language:
    English
    How would I make a skill apply a buff to yourself once you hit an enemy?
     
    #1
  2. Raine

    Raine Villager Member

    Messages:
    11
    Likes Received:
    6
    First Language:
    Spanish
    You need to use the Formula damage box, using the function addState(state_id)

    Example, apply state 4 on the user when attack an enemy:

                a.addState(4);  a.atk * 4 - b.def * 2;

    a is the user, b is the target, so, you can apply to the user a buff, debuff or state. But you must add de state BEFORE the damage formula, or will be ignored.

    If you don't want the buff afects dagame in this round, then you need to use a third variable.

                  dmg = a.atk * 4 - b.def * 2;  a.addState(4);  dmg;

    This way, you store the damage value in the dmg variable, then apply the state, then apply damage.

    YOu can use also addbuff(paramId, turns) or addDebuff(paramId, turns), like:

                  dmg = a.atk * 4 - b.def * 2;  a.addBuff(2,4);  dmg;

    This one adds attack buff for 4 turns.

    The ID list is:  

                       0 Maximun HP

                       1 Maximum MP

                       2 Attack

                       3 Defense

                       4 Magic Attack

                       5 Magic Defense

                       6 Agility

                       7 Luck

    Damage must be deal the last, or all the code after will be ignored. Separate each function with ;
     
    Last edited by a moderator: Nov 2, 2015
    #2
    SOC, sb~, Raths Rants and 1 other person like this.
  3. RyokuHasu

    RyokuHasu Developer Veteran

    Messages:
    274
    Likes Received:
    37
    Location:
    Nebraska
    First Language:
    English
    The way I did this exact thing in VX Ace was i used the effects for call a common event that "Force Action" into using a buff skill with the same name. This works for MV too, I just tried it.

    So basically it's 2 different skills liked together. And you have a lot more range in what the buff skill does exactly this way.

    But the formula method works too.
     
    Last edited by a moderator: Nov 2, 2015
    #3
  4. omfgkevin

    omfgkevin Veteran Veteran

    Messages:
    35
    Likes Received:
    2
    First Language:
    English
    Thanks for this detailed explanation! Helps out a lot!
     
    #4
  5. Riff

    Riff Eorzean Veteran

    Messages:
    261
    Likes Received:
    82
    Location:
    Brunei Darussalam
    First Language:
    English
    Primarily Uses:
    RMMV
    Actually, this works perfectly on single target skills. But do note that if you use such formula in a skill that targets all, the main target (the one that you selected) will receive damage without the buff and the remaining targets will take buffed-up damage.

    The buff is applied as soon as the main target is damaged. Since each target damage is calculated separately, the buff will likely re-apply for each additional target.

    Reason I said 'likely' is because I've tried this with states instead of buffs, but I believe they should work the same way.

    Hope this helps!
     
    #5
  6. northseeker

    northseeker Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    english
    Is it possible to have an attack that only does damage or does more damage if the target is affected by a state.  For example if a formula for an attack that only does damage if a target is poisoned or one that does double damage if its affected by a state.
     
    #6
  7. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,979
    Likes Received:
    10,677
    First Language:
    English
    Primarily Uses:
    RMVXA
    @northseeker

    Please do not hijack someone else's thread with a different question.

    There is a thread which deals specifically with general questions about the damage formula, and I'm fairly sure that your question has already been answered there.
     
    Last edited by a moderator: Nov 4, 2015
    #7
  8. RogdagoR

    RogdagoR Veteran Veteran

    Messages:
    127
    Likes Received:
    29
    Location:
    Venice
    First Language:
    Italian
    And if i want to buff the entire party with a single attack skill?

    For example my hero use "insertnameskill" on enemy and then after the damage this skill leave a buff or heal my entire party for a few turns.
     
    #8
  9. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,979
    Likes Received:
    10,677
    First Language:
    English
    Primarily Uses:
    RMVXA
    #9
  10. Ana Pyre

    Ana Pyre Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMVXA
    If you wanted to make add a percent chance to whether or not the state would be applied, how would you write that?

    EDIT: Wait nevermind, this should be it's own thread
     
    Last edited: May 21, 2017
    #10

Share This Page