RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 63 of 77 View original ↗
  1. CHKNRAVE said:
    Hi everybody, I'm stumped with trying to find a formula I need for a skill. It's supposed to deal damage to an unpredictable number of enemies that can be not all of them, and the damage is split between the targets affected.
    The problem is that I can't find anything to put in the damage formula that would return the number of units affected so I can make the division.

    What are you using to determine the number of targets? I'm guessing the Target Control plugin?

    Edit: Assuming you are, this will work.

    Code:
    <Custom Target Eval>
      targets = [];
      for (var i = 0; i < foes.aliveMembers().length; ++i) {
        var member = foes.aliveMembers()[i];
        if (Math.random() < 0.3 && targets.length < foes.aliveMembers().length) { targets.push(member); }
      }
      this._targetCount = targets.length;
    </Custom Target Eval>
    <Damage Formula>
    value = (a.atk / 2 - b.def / 4);
    value /= this._targetCount;
    </Damage Formula>
  2. @Trihan I am, thanks for the code, it's almost working as intended with the exception that it seems to ignore my row targeting. Is it caused by the RNG part in the if statement?

    EDIT: It works with this in the notes:
    Code:
    <Target: Front enemy row>
    <Custom Target Eval>
      targets = [];
      for (var i = 0; i < foes.aliveMembers().length; ++i) {
        var member = foes.aliveMembers()[i];
        if (member.row()==1 && targets.length < foes.aliveMembers().length) {
          targets.push(member);
        }
      }
      this._targetCount = targets.length;
    </Custom Target Eval>
    and the damage formula simply in the formula space. Thank you!
  3. Yeah, it didn't take rows into account. :)
  4. Okay, new question: how do I set up a formula so that if at least one of the multiple targets has a certain state, a different formula is used for all enemies affected?

    Full disclosure: I've got a skill that either applies a state to the target enemy, or consumes the state to deal damage to the target and any other enemy standing in the same row. Right now my formula has the right targeting method, but the formula checks if the other enemies in question have the state instead of just doing damage to them.
  5. What does your setup look like currently?
  6. The current formula as HP damage:
    if(!b.isStateAffected(16)){if(Math.random()<=0.7){b.addState(16);}}else{b.removeState(16);100;};
    (random number because the state has a 70% chance of being applied)

    Current notetags:
    Code:
    <Custom Target Eval>
    if (target.isStateAffected(16)) {
      for (var i = 0; i < foes.aliveMembers().length; ++i) {
        var member = foes.aliveMembers()[i];
        if (member.row() === target.row()) targets.push(member);
      }
    } else {
      targets.push(target);
    }
    </Custom Target Eval>
    That's how I get the skill to target one enemy if they don't have state 16, and an enemy's entire row if it has it.
  7. For the next bit, I would do a <damage formula> notetag that checks if any of the targets have state 16 and if so use the formula for the whole row, otherwise use the single-target one.
  8. I see, then I guess there's no way around the damage formula plugin this time. Thanks (for the 3rd time recently), and maybe I'll see you later if I can't figure out how to set it up.
  9. If you're not using Damage Core there is a way to do it in the default damage formula box.
  10. Is this the right place to ask for how to make a damage formula that is directly proportional to the taret's missing HP/MP? If so, how can I make those? I was making a spell that deals bonus damage per missing HP and MP of the target.
  11. The target's missing HP is (b.mhp - b.hp) and their missing MP is (b.mmp - b.mp).
  12. OK then! Thanks. I can now make an Execute skill and a Mind Blast spell with that.
  13. Hello everyone! I am having trouble using percentages in my damage formula. All my actors have very low stats (5-20 for everyone at level 1) and I am wondering if it's possible to calculate a percentage of their attack and add it to the damage formula.

    For instance: If Actor 1 uses a skill that does a flat 2 damage, how would I go about adding 120% of his attack stat to the skill's final calculation? (2 + 120% of attack stat)
  14. ANarutoCreature said:
    Hello everyone! I am having trouble using percentages in my damage formula. All my actors have very low stats (5-20 for everyone at level 1) and I am wondering if it's possible to calculate a percentage of their attack and add it to the damage formula.

    For instance: If Actor 1 uses a skill that does a flat 2 damage, how would I go about adding 120% of his attack stat to the skill's final calculation? (2 + 120% of attack stat)

    2 + a.atk * 1.2
  15. Thank you so much for the quick reply!
  16. Is there a formula to check if the target is under bleed (state 43) and if so, set critical hits to 100%?

    Would it be:

    Code:
    b.isStateAffected(43) ? a.cri(1.0)  : 1;

    Thank you.
  17. Setting the critical hit value is a bit more complicated because by default it's governed almost entirely by traits. There are some plugins like Yanfly's Critical Control that allow for this kind of thing, though.
  18. Jenova said:
    Is there a formula to check if the target is under bleed (state 43) and if so, set critical hits to 100%?
    The formula only determines the amount of damage dealt. I suppose the closest you could get is something like if(b.isStateAffected(43)) a.addState(100); damage formula here where 100 is the ID of a state that sets critical rate to 1. However, damage is calculated after determining whether it's a critical hit, so it would affect the actor's next attack rather than the current attack. To set the critical chance of the skill, you'll need a plugin.
  19. Same question with the bleed question but slightly different: Is there a way to make a damage formula where you do more damage (not a critical, just additional damage) to an opponent with a certain effect active (let's say for example Poison) without the need of a plugin or is a plugin needed?
  20. If it's just additional damage based on a state you don't need a plugin for that. Let's say you wanted an enemy with poison to take double damage:

    Code:
    let value = a.atk * 4 - b.def * 2; b.isStateAffected(4) ? value * 2 : value