[RMMV] YANFLY COUNTER FOR DODGING/CRITICAL HIT/HITTING WEAKNESS?

Posts

Pages: 1
KrimsonKatt
Gamedev by sunlight, magical girl by moonlight
3326
So I'm using the Yanfly Counter Core in my game and I've run into an issue. In my class there is a class called the "Swordmaster" who's gimmick is that all their skills use a special resource called "Charge." "Charge" is represented by an item, and each of the class' skills use one or more of these "charge items." The main way to obtain charges is to use the "Bushido Charge" skill which costs 5 AP (MP) to automatically gain 1 BP.

There are also other ways to gain charges, mainly the passive skills "Bushido Dodge," "Bushido Critical," and "Bushido Exploit." Each one grants 1 charge when certain conditions are met such as dodging an attack, landing a critical hit, or exploiting an enemy weakness. However, I have no idea how to actually implement that in my game. I'm trying to use Yanfly Counter Core to trigger an auto-counter when those conditions are met, but it doesn't seem like there's any way to trigger a auto-counter when certain conditions are met rather than when an actor is hit by a skill.

Does anyone know how to accomplish the sort of thing I'm trying to do in RPG Maker MV? Because just having the charge skill to gain charges would take forever to use any of the stronger skills. Alternatively, does anyone have another idea on how to make a charge-based Swordmaster class? If worst comes to worst, I might just have to entirely remove this class from the game and replace it with something else, most likely with an wind/earth mage like a druid or something as my game is lacking those. Thanks.
Marrend
Guardian of the Description Thread
21806
Perhaps within the context of Game_Action? The apply function...

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);
            this.executeDamage(target, value);
        }
        this.item().effects.forEach(function(effect) {
            this.applyItemEffect(target, effect);
        }, this);
        this.applyItemUserEffect(target);
    }
};

...seems to point to evaluating the most of the triggers/flags you're looking for. Unfortunately, I don't know if Yanfly's Counter Core changes any of this off-hand. However, as a possible alternative, considering how you envision "charges" are accumulated, it might be worth considering moving the system in question to work off of using TP, rather than having a separate resource.
KrimsonKatt
Gamedev by sunlight, magical girl by moonlight
3326
I could use TP, that's definitely an option especially since otherwise TP isn't used by my game at all. I would have to do some custom tinkering using Yanfly's TP plugin but otherwise that is a solid idea on how to move this concept forward.

Anyways as for the code, I'm very inexperienced with coding but of what I can see the code seems to be accurate. The thing with Yanfly's MV plugins is that they don't alter the base coding, it just adds in shortcuts to making coding things in using lunatic code much easier. So a lot of that coding you have me likely isn't necessary. Everything lunatic code related in Yanfly's plugins is done with script calls which are all in one big excel sheet including Yanfly's exclusive script calls in both MV and MZ. (visustella)

But yeah, I'm definitely just going to use TP for this. With Yanfly's custom TP types this should be relatively simple.
Pages: 1