Taunt turn config

This commit is contained in:
Eduardo Quezada D'Ottone 2021-10-24 20:21:54 -03:00
parent 70aeaf288f
commit 44625561e5
2 changed files with 10 additions and 3 deletions

View file

@ -123,6 +123,7 @@
#define B_DISABLE_TURNS GEN_7 // Disable's turns. See Cmd_disablelastusedattack. #define B_DISABLE_TURNS GEN_7 // Disable's turns. See Cmd_disablelastusedattack.
#define B_TAILWIND_TURNS GEN_7 // In Gen5+, Tailwind lasts 4 turns instead of 3. #define B_TAILWIND_TURNS GEN_7 // In Gen5+, Tailwind lasts 4 turns instead of 3.
#define B_SLEEP_TURNS GEN_7 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns. #define B_SLEEP_TURNS GEN_7 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns.
#define B_TAUNT_TURNS GEN_7 // In Gen5+, Taunt lasts 3 turns if the user acts before the target, or 4 turns if the target acted before the user. In Gen3, taunt lasts 2 turns and in Gen 4, 3-5 turns.
// Move data settings // Move data settings
#define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc. #define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc.

View file

@ -11778,9 +11778,15 @@ static void Cmd_settaunt(void)
} }
else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) else if (gDisableStructs[gBattlerTarget].tauntTimer == 0)
{ {
u8 turns = 4; #if B_TAUNT_TURNS >= GEN_5
if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker)) u8 turns = 4;
turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia) if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker))
turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia)
#elif B_TAUNT_TURNS == GEN_4
u8 turns = (Random() & 2) + 3;
#else
u8 turns = 2;
#endif
gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns; gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;