Improve Counter Attack State Snippet

Hi. This is my first script/snippet.

Filename: Hamedo.js

Script Name: Hamedo: Improve Counter Attack System

Version: 1.00

Author: 1224Deko

This script/snippet overrides function BattleManager.invokeAction and counter mechanism by default, so be carefull.

What it does:

- Change default Evade and Counter to Counter-Attack system.

- Adds 5 state types of counter attack:

Default Counter-Attack: countering after taking damage:  added for priority, example if you want nullifies all countering system just put that state on target enemy/battler.

First Strike: Countering before taking damages, so if enemy dies battler no recive damage

Forestall: Countering before taking damage, and taking damages only if counter attack was evaded or dmg =< 0.

Double Strike: First Strike plus second counter attack(if previous wasn't lethal of course).

Evade and Counter: Evade and Counter like without this snippet




In Plugin setup you can also find:

CounterEvenDeath: countering even if damage(s) was lethal, should work now but it isn't finished yet.

Multi States: It is a WIP system. So it do nothing yet. But in future i'm planning making a multiple countering system, so i.e. if actor will have CounterEvenDeath and Double Strike states. It will countering 2 times even if it takes lethal damage before second countering.

Counter Same Skill: Don't know if i can make it work ever. Must testing how work countering magics and skills by default.

This is my first meet with js, so i migh did a few mistakes. If you saw something strange please report it.

Any ideas, how to improve counter system?

Script:

http://pastebin.com/CMa9bqMJ

Terms of uses: Free for both non commercial and commercial uses. But for commercial uses please credit me.
I guess it was Hime who made reaction skills script for VXA. A big improvement for this is to be able to decide wich skill do you want to trigger once the counter happens. Also, it was skill-type responsive: if you hit someone with a type of skill, then the counter happens (countering with the skill you wanted, of course).
This above and something i'd like is

Counter damage get lowers/higher depending on a SP stat

Those tags can also be used on actors/enemies so states are not needed

The % chance of countering is dependent on the CNT stat
This is really good.
Janusz, I'm not 100% familiar with Javascript... Is this plugin overwriting the invokeAction function?
I'm a little big confused on how to use this. Do I need to create special states for each type of counter attacking, or can I just use the default counter attack Ex-Parameter? I'd prefer that one since there's only one type of counter attacking I plan on using, which is where the actor just attacks after being attacked.
Janusz, I'm not 100% familiar with Javascript... Is this plugin overwriting the invokeAction function?
Well, it is rewritten Battle Manager.invokeAction... since i didn't find other invokeAction in js files, it looks like it is, but it only change ways of counter-attack mechanism. I'm also not familiar with JS yet.

BTW: I used similar snippet in Ace without complication and i not found other scripts that change this part of engine - don't know why.

I'm a little big confused on how to use this. Do I need to create special states for each type of counter attacking, or can I just use the default counter attack Ex-Parameter? I'd prefer that one since there's only one type of counter attacking I plan on using, which is where the actor just attacks after being attacked.
Adding only Ex-Param. Counter 100% causes that battler will counter after taking damage(like in FF series in example).

Adding any state does nothing if Actor doesn't have Ex-Param Cnt X%.

So, you don't need any states but remeber to change states ID's(in script properties) for unused(ex. 999), to prevent using it in future.

You just need add Ex-Parameter Counter to get countering after damage. If you want use other type you need create states and ex-param cnt.

I'm planning remove ids and add notetags, also i would have to improve magic reflection with counter system(counterspell, deathtouch etc) but i'm still learning javascript and it might take me a little time.
Great Script! Thank you

Feature Request:

Choose skill to counter with instead of skill 1.
It's cool  

thank you
Great script!

I just have a small issue, only the damage popup for the counter attack shows when using dekodcounter.

Original thread: https://forums.rpgmakerweb.com/threads/improve-counter-attack-state-snippet.50418/