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

Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead
I'm so annoyed with myself...I can't get this code to work so it looks like I'm going the plugin route for a problem I should be able to do myself :kaolivid:Great. Now I get to murder save file compatibility. Again.
Can't believe my code from four years ago is still working! Did some expansions, and...
1635194553179.png
In related news, I may have an update for my old Extra status window plugin ready. That is, once I manage to sit down and update the documentation... and the demo project... :kaoswt:

Forum statistics

Threads
116,079
Messages
1,095,572
Members
151,450
Latest member
Dankim633
Top