Pokemon-like Counter/Mirror Coat Skill

Joined
Feb 18, 2019
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm looking for a way to create a skill like Counter or Mirror Coat from Pokemon. In case you don't know, Counter in Pokemon works like this: the user always moves last, but when hit by a physical attack, they deal back double the damage to the opponent. Mirror Coat does the same thing, but for special/magical attacks.

I've been trying to figure out how to do this, but to no avail. I've been considering using Yanfly's plugins to create it, can anyone help me?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,910
Reaction score
624
First Language
Dutch
Primarily Uses
RMMV
yanfly skill core is required, but also lunatic code to create that effect.
you can find the mirror effect on yanfly tips and trick.

there are more usefull tricks, but also alot of usefull lunatic code.
you might need more yeop plugins in order to make it work because
those will be "required".

I cant tell if there is a paid plugin in it, unless you have them all.
 
Joined
Feb 18, 2019
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
yanfly skill core is required, but also lunatic code to create that effect.
you can find the mirror effect on yanfly tips and trick.

there are more usefull tricks, but also alot of usefull lunatic code.
you might need more yeop plugins in order to make it work because
those will be "required".

I cant tell if there is a paid plugin in it, unless you have them all.
This tips and tricks looks like copying a move the opponent used. It looks similar enough that with a few tweaks it MIGHT work. Unfortunately for me my javascript sucks.

So it looks like the code is applied to a Passive State, and then a move. The code for the state is:
Code:
<Custom Action Start Effect>
var action = user.currentAction();
user._lastUsedSkill = user._lastUsedSkill || 1;
if (action && action.isSkill()) {
  user._lastUsedSkill = action.item().id;
}
</Custom Action Start Effect>
Which looks like it gets the last used move the user uses and stores it so that when you use a Mirror Move skill, its code calls on that action, through this code:
Code:
<After Eval>
var id = target._lastUsedSkill || 1;
BattleManager.queueForceAction(user, id, -2);
</After Eval>
This calls the last skill that the targeted enemy used and makes the user use it. But the skill I am planning to do specifically deals back double the damage that was dealt to them. I don't think I need a passive state to deal with that. Maybe only Skill Core. Like maybe it could do a Before Eval that checked the damage dealt and then applies that to the damage calculation. I might be wrong, but it might work.

EDIT: No, I'm an idiot. Use Passive States to keep track of last damage taken through Buffs and States Core with the Custom Respond Effect tag, and then use a Pre-Damage Eval to turn the damage into the damage taken into the damage given times two.

EDIT 2: I think I got it figured out, the only problem I have right now is checking whether or not the skill is a Physical or Magical attack, can anyone help?

EDIT 3: No, I don't got it. I am stuck once again and require assistance >.<
 
Last edited:

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,910
Reaction score
624
First Language
Dutch
Primarily Uses
RMMV
I dont know much Lunatic code while they work a bit different than javascript.
but the mirror is partly of the effect you want.

so the after eval attack should do the dmg x2 of the dmg recieved.
I dont know how to achieve that, but it probably need 2-4 lines more to get
the desire effect you want, so hopefully someone that knows this plugin can
alter the code a bit for you to use :)

it might be possible that its in the tip and tricks if you didn't check the full list
or something closer than this with easier edit. else the after eval need a tiny
modification.

I cant help you further though, but good luck on your project and I hope you get
this to work.
 
Joined
Feb 18, 2019
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
So, I got it working... sorta.

I used a variable to store the damage dealt via Passive State, and in the damage formula, I called that variable and multiplied it by 2. That works, although there is a problem.

This way, it's kinda archaic and a bit messy, but that doesn't really matter right now. What matters is that, since it's a variable, and it's a global Passive State, whenever anyone takes damage, the variable sets itself as the damage the last person took, which means that it doesn't use the damage the counterattacker took. This is problematic in case I want to create a counterattack skill for other actors or enemies, since the damage would be different than intended.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Almost 100,000 Threads! We should make a celebration. Make a 100K logo? :p
Cursed problem: Multiple language switches. Say, you want to switch to EN language from JP but you have no idea where the language switch in JP menu language.
Tonight I'm finally going to start putting the dungeons my team has made on grid paper into the engine. That's the final step of making the game world.
Yay! My new Doomsday machine..... er... "Heroic" machine is ready!
//pushes button :LZSexcite:
Uh oh what's that rumbling?!
// Game explodes :kaoback:
That's the fourth time this week! :kaolivid:
// Gets to work building next "Heroic" Machine. :LZSskeptic:
I was just reflecting back on an old project of mine. I was creating a Wizardry-like game but with a little more complexity. It was being made with RPG Maker VX Ace.



Forum statistics

Threads
99,428
Messages
965,142
Members
131,043
Latest member
naht
Top