Syrup Bomb / Sticky Syrup addition (#3948)

* Syrup Bomb / Sticky Syrup addition

* Update test/battle/move_effect/syrup_bomb.c

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

* Update src/battle_script_commands.c

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
Alex 2024-01-09 13:37:07 +01:00 committed by GitHub
parent 396f2c9565
commit 5498098438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 5 deletions

View file

@ -742,6 +742,7 @@ struct BattleStruct
u8 transformZeroToHero[NUM_BATTLE_SIDES]; u8 transformZeroToHero[NUM_BATTLE_SIDES];
u8 intrepidSwordBoost[NUM_BATTLE_SIDES]; u8 intrepidSwordBoost[NUM_BATTLE_SIDES];
u8 dauntlessShieldBoost[NUM_BATTLE_SIDES]; u8 dauntlessShieldBoost[NUM_BATTLE_SIDES];
u8 stickySyrupdBy[MAX_BATTLERS_COUNT];
}; };
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider, // The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,

View file

@ -3124,6 +3124,8 @@ void SwitchInClearSetData(u32 battler)
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler); gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler);
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler) if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler)
gBattleMons[i].status2 &= ~STATUS2_WRAPPED; gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
if ((gStatuses4[i] & STATUS4_SYRUP_BOMB) && *(gBattleStruct->stickySyrupdBy + i) == battler)
gStatuses4[i] &= ~STATUS4_SYRUP_BOMB;
} }
gActionSelectionCursor[battler] = 0; gActionSelectionCursor[battler] = 0;
@ -3228,6 +3230,8 @@ const u8* FaintClearSetData(u32 battler)
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler); gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(battler);
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler) if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == battler)
gBattleMons[i].status2 &= ~STATUS2_WRAPPED; gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
if ((gStatuses4[i] & STATUS4_SYRUP_BOMB) && *(gBattleStruct->stickySyrupdBy + i) == battler)
gStatuses4[i] &= ~STATUS4_SYRUP_BOMB;
} }
gActionSelectionCursor[battler] = 0; gActionSelectionCursor[battler] = 0;

View file

@ -3136,7 +3136,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlerAbility = gEffectBattler; gBattlerAbility = gEffectBattler;
RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS);
gBattlescriptCurrInstr = BattleScript_FlinchPrevention; gBattlescriptCurrInstr = BattleScript_FlinchPrevention;
} else }
else
{ {
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@ -3683,6 +3684,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
gStatuses4[gEffectBattler] |= STATUS4_SYRUP_BOMB; gStatuses4[gEffectBattler] |= STATUS4_SYRUP_BOMB;
gDisableStructs[gEffectBattler].syrupBombTimer = 3; gDisableStructs[gEffectBattler].syrupBombTimer = 3;
gDisableStructs[gEffectBattler].syrupBombIsShiny = IsMonShiny(&party[gBattlerPartyIndexes[gBattlerAttacker]]); gDisableStructs[gEffectBattler].syrupBombIsShiny = IsMonShiny(&party[gBattlerPartyIndexes[gBattlerAttacker]]);
gBattleStruct->stickySyrupdBy[gEffectBattler] = gBattlerAttacker;
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_SyrupBombActivates; gBattlescriptCurrInstr = BattleScript_SyrupBombActivates;
} }

View file

@ -164,3 +164,51 @@ SINGLE_BATTLE_TEST("Sticky syrup will not decrease speed further then minus six"
} }
} }
} }
SINGLE_BATTLE_TEST("Sticky Syrup is removed when the user switches out")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SYRUP_BOMB); }
TURN { SWITCH(player, 1); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SYRUP_BOMB, player);
HP_BAR(opponent);
MESSAGE("Foe Wobbuffet got covered in sticky syrup!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SYRUP_BOMB_SPEED_DROP, opponent);
MESSAGE("Foe Wobbuffet's Speed fell!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SYRUP_BOMB_SPEED_DROP, opponent);
MESSAGE("Foe Wobbuffet's Speed fell!");
}
}
}
SINGLE_BATTLE_TEST("Sticky Syrup is removed when the user faints")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SYRUP_BOMB);
MOVE(opponent, MOVE_TACKLE);
SEND_OUT(player, 1);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SYRUP_BOMB, player);
HP_BAR(opponent);
MESSAGE("Foe Wobbuffet got covered in sticky syrup!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
HP_BAR(player);
MESSAGE("Wobbuffet fainted!");
MESSAGE("Go! Wynaut!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SYRUP_BOMB_SPEED_DROP, opponent);
MESSAGE("Foe Wobbuffet's Speed fell!");
}
}
}