Flat stat bonus states (R2 24/11)

Discussion in 'JS Plugin Releases (RMMV)' started by Astfgl66, Oct 20, 2016.

    Tags:
  1. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French

    Astfgl's Flat stat bonus states:
    This is a small plugin that allows you to use notetags to give flat stats bonuses using states (instead of percentage based).

    Version2: Added possibilty to refer to the affected character's own parameters when making a notetag.

    Features:
    • Use notetags to give flat stat boosts to actors or enemies
    • The stat boosts can be fixed, variable based, or based on the affected's own parameters.
    Compatible with Yanfly passive states, other state modifying plugins not tested, use at your own risk.

    Notetag list:

    <atkB:>
    <defB:>
    <mhpB:>
    <mmpB:>
    <defB:>
    <mdefB:>
    <agiB:>
    <lckB:>

    To refer to the user parameters:

    user.hp //current hp
    user.mhp //maximum hp
    user.mp //current mp
    user.mmp //maximum mp
    user.tp //current tp
    user.atk //attack
    user.mat //magic attack
    user.def //defense
    user.mdf //magic defense
    user.agi //agility
    user.luk //luck

    Examples:
    • <mhpB: 1000> in the state 4 (poison) notebox will make anyone affected by poison have 1000 more maxHP.
    • <atkB: 10 * v(1)>, will boost the affected charachters atk by 10 times the value of variable 1.
    • <lckB: 10*v(1) - 50> will boost luck by 10 times variable 1 - 50.
    • <mhpB: 10 * user.mmp> will boost hp by 10 times max mp. !NEW!
    • NOT A BUG: You can't use the same parameters you're boosting in the formula or you'll get an error. So you can't have <mhpB: user.mhp> That would be silly anyway because you can do that already in editor by using a 100% max hp boost.

    The bonus is removed with the state.
    You can, of course, use a negative value to reduce the parameter.
    For those with some javascript knowledge: the notetags are evaled and user refers to the actor or enemy object so you can grab everything, not just parameters if you want. Have fun!

    Pictures for clarification:
    Variable based boost:
    [​IMG]

    1- First event, setting the state on actor 1 and variable 10 to 0
    2- Setting variable 10 to 10
    3- State 4 (poison) notebox
    4-Menu before speaking to event 1
    5-Menu after speaking to event 1 but before speaking to event 2
    6-Menu after speaking with event 1 and 2.

    In this example I used the full "$gameVariables.value(10)" command, but you can use "v(10") for the same effect.

    How to use:
    Plug and play. There is no configuration necessary, no parameters to set.

    Download: here on pastebin

    Terms of use:
    Can be found inside the script file for reference.

    Free for commercial and non commercial use. Credits not required.
    Free to edit and repost as long as it is kept under the same terms of use.
    Do not claim as your own.

    Known Bugs:
    None.
    Post in the thread or send me a PM if you have any trouble using this plugin.
    Concerning incompatibility issues: I might release further compatibilty patches if asked, but no promises.


    As always, I am open to suggestions for improvement.
    Have a nice day and happy game making!


    Author: Astfgl
    Date: 24/11/2016
    Version: RC2
    Original request topic for reference:

     
    Last edited: Jun 4, 2017
    #1
  2. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    Hi everyone! Just to let you know that I made a small update for this plugin: you can now make the bonuses based on the affected's own parameters. So you can now have a state that boosts atk by the value of agi, or a state that boosts max Hp by the current mp if you want.


    Just don't use the same parameter you're boosting in there or you'll get a crash. No boosting max hp by the value of max hp in the notetags. Just use the editor's hp boost trait.


    Thanks to @Doktor_Q for the idea!
     
    #2
    killerfer likes this.
  3. CrappyName

    CrappyName Villager Member

    Messages:
    25
    Likes Received:
    2
    First Language:
    English
    I'm using your plugin because I think it is simple yet awesome. I noticed that you use "matk" and "mdef" for magic attack and magic defense. It confused me at first why "mat" and "mdf" weren't working. Just pointing that out for anyone else who might use this.

    Thanks for the cool plugin! I'm using it to make my 4 actors have unique stats bonuses that scale with their level and stay with them no matter what class they change to. That way the player has to think about which actor they want to be which class. If all 4 actors are a Warrior, they will all have different stats.
     
    #3
  4. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    Thanks for letting me know!
    It's always nice to know someone else uses your work.

    Have a nice day and happy game making!
     
    #4
  5. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    just find this awesome feature
    but what I need is flat HIT bonus on weapons... which is ex-parameter
    also I have SKILL instead of MP will this work with that?
    (I don't understand coding except I get the format, so I will get confused with editing it)
     
    #5
  6. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    It doesn't matter how you name your parameters, in engine they are always registered under the same thing: mp, hp, etc...
    So to give a skill flat boost, assuming it's renamed mp, use the mp notetag.

    Unless I'm mistaken hit rate is already a flat boost, so you'd just have to use the trait field. Note that default hit formula is unintuitive anyway and a flat 5% hit rate boost will not amount to a 5% increase in successfull casts.
     
    #6
  7. Alphaistimz

    Alphaistimz AlphaDio Production Veteran

    Messages:
    69
    Likes Received:
    4
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    I'm using Yanfly's plugins to have custom ex and sp parameters.
    Sorry for not being clear, but SKILL is completely new parameter I have, and I remove MP completely because it's unneeded.
    I'm currently making fire emblem-like game for reference...
     
    #7
  8. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    Then you're out of luck with this plugin, it doesn't support anything but default regular parameters.
    I'd check the plugin you use for extra parameters, it's likely they have a way to add to it manually in game. Then you just have to use yanfly's buffs and states core to add to the param when the state is applied and remove to it when it's removed.
     
    #8
  9. pasunna

    pasunna Veteran Veteran

    Messages:
    113
    Likes Received:
    17
    First Language:
    thai
    Primarily Uses:
    RMMV
    sorry I misunderstanding
    the yanfly plugin already do what I want
     
    Last edited: Mar 14, 2019
    #9
  10. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    I don't understand what you want to do at all.
    Could you rephrase that ?
     
    #10
    pasunna likes this.
  11. pasunna

    pasunna Veteran Veteran

    Messages:
    113
    Likes Received:
    17
    First Language:
    thai
    Primarily Uses:
    RMMV
    sorry I misunderstanding
    the yanfly plugin already do what I want
     
    Last edited: Mar 14, 2019
    #11
  12. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    649
    Likes Received:
    494
    First Language:
    French
    Where did you get the mhp Plus notetag from?
    The correct notetag is <mhpB:>.
     
    #12
    pasunna likes this.
  13. pasunna

    pasunna Veteran Veteran

    Messages:
    113
    Likes Received:
    17
    First Language:
    thai
    Primarily Uses:
    RMMV
    sorry I misunderstanding
    the yanfly plugin already do what I want
     
    Last edited: Mar 14, 2019
    #13

Share This Page