I want to create a move similar to the move dig from Pokémon. The Pokémon takes 1 turn to dig into the ground where it will evade all attacks; However certain moves will do additional damage to enemies that are under the ground. How would I go about having specific skills that are able to hit buried enemies
How would I create a move that deals bonus damage to enemies who are underground (can't be hit)
RPG Maker MV SupportCreate an "underground" state and give it to the thing that's underground and apply it whenever it digs down. In the damage formula of your underground killer skill, you can put an if condition into the damage formula, using if (b.isStateAffected(x)) followed by whatever math you want to use for the bonus damage.
Assuming you're using a state to define whether a battler is underground or not, all you need to do is specify a damage multiplier in the damage formula, whose value depends on whether the target has that state or not.
This can be done with the ternary operator
For example:
The move's base damage is
This can be done with the ternary operator
condition ? when_true : when_falseFor example:
JavaScript:
(a.atk - b.def) * (b.isStateAffected(13) ? 2.5 : 1)
The move's base damage is
a.atk - b.def (attacker's attack power minus target's defense) and is multiplied by 2.5 if the defender is affected by state #13, otherwise the damage is multiplied by 1 (normal damage).How would you go about making the underground able to not take dmg from any other attacks. I'm using Yanfly's Hit Accuracy so i could have underground give +1000% evasion chance. Is there a way I can have the hit be forced to hit if the enemy is underground rather than just making it a certain hit effect?
Trying to modify whether something hits or not during the process of the action is really janky.
I'd suggest instead modifying the damage. If you have Yanfly's Buffs & States, you can ignore the stuff about the damage formula (which was perfectly good advice, but now you also want this other bit).
Give your underground state this notetag:
Code:
<Custom React Effect>
if (this.isDamage() && this.item().id!=X)
value=0;
</Custom React Effect>
where X is the ID of your underground-hitting skill. That will cause the underground creature to take 0 damage from all attacks except that skill, which will do damage according to its formula.
Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-create-a-move-that-deals-bonus-damage-to-enemies-who-are-underground-cant-be-hit.153898/