From d4c0f5a8f5d4edc7b6b692136b7910fd350029bb Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Thu, 26 Jun 2025 00:22:23 -0400 Subject: [PATCH] Rename some symbols --- asm/include/overlay_29_0230F9A4.inc | 2 +- asm/include/overlay_29_02325644.inc | 2 +- asm/include/overlay_29_02328030.inc | 2 +- asm/include/overlay_29_02332A0C.inc | 4 ++-- asm/overlay_29_022ECDE4.s | 6 +++--- asm/overlay_29_0230F9A4.s | 2 +- asm/overlay_29_02325644.s | 4 ++-- asm/overlay_29_02328030.s | 2 +- asm/overlay_29_02332A0C.s | 6 +++--- asm/overlay_29_02337CCC.s | 6 +++--- include/dungeon.h | 4 +++- include/dungeon_mode.h | 9 +++++++++ include/enums.h | 8 -------- src/dungeon_ai_item_weight.c | 2 +- 14 files changed, 31 insertions(+), 28 deletions(-) diff --git a/asm/include/overlay_29_0230F9A4.inc b/asm/include/overlay_29_0230F9A4.inc index 2578941c..36ab001b 100644 --- a/asm/include/overlay_29_0230F9A4.inc +++ b/asm/include/overlay_29_0230F9A4.inc @@ -68,7 +68,7 @@ .public ov29_022FB718 .public ov29_02307BDC .public ov29_02322374 -.public ov29_02337E2C +.public IsTileGround .public ov29_02344B9C .public ov29_023460DC .public ov29_02347184 diff --git a/asm/include/overlay_29_02325644.inc b/asm/include/overlay_29_02325644.inc index d6065004..5de2c26c 100644 --- a/asm/include/overlay_29_02325644.inc +++ b/asm/include/overlay_29_02325644.inc @@ -74,7 +74,7 @@ .public ov29_02318D58 .public ov29_02318D98 .public ov29_02332F18 -.public ov29_02337E2C +.public IsTileGround .public ov29_0234B034 .public ov29_0234BA54 .public ov29_02352AD8 diff --git a/asm/include/overlay_29_02328030.inc b/asm/include/overlay_29_02328030.inc index be0f0ba5..c9534aa3 100644 --- a/asm/include/overlay_29_02328030.inc +++ b/asm/include/overlay_29_02328030.inc @@ -65,7 +65,7 @@ .public ov29_02318BBC .public ov29_02318D58 .public ov29_0232A834 -.public ov29_02337E2C +.public IsTileGround .public ov29_0234B034 .public ov29_0234B084 .public ov29_0234C738 diff --git a/asm/include/overlay_29_02332A0C.inc b/asm/include/overlay_29_02332A0C.inc index 959b8785..88c2f67c 100644 --- a/asm/include/overlay_29_02332A0C.inc +++ b/asm/include/overlay_29_02332A0C.inc @@ -30,10 +30,10 @@ .public abs .public ov10_022C6322 .public ov29_022E576C -.public ov29_022EDC30 +.public CanLayTrap .public ov29_0230040C .public ov29_023007DC .public ov29_02304A48 .public ov29_0230D088 -.public ov29_02337E2C +.public IsTileGround .public ov29_0234B034 diff --git a/asm/overlay_29_022ECDE4.s b/asm/overlay_29_022ECDE4.s index a16acbfc..67696500 100644 --- a/asm/overlay_29_022ECDE4.s +++ b/asm/overlay_29_022ECDE4.s @@ -1095,8 +1095,8 @@ _022EDC28: .word DUNGEON_PTR _022EDC2C: .word 0x00012AAA + PREPARE_TRAPPER_TRAP_OFFSET arm_func_end PrepareTrapperTrap - arm_func_start ov29_022EDC30 -ov29_022EDC30: ; 0x022EDC30 + arm_func_start CanLayTrap +CanLayTrap: ; 0x022EDC30 stmdb sp!, {r3, lr} mov r1, r0 ldrsh r0, [r1] @@ -1133,7 +1133,7 @@ ov29_022EDC30: ; 0x022EDC30 _022EDCB4: mov r0, #1 ldmia sp!, {r3, pc} - arm_func_end ov29_022EDC30 + arm_func_end CanLayTrap arm_func_start TrySpawnTrap TrySpawnTrap: ; 0x022EDCBC diff --git a/asm/overlay_29_0230F9A4.s b/asm/overlay_29_0230F9A4.s index b6fd375f..586d5f86 100644 --- a/asm/overlay_29_0230F9A4.s +++ b/asm/overlay_29_0230F9A4.s @@ -876,7 +876,7 @@ _023105DC: _02310614: mov r0, r5 bl GetTileAtEntity - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 bne _023106A4 ldrsh r2, [r4, #0x12] diff --git a/asm/overlay_29_02325644.s b/asm/overlay_29_02325644.s index a1cb4f8e..501b65a6 100644 --- a/asm/overlay_29_02325644.s +++ b/asm/overlay_29_02325644.s @@ -514,7 +514,7 @@ ov29_02325D20: ; 0x02325D20 cmp r1, #0x9c bne _02325D4C bl GetTileAtEntity - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 movne r0, #1 ldmneia sp!, {r3, r4, r5, pc} @@ -733,7 +733,7 @@ DoMoveDig: ; 0x02325FC4 mov r4, #0 bl GetTileAtEntity mov sb, r0 - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 beq _02326000 ldrh r0, [sb] diff --git a/asm/overlay_29_02328030.s b/asm/overlay_29_02328030.s index 3d9721fd..3ac80100 100644 --- a/asm/overlay_29_02328030.s +++ b/asm/overlay_29_02328030.s @@ -1219,7 +1219,7 @@ DoMoveDive: ; 0x02328ECC mov r5, r3 mov r4, #0 bl GetTileAtEntity - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 beq _02328F0C ldr r2, _02328F88 ; =0x00000ED8 diff --git a/asm/overlay_29_02332A0C.s b/asm/overlay_29_02332A0C.s index edea9988..069cd9c8 100644 --- a/asm/overlay_29_02332A0C.s +++ b/asm/overlay_29_02332A0C.s @@ -1204,7 +1204,7 @@ _023339B0: ldmia sp!, {r3, r4, r5, r6, r7, pc} _023339D8: bl GetTileAtEntity - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 beq _02333F90 mov r0, #0 @@ -1212,7 +1212,7 @@ _023339D8: _023339F0: bl GetTileAtEntity mov r4, r0 - bl ov29_02337E2C + bl IsTileGround cmp r0, #0 beq _02333A14 ldrh r0, [r4] @@ -1326,7 +1326,7 @@ _02333B60: ldmia sp!, {r3, r4, r5, r6, r7, pc} _02333B84: add r0, r4, #4 - bl ov29_022EDC30 + bl CanLayTrap cmp r0, #0 bne _02333F90 mov r0, #0 diff --git a/asm/overlay_29_02337CCC.s b/asm/overlay_29_02337CCC.s index 015e996f..fb97a0cc 100644 --- a/asm/overlay_29_02337CCC.s +++ b/asm/overlay_29_02337CCC.s @@ -111,8 +111,8 @@ _02337E0C: _02337E28: .word DUNGEON_PTR arm_func_end ov29_02337D68 - arm_func_start ov29_02337E2C -ov29_02337E2C: ; 0x02337E2C + arm_func_start IsTileGround +IsTileGround: ; 0x02337E2C stmdb sp!, {r3, r4, r5, lr} mov r5, r0 mov r4, #0 @@ -147,7 +147,7 @@ _02337E84: .align 2, 0 _02337E8C: .word DUNGEON_PTR _02337E90: .word SECONDARY_TERRAIN_TYPES - arm_func_end ov29_02337E2C + arm_func_end IsTileGround arm_func_start IsWaterTileset IsWaterTileset: ; 0x02337E94 diff --git a/include/dungeon.h b/include/dungeon.h index 528acb0b..9b6723c1 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -6,16 +6,18 @@ #include "item.h" #define MAX_TEAM_MEMBERS 4 +#define DUNGEON_MAX_WILD_POKEMON 16 #define DUNGEON_MAX_POKEMON 20 #define DUNGEON_MAX_SIZE_X 56 #define DUNGEON_MAX_SIZE_Y 32 -enum TerrainType +enum terrain_type { // These 3 seem to indicate the 'main' type of the terrain. See helper functions for how they're set. TERRAIN_TYPE_WALL = 0, // x0 When neither TERRAIN_TYPE_NORMAL nor TERRAIN_TYPE_SECONDARY are set TERRAIN_TYPE_NORMAL = 1 << 0, // x1 TERRAIN_TYPE_SECONDARY = 1 << 1, // Water or lava depending on the dungeon. x2 + TERRAIN_TYPE_CHASM = 3, TERRAIN_TYPE_IMPASSABLE_WALL = 1 << 4, // x10 }; diff --git a/include/dungeon_mode.h b/include/dungeon_mode.h index 495fedca..6b0c4442 100644 --- a/include/dungeon_mode.h +++ b/include/dungeon_mode.h @@ -10,8 +10,17 @@ #define NUM_PICKED_IQ_SKILLS 3 #define MAX_MON_MOVES 4 +#define MAX_STAT_STAGE 20 #define MAX_SPEED_STAGE 4 #define NUM_SPEED_COUNTERS 5 +#define MAX_STOCKPILE_STAGE 3 + +#define STAT_STAGE_ATK 0 +#define STAT_STAGE_SP_ATK 1 +#define STAT_STAGE_DEF 0 +#define STAT_STAGE_SP_DEF 1 +#define STAT_STAGE_ACCURACY 0 +#define STAT_STAGE_EVASION 1 // Used in various contexts, like with entity positions in the dungeon struct position { diff --git a/include/enums.h b/include/enums.h index a53ebc52..d36c2d12 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1,14 +1,6 @@ #ifndef PMDSKY_ENUMS_H #define PMDSKY_ENUMS_H -// Terrain type for a tile -enum terrain_type { - TERRAIN_WALL = 0, - TERRAIN_NORMAL = 1, - TERRAIN_SECONDARY = 2, // Water or lava - TERRAIN_CHASM = 3, -}; - // Tactic ID. These are usually encoded as bitvectors. enum tactic_id { TACTIC_LETS_GO_TOGETHER = 0, diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index 1d9ee38e..a1cd6cf2 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -305,7 +305,7 @@ u32 GetAiUseItemProbability(struct entity *item_consumer, struct item *item, u32 item_weight = 0; break; case ITEM_VIOLENT_SEED: - if (pokemon_info->stat_modifiers.offensive_stages[1] >= 20) + if (pokemon_info->stat_modifiers.offensive_stages[STAT_STAGE_SP_ATK] >= 20) item_weight = 0; else item_weight = 80;