Skip to content

Commit

Permalink
Adds Pledge Side Statuses as Starting Statuses (#5899)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Dec 30, 2024
1 parent e93e88a commit af19b13
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 130 deletions.
4 changes: 1 addition & 3 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -5899,8 +5899,7 @@ BattleScript_OverworldStatusStarts::

BattleScript_OverworldStatusStarts_TryActivations:
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TRICK_ROOM, BattleScript_TryRoomServiceLoop
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TAILWIND_PLAYER, BattleScript_TryTailwindAbilitiesLoop
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TAILWIND_OPPONENT, BattleScript_TryTailwindAbilitiesLoop
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SET_TAILWIND, BattleScript_TryTailwindAbilitiesLoop
return

BattleScript_OverworldWeatherStarts::
Expand Down Expand Up @@ -8333,7 +8332,6 @@ BattleScript_GrassyTerrainLoopIncrement::
addbyte gBattleCommunication, 1
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_GrassyTerrainLoop
bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd
BattleScript_GrassyTerrainHealEnd:
return

Expand Down
30 changes: 19 additions & 11 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
#define STATUS_FIELD_PSYCHIC_TERRAIN (1 << 9)
#define STATUS_FIELD_ION_DELUGE (1 << 10)
#define STATUS_FIELD_FAIRY_LOCK (1 << 11)
#define STATUS_FIELD_TERRAIN_PERMANENT (1 << 12) // Overworld thunderstorm generates electric terrain

#define STATUS_FIELD_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN)

Expand Down Expand Up @@ -539,15 +538,24 @@

// Constants for B_VAR_STARTING_STATUS
// Timer value controlled by B_VAR_STARTING_STATUS_TIMER
#define STARTING_STATUS_NONE 0
#define STARTING_STATUS_ELECTRIC_TERRAIN 1
#define STARTING_STATUS_MISTY_TERRAIN 2
#define STARTING_STATUS_GRASSY_TERRAIN 3
#define STARTING_STATUS_PSYCHIC_TERRAIN 4
#define STARTING_STATUS_TRICK_ROOM 5
#define STARTING_STATUS_MAGIC_ROOM 6
#define STARTING_STATUS_WONDER_ROOM 7
#define STARTING_STATUS_TAILWIND_PLAYER 8
#define STARTING_STATUS_TAILWIND_OPPONENT 9
enum StartingStatus
{
STARTING_STATUS_NONE,
STARTING_STATUS_ELECTRIC_TERRAIN,
STARTING_STATUS_MISTY_TERRAIN,
STARTING_STATUS_GRASSY_TERRAIN,
STARTING_STATUS_PSYCHIC_TERRAIN,
STARTING_STATUS_TRICK_ROOM,
STARTING_STATUS_MAGIC_ROOM,
STARTING_STATUS_WONDER_ROOM,
STARTING_STATUS_TAILWIND_PLAYER,
STARTING_STATUS_TAILWIND_OPPONENT,
STARTING_STATUS_RAINBOW_PLAYER,
STARTING_STATUS_RAINBOW_OPPONENT,
STARTING_STATUS_SEA_OF_FIRE_PLAYER,
STARTING_STATUS_SEA_OF_FIRE_OPPONENT,
STARTING_STATUS_SWAMP_PLAYER,
STARTING_STATUS_SWAMP_OPPONENT,
};

#endif // GUARD_CONSTANTS_BATTLE_H
8 changes: 5 additions & 3 deletions include/constants/battle_string_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -1010,9 +1010,11 @@
#define B_MSG_SET_TRICK_ROOM 4
#define B_MSG_SET_MAGIC_ROOM 5
#define B_MSG_SET_WONDER_ROOM 6
#define B_MSG_SET_TAILWIND_PLAYER 7
#define B_MSG_SET_TAILWIND_OPPONENT 8
#define B_MSG_STARTING_STATUS_COUNT 9
#define B_MSG_SET_TAILWIND 7
#define B_MSG_SET_RAINBOW 8
#define B_MSG_SET_SEA_OF_FIRE 9
#define B_MSG_SET_SWAMP 10
#define B_MSG_STARTING_STATUS_COUNT 11


// gWrappedStringIds
Expand Down
20 changes: 11 additions & 9 deletions src/battle_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,15 +915,17 @@ const u16 gMentalHerbCureStringIds[] =

const u16 gStartingStatusStringIds[B_MSG_STARTING_STATUS_COUNT] =
{
[B_MSG_TERRAIN_SET_MISTY] = STRINGID_TERRAINBECOMESMISTY,
[B_MSG_TERRAIN_SET_ELECTRIC] = STRINGID_TERRAINBECOMESELECTRIC,
[B_MSG_TERRAIN_SET_PSYCHIC] = STRINGID_TERRAINBECOMESPSYCHIC,
[B_MSG_TERRAIN_SET_GRASSY] = STRINGID_TERRAINBECOMESGRASSY,
[B_MSG_SET_TRICK_ROOM] = STRINGID_DIMENSIONSWERETWISTED,
[B_MSG_SET_MAGIC_ROOM] = STRINGID_BIZARREARENACREATED,
[B_MSG_SET_WONDER_ROOM] = STRINGID_BIZARREAREACREATED,
[B_MSG_SET_TAILWIND_PLAYER] = STRINGID_TAILWINDBLEW,
[B_MSG_SET_TAILWIND_OPPONENT] = STRINGID_TAILWINDBLEW,
[B_MSG_TERRAIN_SET_MISTY] = STRINGID_TERRAINBECOMESMISTY,
[B_MSG_TERRAIN_SET_ELECTRIC] = STRINGID_TERRAINBECOMESELECTRIC,
[B_MSG_TERRAIN_SET_PSYCHIC] = STRINGID_TERRAINBECOMESPSYCHIC,
[B_MSG_TERRAIN_SET_GRASSY] = STRINGID_TERRAINBECOMESGRASSY,
[B_MSG_SET_TRICK_ROOM] = STRINGID_DIMENSIONSWERETWISTED,
[B_MSG_SET_MAGIC_ROOM] = STRINGID_BIZARREARENACREATED,
[B_MSG_SET_WONDER_ROOM] = STRINGID_BIZARREAREACREATED,
[B_MSG_SET_TAILWIND] = STRINGID_TAILWINDBLEW,
[B_MSG_SET_RAINBOW] = STRINGID_ARAINBOWAPPEAREDONSIDE,
[B_MSG_SET_SEA_OF_FIRE] = STRINGID_SEAOFFIREENVELOPEDSIDE,
[B_MSG_SET_SWAMP] = STRINGID_SWAMPENVELOPEDSIDE,
};

const u16 gTerrainStringIds[B_MSG_TERRAIN_COUNT] =
Expand Down
2 changes: 1 addition & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -16988,7 +16988,7 @@ void BS_SetRemoveTerrain(void)
{
u32 atkHoldEffect = GetBattlerHoldEffect(gBattlerAttacker, TRUE);

gFieldStatuses &= ~(STATUS_FIELD_TERRAIN_ANY | STATUS_FIELD_TERRAIN_PERMANENT);
gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY;
gFieldStatuses |= statusFlag;
gFieldTimers.terrainTimer = (atkHoldEffect == HOLD_EFFECT_TERRAIN_EXTENDER) ? 8 : 5;
gBattlescriptCurrInstr = cmd->nextInstr;
Expand Down
Loading

0 comments on commit af19b13

Please sign in to comment.