CarbonatedBlood

Villager
Member
Joined
Sep 15, 2021
Messages
8
Reaction score
1
First Language
English
Primarily Uses
RMVXA
That is to say, a state that is removed whenever the actor/enemy it is attached to makes a damaging attack, regardless if it hits or not. (A state that gives its owner 150% more damage, but only for a single hit).

I'd enjoy the script's effect to be implemented via state notetags, as I can technically achieve this effect as of now with a separate script, though doing so would involve a lot of notetag clogging amongst almost every skill.
 

WCouillard

Veteran
Veteran
Joined
Nov 24, 2013
Messages
77
Reaction score
21
First Language
English
Primarily Uses
Add the following function to rpg_objects.js if you want to add this to one particular skill:

JavaScript:
Game_Battler.prototype.empoweredAttack = function(a, b) {
  baseDamageValue = X;
    if (a.isStateAffected(Y)) {
      baseDamageValue *= 1.5;
      a.removeState(Y);
    }
    return baseDamageValue;
};

Put this in the damage formula field of the skill in your database:

a.empoweredAttack(a, b)

Replace the damage formula with what you use to determine damage (X), and the state ID of which state you use to determine this effect (Y).

If you want this to apply to any damage, then you'll need to edit this function in the same file with something like this, although I did not test this part of it:

JavaScript:
Game_Action.prototype.apply = function(target) {
    var result = target.result();
    this.subject().clearResult();
    result.clear();
    result.used = this.testApply(target);
    result.missed = (result.used && Math.random() >= this.itemHit(target));
    result.evaded = (!result.missed && Math.random() < this.itemEva(target));
    result.physical = this.isPhysical();
    result.drain = this.isDrain();
    if (result.isHit()) {
        if (this.item().damage.type > 0) {
            result.critical = (Math.random() < this.itemCri(target));
            var value = this.makeDamageValue(target, result.critical);
        }  
       if (this.subject().isStateAffected(X)) {
        var value *= 1.5;
        this.subject().removeState(X);
        this.executeDamage(target, value);
       }
        this.item().effects.forEach(function(effect) {
            this.applyItemEffect(target, effect);
        }, this);
        this.applyItemUserEffect(target);
    }
    if (this.subject().isStateAffected(X)) {
      this.subject().removeState(X); // Ensures state is removed on a miss/evade
    }
};
 
Last edited:

Latest Threads

Latest Profile Posts

Monday morning, and the sudden message: Hey, can you set up a full second lesson about pixel art till tomorrow?
No one:
Steam game achievement: "Die 100 times in easy mode".
I want to learn Javascript to create a custom menu, but I don't really know where to start.
One uncomfortable truth that has withstood the test of time, is how most people will stand by while they see a crime happening, unless it's illegal to stand by. We probably wouldn't have stories about "special heroes" or games about heroes if the "everyday common folk" were largely capable of being heroes. Heroes face dangers that most people are not willing to.
I'm having toooo much fun designing the new MP (Mental Psyche) system. I've only worked it out for enemies so far, but it's fun to stun them, then go after their MP and delete them instead to farm for better item drops.

Forum statistics

Threads
115,887
Messages
1,093,723
Members
151,132
Latest member
skyvory
Top