Skill that can only affects characters with certain state

Helel257

Villager
Member
Joined
Aug 18, 2020
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey all,

This is my first time posting in the forums so be sure to move this if it's in the wrong place. Still collecting my bearings.

Basically, I want to make a skill that instantly kills all enemies that have a specific state.

One example in a game I can point to is Persona 4: there's a boss with a move that inflicts Fear on the entire party, then on its next turn uses another move that insta-kills all party members with the Fear status. Is something like that also possible in MV? I've also got Yanfly's Target Core if that's necessary for pulling this off. Thanks in advance
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,786
Reaction score
1,697
First Language
English
Primarily Uses
RMMV
If you have Yanfly's action sequences, this is super easy to do in a really clean-looking way:

Code:
<Whole Action>
perform action
</Whole Action>
<Target Action>
if (target.isStateAffected(n) && Math.random() < target.stateRate(1) && !target.isStateResist(1))
  action animation: target
  eval: target._hp = 0;
  collapse: target
end
</Target Action>
<Finish Action>
wait for animation
perform finish
</Finish Action>

Something like that. Replace the "n" in isStateAffected with the ID of your to-be-killed state.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
698
Reaction score
307
First Language
english
Primarily Uses
RMMV
damage formula
b.isStateAffected(X) ? b.die();

change X to the ID of the state required for them to die instantly to (Fear)
the issue with this formula however is if a boss could be effected by Fear but you dont want the boss to be able to be 1 shoted.
in this case the easyest way to avoid that is change b.die() into b.mhp and make the skill a special element type that bosses and certain mobs can be immune to.

damage formulas can do ALOT in MV.
 

Helel257

Villager
Member
Joined
Aug 18, 2020
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you both for your replies!

I was sadly unable to get the action sequence Aesica left to work, but I was able to get the damage formula strat to work as so:

Code:
b.isStateAffected(X) ? b.die: 0;

This instakills the target, but displays a '0' damage number on my end, so I amended the formula slightly to this:

Code:
b.isStateAffected(X) ? 999: 0;

Since in my RPG the max Actor HP is 999, it's mechanically the exact same but gives off a nice, big, dangerous damage number for the player to gawk at. If anyone in the future is also using this formula just slap a few extra 9s onto the formula depending on how much max HP your players can have.
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,786
Reaction score
1,697
First Language
English
Primarily Uses
RMMV
I admit I didn't really test it out, but if you're fine with the damage appearing then I guess I don't need to. :D
 

Latest Threads

Latest Profile Posts

I am SO HYPED to share this trailer with everyone when its done. I almost want to tear up i had no idea how far i came along with Fallen Feather in these last 3 years.
how it looks from the top
Hike was successful guys! I made it to the top!
Add Film-like Visual Effects During Test-Play, Deploy Games with Electron | RPG Maker News #69

brain broken as soon as i figure out whats wrong with my game im taking a long nap

Forum statistics

Threads
112,184
Messages
1,066,438
Members
145,784
Latest member
lafa
Top