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

Discussion in 'Javascript/Plugin Support' started by Mparagames, Apr 7, 2019.

  1. Mparagames

    Mparagames Amateur developer trying to be awesome Member

    Messages:
    16
    Likes Received:
    4
    Location:
    Brazil
    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.
     
    #1

Share This Page