How to create a counter that deals the original amount of damage?

Mparagames

Amateur developer trying to be awesome
Member
Joined
Jan 8, 2018
Messages
16
Reaction score
4
First Language
Portuguese(BRA)
Primarily Uses
RMMV
Hello,

I was able to change the skill used when countering a physical move by adding "this._action.setSkill(x);" at the .invokeCounterAttack function in Yanfly's Battle Engine Core script.

BattleManager.invokeCounterAttack = function(subject, target) {

this._action.setSkill(201);
this._action.apply(subject);
this._logWindow.displayCounter(target);
this._logWindow.displayActionResults(target, subject);
if (subject.isDead()) subject.performCollapse();
};

Question is, I have no idea of how to actually set the damage of the attack chosen as the counter always
equal to the damage that would be given if the attack that was originally selected wasn't countered.
To clarify, I don't want to apply the original attack's damage formula to the new target; instead, I want for
the game to read the original damage formula as if it was going to hit the original target, and then applying
that same damage on the new target (the original attacker) instead (the original target receives no damage at
all if the attack is countered, just like the default counter is meant to be, so no "counter after hittting").

Is there a way to actually achieve that effect?


Thanks in regard.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The only upside of this remote semester was the plenty of funny photoshop material those facecams provided. Not that I would do that. Ever.
New skit is up for grid battle system. Less tactics battle engine looking battle systems, more final fantasy/breath of fire looking battle systems.

Dororo wrote on Tsukihime's profile.
For the grid battle system: a function to check if another actor is in a given range - to trigger combo actions or benefit of passive aura/morale ranges.
Uuuh I cannot find any good RPG to play
Gimme some free RPG recommendations plz
I need to consume it
I'm in a need of excitement caused by doing literally nothing on my laptop and then thinking I did something useful and then realising that I didnt and crying internally
RPG Maker Community Discussion on releasing your game

Forum statistics

Threads
100,512
Messages
976,650
Members
132,081
Latest member
nwr
Top