Making passives with 2 of Yanfly's States Plugins

Discussion in 'Javascript/Plugin Support' started by Fernyfer775, Jan 21, 2017.

  1. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,302
    Likes Received:
    805
    First Language:
    English
    Hey all, so I am trying to create a few passive abilities in my game but I'm not fluent at all in javascript, so I was hoping somebody might be able to help me out. Below are the states/passives that I'm trying to create using Yanfly's plugins. I know how to use the plugins themselves, just need help creating the actual javascript codes to throw into the plugin's notetags.


    Here are the passives:

    1. PASSIVE#1: When this character attacks a target with her own debuffs on it, she regenerates some mana. For example, this character has a total of 4 debuffs she can place on an enemy. I want her to be able to restore MP whenever she attacks an enemy based on how many of those debuffs she has on it, aiming for about 1% MP regeneration per debuff.
    2. PASSIVE#2: Overall damage is boosted by 1% for ever 5% Critical Hit chance the character has. For example, at 20% critical hit chance, that character would have 4% boosted base damage. (If a flat damage boost in not something that could be done, I would even settle for this passive to boost a parameter, like Agility for example instead)
    3. PASSIVE#3: Healing done is boosted by the amount of current MP the user has, starting at 10% bonus healing at full MP and going down 1% for every 10% MP missing. (If a flat healing boost in not something that could be done, I would even settle for this passive to boost a parameter, like M.Def for example instead)
    4. PASSIVE#4: Damage is increased by the amount of current MP the user has missing. At 100% MP, damage is boosted by 0%, and then increases by 1% for every 10% of MP that is currently missing, maxing out at 10% boosted damage at 0% MP. (If a flat damage boost in not something that could be done, I would even settle for this passive to boost a parameter, like M.Atk for example instead)
    5. PASSIVE#5: Defense and Attack power is increased as HP gets lower. I want this one to be a 2% boost to defense and attack for every 10% of MaxHP that is missing, maxing out at about 20% boost if the character is at about 1% of his MaxHP.



    I know that some of these can be easily created in the damage formula boxes themselves, but I want them to be passive states that the character can unlock via my skill learn system.


    Any and all help would be greatly appreciated! :D  Thank you!


    PS - Here are the links to the plugins: 


    http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/


    http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/
     
    #1
  2. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,302
    Likes Received:
    805
    First Language:
    English
    Bump :D
     
    #2
  3. lolshtar

    lolshtar Master of Magic thatknow nospell Veteran

    Messages:
    694
    Likes Received:
    101
    First Language:
    French
    Primarily Uses:
    RMMV
    You'll need another hidden passive state on all actors that calculates the user stats depending where you need it

    Regenerate
    Respond
    Action End
    Battle

    are the ones that would fit most

    target._mprate = target.mp/target.mmp
    target._hprate = target.hp/target.mhp


    On the passive states, for example #3

    if (user._mprate >= 0.90) {
    user._HealBonus = 1.1 }
    if (user._mprate < 0.90 && user._mprate >= 0.80) {
    user._HealBonus = 1.09 }

    add the user._HealBonus in the skill formula of all healing skills

    At the beginning of the game add for each actor

    $gameActors.actor(1)._HealBonus = $gameActors.actor(1)._HealBonus || 0;

    otherwise your formulas will have a NaN value

    You can figure out the rest if you're not lazy.



    What you're trying to do is way harder than it sounds, l would simplify it by a ton because the players aren't going to care about small values anyways.
     
    #3
  4. Iqus

    Iqus inVictor Member

    Messages:
    27
    Likes Received:
    11
    Location:
    England
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Passive 1: Just create a Custom Confirm Effect and in it create a variable, let's call it user._totaldebuff. Have a conditional for each state, if the target has X state or debuff, variable += 1. Then, on a Custom Regenerate Effect have the MP rate you want be multiplied by this variable. Remember to set the variable back to undefined after it.

    Passive 2: On a global passive make a Custom Confirm Effect with: value += Math.ceil(value * (0.01 * (user.crt / 0.05)))

    Passive 4: value += Math.ceil(value * Math.min(0.1, (0.01 * ((1 - user.mpRate()) / 0.1))))

    Passive 5: This cannot be done the traditional way with Yanfly codes since it can create several problems, however, you can do this. Create a dummy state and use YEP_BaseParamControl. Change both Attack and Defense formulas for this:
    ((base + plus) * paramRate * buffRate + flat) * Math.ceil(Math.max(1, Math.min(1.2, (user.isStateAffected(x) + (0.02 * (1 - user.hpRate() / 0.1))))))
     
    #4
    Fernyfer775 likes this.
  5. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,302
    Likes Received:
    805
    First Language:
    English
    @Iqus Awesomeness, for most of these passives, I figured out a way to do what I'm looking for using the damagecore using some of the code you posted. Thanks so much for your help! ^_^
     
    #5

Share This Page