MOG Chrono Engine ABS Passive - Chance to Counterattack

● ARCHIVED · READ-ONLY
Started by gaa 18 posts View original ↗
  1. Hi, does anyone have any idea how to add a counter attack/parry to the ABS chrono engine, just to negate damage, similar to dodge or block, it doesn't need to return an auto attack. It could just be another instance of dodge chance, but with a different name = parry. Please, this would really help me.
  2. gaa said:
    Hi, does anyone have any idea how to add a counter attack/parry to the ABS chrono engine, just to negate damage, similar to dodge or block, it doesn't need to return an auto attack. It could just be another instance of dodge chance, but with a different name = parry. Please, this would really help me.
    You'd either have to modify the source code because it would require an additional check for dodging during the tool event damage check. If I were doing it I'd build it off the shielding/blocking functions as a template.

    Or do something like an extra button common event that gives the player a temporary invulnerability state and only works for a few frames
  3. Do you know anyone who could do that? I'd pay for it, of course.
    And another question, how much would it cost, how complicated is it?
  4. There is a subforum for comissions you can post in once you have 30 posts. Could you clarify how you want this dodge/parry mechanic to differ from the shield?
  5. AquaEcho said:
    There is a subforum for comissions you can post in once you have 30 posts. Could you clarify how you want this dodge/parry mechanic to differ from the shield?
    I want it to be a passive ability on a percentage basis, just like dodge, but the parry name will pop up.

    (Also would be cool to add a x % chance to passively block damage based on a variable and +x% while holding shield.
    If this is too hard to change, then I want to drain stamina while holding the shield, and when stamina is 0, the shield is no longer held.)
    BTW: Thank you for reply AquaEcho
  6. So the player doesn't have to press anything to parry/block? There is just an extra percent chance to parry when taking damage? If the player stands there and does nothing while being attacked some percentage of attacks get blocked? What stat affects the parry chance?

    gaa said:
    then I want to drain stamina while holding the shield, and when stamina is 0, the shield is no longer held.)
    This shouldn't be difficult but you would have to modify the ChronoCT code. Probably just add an extra function modified from the dashing check to check for shielding.
  7. AquaEcho said:
    So the player doesn't have to press anything to parry/block? There is just an extra percent chance to parry when taking damage? If the player stands there and does nothing while being attacked some percentage of attacks get blocked? What stat affects the parry chance?
    Yes, the player doesn't have to press anything, just like with the dodge.
    Yes if the player is standing, a percentage of attacks will be blocked.

    Stat: The parry chance can be basically a counter attack, except it doesn't return damage. Or just a variable, whatever.
    I think it would be really hard to make an option of a perfect parry(returning damage),
    Normal "Parry"(dodge attack/block), and if switch is on "(Perfect) Parry" will return damage.
  8. gaa said:
    Yes, the player doesn't have to press anything, just like with the dodge.
    Yes if the player is standing, a percentage of attacks will be blocked.

    Stat: The parry chance can be basically a counter attack, except it doesn't return damage. Or just a variable, whatever.
    I think it would be really hard to make an option of a perfect parry(returning damage),
    Normal "Parry"(dodge attack/block), and if switch is on "(Perfect) Parry" will return damage.
    Then this isn't really a ChronoEngine problem and you could just start a new thread asking how to add an extra "parry" stat in the battle formula.

    You could probably do both parry and perfect parry as two different states, then just check for the state, but battle formulas aren't my specialty so I'd advise a new thread.
  9. AquaEcho said:
    Then this isn't really a ChronoEngine problem and you could just start a new thread asking how to add an extra "parry" stat in the battle formula.

    You could probably do both parry and perfect parry as two different states, then just check for the state, but battle formulas aren't my specialty so I'd advise a new thread.
    Unfortunately nope, ABS chrono attacks works differently than turn based attacks
  10. gaa said:
    Unfortunately nope, ABS chrono attacks works differently than turn based attacks
    The ABS uses the same battle formula the turn based system does. ChronoEngine just adds on map tool event collision checks. The battler, weapon and states data come from the database just like the default battle system.
  11. OP, since that other plugin didn't work, I wrote you a quick plugin that will give anyone with a state an X percent chance to guard an attack. Create a state with the notetag <blockChance:25> where 25 is the percent of attacks you want guarded. You can use this with Yanfly Auto Passive States if you want the player to always have this state under certain conditions.
    1696997949227.png

    Then put the below code in a new .js plugin file at the bottom of your plugin list. Change 19 to the state number (mine was 19 in the example pic).
    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
  12. AquaEcho said:
    OP, since that other plugin didn't work, I wrote you a quick plugin that will give anyone with a state an X percent chance to guard an attack. Create a state with the notetag <blockChance:25> where 25 is the percent of attacks you want guarded. You can use this with Yanfly Auto Passive States if you want the player to always have this state under certain conditions.
    View attachment 279728

    Then put the below code in a new .js plugin file at the bottom of your plugin list. Change 19 to the state number (mine was 19 in the example pic).
    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
    Hi, thanks a lot, I tried it in the Chrono engine demo, and unfortunately it doesn't work. I've set <blockChance:100>, state 19 and the player is still taking damage.
  13. gaa said:
    Hi, thanks a lot, I tried it in the Chrono engine demo, and unfortunately it doesn't work. I've set <blockChance:100>, state 19 and the player is still taking damage.
    Could you try a number that's not 100 and post a screencap of your state page? Is the player affected with that state?
  14. 1697023075896.png
    1697023099162.png
    1697023213413.png
    Yes, here, I noticed that the guard activates only when the player attacks, it doesn't even need a target.
  15. gaa said:
    View attachment 279737
    View attachment 279738
    View attachment 279739
    Yes, here, I noticed that the guard activates only when the player attacks, it doesn't even need a target.
    Oh, you only tested it against touch damage and may be part of the reason the other plugin didn't work. Ok, this should block against touch damage and stop the guard against yourself

    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(this.user() != target && target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
    
    Game_Chrono.prototype.executeTouchDamage = function(user,target) {
        if (target.battler()._ras.collisionD > 0) {return};
        if (this.isGuardingDirectionTouch(user,target)) {
            this.executeGuardTouch(user,target);
            return
        };
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return;
            }
        }
        var subject = user.battler();
        var action = new Game_Action(subject);
        action.setAbsSubject(subject)
        var oldHP = target.battler()._hp;   
        var coop = [];
        var skillId = user.battler().attackSkillId();
        action.setSkill(skillId);
        action.applyCN(target.battler(),coop);
        target.battler().startDamagePopup();   
        target.battler()._ras.collisionD = 30;
        if (oldHP > target.battler()._hp) {
            this.executeTouchTouchAfterHit(user,target,skillId);
        };
    };
  16. AquaEcho said:
    Oh, you only tested it against touch damage and may be part of the reason the other plugin didn't work. Ok, this should block against touch damage and stop the guard against yourself

    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(this.user() != target && target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
    
    Game_Chrono.prototype.executeTouchDamage = function(user,target) {
        if (target.battler()._ras.collisionD > 0) {return};
        if (this.isGuardingDirectionTouch(user,target)) {
            this.executeGuardTouch(user,target);
            return
        };
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return;
            }
        }
        var subject = user.battler();
        var action = new Game_Action(subject);
        action.setAbsSubject(subject)
        var oldHP = target.battler()._hp;  
        var coop = [];
        var skillId = user.battler().attackSkillId();
        action.setSkill(skillId);
        action.applyCN(target.battler(),coop);
        target.battler().startDamagePopup();  
        target.battler()._ras.collisionD = 30;
        if (oldHP > target.battler()._hp) {
            this.executeTouchTouchAfterHit(user,target,skillId);
        };
    };
    Thanks again,
    Yes, It doesn't show the guard anymore, but the block isn't working.
    It would be cool if it showed that guard animation or any different, when attack is blocked
  17. gaa said:
    Thanks again,
    Yes, It doesn't show the guard anymore, but the block isn't working.
    It would be cool if it showed that guard animation or any different, when attack is blocked
    Add this.executeGuardTouch(user,target); before return to this section in executeTouchDamage
    Code:
    if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                this.executeGuardTouch(user,target);
                return;

    Full code:
    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(this.user() != target && target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
    
    Game_Chrono.prototype.executeTouchDamage = function(user,target) {
        if (target.battler()._ras.collisionD > 0) {return};
        if (this.isGuardingDirectionTouch(user,target)) {
            this.executeGuardTouch(user,target);
            return
        };
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                this.executeGuardTouch(user,target);
                return;
            }
        }
        var subject = user.battler();
        var action = new Game_Action(subject);
        action.setAbsSubject(subject)
        var oldHP = target.battler()._hp;   
        var coop = [];
        var skillId = user.battler().attackSkillId();
        action.setSkill(skillId);
        action.applyCN(target.battler(),coop);
        target.battler().startDamagePopup();   
        target.battler()._ras.collisionD = 30;
        if (oldHP > target.battler()._hp) {
            this.executeTouchTouchAfterHit(user,target,skillId);
        };
    };
  18. AquaEcho said:
    Add this.executeGuardTouch(user,target); before return to this section in executeTouchDamage
    Code:
    if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                this.executeGuardTouch(user,target);
                return;

    Full code:
    Code:
    ToolEvent.prototype.isInvunerableAction = function(target,battler) {
        if (battler._ras.invunerable && this.user() != target) {return true};
        var invunerable = false;
        if(this.user() != target && target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                return true;
            }
        }
        for (var i = 0; i < battler._ras.invunerableActions.length; i++) {
             var actionID = Number(battler._ras.invunerableActions[i]);
             if (actionID === this._tool.id) {invunerable = true;break};
        };
        return invunerable;
    };
    
    Game_Chrono.prototype.executeTouchDamage = function(user,target) {
        if (target.battler()._ras.collisionD > 0) {return};
        if (this.isGuardingDirectionTouch(user,target)) {
            this.executeGuardTouch(user,target);
            return
        };
        if(target.battler().isStateAffected(19)){
            if((Math.random() * 100) < $dataStates[19].meta.blockChance){
                this.executeGuardTouch(user,target);
                return;
            }
        }
        var subject = user.battler();
        var action = new Game_Action(subject);
        action.setAbsSubject(subject)
        var oldHP = target.battler()._hp;  
        var coop = [];
        var skillId = user.battler().attackSkillId();
        action.setSkill(skillId);
        action.applyCN(target.battler(),coop);
        target.battler().startDamagePopup();  
        target.battler()._ras.collisionD = 30;
        if (oldHP > target.battler()._hp) {
            this.executeTouchTouchAfterHit(user,target,skillId);
        };
    };
    Oh, my God, it works! Thank you so much :yhappy: