- Joined
- Aug 18, 2012
- Messages
- 78
- Reaction score
- 82
- First Language
- Polish
- Primarily Uses
- RMMZ
In RMMZ I'm hoping to allow to counter both physical and magic attacks when the character is defending. The way I want it to work is that upon first hit that the affected unit receives (there are a lot of skills that hit multiple times) the defending unit will retaliate with the Counter skill (mainly to increase the counterer's TP but I do realize there are other methods). I have this put in the Defend state's Note are (I am using Visustella):
However it's not working as I hope as it causes the enemy that attacks defender to attack the defender continuously until they evade. Sadly my programming skills are very limited.
As far as I can tell user.forceAction(skill, target); should be altered to something else. Also, note that I do plan to add additional condition for activating the Counter skill, that is to be affected by a state (which AFAIK would be user.isStateAffected(stateID)).
<JS Post-Damage as Target>
if (this.isHpEffect()) {
const skill = 5;
const target = -2;
user.forceAction(skill, target);
}
</JS Post-Damage as Target>
However it's not working as I hope as it causes the enemy that attacks defender to attack the defender continuously until they evade. Sadly my programming skills are very limited.
As far as I can tell user.forceAction(skill, target); should be altered to something else. Also, note that I do plan to add additional condition for activating the Counter skill, that is to be affected by a state (which AFAIK would be user.isStateAffected(stateID)).