From 0509d985bdeb518b445ea90d49813b862e0cb6b5 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 29 Aug 2025 15:44:26 +0200 Subject: [PATCH] more externs --- include/move_orb_actions_1.h | 4 +-- src/dungeon_damage.c | 15 ++-------- src/dungeon_item_action.c | 4 +-- src/dungeon_main.c | 1 - src/dungeon_menu_team.c | 1 - src/dungeon_misc.c | 3 +- src/dungeon_mon_spawn.c | 1 - src/dungeon_move.c | 10 +++---- src/move_orb_actions_1.c | 57 ++++++++++++++++++------------------ src/move_orb_actions_2.c | 22 +++++++------- src/move_orb_actions_3.c | 27 ++++++++--------- src/move_orb_actions_4.c | 10 +++---- src/move_orb_effects_2.c | 9 ++---- src/trap.c | 8 ++--- 14 files changed, 78 insertions(+), 94 deletions(-) diff --git a/include/move_orb_actions_1.h b/include/move_orb_actions_1.h index 02df68fb0..4d33225fc 100644 --- a/include/move_orb_actions_1.h +++ b/include/move_orb_actions_1.h @@ -79,7 +79,7 @@ bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern const s32 gUnknown_8106A4C[1]; -extern const s32 gUnknown_8106A50[1]; +extern const s32 gStatIndexAtkDef; +extern const s32 gStatIndexSpecial; #endif /* ifndef GUARD_MOVE_ORB_ACTIONS_1_H */ diff --git a/src/dungeon_damage.c b/src/dungeon_damage.c index f5b3a0176..c957b1f58 100644 --- a/src/dungeon_damage.c +++ b/src/dungeon_damage.c @@ -35,6 +35,7 @@ #include "code_804267C.h" #include "code_805D8C8.h" #include "dungeon_map_access.h" +#include "dungeon_data.h" #include "move_effects_target.h" #include "pokemon.h" #include "position_util.h" @@ -43,6 +44,7 @@ #include "exclusive_pokemon.h" #include "hurl_orb.h" #include "dungeon_mon_spawn.h" +#include "move_orb_actions_1.h" extern void sub_8041B18(Entity *pokemon); extern void sub_8041B90(Entity *pokemon); @@ -70,17 +72,6 @@ extern void sub_8042978(Entity *); extern void sub_804298C(Entity *); extern void sub_80428EC(Entity *); -extern const s32 gUnknown_8106A4C; -extern const u8 *const gUnknown_8100548; -extern const u8 *const gUnknown_80FD46C; -extern const u8 *const gUnknown_810056C; -extern const s16 gUnknown_810AC60; -extern const s16 gUnknown_810AC68; -extern const s16 gUnknown_810AC64; -extern const s16 gUnknown_810AC66; -extern const s16 gUnknown_810AC68; -extern const s16 gUnknown_810AC62; - static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struct DamageStruct *r5, bool32 isFalseSwipe, bool32 giveExp, s16 arg4_, s32 arg8); static bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, DamageStruct *dmgStruct); static void sub_806F500(void); @@ -128,7 +119,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * } if (GetEntInfo(target)->bideClassStatus.status == STATUS_ENRAGED) { - RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); + RaiseAttackStageTarget(attacker, target, gStatIndexAtkDef, 1); } if (!EntityIsValid(attacker) || !EntityIsValid(target)) diff --git a/src/dungeon_item_action.c b/src/dungeon_item_action.c index 6908acae6..41cbdf762 100644 --- a/src/dungeon_item_action.c +++ b/src/dungeon_item_action.c @@ -947,8 +947,8 @@ static void GrimyFoodItemAction(Entity *pokemon, Entity * target) ParalyzeStatusTarget(pokemon, target, TRUE); break; case 4: - LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 3, 1, TRUE); - LowerAttackStageTarget(pokemon, target, gUnknown_8106A50[0], 3, 1, TRUE); + LowerAttackStageTarget(pokemon, target, gStatIndexAtkDef, 3, 1, TRUE); + LowerAttackStageTarget(pokemon, target, gStatIndexSpecial, 3, 1, TRUE); break; } } diff --git a/src/dungeon_main.c b/src/dungeon_main.c index a5bf17fbf..d015f28e1 100644 --- a/src/dungeon_main.c +++ b/src/dungeon_main.c @@ -60,7 +60,6 @@ #include "dungeon_item_action.h" extern void HandleUnsetItemAction(Entity *,bool8); -extern void sub_806A6E8(Entity *); extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); void TryPointCameraToMonster(Entity *a0, u8 a1); bool8 sub_80701A4(Entity *a0); diff --git a/src/dungeon_menu_team.c b/src/dungeon_menu_team.c index 13d539594..12168a4c7 100644 --- a/src/dungeon_menu_team.c +++ b/src/dungeon_menu_team.c @@ -46,7 +46,6 @@ #include "text_2.h" #include "weather.h" -extern void sub_806A6E8(Entity *); extern void TryTriggerTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); bool8 sub_805E874(void); bool8 sub_80701A4(Entity *a0); diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index e9c37c13f..12f3f2fc9 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -48,11 +48,11 @@ #include "dungeon_engine.h" #include "dungeon_cutscene.h" #include "dungeon_mon_spawn.h" +#include "dungeon_info.h" static void EnsureCastformLoaded(void); static void EnsureDeoxysLoaded(void); -extern bool8 IsLevelResetDungeon(u8 dungeon); extern bool8 sub_806A58C(s16 r0); extern void sub_8078084(Entity * pokemon); extern void sub_808DFDC(s32 a1, DungeonMon* a2); @@ -61,7 +61,6 @@ extern bool8 sub_8070F80(Entity * pokemon, s32 direction); extern s32 sub_806A4DC(EntityInfo *info); extern void sub_8042900(Entity *r0); extern void sub_8042968(Entity *r0); -extern void EndAbilityImmuneStatus(Entity *, Entity *); extern void sub_8041BBC(Entity *r0); extern void sub_804178C(u32); extern void sub_8042B20(Entity *entity); diff --git a/src/dungeon_mon_spawn.c b/src/dungeon_mon_spawn.c index b319a3f3b..72e2df9b5 100644 --- a/src/dungeon_mon_spawn.c +++ b/src/dungeon_mon_spawn.c @@ -40,7 +40,6 @@ extern void sub_8042900(Entity *r0); extern void sub_8042968(Entity *r0); -extern void EndAbilityImmuneStatus(Entity *, Entity *); void sub_8041BBC(Entity *r0); extern void sub_804178C(u32); extern void sub_8042B20(Entity *entity); diff --git a/src/dungeon_move.c b/src/dungeon_move.c index a3089db25..19c5d24c5 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -492,16 +492,16 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, moveHadEffect = PoisonStingMoveAction(attacker, currTarget, move, itemId); break; case MOVE_PSYCHIC: - moveHadEffect = sub_8058C98(attacker, currTarget, move, gUnknown_8106A50[0], itemId); + moveHadEffect = sub_8058C98(attacker, currTarget, move, gStatIndexSpecial, itemId); break; case MOVE_ACID: - moveHadEffect = sub_8058C98(attacker, currTarget, move, gUnknown_8106A4C[0], itemId); + moveHadEffect = sub_8058C98(attacker, currTarget, move, gStatIndexAtkDef, itemId); break; case MOVE_METAL_CLAW: - moveHadEffect = MetalClawMoveAction(attacker, currTarget, move, gUnknown_8106A4C[0], itemId); + moveHadEffect = MetalClawMoveAction(attacker, currTarget, move, gStatIndexAtkDef, itemId); break; case MOVE_STEEL_WING: - moveHadEffect = SteelWingMoveAction(attacker, currTarget, move, gUnknown_8106A4C[0], itemId); + moveHadEffect = SteelWingMoveAction(attacker, currTarget, move, gStatIndexAtkDef, itemId); break; case MOVE_POISON_TAIL: moveHadEffect = PoisonTailMoveAction(attacker, currTarget, move, itemId); @@ -1342,7 +1342,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, } if (EntityIsValid(attacker) && GetEntInfo(attacker)->unk155 != 0) { GetEntInfo(attacker)->unk155 = 0; - LowerAttackStageTarget(attacker, attacker, gUnknown_8106A50[0], 2, 0, FALSE); + LowerAttackStageTarget(attacker, attacker, gStatIndexSpecial, 2, 0, FALSE); } } } diff --git a/src/move_orb_actions_1.c b/src/move_orb_actions_1.c index 2d4ae52b7..dd34d3138 100644 --- a/src/move_orb_actions_1.c +++ b/src/move_orb_actions_1.c @@ -34,10 +34,6 @@ #include "dungeon_damage.h" #include "move_util.h" -// Note: For some reason I have to define these as an array of 1 to match asm. -const s32 gUnknown_8106A4C[1] = {0}; -const s32 gUnknown_8106A50[1] = {1}; - bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -46,15 +42,13 @@ bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_ if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gIronTailSecondaryChance)) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1, 1, FALSE); + LowerDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 1, 1, FALSE); } } return flag; } -static const s24_8 sRolloutModifiers[] = { - IntToF248_2(1.0), IntToF248_2(1.0), IntToF248_2(1.5), IntToF248_2(2.0), IntToF248_2(2.5), IntToF248_2(3.0), IntToF248_2(3.5), IntToF248_2(4.0), IntToF248_2(4.5), IntToF248_2(5.0) -}; +static const s24_8 sRolloutModifiers[]; bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4) { @@ -126,13 +120,13 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A50[0],TRUE); + LowerAccuracyStageTarget(pokemon,target,gStatIndexSpecial,TRUE); return TRUE; } bool8 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C[0],FloatToF248(0.5),TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gStatIndexAtkDef,FloatToF248(0.5),TRUE); return TRUE; } @@ -297,7 +291,7 @@ bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ConfuseStatusTarget(pokemon, target, TRUE); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 2); + RaiseAttackStageTarget(pokemon, target, gStatIndexAtkDef, 2); return TRUE; } @@ -322,7 +316,7 @@ bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4) bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - ChangeDefenseMultiplierTarget(pokemon, target, gUnknown_8106A4C[0], FloatToF248(0.25), 1); + ChangeDefenseMultiplierTarget(pokemon, target, gStatIndexAtkDef, FloatToF248(0.25), 1); return TRUE; } @@ -377,7 +371,7 @@ bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, s32 pa bool8 FakeTearsMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 2, 1, TRUE); + LowerDefenseStageTarget(pokemon, target, gStatIndexSpecial, 2, 1, TRUE); return TRUE; } @@ -451,7 +445,7 @@ bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para flag = TRUE; if(sub_805727C(pokemon, target, gAuroraBeamAtkLowerChance)) { - ChangeAttackMultiplierTarget(pokemon, target, gUnknown_8106A4C[0], FloatToF248(0.5), FALSE); + ChangeAttackMultiplierTarget(pokemon, target, gStatIndexAtkDef, FloatToF248(0.5), FALSE); } } return flag; @@ -463,8 +457,8 @@ bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 entityInfo = GetEntInfo(pokemon); entityInfo->HP = 1; - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C[0],FloatToF248(0.25),TRUE); - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50[0],FloatToF248(0.25),TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gStatIndexAtkDef,FloatToF248(0.25),TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gStatIndexSpecial,FloatToF248(0.25),TRUE); entityInfo->unk154 = 1; return TRUE; } @@ -478,7 +472,7 @@ bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param flag = TRUE; if(sub_805727C(pokemon, target, gOctazookaAccLowerChance)) { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C[0], FALSE); + LowerAccuracyStageTarget(pokemon, target, gStatIndexAtkDef, FALSE); } } return flag; @@ -487,7 +481,7 @@ bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ConfuseStatusTarget(pokemon, target, TRUE); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexSpecial, 1); return TRUE; } @@ -601,7 +595,7 @@ bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50[0]); + RaiseAccuracyStageTarget(pokemon, target, gStatIndexSpecial); return TRUE; } @@ -622,7 +616,7 @@ bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) // NOTE: Is there a better name for this? bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + RaiseDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 1); return TRUE; } @@ -635,7 +629,7 @@ bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 // NOTE: Is there a better name for this? bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexAtkDef, 1); return TRUE; } @@ -685,7 +679,7 @@ bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para flag = TRUE; if(sub_805727C(pokemon, target, gShadowBallSecondaryChance)) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1, 1, FALSE); + LowerDefenseStageTarget(pokemon, target, gStatIndexSpecial, 1, 1, FALSE); } } return flag; @@ -882,13 +876,13 @@ bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, s32 bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 3, 1, TRUE); + LowerDefenseStageTarget(pokemon, target, gStatIndexSpecial, 3, 1, TRUE); return TRUE; } bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - s32 index = gUnknown_8106A4C[0]; + s32 index = gStatIndexAtkDef; LowerAttackStageTarget(pokemon, target, index, 1, 1, TRUE); LowerDefenseStageTarget(pokemon, target, index, 1, 1, TRUE); return TRUE; @@ -944,9 +938,9 @@ bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 pa { entityInfo = GetEntInfo(pokemon); RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE); - index1 = gUnknown_8106A4C[0]; + index1 = gStatIndexAtkDef; RaiseAttackStageTarget(pokemon, pokemon, index1, 1); - index2 = gUnknown_8106A50[0]; + index2 = gStatIndexSpecial; RaiseAttackStageTarget(pokemon, pokemon, index2, 1); RaiseDefenseStageTarget(pokemon, pokemon, index1, 1); RaiseDefenseStageTarget(pokemon, pokemon, index2, 1); @@ -990,8 +984,15 @@ bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_ bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + RaiseDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 1); + RaiseDefenseStageTarget(pokemon, target, gStatIndexSpecial, 1); return TRUE; } +// Put all the way below for matching. +const s32 gStatIndexAtkDef = 0; +const s32 gStatIndexSpecial = 1; + +static const s24_8 sRolloutModifiers[] = { + IntToF248_2(1.0), IntToF248_2(1.0), IntToF248_2(1.5), IntToF248_2(2.0), IntToF248_2(2.5), IntToF248_2(3.0), IntToF248_2(3.5), IntToF248_2(4.0), IntToF248_2(4.5), IntToF248_2(5.0) +}; diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index a357db337..83fa74473 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -19,6 +19,7 @@ #include "dungeon_random.h" #include "dungeon_util.h" #include "dungeon_move.h" +#include "dungeon_misc.h" #include "move_effects_target.h" #include "moves.h" #include "number_util.h" @@ -36,7 +37,6 @@ #include "warp_target.h" #include "explosion.h" -extern void EndAbilityImmuneStatus(Entity *, Entity *); extern void nullsub_92(Entity *); bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) @@ -86,7 +86,7 @@ bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para if(sub_805727C(pokemon, pokemon, gMeteorMashSecondaryChance)) { entityInfo = GetEntInfo(pokemon); - RaiseAttackStageTarget(pokemon, pokemon, gUnknown_8106A4C[0], 1); + RaiseAttackStageTarget(pokemon, pokemon, gStatIndexAtkDef, 1); SetExpMultplier(entityInfo); } } @@ -160,7 +160,7 @@ bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par flag = TRUE; if(RollSecondaryEffect(pokemon, 0)) { - LowerAttackStageTarget(pokemon, pokemon, gUnknown_8106A50[0], 2, 0, FALSE); + LowerAttackStageTarget(pokemon, pokemon, gStatIndexSpecial, 2, 0, FALSE); } } return flag; @@ -538,7 +538,7 @@ bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C[0], TRUE); + LowerAccuracyStageTarget(pokemon, target, gStatIndexAtkDef, TRUE); return TRUE; } @@ -559,7 +559,7 @@ bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexSpecial, 1); return TRUE; } @@ -678,7 +678,7 @@ bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para flag = TRUE; if(sub_805727C(pokemon, target, gMuddyWaterAccLowerChance)) { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C[0], FALSE); + LowerAccuracyStageTarget(pokemon, target, gStatIndexAtkDef, FALSE); } } return flag; @@ -738,7 +738,7 @@ bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50[0]); + RaiseAccuracyStageTarget(pokemon, target, gStatIndexSpecial); return TRUE; } @@ -790,7 +790,7 @@ bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 2); + RaiseAttackStageTarget(pokemon, target, gStatIndexAtkDef, 2); return TRUE; } @@ -853,8 +853,8 @@ bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par TryDisplayDungeonLoggableMessage3(target, target, gUnknown_80FEB60); } else { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50[0], 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexAtkDef, 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexSpecial, 1); flag = TRUE; } return flag; @@ -862,7 +862,7 @@ bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 2); + RaiseDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 2); return TRUE; } diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c index 2d2241d76..6f59d2c79 100644 --- a/src/move_orb_actions_3.c +++ b/src/move_orb_actions_3.c @@ -46,7 +46,6 @@ #include "warp_target.h" static void sub_805A7D4(Entity *, Entity *, Item *, DungeonPos *); -extern void sub_806A6E8(Entity *); bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { @@ -257,7 +256,7 @@ bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 flag = TRUE; if(sub_805727C(pokemon, target, 0)) { - LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C[0], FALSE); + LowerAccuracyStageTarget(pokemon, target, gStatIndexAtkDef, FALSE); } } return flag; @@ -270,13 +269,13 @@ bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 2); + RaiseDefenseStageTarget(pokemon, target, gStatIndexSpecial, 2); return TRUE; } bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1, 1, TRUE); + LowerAttackStageTarget(pokemon, target, gStatIndexAtkDef, 1, 1, TRUE); return TRUE; } @@ -333,7 +332,7 @@ bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_ bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1, 1, TRUE); + LowerDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 1, 1, TRUE); return TRUE; } @@ -441,7 +440,7 @@ bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,pokemon,0) != 0) { - stat = gUnknown_8106A4C[0]; + stat = gStatIndexAtkDef; LowerAttackStageTarget(pokemon,pokemon,stat,1,0,FALSE); LowerDefenseStageTarget(pokemon,pokemon,stat,1,0,FALSE); } @@ -672,7 +671,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, s32 para info = GetEntInfo(pokemon); flag = FALSE; if (FixedPointToInt(info->belly) > 1) { - RaiseAttackStageTarget(pokemon,target,gUnknown_8106A4C[0],99); + RaiseAttackStageTarget(pokemon,target,gStatIndexAtkDef,99); info->belly = IntToFixedPoint(1); flag = TRUE; } @@ -708,13 +707,13 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, s32 p LowerMovementSpeedTarget(pokemon,target,1,FALSE); break; case 3: - LowerAttackStageTarget(pokemon,target,gUnknown_8106A4C[0],1,1,FALSE); + LowerAttackStageTarget(pokemon,target,gStatIndexAtkDef,1,1,FALSE); break; case 4: - LowerDefenseStageTarget(pokemon,target,gUnknown_8106A4C[0],1,1,FALSE); + LowerDefenseStageTarget(pokemon,target,gStatIndexAtkDef,1,1,FALSE); break; case 5: - LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A4C[0],FALSE); + LowerAccuracyStageTarget(pokemon,target,gStatIndexAtkDef,FALSE); break; case 6: ConfuseStatusTarget(pokemon,target,FALSE); @@ -748,7 +747,7 @@ bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - s32 stat = gUnknown_8106A4C[0]; + s32 stat = gStatIndexAtkDef; RaiseAttackStageTarget(pokemon, target, stat, 1); RaiseDefenseStageTarget(pokemon, target, stat, 1); return TRUE; @@ -762,7 +761,7 @@ bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 2, 1, TRUE); + LowerAttackStageTarget(pokemon, target, gStatIndexAtkDef, 2, 1, TRUE); return TRUE; } @@ -821,7 +820,7 @@ bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, s32 par if ( HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gCrushClawSecondaryChance) != 0) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1, 1, FALSE); + LowerDefenseStageTarget(pokemon, target, gStatIndexAtkDef, 1, 1, FALSE); } } return flag; @@ -961,7 +960,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target, Move *move, s32 param bool8 TailGlowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - RaiseAttackStageTarget(pokemon,target,gUnknown_8106A50[0], 2); + RaiseAttackStageTarget(pokemon,target,gStatIndexSpecial, 2); return TRUE; } diff --git a/src/move_orb_actions_4.c b/src/move_orb_actions_4.c index 677c6e415..8af091543 100644 --- a/src/move_orb_actions_4.c +++ b/src/move_orb_actions_4.c @@ -56,7 +56,7 @@ bool8 ProtectMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4 bool8 DefenseCurlMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) { - RaiseDefenseStageTarget(pokemon,target,gUnknown_8106A4C[0],1); + RaiseDefenseStageTarget(pokemon,target,gStatIndexAtkDef,1); return TRUE; } @@ -74,7 +74,7 @@ bool8 MistBallMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_ if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gMistBallSecondaryChance) != 0) { - LowerAttackStageTarget(pokemon,target,gUnknown_8106A50[0],1,1,0); + LowerAttackStageTarget(pokemon,target,gStatIndexSpecial,1,1,0); } } return flag; @@ -99,7 +99,7 @@ bool8 MirrorCoatMoveAction(Entity * pokemon,Entity * target,Move *move, s32 para bool8 CalmMindMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4) { - u32 stat = gUnknown_8106A50[0]; + u32 stat = gStatIndexSpecial; RaiseAttackStageTarget(pokemon,target,stat,1); RaiseDefenseStageTarget(pokemon,target,stat,1); return TRUE; @@ -303,7 +303,7 @@ bool8 DragonRageMoveAction(Entity * pokemon, Entity * target, Move *move, s32 pa bool8 DragonDanceMoveAction( Entity * pokemon, Entity * target, Move *move, s32 param_4) { - RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); + RaiseAttackStageTarget(pokemon, target, gStatIndexAtkDef, 1); RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); return TRUE; } @@ -332,7 +332,7 @@ bool8 LusterPurgeMoveAction(Entity * pokemon, Entity * target, Move * move, s32 flag = TRUE; if(sub_805727C(pokemon, target, gLusterPurgeSecondaryChance)) { - LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1, 1, 0); + LowerDefenseStageTarget(pokemon, target, gStatIndexSpecial, 1, 1, 0); } } return flag; diff --git a/src/move_orb_effects_2.c b/src/move_orb_effects_2.c index 070f95671..7c929a32f 100644 --- a/src/move_orb_effects_2.c +++ b/src/move_orb_effects_2.c @@ -27,8 +27,7 @@ #include "dungeon_floor_spawns.h" #include "dungeon_tilemap.h" #include "pokemon_3.h" - -extern u32 gUnknown_8106A4C; +#include "move_orb_actions_1.h" extern void sub_8041D84(Entity *); extern void sub_804178C(u32); @@ -557,7 +556,6 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) void CurseStatusTarget(Entity *pokemon, Entity * target) { - u32 statStage; s32 HP; EntityInfo * pokemonEntityData; EntityInfo * targetEntityInfo; @@ -586,9 +584,8 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB004); } else { - statStage = gUnknown_8106A4C; - RaiseAttackStageTarget(pokemon,pokemon,statStage,1); - RaiseDefenseStageTarget(pokemon,pokemon,statStage,1); + RaiseAttackStageTarget(pokemon,pokemon,gStatIndexAtkDef,1); + RaiseDefenseStageTarget(pokemon,pokemon,gStatIndexAtkDef,1); LowerMovementSpeedTarget(pokemon,pokemon,1,TRUE); } EntityUpdateStatusSprites(target); diff --git a/src/trap.c b/src/trap.c index cbdfdcc1b..d426f90d8 100644 --- a/src/trap.c +++ b/src/trap.c @@ -415,16 +415,16 @@ void HandleMudTrap(Entity *pokemon, Entity *target) rand = DungeonRandInt(100); randDef = rand; if (rand < 25) { - LowerAttackStageTarget(pokemon,target,gUnknown_8106A4C[0],1,1,1); + LowerAttackStageTarget(pokemon,target,gStatIndexAtkDef,1,1,1); } else if (rand < 50) { - LowerAttackStageTarget(pokemon,target,gUnknown_8106A50[0],1,1,1); + LowerAttackStageTarget(pokemon,target,gStatIndexSpecial,1,1,1); } else if (randDef < 75) { - LowerDefenseStageTarget(pokemon,target,gUnknown_8106A4C[0],1,1,1); + LowerDefenseStageTarget(pokemon,target,gStatIndexAtkDef,1,1,1); } else { - LowerDefenseStageTarget(pokemon,target,gUnknown_8106A50[0],1,1,1); + LowerDefenseStageTarget(pokemon,target,gStatIndexSpecial,1,1,1); } }