Linked Stats (e.g.: MHP based on DEF), v. 1.1.1

Discussion in 'JS Plugins In Development' started by Zevia, Jan 11, 2019.

    Tags:
  1. Zevia

    Zevia Veteran Veteran

    Messages:
    490
    Likes Received:
    187
    First Language:
    English
    Primarily Uses:
    RMMV
    Created from this thread. Posting here for now to see if people find issues that need to be fixed or have enhancements they'd like to request.

    Version 1.1.1: Github Link

    Description
    This plugin allows a user to add bonuses to one of the primary 8 stats (mhp, mmp, atk, def, mat, mdf, agi, luk) based on a percentage of the other stats. This bonus can be applied based either on a class basis, for Actors, or on an enemy basis. As an example, a Hero class could have its MHP increased by 50% of its DEF, or a Bat could have its ATK increased by 30% of its AGI and 40% of its LUK. Equipping new items or adding states that change these values would adjust the stats, accordingly.

    Installation
    Either right click the Github link above and save as "LinkedStats.js", or create a new text file called "LinkedStats.js" and copy-paste the text from the link into it.
    Move the file into your project's js/plugins folder.

    Instructions
    Under either an enemy's note box or a class's note box, add a note tag with the format:
    Code:
    <link stat: x secondStat>
    
    where stat is the stat you want to adjust, secondStat is the stat you want to base the adjustment on, and x is the percentage of the secondStat you want to adjust by.

    For example, if you want an enemy's MHP to be increased by 35% of their DEF, put:

    Code:
    <link mhp: 35 def>
    
    If you'd like a class's ATK to be increased by 22% of the class's AGI and 45% of the class's LUK, put:

    Code:
    <link atk: 22 agi, 45 luk>
    
    Editable Parameters
    You can edit the minimum value for any of the 8 primary stats. By default, the RPG Maker MV Engine assigns a default minimum of 0 for MMP and 1 for the other 7. However, if you'd like a class's stat to be based solely on a combination of other stats, you can adjust the minimums. For example, if you'd like a class's MHP to be solely based on the class's DEF plus LUK, then you can set the minimum HP parameter to 0 and in the class's note box, put:

    Code:
    <link mhp: 100 def, 100 luk>
    
    If you'd like a class to be potentially killed by having their DEF and LUK reduced to 0, then additionally set the minimum DEF and minimum LUK parameter to 0.

    Screenshots
    Hero class has MHP of 200, ATK of 16, DEF of 100, LUK of 32. Adding a couple notetags to increase mhp and atk:
    [​IMG]

    With MHP increases by 40% of DEF and ATK increased by 50% of LUK, the Hero class now has 240 MHP and 32 ATK:
    [​IMG]

    Equipping a shield that raises DEF by 10...
    [​IMG]

    Also increases MHP by 4!
    [​IMG]

    EDIT: Fixed an issue with linking multiple stats to a stat. Now you comma-separate values instead of trying to link the same stat multiple times.

    EDIT: Added a polyfill for older versions of RMMV that don't support Array.prototype.find.
     
    Last edited: Jan 12, 2019
    #1

Share This Page