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

I'm gonna put my project on pause for a tiny bit so I can explore the engine outside of it... Winging it can only get you so far LMFAO
Have seen some of my favorite people here posting and helping others with questions today -- love to see it!
Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e
I added a little squish effect when characters change direction to try and make things a bit more lively. Though it's a bit hard to see on the fast moving guys.
2f4fiuy.gif

Forum statistics

Threads
116,126
Messages
1,095,978
Members
151,537
Latest member
Anrirck
Top