Stockpile/SpitUp/Swallow for VX Ace.

Discussion in 'RGSS3 Script Requests' started by Alarkus, Jul 8, 2019.

  1. Alarkus

    Alarkus Veteran Veteran

    Messages:
    68
    Likes Received:
    33
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hello.
    For RPG Maker MV, Yanfly has a convenient collection of mini-scripts for a Stockpile, Spit Up, and Swallow ability, similar to Pokemon.
    For those unfamiliar, a character "stocks up", and then after doing so, can use spit up or swallow and the damage, or HP recovered is based off of how many stocks you have.
    I've been able to make an easy workaround for Stockpile by simply using a stack-states script, making Stockpile a state, and have a common event check a variable each time the skill is used to determine how many stocks there are (and if they attempt to use it more than the max it resets)
    However, creating the Spit Up and Swallow parts are difficult. I suppose the simplest way would be for there to be a small script that
    A. Checks for the designated variable to see how many stocks there are
    and
    B. Based off of that, adjust the damage (or in Swallow's case healing) formula for that particular skill.
    I feel like this should be simple, but my knowledge of Ruby is incredibly amateur.
     
    #1
  2. Alarkus

    Alarkus Veteran Veteran

    Messages:
    68
    Likes Received:
    33
    First Language:
    English
    Primarily Uses:
    RMVXA
    I managed to figure out a solution and will leave what I did here for future searches by other users:

    -Create a Common Event "Stockpile" that simply checks a variable to see if it's at your max stockpile stack rate, if it is, the event resets the variable to 0 (this could also just prevent it from going any higher), if it's not then it adds to the variable.
    -Create a Stockpile State that adds to defense and mag. defense and use the Stacking States script by Neon Black to stack it:
    https://forums.rpgmakerweb.com/index.php?threads/stacking-states.14110/
    -Create a Common Event "Stockpile Reset" that resets the counter and state (This will be applied to skills later)
    -Create two "Fake Skills", Spit Up and Swallow
    -These two skills will do nothing but activate two common events for each. "Spit Up Check and Swallow Check".
    -These two common events will check the stated variable, and if it's 0 give a failure message. If anything else it'll force the ACTUAL Spit up or Swallow skill to occur.
    -The ACTUAL Spit Up and Swallow Skill will also activate the previous mentioned Reset Common Event, so the player will lose the state and reset after using the skill.
    -In the HP Damage/HP recover section, use the following formulas:

    Code:
    #For Spit Up
    $game_variables[25] * a.mat*4-b.mdf*2 + 150
    
    #For Swallow
    $game_variables[25] * a.mat*3 + 100
    Adjust the [x] Variable number to whatever your variable is. The formula can also be adjusted as needed.

    Finally, you need one last thing...
    -Yanfly's "Anti Fail" script, so the "Fake Skills" won't display any text and will just run the common event.
    https://yanflychannel.wordpress.com/rmvxa/utility-scripts/anti-fail-message/
     
    #2

Share This Page