Hi! I was wondering if there's a way for me to make an attack only able to target enemies with a specific status, and fail if they also have another status? The two states I'm wanting to be able to test for are called "Polychoron-ized" and "Boss Monster." Basically, I want an attack that if the enemy is Polochoron-ized it can be targeted, but if it's a Boss Monster, it will always fail/miss no matter what. How would I go about doing that?
Only target an enemy if they have a certain state, fail if enemy has another state?
RPG Maker MV Supportis "Boss Monster" a state or an enemy?
It's a state applied to Boss enemies.
There are a couple of ways to go about this - the easy way and the elegant way.
Easy way - incorporate checking the states into your damage formula. There are threads about this if you Google it, but essentially you'd put in your damage formula something like:
Replace X with the ID for your poly state and Y with the ID for your boss state, replace the damage formula with whatever you want to use. That will make the skill do its damage formula only if the target has the poly state and is not a boss, and in all other cases hit for 0.
The elegant way would be to use Yanfly's Selection Control, which is a paid plugin that allows you to actually prevent the player from selecting a target with the skill that you don't want to. So using the above method they'd use the skill and do 0 damage and waste their turn, but using selection control they would see that they don't have a valid target to activate the skill on. (Note that this way is not contrasted to the easy way because it's hard - it's quite simple to implement - it just requires an expenditure)
Easy way - incorporate checking the states into your damage formula. There are threads about this if you Google it, but essentially you'd put in your damage formula something like:
(b.isStateAffected(X) && !b.isStateAffected(Y)) ? a.atk*4 - b.def*2 : 0Replace X with the ID for your poly state and Y with the ID for your boss state, replace the damage formula with whatever you want to use. That will make the skill do its damage formula only if the target has the poly state and is not a boss, and in all other cases hit for 0.
The elegant way would be to use Yanfly's Selection Control, which is a paid plugin that allows you to actually prevent the player from selecting a target with the skill that you don't want to. So using the above method they'd use the skill and do 0 damage and waste their turn, but using selection control they would see that they don't have a valid target to activate the skill on. (Note that this way is not contrasted to the easy way because it's hard - it's quite simple to implement - it just requires an expenditure)
Thank you! I figured it out with the Yanfly Selection control!
Actually, I take that back. It seems with selection control I can only change things to "cannot be targeted by X," rather than "can be targeted by X." Is there a way I can do this a different way?
Note: I have all of the Yanfly plugins for MV.
Right in the documentation, in the Select Conditions section. You'd do:
Code:
<Select Conditions>
State: X
Not State: Y
</Select Conditions>
<Cannot Select: Skill ID_number>, but there's not a particular reason to break things up like that...just alternate paths to the same effect.Thank you! I didn't see that, ehehe.
Original thread: https://forums.rpgmakerweb.com/threads/only-target-an-enemy-if-they-have-a-certain-state-fail-if-enemy-has-another-state.139398/