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 Posts

Latest Profile Posts

Folks, if anyone sends you a message inviting you to add their API to your game, please report them. We don't want people spamming our members asking them to add stuff to their games for their own (or others') benefit.
I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D

Forum statistics

Threads
117,010
Messages
1,103,787
Members
152,906
Latest member
Heru_
Top