diff --git a/include/common_structs.h b/include/common_structs.h index 780cf49b7d..fd41e679f6 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -137,7 +137,7 @@ typedef struct Npc { /* 0x0A6 */ s16 collisionRadius; /* 0x0A8 */ s16 collisionHeight; /* 0x0AA */ u8 renderMode; - /* 0x0AB */ u8 unk_AB; + /* 0x0AB */ s8 unk_AB; /* 0x0AC */ u8 unk_AC; /* 0x0AD */ char unk_AD[3]; /* 0x0B0 */ s32 unk_B0; diff --git a/include/enums.h b/include/enums.h index ef7c1c4918..6ce35183fd 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1504,4 +1504,28 @@ enum Areas { AREA_TST, }; +enum NpcFlags { + NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle + NPC_FLAG_4 = 0x00000004, + NPC_FLAG_ENABLE_HIT_SCRIPT = 0x00000008, + NPC_FLAG_10 = 0x00000010, // TODO (shadow-related?) + NPC_FLAG_NO_AI = 0x00000020, ///< Disable movement AI and collision (idle animation plays) + NPC_FLAG_80 = 0x00000080, // TODO + NPC_FLAG_100 = 0x00000100, // TODO + NPC_FLAG_200 = 0x00000200, // TODO (enable gravity?) + NPC_FLAG_LOCK_ANIMS = 0x00000400, ///< Do not allow scripts to change animation + NPC_FLAG_IGNORE_HEIGHT = 0x00000800, ///< Causes NpcMoveTo() to ignore stairs + NPC_FLAG_NO_PROJECT_SHADOW = 0x00002000, ///< Draw shadow at base of sprite instead of projecting to ground + NPC_FLAG_4000 = 0x00004000, + NPC_FLAG_8000 = 0x00008000, + NPC_FLAG_10000 = 0x00010000, + NPC_FLAG_INVISIBLE = 0x00020000, ///< Invisible sprite (shadow and particles still render) (TODO: possibly causes loading of player sprites instead?) + NPC_FLAG_40000 = 0x00040000, + NPC_FLAG_200000 = 0x00200000, + NPC_FLAG_400000 = 0x00400000, + NPC_FLAG_NO_DROPS = 0x00800000, ///< Do not drop hearts, flowers, or coins on defeat + NPC_FLAG_40000000 = 0x40000000, + NPC_FLAG_80000000 = 0x80000000, +}; + #endif diff --git a/include/map.h b/include/map.h index efec43c35a..baf263fcfd 100644 --- a/include/map.h +++ b/include/map.h @@ -9,7 +9,7 @@ #define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f)) -typedef Vec4f EntryList[0]; +typedef Vec4f EntryList[]; /// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads. typedef struct MapConfig { @@ -124,7 +124,7 @@ typedef struct StatDrop { /* 0x06 */ s16 chancePerAttempt; ///< % chance for a single heart/flower to be dropped from each attempt. } StatDrop; // size = 0x08 -#define NO_DROPS { F16(100), F16(0), 0, F16(0) } +#define NO_DROPS { { F16(100), F16(0), 0, F16(0) }, } #define STANDARD_HEART_DROPS(attempts) { \ { F16(20), F16(70), attempts, F16(50) }, \ @@ -199,9 +199,11 @@ typedef struct StaticNpc { /* 0x1EC */ MessageID tattle; } StaticNpc; // size = 0x1F0 -typedef struct EnemyTerritoryThing { +enum TerritoryShape { SHAPE_CYLINDER, SHAPE_RECT }; + +typedef struct { /* 0x00 */ s32 unk_00; - /* 0x04 */ s32 shape; + /* 0x04 */ enum TerritoryShape shape; /* 0x08 */ s32 pointX; /* 0x0C */ s32 pointZ; /* 0x10 */ s32 sizeX; @@ -210,19 +212,35 @@ typedef struct EnemyTerritoryThing { /* 0x1C */ s16 unk_1C; } EnemyTerritoryThing; // size = 0x20 -typedef struct EnemyTerritory { - /* 0x00 */ Vec3i unk_00; - /* 0x0C */ char unk_0C[0x8]; - /* 0x14 */ s32 unk_14; - /* 0x18 */ s32 unk_18; - /* 0x1C */ s32 pointX; - /* 0x20 */ s32 pointY; - /* 0x24 */ s32 pointZ; - /* 0x28 */ s32 sizeX; - /* 0x2C */ s32 sizeZ; - /* 0x30 */ s32 shape; - /* 0x34 */ s32 unk_34; -} EnemyTerritory; // size = ??? +typedef struct { + /* 0x00 */ Vec3i point; + /* 0x0C */ s32 wanderSizeX; + /* 0x10 */ s32 wanderSizeZ; + /* 0x14 */ s32 moveSpeedOverride; + /* 0x18 */ enum TerritoryShape wanderShape; + /* 0x1C */ Vec3i detect; + /* 0x28 */ s32 detectSizeX; + /* 0x2C */ s32 detectSizeZ; + /* 0x30 */ enum TerritoryShape detectShape; + /* 0x34 */ s32 isFlying; +} EnemyTerritoryWander; // size = 0x38 + +typedef struct { + /* 0x00 */ s32 numPoints; + /* 0x04 */ Vec3i points[10]; + /* 0x7C */ s32 moveSpeedOverride; + /* 0x80 */ Vec3i detect; + /* 0x8C */ s32 detectSizeX; + /* 0x90 */ s32 detectSizeZ; + /* 0x94 */ enum TerritoryShape detectShape; + /* 0x98 */ s32 isFlying; +} EnemyTerritoryPatrol; // size = 0x9C + +typedef union { + EnemyTerritoryWander wander; + EnemyTerritoryPatrol patrol; + char PADDING[0xC0]; +} EnemyTerritory; // size = 0xC0 typedef struct Enemy { /* 0x00 */ s32 flags; diff --git a/include/script_api/common.h b/include/script_api/common.h index 097ff0625a..7c6ed11cf1 100644 --- a/include/script_api/common.h +++ b/include/script_api/common.h @@ -261,6 +261,7 @@ ApiStatus DemoReleaseButton(ScriptInstance* script, s32 isInitialCall); ApiStatus DemoSetButtons(ScriptInstance* script, s32 isInitialCall); ApiStatus DemoJoystickRadial(ScriptInstance* script, s32 isInitialCall); ApiStatus DemoJoystickXY(ScriptInstance* script, s32 isInitialCall); +ApiStatus WaitForPlayerInputEnabled(ScriptInstance* script, s32 isInitialCall); ApiStatus func_802CFE2C(ScriptInstance* script, s32 isInitialCall); ApiStatus func_802CFD30(ScriptInstance* script, s32 isInitialCall); diff --git a/include/si.h b/include/si.h index efbce7912f..968018274e 100644 --- a/include/si.h +++ b/include/si.h @@ -110,6 +110,7 @@ typedef enum ScriptOpcode { #define SI_ARRAY(v) ((v - 190000000)) #define SI_ARRAY_FLAG(v) ((v - 210000000)) #define SI_FIXED(v) (((v * 1024.0f) + -230000000)) // See float_to_fixed_var +#define MAKE_ENTITY_END 0x80000000 #define STORY_PROGRESS SI_SAVE_VAR(0) #define WORLD_LOCATION SI_SAVE_VAR(425) diff --git a/include/types.h b/include/types.h index 1754b8d8eb..4bd31d098e 100644 --- a/include/types.h +++ b/include/types.h @@ -15,5 +15,5 @@ typedef s32 BattleID; typedef s32 NpcAnimID; #define NPC_ANIM(sprite, palette, anim) (((_NPC_SPRITE_##sprite << 16) + (_NPC_PALETTE_##sprite##_##palette << 8) + _NPC_ANIM_##sprite##_##anim)) - +#define ANIM_END -1 #endif diff --git a/python b/python new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/battle/item/coconut/lib.c b/src/battle/item/coconut/lib.c index b6b1587b62..8a0b6980f0 100644 --- a/src/battle/item/coconut/lib.c +++ b/src/battle/item/coconut/lib.c @@ -72,7 +72,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -138,7 +138,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/dizzy_dial/lib.c b/src/battle/item/dizzy_dial/lib.c index b65756d6ef..fa2fa1fa58 100644 --- a/src/battle/item/dizzy_dial/lib.c +++ b/src/battle/item/dizzy_dial/lib.c @@ -104,7 +104,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -168,7 +168,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/dried_shroom/lib.c b/src/battle/item/dried_shroom/lib.c index 43a3ced6a0..544bd62305 100644 --- a/src/battle/item/dried_shroom/lib.c +++ b/src/battle/item/dried_shroom/lib.c @@ -87,7 +87,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -151,7 +151,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/dusty_hammer/lib.c b/src/battle/item/dusty_hammer/lib.c index b027371500..566548bdd8 100644 --- a/src/battle/item/dusty_hammer/lib.c +++ b/src/battle/item/dusty_hammer/lib.c @@ -65,7 +65,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -129,7 +129,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/egg_missile/lib.c b/src/battle/item/egg_missile/lib.c index 17aafdbcdd..cdec1b1646 100644 --- a/src/battle/item/egg_missile/lib.c +++ b/src/battle/item/egg_missile/lib.c @@ -77,7 +77,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -141,7 +141,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/electro_pop/lib.c b/src/battle/item/electro_pop/lib.c index f3d9de7a37..3ea5fb960b 100644 --- a/src/battle/item/electro_pop/lib.c +++ b/src/battle/item/electro_pop/lib.c @@ -144,7 +144,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -208,7 +208,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/fire_flower/fire_flower.c b/src/battle/item/fire_flower/fire_flower.c index 1848a9ccee..03d78c35b5 100644 --- a/src/battle/item/fire_flower/fire_flower.c +++ b/src/battle/item/fire_flower/fire_flower.c @@ -24,7 +24,7 @@ Script N(main) = SCRIPT({ SetActorSpeed(ACTOR_PLAYER, 2.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); SetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); } spawn { diff --git a/src/battle/item/fire_flower/lib.c b/src/battle/item/fire_flower/lib.c index 16086704af..7918b90dc5 100644 --- a/src/battle/item/fire_flower/lib.c +++ b/src/battle/item/fire_flower/lib.c @@ -94,7 +94,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -158,7 +158,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/food/lib.c b/src/battle/item/food/lib.c index d89cb87afd..c9415138d4 100644 --- a/src/battle/item/food/lib.c +++ b/src/battle/item/food/lib.c @@ -151,7 +151,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -215,7 +215,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/fright_jar/lib.c b/src/battle/item/fright_jar/lib.c index 00f1f30e4c..beffdbd98e 100644 --- a/src/battle/item/fright_jar/lib.c +++ b/src/battle/item/fright_jar/lib.c @@ -83,7 +83,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -147,7 +147,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/hustle_drink/lib.c b/src/battle/item/hustle_drink/lib.c index 827eae540e..b37f90b706 100644 --- a/src/battle/item/hustle_drink/lib.c +++ b/src/battle/item/hustle_drink/lib.c @@ -97,7 +97,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -161,7 +161,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/insecticide_herb/lib.c b/src/battle/item/insecticide_herb/lib.c index 25def55bf9..d68a0c409d 100644 --- a/src/battle/item/insecticide_herb/lib.c +++ b/src/battle/item/insecticide_herb/lib.c @@ -75,13 +75,18 @@ ApiStatus N(func_802A1280_72A9D0)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } +// This is a duplicate, search for others // TODO figure out what this actually is // func_80072230 invokes gEffectTable[111]'s entryPoint function // that function is currently typed to return void // Assume it returns an Effect* and unk_0C is this EffectInstanceData // s32 unk_0C; //? Maybe EffectInstanceData too ? struct N(temp2) { - char unk_00[0x18]; + char unk_00[0x8]; + f32 unk_08; + f32 unk_0C; + f32 unk_10; + char unk_14[0x4]; s32 unk_18; s32 unk_1C; s32 unk_20; @@ -89,6 +94,9 @@ struct N(temp2) { s32 unk_28; s32 unk_2C; s32 unk_30; + char unk_34[0x3C]; + s32 unk_70; + s32 unk_74; } N(temp2); struct N(temp) { @@ -129,7 +137,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -193,7 +201,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/life_shroom/lib.c b/src/battle/item/life_shroom/lib.c index b25cb664ee..356eff181a 100644 --- a/src/battle/item/life_shroom/lib.c +++ b/src/battle/item/life_shroom/lib.c @@ -144,7 +144,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -208,7 +208,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/mushroom/lib.c b/src/battle/item/mushroom/lib.c index 01fd756663..fc5fb5295a 100644 --- a/src/battle/item/mushroom/lib.c +++ b/src/battle/item/mushroom/lib.c @@ -143,7 +143,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -207,7 +207,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/mystery/lib.c b/src/battle/item/mystery/lib.c index 98b972d60f..62773266d9 100644 --- a/src/battle/item/mystery/lib.c +++ b/src/battle/item/mystery/lib.c @@ -283,7 +283,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -347,7 +347,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/pebble/lib.c b/src/battle/item/pebble/lib.c index ef34c35ac3..0f432612ff 100644 --- a/src/battle/item/pebble/lib.c +++ b/src/battle/item/pebble/lib.c @@ -65,7 +65,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -129,7 +129,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/please_come_back/lib.c b/src/battle/item/please_come_back/lib.c index ab8d134425..41fa6bc7e3 100644 --- a/src/battle/item/please_come_back/lib.c +++ b/src/battle/item/please_come_back/lib.c @@ -65,7 +65,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -129,7 +129,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/please_come_back/please_come_back.c b/src/battle/item/please_come_back/please_come_back.c index 203b3f8f0d..3a8582d776 100644 --- a/src/battle/item/please_come_back/please_come_back.c +++ b/src/battle/item/please_come_back/please_come_back.c @@ -3,7 +3,7 @@ Script N(main) = SCRIPT({ SI_VAR(10) = c ITEM_DIZZY_DIAL; await N(UseItemWithEffect); - SetGoalToHome(0); + SetGoalToHome(ACTOR_PLAYER); SetJumpAnimations(ACTOR_PLAYER, 0, ANIM_MIDAIR_STILL, ANIM_MIDAIR, ANIM_10009); SetActorSpeed(ACTOR_PLAYER, 4.0); SetActorJumpGravity(ACTOR_PLAYER, 1.80078125); diff --git a/src/battle/item/pow_block/lib.c b/src/battle/item/pow_block/lib.c index 1e34196f75..a028279e6d 100644 --- a/src/battle/item/pow_block/lib.c +++ b/src/battle/item/pow_block/lib.c @@ -108,7 +108,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -172,7 +172,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/pow_block/pow_block.c b/src/battle/item/pow_block/pow_block.c index 7aa92cbd30..110c8bc0ed 100644 --- a/src/battle/item/pow_block/pow_block.c +++ b/src/battle/item/pow_block/pow_block.c @@ -4,13 +4,13 @@ Script N(main) = SCRIPT({ SI_VAR(10) = c ITEM_P_O_W_BLOCK; await N(UseItemWithEffect); sleep 10; - MakeEntity(0x802EA2E0, 0xFFFFFFD8, 60, 0, 0, 0x80000000); + MakeEntity(0x802EA2E0, -40, 60, 0, 0, MAKE_ENTITY_END); SI_VAR(10) = SI_VAR(0); N(func_802A1318_718B68)(); - PlayEffect(0x7, 2, 0xFFFFFFD8, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFE2, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFD8, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFD8, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -30, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); sleep 20; UseCamPreset(2); @@ -19,10 +19,10 @@ Script N(main) = SCRIPT({ sleep 15; PlaySoundAtActor(ACTOR_PLAYER, SOUND_HIT_BLOCK); N(func_802A123C_718A8C)(); - PlayEffect(0x7, 2, 0xFFFFFFD8, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFE2, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFD8, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFD8, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -30, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -40, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); StartRumble(4); ShakeCam(1, 0, 2, 1.0); ShakeCam(1, 0, 2, 3.0); @@ -41,7 +41,7 @@ Script N(main) = SCRIPT({ SetActorSpeed(ACTOR_PLAYER, 4.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); SetGoalPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); sleep 5; SetJumpAnimations(ACTOR_PLAYER, 0, ANIM_MIDAIR_STILL, ANIM_MIDAIR, ANIM_10009); SetActorJumpGravity(ACTOR_PLAYER, 0.6005859375); @@ -66,10 +66,10 @@ Script N(main) = SCRIPT({ if (SI_VAR(0) != -1) { goto 0; } - PlayEffect(0x7, 2, 0xFFFFFFBA, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFC4, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFBA, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); - PlayEffect(0x7, 2, 0xFFFFFFBA, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -70, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -60, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -70, 60, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); + PlayEffect(0x7, 2, -70, 55, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0); N(func_802A12E4_718B34)(); sleep 30; await N(PlayerGoHome); diff --git a/src/battle/item/repel_gel/lib.c b/src/battle/item/repel_gel/lib.c index 55eb2dfc1a..dce1f7cb7b 100644 --- a/src/battle/item/repel_gel/lib.c +++ b/src/battle/item/repel_gel/lib.c @@ -77,7 +77,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -141,7 +141,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/shooting_star/lib.c b/src/battle/item/shooting_star/lib.c index 7ab60e16fd..1e851fddee 100644 --- a/src/battle/item/shooting_star/lib.c +++ b/src/battle/item/shooting_star/lib.c @@ -156,7 +156,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -220,7 +220,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/sleepy_sheep/lib.c b/src/battle/item/sleepy_sheep/lib.c index 4cd291fcce..71fdc7eb3b 100644 --- a/src/battle/item/sleepy_sheep/lib.c +++ b/src/battle/item/sleepy_sheep/lib.c @@ -284,7 +284,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -348,7 +348,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/sleepy_sheep/sleepy_sheep.c b/src/battle/item/sleepy_sheep/sleepy_sheep.c index 207266d7a3..545fec2e80 100644 --- a/src/battle/item/sleepy_sheep/sleepy_sheep.c +++ b/src/battle/item/sleepy_sheep/sleepy_sheep.c @@ -133,7 +133,7 @@ Script N(main) = SCRIPT({ SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); GetActorPos(ACTOR_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); SI_VAR(1) += 32; - ShowEmote(0, 2, 0xFFFFFFD3, 20, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10); + ShowEmote(0, EMOTE_QUESTION, -45, 20, 2, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10); sleep 30; SetActorYaw(ACTOR_PLAYER, 30); sleep 1; diff --git a/src/battle/item/snowman_doll/lib.c b/src/battle/item/snowman_doll/lib.c index 571f4e4904..d3a9c0e5d8 100644 --- a/src/battle/item/snowman_doll/lib.c +++ b/src/battle/item/snowman_doll/lib.c @@ -95,7 +95,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -159,7 +159,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/stone_cap/lib.c b/src/battle/item/stone_cap/lib.c index 52c319d13f..e3a174dd86 100644 --- a/src/battle/item/stone_cap/lib.c +++ b/src/battle/item/stone_cap/lib.c @@ -107,7 +107,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -171,7 +171,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/stop_watch/lib.c b/src/battle/item/stop_watch/lib.c index f5db43f329..7d481c9bd4 100644 --- a/src/battle/item/stop_watch/lib.c +++ b/src/battle/item/stop_watch/lib.c @@ -83,7 +83,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -147,7 +147,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/strange_cake/lib.c b/src/battle/item/strange_cake/lib.c index 29c3eaf933..6757bf4b35 100644 --- a/src/battle/item/strange_cake/lib.c +++ b/src/battle/item/strange_cake/lib.c @@ -350,7 +350,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -414,7 +414,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/super_soda/lib.c b/src/battle/item/super_soda/lib.c index 06cac14836..d1723fad9f 100644 --- a/src/battle/item/super_soda/lib.c +++ b/src/battle/item/super_soda/lib.c @@ -143,7 +143,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -207,7 +207,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/tasty_tonic/lib.c b/src/battle/item/tasty_tonic/lib.c index dcadc5e0bb..d1c641b92c 100644 --- a/src/battle/item/tasty_tonic/lib.c +++ b/src/battle/item/tasty_tonic/lib.c @@ -90,7 +90,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -154,7 +154,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/thunder_bolt/lib.c b/src/battle/item/thunder_bolt/lib.c index 75567051dd..5e1148858c 100644 --- a/src/battle/item/thunder_bolt/lib.c +++ b/src/battle/item/thunder_bolt/lib.c @@ -111,7 +111,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -175,7 +175,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/thunder_rage/lib.c b/src/battle/item/thunder_rage/lib.c index f9b2cedf5f..da4c7ffeb9 100644 --- a/src/battle/item/thunder_rage/lib.c +++ b/src/battle/item/thunder_rage/lib.c @@ -111,7 +111,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -175,7 +175,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/ultra_shroom/lib.c b/src/battle/item/ultra_shroom/lib.c index 59b8f6a346..7ebee5a6a5 100644 --- a/src/battle/item/ultra_shroom/lib.c +++ b/src/battle/item/ultra_shroom/lib.c @@ -86,7 +86,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -150,7 +150,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/unknown_item/lib.c b/src/battle/item/unknown_item/lib.c index 8d81e2bfc7..37f1501feb 100644 --- a/src/battle/item/unknown_item/lib.c +++ b/src/battle/item/unknown_item/lib.c @@ -86,7 +86,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -150,7 +150,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/battle/item/volt_shroom/lib.c b/src/battle/item/volt_shroom/lib.c index 00c5a9f361..d4ba8b9dc9 100644 --- a/src/battle/item/volt_shroom/lib.c +++ b/src/battle/item/volt_shroom/lib.c @@ -74,7 +74,7 @@ Script N(UseItemWithEffect) = SCRIPT({ $x += 18; SetActorSpeed(ACTOR_PLAYER, 4.0); SetGoalPos(ACTOR_PLAYER, $x, $y, $z); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); $y += 45; $effectY = $y; @@ -138,7 +138,7 @@ Script N(PlayerGoHome) = SCRIPT({ SetGoalToHome(ACTOR_PLAYER); SetActorSpeed(ACTOR_PLAYER, 8.0); SetAnimation(ACTOR_PLAYER, 0, ANIM_RUNNING); - PlayerRunToGoal(0); + PlayerRunToGoal(ACTOR_PLAYER); SetAnimation(ACTOR_PLAYER, 0, ANIM_10002); UseIdleAnimation(ACTOR_PLAYER, 1); diff --git a/src/code_16c8e0.c b/src/code_16c8e0.c index 8a9660925a..d0951d7cae 100644 --- a/src/code_16c8e0.c +++ b/src/code_16c8e0.c @@ -46,7 +46,7 @@ Script BtlBringPartnerOut = SCRIPT({ SetActorScale(ACTOR_PARTNER, 1.0, 1.0, 1.0); } PlaySoundAtActor(ACTOR_PLAYER, SOUND_UNKNOWN_D); - GetGoalPos(256, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + GetGoalPos(ACTOR_PARTNER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetActorJumpGravity(ACTOR_PARTNER, 1.0); if (SI_VAR(1) == 0) { JumpToGoal(ACTOR_PARTNER, 20, 0, 0, 1); diff --git a/src/code_23680.c b/src/code_23680.c index ae06114a41..effb2c7641 100644 --- a/src/code_23680.c +++ b/src/code_23680.c @@ -203,9 +203,9 @@ void func_80049ECC(ScriptInstance* script) { } } -INCLUDE_ASM(s32, "code_23680", func_80049F7C); +INCLUDE_ASM(void, "code_23680", func_80049F7C, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); -INCLUDE_ASM(s32, "code_23680", func_8004A124); +INCLUDE_ASM(void, "code_23680", func_8004A124, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); void func_8004A3E8(ScriptInstance* script, s32 arg1) { Enemy* enemy = script->owner1.enemy; @@ -213,7 +213,7 @@ void func_8004A3E8(ScriptInstance* script, s32 arg1) { npc->duration--; if (npc->duration == 0) { - npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->unk_00.x, enemy->territory->unk_00.z)); + npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z)); script->functionTemp[0].s = 0; } } diff --git a/src/code_EA0C10.c b/src/code_EA0C10.c index 364af48dc0..7cbc2918c8 100644 --- a/src/code_EA0C10.c +++ b/src/code_EA0C10.c @@ -50,6 +50,29 @@ INCLUDE_ASM(s32, "code_EA0C10", func_802425B0_EA2EB0); INCLUDE_ASM(s32, "code_EA0C10", func_80242608_EA2F08); INCLUDE_ASM(s32, "code_EA0C10", func_8024267C_EA2F7C); +/* +ApiStatus N(func_8024267C_EA2F7C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EA0C10", func_80242730_EA3030); @@ -58,8 +81,38 @@ INCLUDE_ASM(s32, "code_EA0C10", func_80242794_EA3094); INCLUDE_ASM(s32, "code_EA0C10", func_802427F0_EA30F0); INCLUDE_ASM(s32, "code_EA0C10", func_802429C0_EA32C0); +/* +ApiStatus N(func_802429C0_EA32C0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_EA0C10", func_80242A14_EA3314); +/* +ApiStatus N(func_80242A14_EA3314)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_EA0C10", func_80242A4C_EA334C); diff --git a/src/code_EA8AE0.c b/src/code_EA8AE0.c index c4e9df99d3..fffd6bae01 100644 --- a/src/code_EA8AE0.c +++ b/src/code_EA8AE0.c @@ -35,6 +35,29 @@ INCLUDE_ASM(s32, "code_EA8AE0", func_802413FC_EA9EDC); INCLUDE_ASM(s32, "code_EA8AE0", func_8024140C_EA9EEC); INCLUDE_ASM(s32, "code_EA8AE0", func_80241468_EA9F48); +/* +ApiStatus N(func_80241468_EA9F48)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EA8AE0", func_8024151C_EA9FFC); @@ -43,8 +66,38 @@ INCLUDE_ASM(s32, "code_EA8AE0", func_80241580_EAA060); INCLUDE_ASM(s32, "code_EA8AE0", func_802415DC_EAA0BC); INCLUDE_ASM(s32, "code_EA8AE0", func_802417AC_EAA28C); +/* +ApiStatus N(func_802417AC_EAA28C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_EA8AE0", func_80241800_EAA2E0); +/* +ApiStatus N(func_80241800_EAA2E0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_EA8AE0", func_80241838_EAA318); diff --git a/src/code_EB1170.c b/src/code_EB1170.c index cc0839bf34..3f3321bfb3 100644 --- a/src/code_EB1170.c +++ b/src/code_EB1170.c @@ -1,6 +1,29 @@ #include "common.h" INCLUDE_ASM(s32, "code_EB1170", func_80240310_EB1170); +/* +ApiStatus N(func_80240310_EB1170)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EB1170", func_802403C4_EB1224); @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "code_EB1170", func_80240428_EB1288); INCLUDE_ASM(s32, "code_EB1170", func_80240484_EB12E4); INCLUDE_ASM(s32, "code_EB1170", func_80240654_EB14B4); +/* +ApiStatus N(func_80240654_EB14B4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_EB1170", func_802406A8_EB1508); +/* +ApiStatus N(func_802406A8_EB1508)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_EB1170", func_802406E0_EB1540); diff --git a/src/code_EB8E90.c b/src/code_EB8E90.c index 2dffe36b5e..9dc6ac54fb 100644 --- a/src/code_EB8E90.c +++ b/src/code_EB8E90.c @@ -1,14 +1,149 @@ #include "common.h" INCLUDE_ASM(s32, "code_EB8E90", func_80240040_EB8E90); +/* +ApiStatus N(func_80240040_EB8E90)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_80240198_EB8FE8); +/* +void N(func_80240198_EB8FE8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_80240440_EB9290); INCLUDE_ASM(s32, "code_EB8E90", func_80240500_EB9350); +/* +void N(func_80240500_EB9350)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_802406BC_EB950C); +/* +ApiStatus N(func_802406BC_EB950C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_80240770_EB95C0); @@ -17,10 +152,51 @@ INCLUDE_ASM(s32, "code_EB8E90", func_802407E4_EB9634); INCLUDE_ASM(s32, "code_EB8E90", func_8024085C_EB96AC); INCLUDE_ASM(s32, "code_EB8E90", func_8024098C_EB97DC); +/* +ApiStatus N(func_8024098C_EB97DC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_80240AAC_EB98FC); INCLUDE_ASM(s32, "code_EB8E90", func_80240B14_EB9964); +/* +void N(func_80240B14_EB9964)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_EB8E90", func_80240BD4_EB9A24); diff --git a/src/code_EB9D90.c b/src/code_EB9D90.c index 4d2b35fa67..14fa6d0bfa 100644 --- a/src/code_EB9D90.c +++ b/src/code_EB9D90.c @@ -7,6 +7,29 @@ INCLUDE_ASM(s32, "code_EB9D90", func_80240FB0_EB9E00); INCLUDE_ASM(s32, "code_EB9D90", func_802410E4_EB9F34); INCLUDE_ASM(s32, "code_EB9D90", func_8024121C_EBA06C); +/* +A) { + Bytecode* args = script->ptrReadPos; + s32 a1 = *args++; + s32 var0 = get_variable(script, a1); + s32 a2 = *args++; + f32 var1 = get_float_variable(script, *args++); + f32 var2 = get_float_variable(script, *args++); + s32 var3 = get_variable(script, *args++); + s32 var4 = get_variable(script, *args++); + f32 temp = (get_float_variable(script, *args++) / 180.0f) * PI; + f32 diff = fabsf(var2 - var1) / 2; + + if (var4 != 0 && var3 < var0) { + var0 = var3; + set_variable(script, a1, var3); + } + + set_float_variable(script, a2, (var1 + diff) - (diff * cos_rad(((var0 * PI) / var3) + temp))); + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "code_EB9D90", func_802413AC_EBA1FC); diff --git a/src/code_EC2240.c b/src/code_EC2240.c index 379872b653..bdbfe0567c 100644 --- a/src/code_EC2240.c +++ b/src/code_EC2240.c @@ -1,6 +1,29 @@ #include "common.h" INCLUDE_ASM(s32, "code_EC2240", func_80240040_EC2240); +/* +ApiStatus N(func_80240040_EC2240)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EC2240", func_802400F4_EC22F4); diff --git a/src/code_EC7590.c b/src/code_EC7590.c index 4b094f377f..26c5f6784b 100644 --- a/src/code_EC7590.c +++ b/src/code_EC7590.c @@ -5,5 +5,28 @@ INCLUDE_ASM(s32, "code_EC7590", func_802403E0_EC7590); INCLUDE_ASM(s32, "code_EC7590", func_80240450_EC7600); INCLUDE_ASM(s32, "code_EC7590", func_8024061C_EC77CC); +/* +ApiStatus N(func_8024061C_EC77CC)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EC7590", func_802406D0_EC7880); diff --git a/src/code_ECAA80.c b/src/code_ECAA80.c index b62edade57..b80863ff0c 100644 --- a/src/code_ECAA80.c +++ b/src/code_ECAA80.c @@ -13,8 +13,38 @@ INCLUDE_ASM(s32, "code_ECAA80", func_80241770_ECB470); INCLUDE_ASM(s32, "code_ECAA80", func_802417CC_ECB4CC); INCLUDE_ASM(s32, "code_ECAA80", func_8024199C_ECB69C); +/* +ApiStatus N(func_8024199C_ECB69C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_ECAA80", func_802419F0_ECB6F0); +/* +ApiStatus N(func_802419F0_ECB6F0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_ECAA80", func_80241A28_ECB728); diff --git a/src/code_ED0310.c b/src/code_ED0310.c index ce33538d23..a6e470504e 100644 --- a/src/code_ED0310.c +++ b/src/code_ED0310.c @@ -3,23 +3,243 @@ #define NAMESPACE code_ED0310 INCLUDE_ASM(s32, "code_ED0310", func_80240320_ED0310); +/* +void N(func_80240320_ED0310)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.unk_18, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_ED0310", func_802404D0_ED04C0); INCLUDE_ASM(s32, "code_ED0310", func_80240AF8_ED0AE8); INCLUDE_ASM(s32, "code_ED0310", func_80240BB8_ED0BA8); +/* +void N(func_80240BB8_ED0BA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ INCLUDE_ASM(s32, "code_ED0310", func_80240EFC_ED0EEC); INCLUDE_ASM(s32, "code_ED0310", func_80240F74_ED0F64); +/* +void N(func_80240F74_ED0F64)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/DeadUnkNpcAIFunc14.inc.c" INCLUDE_ASM(s32, "code_ED0310", func_80241114_ED1104); INCLUDE_ASM(s32, "code_ED0310", func_80241178_ED1168); +/* +void N(func_80241178_ED1168)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "code_ED0310", func_80241508_ED14F8); +/* +void N(func_80241508_ED14F8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "code_ED0310", func_8024162C_ED161C); diff --git a/src/code_ED42A0.c b/src/code_ED42A0.c index ca7a7ea2d9..4551780805 100644 --- a/src/code_ED42A0.c +++ b/src/code_ED42A0.c @@ -1,6 +1,29 @@ #include "common.h" INCLUDE_ASM(s32, "code_ED42A0", func_80240080_ED42A0); +/* +ApiStatus N(func_80240080_ED42A0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_ED42A0", func_80240134_ED4354); diff --git a/src/code_EDC020.c b/src/code_EDC020.c index e66c837219..9d363fdda6 100644 --- a/src/code_EDC020.c +++ b/src/code_EDC020.c @@ -5,6 +5,29 @@ INCLUDE_ASM(s32, "code_EDC020", func_80240040_EDC020); INCLUDE_ASM(s32, "code_EDC020", func_802400B0_EDC090); INCLUDE_ASM(s32, "code_EDC020", func_8024027C_EDC25C); +/* +ApiStatus N(func_8024027C_EDC25C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ INCLUDE_ASM(s32, "code_EDC020", func_80240330_EDC310); @@ -13,7 +36,37 @@ INCLUDE_ASM(s32, "code_EDC020", func_80240394_EDC374); INCLUDE_ASM(s32, "code_EDC020", func_802403F0_EDC3D0); INCLUDE_ASM(s32, "code_EDC020", func_802405C0_EDC5A0); +/* +ApiStatus N(func_802405C0_EDC5A0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_EDC020", func_80240614_EDC5F4); +/* +ApiStatus N(func_80240614_EDC5F4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_EDC020", func_8024064C_EDC62C); diff --git a/src/code_EDEA00.c b/src/code_EDEA00.c index e953159463..9de7d403ad 100644 --- a/src/code_EDEA00.c +++ b/src/code_EDEA00.c @@ -5,24 +5,244 @@ INCLUDE_ASM(s32, "code_EDEA00", func_80240040_EDEA00); INCLUDE_ASM(s32, "code_EDEA00", func_802401C4_EDEB84); +/* +void N(func_802401C4_EDEB84)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.unk_18, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_EDEA00", func_80240374_EDED34); INCLUDE_ASM(s32, "code_EDEA00", func_8024099C_EDF35C); INCLUDE_ASM(s32, "code_EDEA00", func_80240A5C_EDF41C); +/* +void N(func_80240A5C_EDF41C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ INCLUDE_ASM(s32, "code_EDEA00", func_80240DA0_EDF760); INCLUDE_ASM(s32, "code_EDEA00", func_80240E18_EDF7D8); +/* +void N(func_80240E18_EDF7D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/DeadUnkNpcAIFunc14.inc.c" INCLUDE_ASM(s32, "code_EDEA00", func_80240FB8_EDF978); INCLUDE_ASM(s32, "code_EDEA00", func_8024101C_EDF9DC); +/* +void N(func_8024101C_EDF9DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "code_EDEA00", func_802413AC_EDFD6C); +/* +void N(func_802413AC_EDFD6C)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "code_EDEA00", func_802414D0_EDFE90); diff --git a/src/code_EE70C0.c b/src/code_EE70C0.c index c69f2a4c81..229336bfc5 100644 --- a/src/code_EE70C0.c +++ b/src/code_EE70C0.c @@ -3,24 +3,244 @@ #define NAMESPACE code_EE70C0 INCLUDE_ASM(s32, "code_EE70C0", func_80240B10_EE70C0); +/* +void N(func_80240B10_EE70C0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.unk_18, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_80240CC0_EE7270); INCLUDE_ASM(s32, "code_EE70C0", func_802412E8_EE7898); INCLUDE_ASM(s32, "code_EE70C0", func_802413A8_EE7958); +/* +void N(func_802413A8_EE7958)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_802416EC_EE7C9C); INCLUDE_ASM(s32, "code_EE70C0", func_80241764_EE7D14); +/* +void N(func_80241764_EE7D14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/DeadUnkNpcAIFunc14.inc.c" INCLUDE_ASM(s32, "code_EE70C0", func_80241904_EE7EB4); INCLUDE_ASM(s32, "code_EE70C0", func_80241968_EE7F18); +/* +void N(func_80241968_EE7F18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_80241CF8_EE82A8); +/* +void N(func_80241CF8_EE82A8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_80241E1C_EE83CC); @@ -29,7 +249,37 @@ INCLUDE_ASM(s32, "code_EE70C0", func_80242034_EE85E4); INCLUDE_ASM(s32, "code_EE70C0", func_80242090_EE8640); INCLUDE_ASM(s32, "code_EE70C0", func_80242260_EE8810); +/* +ApiStatus N(func_80242260_EE8810)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_802422B4_EE8864); +/* +ApiStatus N(func_802422B4_EE8864)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "code_EE70C0", func_802422EC_EE889C); diff --git a/src/code_EEDF50.c b/src/code_EEDF50.c index 01d48d2c42..f86bad2c4a 100644 --- a/src/code_EEDF50.c +++ b/src/code_EEDF50.c @@ -3,24 +3,244 @@ #define NAMESPACE code_EEDF50 INCLUDE_ASM(s32, "code_EEDF50", func_80240E50_EEDF50); +/* +void N(func_80240E50_EEDF50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.unk_18, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_EEDF50", func_80241000_EEE100); INCLUDE_ASM(s32, "code_EEDF50", func_80241628_EEE728); INCLUDE_ASM(s32, "code_EEDF50", func_802416E8_EEE7E8); +/* +void N(func_802416E8_EEE7E8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ INCLUDE_ASM(s32, "code_EEDF50", func_80241A2C_EEEB2C); INCLUDE_ASM(s32, "code_EEDF50", func_80241AA4_EEEBA4); +/* +void N(func_80241AA4_EEEBA4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/DeadUnkNpcAIFunc14.inc.c" INCLUDE_ASM(s32, "code_EEDF50", func_80241C44_EEED44); INCLUDE_ASM(s32, "code_EEDF50", func_80241CA8_EEEDA8); +/* +void N(func_80241CA8_EEEDA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "code_EEDF50", func_80242038_EEF138); +/* +void N(func_80242038_EEF138)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "code_EEDF50", func_8024215C_EEF25C); diff --git a/src/code_EF2680.c b/src/code_EF2680.c index 763815cd4f..9a05c9a346 100644 --- a/src/code_EF2680.c +++ b/src/code_EF2680.c @@ -3,24 +3,244 @@ #define NAMESPACE code_EF2680 INCLUDE_ASM(s32, "code_EF2680", func_80240070_EF2680); +/* +void N(func_80240070_EF2680)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.unk_18, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "code_EF2680", func_80240220_EF2830); INCLUDE_ASM(s32, "code_EF2680", func_80240848_EF2E58); INCLUDE_ASM(s32, "code_EF2680", func_80240908_EF2F18); +/* +void N(func_80240908_EF2F18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ INCLUDE_ASM(s32, "code_EF2680", func_80240C4C_EF325C); INCLUDE_ASM(s32, "code_EF2680", func_80240CC4_EF32D4); +/* +void N(func_80240CC4_EF32D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/DeadUnkNpcAIFunc14.inc.c" INCLUDE_ASM(s32, "code_EF2680", func_80240E64_EF3474); INCLUDE_ASM(s32, "code_EF2680", func_80240EC8_EF34D8); +/* +void N(func_80240EC8_EF34D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "code_EF2680", func_80241258_EF3868); +/* +void N(func_80241258_EF3868)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "code_EF2680", func_8024137C_EF398C); diff --git a/src/code_EFEB00.c b/src/code_EFEB00.c index c68c6f99db..27365d7346 100644 --- a/src/code_EFEB00.c +++ b/src/code_EFEB00.c @@ -9,6 +9,29 @@ #include "common/DeadUnk1.inc.c" INCLUDE_ASM(s32, "code_EFEB00", func_80240340_EFEE40); +/* +A) { + Bytecode* args = script->ptrReadPos; + s32 a1 = *args++; + s32 var0 = get_variable(script, a1); + s32 a2 = *args++; + f32 var1 = get_float_variable(script, *args++); + f32 var2 = get_float_variable(script, *args++); + s32 var3 = get_variable(script, *args++); + s32 var4 = get_variable(script, *args++); + f32 temp = (get_float_variable(script, *args++) / 180.0f) * PI; + f32 diff = fabsf(var2 - var1) / 2; + + if (var4 != 0 && var3 < var0) { + var0 = var3; + set_variable(script, a1, var3); + } + + set_float_variable(script, a2, (var1 + diff) - (diff * cos_rad(((var0 * PI) / var3) + temp))); + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "code_EFEB00", func_802404D0_EFEFD0); @@ -18,4 +41,4 @@ INCLUDE_ASM(s32, "code_EFEB00", func_80240660_EFF160); INCLUDE_ASM(s32, "code_EFEB00", func_80240784_EFF284); -INCLUDE_ASM(s32, "code_EFEB00", func_802407B0_EFF2B0); +INCLUDE_ASM(s32, "code_EFEB00", func_802407B0_EFF2B0); \ No newline at end of file diff --git a/src/code_F5750.c b/src/code_F5750.c index 4569adc957..6f547abf2f 100644 --- a/src/code_F5750.c +++ b/src/code_F5750.c @@ -352,7 +352,7 @@ ApiStatus WaitForPlayerInputEnabled(ScriptInstance* script, s32 isInitialCall) { return !(gPlayerStatus.flags & 0x2000) * ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_F5750", func_802D2520); +INCLUDE_ASM(ApiStatus, "code_F5750", func_802D2520, ScriptInstance* script, s32 isInitialCall); ApiStatus func_802D286C(ScriptInstance* script, s32 isInitialCall) { s32 temp = *script->ptrReadPos; diff --git a/src/world/area_arn/arn.h b/src/world/area_arn/arn.h new file mode 100644 index 0000000000..43722d86d7 --- /dev/null +++ b/src/world/area_arn/arn.h @@ -0,0 +1,18 @@ +#ifndef _WORLD_AREA_ARN_ARN_H_ +#define _WORLD_AREA_ARN_ARN_H_ + +#include "si.h" + +MapConfig arn_02_config; +MapConfig arn_03_config; +MapConfig arn_04_config; +MapConfig arn_05_config; +MapConfig arn_07_config; +MapConfig arn_08_config; +MapConfig arn_09_config; +MapConfig arn_10_config; +MapConfig arn_11_config; +MapConfig arn_12_config; +MapConfig arn_13_config; + +#endif diff --git a/src/world/area_arn/arn_02/arn_02.h b/src/world/area_arn/arn_02/arn_02.h index 81436f4228..2624c31f4f 100644 --- a/src/world/area_arn/arn_02/arn_02.h +++ b/src/world/area_arn/arn_02/arn_02.h @@ -1,14 +1,16 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_02 s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3); -s32 func_80240C90_BDDE40(ScriptInstance *script, NpcAISettings *aiSettings); +ApiStatus N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall); -Script N(Main); -Script N(PlayMusic); -Script N(MakeEntities); -NpcGroupList N(npcGroupList); +Script N(main); +Script N(80241040); +NpcGroupList N(npcGroupList_80241A9C); +Script N(makeEntities); +ApiStatus N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall); extern s16 D_8009A634; diff --git a/src/world/area_arn/arn_02/events.c b/src/world/area_arn/arn_02/events.c index 85fd5f467c..a9f16348eb 100644 --- a/src/world/area_arn/arn_02/events.c +++ b/src/world/area_arn/arn_02/events.c @@ -2,120 +2,104 @@ #include "sprite/npc/cleft.h" #include "sprite/npc/goomba.h" -Script N(Exit1) = EXIT_WALK_SCRIPT(60, 0, "arn_05", 1); -Script N(Exit2) = EXIT_WALK_SCRIPT(60, 1, "arn_04", 0); +Script N(exitWalk_802410F0) = EXIT_WALK_SCRIPT(60, 0, "arn_05", 1); -Script N(BindExits) = SCRIPT({ - bind N(Exit1) to TRIGGER_FLOOR_ABOVE 1; - bind N(Exit2) to TRIGGER_FLOOR_ABOVE 6; +Script N(exitWalk_8024114C) = EXIT_WALK_SCRIPT(60, 1, "arn_04", 0); + +Script N(802411A8) = SCRIPT({ + bind N(exitWalk_802410F0) to TRIGGER_FLOOR_ABOVE 1; + bind N(exitWalk_8024114C) to TRIGGER_FLOOR_ABOVE 6; }); -Script N(Main) = SCRIPT({ +Script N(main) = SCRIPT({ WORLD_LOCATION = LOCATION_GUSTY_GULCH; SetSpriteShading(-1); SetCamPerspective(0, 3, 25, 16, 4096); SetCamBGColor(0, 0, 0, 0); SetCamEnabled(0, 1); - MakeNpcs(0, N(npcGroupList)); - await N(MakeEntities); - spawn N(PlayMusic); - SI_VAR(0) = N(BindExits); + MakeNpcs(0, N(npcGroupList_80241A9C)); + await N(makeEntities); + spawn N(80241040); + SI_VAR(0) = N(802411A8); spawn EnterWalk; sleep 1; }); -s32 N(padding2)[] = { 0, 0, 0 }; +static s32 N(pad_12C4)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; -Script N(MakeEntities) = SCRIPT({ - MakeItemEntity(ITEM_DIZZY_DIAL, 0xFFFFFF08, 193, 45, 17, SI_SAVE_FLAG(1005)); +Script N(makeEntities) = SCRIPT({ + MakeItemEntity(ITEM_DIZZY_DIAL, -248, 193, 45, 17, SI_SAVE_FLAG(1005)); MakeItemEntity(ITEM_LETTER07, 536, 260, 227, 17, SI_SAVE_FLAG(1006)); - MakeEntity(0x802EA564, 0xFFFFFEA2, 172, 170, 0, ITEM_COIN, 0x80000000); + MakeEntity(0x802EA564, -350, 172, 170, 0, ITEM_COIN, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(1002)); - MakeEntity(0x802EA564, 225, 265, 30, 0, ITEM_COIN, 0x80000000); + MakeEntity(0x802EA564, 225, 265, 30, 0, ITEM_COIN, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(1003)); - MakeEntity(0x802EA564, 275, 265, 150, 0, ITEM_REPEL_GEL, 0x80000000); + MakeEntity(0x802EA564, 275, 265, 150, 0, ITEM_REPEL_GEL, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(1004)); }); -NpcAISettings N(goombaAISettings) = { - .moveSpeed = 1.8f, - .moveTime = 40, - .waitTime = 15, - .alertRadius = 150.0f, - .unk_10 = { .f = 0.0f }, - .unk_14 = 2, - .chaseSpeed = 3.3f, - .unk_1C = 70, - .unk_20 = 1, - .chaseRadius = 180.0f, - .unk_28 = { .f = 0.0f }, - .unk_2C = TRUE, +NpcAISettings N(npcAISettings_802413D0) = { + .moveSpeed = 1.8f, + .moveTime = 40, + .waitTime = 15, + .alertRadius = 150.0f, + .unk_14 = 2, + .chaseSpeed = 3.3f, + .unk_1C = 70, + .unk_20 = 1, + .chaseRadius = 180.0f, + .unk_2C = 1, }; -Script N(GoombaAI) = SCRIPT({ - DoBasicAI(N(goombaAISettings)); +Script N(npcAI_80241400) = SCRIPT({ + DoBasicAI(N(npcAISettings_802413D0)); }); -NpcSettings N(goombaNpcSettings) = { - .unk_00 = { 0x00, 0x00, 0x00, 0x00 }, +NpcSettings N(npcSettings_80241420) = { .height = 20, - .radius = 23, - .otherAI = NULL, - .onInteract = NULL, - .ai = N(GoombaAI), - .onHit = EnemyNpcHit, - .aux = NULL, - .onDefeat = EnemyNpcDefeat, - .flags = 0x00000000, - .unk_24 = { 0x00, 0x00, 0x00, 0x00 }, + .radius = 23, + .ai = &N(npcAI_80241400), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, .level = 12, - .unk_2A = 0x0000, }; -NpcAISettings N(cleftAISettings) = { - .moveSpeed = 1.0f, - .moveTime = 30, - .waitTime = 30, - .alertRadius = 120.0f, - .unk_10 = { .f = 0.0f }, - .unk_14 = 3, - .chaseSpeed = 8.5f, - .unk_1C = 60, - .unk_20 = 3, - .chaseRadius = 100.0f, - .unk_28 = { .f = 60.0f }, - .unk_2C = TRUE, +NpcAISettings N(npcAISettings_8024144C) = { + .moveSpeed = 1.0f, + .moveTime = 30, + .waitTime = 30, + .alertRadius = 120.0f, + .unk_14 = 3, + .chaseSpeed = 8.5f, + .unk_1C = 60, + .unk_20 = 3, + .chaseRadius = 100.0f, + .unk_28 = { .f = 60.0f }, + .unk_2C = 1, }; -Script N(CleftAI) = SCRIPT({ - func_80240C90_BDDE40(N(cleftAISettings), 8); +Script N(npcAI_8024147C) = SCRIPT({ + N(func_80240C90_BDDE40)(N(npcAISettings_8024144C), 8); }); -NpcSettings N(cleftNpcSettings) = { - .unk_00 = { 0x00, 0x00, 0x00, 0x00 }, +NpcSettings N(npcSettings_802414A0) = { .height = 24, - .radius = 24, - .otherAI = NULL, - .onInteract = NULL, - .ai = N(CleftAI), - .onHit = EnemyNpcHit, - .aux = NULL, - .onDefeat = EnemyNpcDefeat, - .flags = 0x00000000, - .unk_24 = { 0x00, 0x00, 0x00, 0x00 }, + .radius = 24, + .ai = &N(npcAI_8024147C), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, .level = 15, - .unk_2A = 0x0000, }; -StaticNpc N(CleftNPC1) = { +StaticNpc N(npcGroup_802414CC) = { .id = 0, - .settings = &N(cleftNpcSettings), + .settings = &N(npcSettings_802414A0), .pos = { -196.0f, 130.0f, 104.0f }, - .flags = 0x00000400, - .init = NULL, + .flags = NPC_FLAG_LOCK_ANIMS, .yaw = 90, .dropFlags = 0x80, - .itemDropChance = 0, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), .minCoinBonus = 1, @@ -139,20 +123,16 @@ StaticNpc N(CleftNPC1) = { NPC_ANIM(cleft, Palette_01, Anim_16), NPC_ANIM(cleft, Palette_01, Anim_0), }, - .unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 }, - .extraAnimations = NULL, - .tattle = 0, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -StaticNpc N(CleftNPC2) = { +StaticNpc N(npcGroup_802416BC) = { .id = 1, - .settings = &N(cleftNpcSettings), + .settings = &N(npcSettings_802414A0), .pos = { 641.0f, 268.0f, 202.0f }, - .flags = 0x00000400, - .init = NULL, + .flags = NPC_FLAG_LOCK_ANIMS, .yaw = 90, .dropFlags = 0x80, - .itemDropChance = 0, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), .minCoinBonus = 1, @@ -176,26 +156,20 @@ StaticNpc N(CleftNPC2) = { NPC_ANIM(cleft, Palette_01, Anim_16), NPC_ANIM(cleft, Palette_01, Anim_0), }, - .unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 }, - .extraAnimations = NULL, - .tattle = 0, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -StaticNpc N(GoombaNPC) = { +StaticNpc N(npcGroup_802418AC) = { .id = 2, - .settings = &N(goombaNpcSettings), + .settings = &N(npcSettings_80241420), .pos = { 333.0f, 215.0f, 85.0f }, - .flags = 0x00000400, - .init = NULL, + .flags = NPC_FLAG_LOCK_ANIMS, .yaw = 90, .dropFlags = 0x80, .itemDropChance = 20, - .itemDrops = { { ITEM_DRIED_SHROOM, 10, 0 }, - }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), - .minCoinBonus = 0, .maxCoinBonus = 2, .movement = { 333, 215, 85, 40, 30, -32767, 1, 360, 215, 150, 120, 137, 1 }, .animations = { @@ -216,21 +190,19 @@ StaticNpc N(GoombaNPC) = { NPC_ANIM(goomba, hyper, run), NPC_ANIM(goomba, hyper, run), }, - .unk_1E0 = { 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0 }, - .extraAnimations = NULL, - .tattle = 0, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -NpcGroupList N(npcGroupList) = { - NPC_GROUP(N(CleftNPC1), BATTLE_ID(14, 10, 0, 1)), - NPC_GROUP(N(CleftNPC2), BATTLE_ID(14, 13, 0, 1)), - NPC_GROUP(N(GoombaNPC), BATTLE_ID(14, 3, 0, 1)), +NpcGroupList N(npcGroupList_80241A9C) = { + NPC_GROUP(N(npcGroup_802414CC), BATTLE_ID(14, 10, 0, 1)), + NPC_GROUP(N(npcGroup_802416BC), BATTLE_ID(14, 13, 0, 1)), + NPC_GROUP(N(npcGroup_802418AC), BATTLE_ID(14, 3, 0, 1)), {}, }; // gCameras loading after the offset calculation instead of before #ifdef NON_MATCHING -s32 func_80240000_BDD1B0(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { PlayerStatus** playerStatus; Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); @@ -261,23 +233,23 @@ s32 func_80240000_BDD1B0(ScriptInstance *script, NpcAISettings *aiSettings, Enem return phi_s0; } #else -INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", func_80240000_BDD1B0, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape); +INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", arn_02_func_80240000_BDD1B0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc18.inc.c" -void func_802401D4_BDD384(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; if (script->functionTemp[1].s <= 0) { script->functionTemp[1].s = aiSettings->unk_14; - if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { npc->currentAnim = enemy->animList[9]; - fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); - npc->duration = 0xC; + npc->duration = 12; script->functionTemp[0].s = 2; } } @@ -291,16 +263,16 @@ void func_802401D4_BDD384(ScriptInstance *script, NpcAISettings *aiSettings, Ene #include "world/common/UnkNpcAIFunc22.inc.c" -void func_802404D0_BDD680(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_802404D0_BDD680)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { PlayerStatus** playerStatus; Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); s32 var; - if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { playerStatus = &gPlayerStatusPtr; npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); - script->functionTemp[0].s = 0xC; + script->functionTemp[0].s = 12; } else { npc->duration--; if (npc->duration <= 0) { @@ -309,8 +281,8 @@ void func_802404D0_BDD680(ScriptInstance *script, NpcAISettings *aiSettings, Ene npc->yaw = clamp_angle(npc->yaw + 180.0f); npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { - fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &var); - npc->duration = 0xF; + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; script->functionTemp[0].s = 0x28; } } @@ -319,7 +291,7 @@ void func_802404D0_BDD680(ScriptInstance *script, NpcAISettings *aiSettings, Ene #include "world/common/UnkNpcAIFunc16.inc.c" -void func_80240694_BDD844(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); PlayerStatus** playerStatus = &gPlayerStatusPtr; @@ -346,7 +318,7 @@ void func_80240694_BDD844(ScriptInstance *script, NpcAISettings *aiSettings, Ene } } -void func_80240834_BDD9E4(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_80240834_BDD9E4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ; @@ -356,10 +328,10 @@ void func_80240834_BDD9E4(ScriptInstance *script, NpcAISettings *aiSettings, Ene npc_move_heading(npc, npc->moveSpeed, npc->yaw); phi_s1 = 0; - if (is_point_within_region(enemy->territory->shape, - enemy->territory->pointX, enemy->territory->pointZ, - npc->pos.x, npc->pos.z, enemy->territory->sizeX, - enemy->territory->sizeZ)) { + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { phi_s1 = 1; } @@ -382,35 +354,35 @@ void func_80240834_BDD9E4(ScriptInstance *script, NpcAISettings *aiSettings, Ene } } -void func_80240984_BDDB34(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { npc->currentAnim = enemy->animList[1]; - if (enemy->territory->unk_14 < 0) { + if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { - npc->moveSpeed = enemy->territory->unk_14 / 32767.0; + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; } script->functionTemp[0].s = 0x29; } } -void func_80240A30_BDDBE0(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(func_80240A30_BDDBE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); PlayerStatus** playerStatus = &gPlayerStatusPtr; - if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->unk_00.x, enemy->territory->unk_00.z) <= npc->moveSpeed) { + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->duration = 10; script->functionTemp[0].s = 50; } else if (npc->unk_8C == 0) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->unk_00.x, enemy->territory->unk_00.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); } } @@ -421,117 +393,113 @@ void func_80240A30_BDDBE0(ScriptInstance *script, NpcAISettings *aiSettings, Ene #include "world/common/UnkDurationCheck.inc.c" -s32 func_80240C90_BDDE40(ScriptInstance *script, NpcAISettings *aiSettings) { +s32 N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc *npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; - NpcAISettings* npcAI = (NpcAISettings*)get_variable(script, *args++); - EnemyTerritoryThing shape; - EnemyTerritoryThing* shapePtr = &shape; - u32 var; + NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; enemy->varTable[10] = get_variable(script, *args++); - shape.unk_00 = 0; - shape.shape = enemy->territory->shape; - shape.pointX = enemy->territory->pointX; - shape.pointZ = enemy->territory->pointZ; - shape.sizeX = enemy->territory->sizeX; - shape.sizeZ = enemy->territory->sizeZ; - shape.unk_34 = 40.0f; - shape.unk_1C = 0; + territory.unk_00 = 0; + territory.shape = enemy->territory->wander.detectShape; + territory.pointX = enemy->territory->wander.detect.x; + territory.pointZ = enemy->territory->wander.detect.z; + territory.sizeX = enemy->territory->wander.detectSizeX; + territory.sizeZ = enemy->territory->wander.detectSizeZ; + territory.unk_34 = 40.0f; + territory.unk_1C = 0; - if (aiSettings != NULL) { - script->functionTemp[0].s = NULL; + if (isInitialCall) { + script->functionTemp[0].s = 0; npc->duration = 0; npc->flags &= ~0x800; - if (enemy->territory->unk_34 == 0) { - npc->flags |= 0x200; - npc->flags &= ~0x8; - + if (!enemy->territory->wander.isFlying) { + npc->flags = (npc->flags | 0x200) & ~0x8; } else { - npc->flags &= ~0x200; - npc->flags |= 0x8; + npc->flags = (npc->flags & ~0x200) | 0x8; } } if (enemy->unk_B0 & 4) { if (enemy->unk_B4 != 0) { - return 0; + return ApiStatus_BLOCK; } enemy->unk_B0 &= ~4; } - if ((u32)script->functionTemp[0].s - 12 < 3 && func_80240000_BDD1B0(script, npcAI, shapePtr)) { + if ((u32)script->functionTemp[0].s - 12 < 3 && N(func_80240000_BDD1B0)(script, npcAISettings, territoryPtr)) { script->functionTemp[0].s = 20; } switch (script->functionTemp[0].s) { case 0: - N(UnkNpcAIFunc18)(script, npcAI, shapePtr); + N(UnkNpcAIFunc18)(script, npcAISettings, territoryPtr); case 1: - func_802401D4_BDD384(script, npcAI, shapePtr); + N(func_802401D4_BDD384)(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 2) { - return 0; + return ApiStatus_BLOCK; } case 2: - N(UnkNpcAIFunc21)(script, npcAI, shapePtr); + N(UnkNpcAIFunc21)(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 3) { - return 0; + return ApiStatus_BLOCK; } case 3: - N(UnkNpcAIFunc20)(script, npcAI, shapePtr); + N(UnkNpcAIFunc20)(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 4) { - return 0; + return ApiStatus_BLOCK; } case 4: - N(UnkNpcAIFunc22)(script, npcAI, shapePtr); + N(UnkNpcAIFunc22)(script, npcAISettings, territoryPtr); case 5: - func_802404D0_BDD680(script, npcAI, shapePtr); - return 0; + N(func_802404D0_BDD680)(script, npcAISettings, territoryPtr); + return ApiStatus_BLOCK; case 12: - func_80049F7C(script, npcAI, shapePtr); + func_80049F7C(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 13) { - return 0; + return ApiStatus_BLOCK; } case 13: - func_8004A124(script, npcAI, shapePtr); + func_8004A124(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 14) { - return 0; + return ApiStatus_BLOCK; } case 14: npc->duration--; if (npc->duration == 0) { script->functionTemp[0].s = 40; } - return 0; + return ApiStatus_BLOCK; case 20: - N(UnkNpcAIFunc16)(script, npcAI, shapePtr); + N(UnkNpcAIFunc16)(script, npcAISettings, territoryPtr); case 21: - func_80240694_BDD844(script, npcAI, shapePtr); - return 0; + N(func_80240694_BDD844)(script, npcAISettings, territoryPtr); + return ApiStatus_BLOCK; case 22: - func_80240834_BDD9E4(script, npcAI, shapePtr); - return 0; + N(func_80240834_BDD9E4)(script, npcAISettings, territoryPtr); + return ApiStatus_BLOCK; case 40: - func_80240984_BDDB34(script, npcAI, shapePtr); + N(func_80240984_BDDB34)(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 41) { - return 0; + return ApiStatus_BLOCK; } case 41: - func_80240A30_BDDBE0(script, npcAI, shapePtr); - return 0; + N(func_80240A30_BDDBE0)(script, npcAISettings, territoryPtr); + return ApiStatus_BLOCK; case 50: - N(UnkNpcAIFunc19)(script, npcAI, shapePtr); + N(UnkNpcAIFunc19)(script, npcAISettings, territoryPtr); case 51: - N(UnkNpcAIFunc17)(script, npcAI, shapePtr); + N(UnkNpcAIFunc17)(script, npcAISettings, territoryPtr); if (script->functionTemp[0].s != 52) { - return 0; + return ApiStatus_BLOCK; } case 52: - N(UnkDurationCheck)(script, npcAI, shapePtr); - return 0; + N(UnkDurationCheck)(script, npcAISettings, territoryPtr); + return ApiStatus_BLOCK; } - return 0; + return ApiStatus_BLOCK; } diff --git a/src/world/area_arn/arn_02/header.c b/src/world/area_arn/arn_02/header.c index 5f8356b98a..bb67146799 100644 --- a/src/world/area_arn/arn_02/header.c +++ b/src/world/area_arn/arn_02/header.c @@ -1,20 +1,20 @@ #include "arn_02.h" #include "message_ids.h" -Vec4f N(entryList)[] = { +EntryList N(entryList) = { { -585.0f, 60.0f, 150.0f, 90.0f }, { 880.0f, 320.0f, 150.0f, 270.0f }, }; MapConfig N(config) = { - .main = N(Main), + .main = N(main), .entryList = N(entryList), .entryCount = ENTRY_COUNT(N(entryList)), .background = &gBackgroundImage, .tattle = MSG_arn_02_tattle, }; -Script N(PlayMusic) = SCRIPT({ +Script N(80241040) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_WOKE_UP { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); @@ -26,5 +26,5 @@ Script N(PlayMusic) = SCRIPT({ SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } - PlayAmbientSounds(1); + PlayAmbientSounds(AMBIENT_WIND); }); diff --git a/src/world/area_arn/arn_03/BDED90.c b/src/world/area_arn/arn_03/BDED90.c deleted file mode 100644 index d654f6893a..0000000000 --- a/src/world/area_arn/arn_03/BDED90.c +++ /dev/null @@ -1,45 +0,0 @@ -#include "arn_03.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80240000_BDED90); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80240158_BDEEE8); - -#include "world/common/UnkNpcAIFunc1.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_802404C0_BDF250); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_8024067C_BDF40C); - -#include "world/common/NpcJumpFunc2.inc.c" - -# include "world/common/NpcJumpFunc.inc.c" - -#include "world/common/UnkNpcAIFunc13.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_8024094C_BDF6DC); - -#include "world/common/UnkNpcDurationFlagFunc.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80240AD4_BDF864); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80240B94_BDF924); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80240E90_BDFC20); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80241068_BDFDF8); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_8024113C_BDFECC); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_802412B0_BE0040); - -#include "world/common/GetItemName.inc.c" - -#include "world/common/GetNpcCollisionHeight.inc.c" - -#include "world/common/SomeXYZFuncTodoRename.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_802415F4_BE0384); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80241648_BE03D8); - -INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", func_80241680_BE0410); diff --git a/src/world/area_arn/arn_03/arn_03.h b/src/world/area_arn/arn_03/arn_03.h index d34dd8248f..dfaaa4ec27 100644 --- a/src/world/area_arn/arn_03/arn_03.h +++ b/src/world/area_arn/arn_03/arn_03.h @@ -1,4 +1,27 @@ #include "common.h" #include "map.h" +#include "message_ids.h" +#include "../arn.h" #define NAMESPACE arn_03 + +void func_802D6420(void); +void func_802D6954(void); +void func_802CF56C(void); + +ApiStatus N(SomeXYZFuncTodoRename)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80241648_BE03D8)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80241680_BE0410)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802415F4_BE0384)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall); + +Script N(main); +Script N(80241780); +NpcGroupList N(npcGroupList_80244740); +NpcGroupList N(npcGroupList_80244788); +Script N(makeEntities); +ApiStatus N(func_8024113C_BDFECC)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(SomeXYZFuncTodoRename)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_80241648_BE03D8)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_80241680_BE0410)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_802415F4_BE0384)(ScriptInstance *script, s32 isInitialCall); diff --git a/src/world/area_arn/arn_03/events.c b/src/world/area_arn/arn_03/events.c new file mode 100644 index 0000000000..f7d0825ae8 --- /dev/null +++ b/src/world/area_arn/arn_03/events.c @@ -0,0 +1,1292 @@ +#include "arn_03.h" +#include "sprite/npc/boo.h" +#include "sprite/npc/world_bow.h" + +s32 D_80244A20[0x70]; + +Script N(exitWalk_80241830) = EXIT_WALK_SCRIPT(60, 0, "arn_07", 1); + +Script N(exitWalk_8024188C) = EXIT_WALK_SCRIPT(60, 1, "arn_05", 0); + +Script N(802418E8) = SCRIPT({ + bind N(exitWalk_80241830) to TRIGGER_FLOOR_ABOVE 1; + bind N(exitWalk_8024188C) to TRIGGER_FLOOR_ABOVE 5; +}); + +Script N(enterWalk_80241930) = SCRIPT({ + GetLoadType(SI_VAR(1)); + if (SI_VAR(1) == 1) { + spawn EnterSavePoint; + spawn N(802418E8); + return; + } + if (STORY_PROGRESS < STORY_CH3_ARRIVED_AT_GHOST_TOWN) { + SetPlayerPos(-175, 165, 160); + InterpPlayerYaw(90, 0); + SetNpcPos(NPC_PARTNER, -175, 165, 160); + InterpNpcYaw(NPC_PARTNER, 90, 0); + SetPlayerSpeed(4); + PlayerMoveTo(-55, 160, 0); + spawn N(802418E8); + return; + } + SI_VAR(0) = N(802418E8); + spawn EnterWalk; +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_GUSTY_GULCH; + SetSpriteShading(-1); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamEnabled(0, 1); + SI_AREA_FLAG(3) = 0; + SI_AREA_FLAG(4) = 0; + SI_AREA_FLAG(5) = 0; + if (STORY_PROGRESS < STORY_CH3_DEFEATED_TUBBA_BLUBBA) { + MakeNpcs(0, N(npcGroupList_80244740)); + } else { + MakeNpcs(0, N(npcGroupList_80244788)); + } + if (SI_SAVE_FLAG(1020) == 1) { + SI_MAP_VAR(0) = 450; + SI_MAP_VAR(1) = 450; + } + await N(makeEntities); + spawn N(80241780); + spawn N(enterWalk_80241930); + sleep 1; +}); + +static s32 N(pad_1BB8)[] = { + 0x00000000, 0x00000000, +}; + +NpcAISettings N(npcAISettings_80241BC0) = { + .moveSpeed = 1.0f, + .moveTime = 25, + .waitTime = 30, + .alertRadius = 50.0f, + .unk_10 = { .f = 50.0f }, + .unk_14 = 10, + .chaseRadius = 100.0f, + .unk_28 = { .f = 80.0f }, + .unk_2C = 1, +}; + +Script N(npcAI_80241BF0) = SCRIPT({ + N(func_8024113C_BDFECC)(N(npcAISettings_80241BC0)); +}); + +NpcSettings N(npcSettings_80241C10) = { + .height = 24, + .radius = 24, + .ai = &N(npcAI_80241BF0), + .level = 99, +}; + +NpcSettings N(npcSettings_80241C3C) = { + .height = 24, + .radius = 24, + .level = 99, +}; + +s32 N(D_80241C68_BE09F8) = { + 0x00000000, +}; + +Script N(80241C6C) = SCRIPT({ + ShowGotItem(SI_VAR(0), 1, 0); + return; +}); + +Script N(80241C9C) = SCRIPT({ + ShowGotItem(SI_VAR(0), 1, 16); + return; +}); + +s32 N(D_80241CCC_BE0A5C) = { + 0x00000000, +}; + +s32 N(D_80241CD0_BE0A60) = { + 0x00000000, +}; + +Script N(80241CD4) = SCRIPT({ + SI_VAR(9) = SI_VAR(1); + func_802D6420(); + SI_VAR(10) = SI_VAR(0); + match SI_VAR(0) { + == 0 {} + == -1 {} + else { + RemoveKeyItemAt(SI_VAR(1)); + GetPlayerPos(SI_VAR(3), SI_VAR(4), SI_VAR(5)); + N(SomeXYZFuncTodoRename)(SI_VAR(3), SI_VAR(4), SI_VAR(5)); + SI_VAR(0) |=c 0x50000; + MakeItemEntity(SI_VAR(0), SI_VAR(3), SI_VAR(4), SI_VAR(5), 1, 0); + SetPlayerAnimation(0x60005); + sleep 30; + SetPlayerAnimation(ANIM_10002); + RemoveItemEntity(SI_VAR(0)); + } + } + N(func_80241648_BE03D8)(SI_VAR(10)); + func_802D6954(); + unbind; +}); + +Script N(80241E18) = { + SI_CMD(ScriptOpcode_CALL, N(func_80241680_BE0410), SI_VAR(0)), + SI_CMD(ScriptOpcode_BIND_PADLOCK, N(80241CD4), 0x10, 0, D_80244A20, 0, 1), + SI_CMD(ScriptOpcode_CALL, N(func_802415F4_BE0384), SI_VAR(0)), + SI_CMD(ScriptOpcode_RETURN), + SI_CMD(ScriptOpcode_END) +}; + +Script N(80241E68) = SCRIPT({ + SetPlayerAnimation(ANIM_10002); + sleep 1; + SetPlayerAnimation(0x80007); + sleep 20; +}); + +Script N(interact_80241EB0) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(2) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0073)); + SI_AREA_FLAG(2) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0074)); + SI_AREA_FLAG(2) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0075)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0076)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0077)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0078)); + SetPlayerAnimation(ANIM_10002); + sleep 10; + SetPlayerAnimation(0x80007); + sleep 20; + EndSpeech(-1, 9765124, 9765121, 0); + } + } +}); + +Script N(idle_80242064) = SCRIPT({ + DisablePlayerInput(TRUE); + sleep 25; + spawn { + sleep 50; + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 325); + SetCamSpeed(0, 4.0); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PanToTarget(0, 0, 1); + } + spawn { + sleep 20; + GetCurrentPartnerID(SI_VAR(6)); + if (SI_VAR(6) != 9) { + BringPartnerOut(9); + DisablePartnerAI(0); + sleep 1; + NpcFaceNpc(NPC_PARTNER, NPC_SELF, 0); + sleep 5; + SetNpcJumpscale(NPC_PARTNER, 0); + if (SI_VAR(6) == 4) { + NpcJump0(NPC_PARTNER, -81, 176, 171, 20); + } else { + NpcJump0(NPC_PARTNER, -81, 186, 171, 20); + } + EnablePartnerAI(); + } + } + SetNpcJumpscale(NPC_SELF, 0); + NpcJump0(NPC_SELF, -8, 186, 159, 60); + sleep 15; + DisablePartnerAI(0); + InterpNpcYaw(NPC_SELF, -4, 0); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x006E)); + InterpNpcYaw(NPC_PARTNER, -1, 0); + SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x006F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x0070)); + InterpNpcYaw(NPC_PARTNER, -1, 0); + SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x0071)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x0072)); + EnablePartnerAI(); + sleep 10; + GetCurrentPartnerID(SI_VAR(6)); + if (SI_VAR(6) != 9) { + PutPartnerAway(); + } + spawn { + NpcMoveTo(NPC_SELF, 30, 125, 30); + InterpNpcYaw(NPC_SELF, 270, 0); + } + func_802CF56C(2); + sleep 15; + STORY_PROGRESS = STORY_CH3_ARRIVED_AT_GHOST_TOWN; + DisablePlayerInput(FALSE); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamSpeed(0, 3); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + PanToTarget(0, 0, 0); +}); + +Script N(init_802424E0) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_ARRIVED_AT_GHOST_TOWN) { + SetNpcPos(NPC_SELF, 175, 240, 145); + BindNpcIdle(NPC_SELF, N(idle_80242064)); + } + BindNpcInteract(NPC_SELF, N(interact_80241EB0)); +}); + +Script N(interact_8024254C) = SCRIPT({ + if (SI_MAP_VAR(0) != 0) { + if (SI_MAP_VAR(0) >= SI_MAP_VAR(1)) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0081)); + SI_VAR(0) = 118; + SI_VAR(1) = 1; + await N(80241C6C); + AddKeyItem(ITEM_PACKAGE); + SI_MAP_VAR(0) = 0; + SI_SAVE_FLAG(1015) = 1; + SI_SAVE_FLAG(1020) = 0; + return; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0080)); + return; + } + } + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(3) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0079)); + SI_AREA_FLAG(3) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007A)); + SI_AREA_FLAG(3) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007B)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007C)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007D)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007E)); + } + } + if (SI_SAVE_FLAG(1015) == 0) { + if (SI_SAVE_VAR(348) == 18) { + await N(80241E68); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007F)); + EndSpeech(-1, 9765124, 9765121, 0); + SI_MAP_VAR(0) = 0; + SI_MAP_VAR(1) = 450; + SI_SAVE_FLAG(1020) = 1; + spawn { + loop { + SI_MAP_VAR(0) += 1; + sleep 1; + if (SI_MAP_VAR(0) >= SI_MAP_VAR(1)) { + break loop; + } + } + } + } + } +}); + +Script N(init_802428A8) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_8024254C)); +}); + +Script N(802428CC) = SCRIPT({ + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + GetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5)); + if (SI_VAR(0) > SI_VAR(3)) { + SI_VAR(0) += 60; + SetNpcYaw(0x4, 90); + } else { + SI_VAR(0) -= 60; + SetNpcYaw(0x4, 270); + } + SI_VAR(1) += 20; + SetNpcPos(0x4, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + func_802CFD30(0x4, 7, 0, 0, 0, 0); + sleep 1; +}); + +Script N(802429D4) = SCRIPT({ + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + GetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5)); + if (SI_VAR(0) > SI_VAR(3)) { + SI_VAR(0) += 30; + } else { + SI_VAR(0) -= 30; + } + spawn { + MakeLerp(0, 255, 40, 0); + 10: + UpdateLerp(); + func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + if (SI_VAR(1) == 1) { + goto 10; + } + } + NpcMoveTo(0x4, SI_VAR(0), SI_VAR(2), 40); +}); + +Script N(80242B0C) = SCRIPT({ + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + GetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5)); + if (SI_VAR(0) > SI_VAR(3)) { + SI_VAR(0) += 60; + } else { + SI_VAR(0) -= 60; + } + spawn { + MakeLerp(255, 0, 40, 0); + 10: + UpdateLerp(); + func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + if (SI_VAR(1) == 1) { + goto 10; + } + } + NpcMoveTo(0x4, SI_VAR(0), SI_VAR(2), 40); + SetNpcPos(0x4, 0, -1000, 0); +}); + +Script N(80242C60) = SCRIPT({ + await N(802429D4); + SI_MAP_VAR(2) = 0; + SI_MAP_VAR(3) = 0; + spawn { + sleep 25; + SetPlayerAnimation(0x80017); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_9)); + loop { + if (SI_MAP_VAR(2) == 1) { + break loop; + } + sleep 1; + } + SetPlayerAnimation(ANIM_10002); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_1)); + } + SetNpcAnimation(0x4, NPC_ANIM(boo, Palette_01, Anim_8)); + EndSpeech(4, 9765128, 9765128, 5); + sleep 30; + SetNpcAnimation(0x4, NPC_ANIM(boo, Palette_01, Anim_1)); + sleep 10; + await N(80242B0C); + SI_MAP_VAR(2) = 1; + sleep 15; +}); + +Script N(interact_80242DC4) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(4) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0082)); + SI_AREA_FLAG(4) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0083)); + SI_AREA_FLAG(4) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0084)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0085)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + DisablePartnerAI(0); + DisablePlayerPhysics(TRUE); + spawn { + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(2) += -20; + SetNpcSpeed(NPC_PARTNER, 2.0); + NpcMoveTo(NPC_PARTNER, SI_VAR(0), SI_VAR(2), 0); + NpcFaceNpc(NPC_PARTNER, NPC_SELF, 1); + } + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0086)); + await N(802428CC); + PlayerFaceNpc(4, 1); + NpcFaceNpc(NPC_PARTNER, 0x4, 1); + SpeakToPlayer(0x4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x0087)); + await N(80242C60); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0088)); + DisablePlayerPhysics(FALSE); + EnablePartnerAI(); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + DisablePartnerAI(0); + DisablePlayerPhysics(TRUE); + spawn { + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(2) += -20; + SetNpcSpeed(NPC_PARTNER, 2.0); + NpcMoveTo(NPC_PARTNER, SI_VAR(0), SI_VAR(2), 0); + NpcFaceNpc(NPC_PARTNER, NPC_SELF, 1); + } + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0089)); + await N(802428CC); + PlayerFaceNpc(4, 1); + NpcFaceNpc(NPC_PARTNER, 0x4, 1); + SpeakToPlayer(0x4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x008A)); + await N(80242C60); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008B)); + DisablePlayerPhysics(FALSE); + EnablePartnerAI(); + } + } +}); + +Script N(init_802431A4) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_80242DC4)); +}); + +Script N(interact_802431C8) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(5) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008C)); + SI_AREA_FLAG(5) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008D)); + SI_AREA_FLAG(5) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008E)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008F)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0090)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0091)); + } + } +}); + +Script N(init_80243328) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_802431C8)); +}); + +Script N(init_8024334C) = SCRIPT({ + SetNpcPos(NPC_SELF, 0, -1000, 0); +}); + +StaticNpc N(npcGroup_80243378) = { + .id = 0, + .settings = &N(npcSettings_80241C10), + .pos = { 36.0f, 185.0f, 140.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS, + .init = &N(init_802424E0), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .movement = { 2, 36, 10, 185, 56, 10, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 479, 215, 198, 150 }, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AA), +}; + +StaticNpc N(npcGroup_80243568) = { + .id = 1, + .settings = &N(npcSettings_80241C3C), + .pos = { 209.0f, 185.0f, 217.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS, + .init = &N(init_802428A8), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AB), +}; + +StaticNpc N(npcGroup_80243758) = { + .id = 2, + .settings = &N(npcSettings_80241C10), + .pos = { 379.0f, 186.0f, 186.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS, + .init = &N(init_802431A4), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .movement = { 2, 379, 10, 186, 399, 10, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 479, 215, 198, 150 }, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AC), +}; + +StaticNpc N(npcGroup_80243948) = { + .id = 3, + .settings = &N(npcSettings_80241C3C), + .pos = { 544.0f, 235.0f, 128.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS, + .init = &N(init_80243328), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AD), +}; + +StaticNpc N(npcGroup_80243B38) = { + .id = 4, + .settings = &N(npcSettings_80241C3C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS, + .init = &N(init_8024334C), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, +}; + +Script N(idle_80243D28) = SCRIPT({ + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(3) = SI_VAR(0); + SI_VAR(3) += -60; + SI_VAR(4) = SI_VAR(0); + SI_VAR(4) += 60; + loop { + RandInt(5, SI_VAR(5)); + SI_VAR(6) =f SI_VAR(5); + SI_VAR(6) *= 0.1005859375; + SI_VAR(6) += 0.80078125; + SetNpcSpeed(NPC_SELF, SI_VAR(6)); + NpcMoveTo(NPC_SELF, SI_VAR(3), SI_VAR(2), 0); + RandInt(5, SI_VAR(5)); + SI_VAR(6) =f SI_VAR(5); + SI_VAR(6) *= 0.1005859375; + SI_VAR(6) += 0.80078125; + SetNpcSpeed(NPC_SELF, SI_VAR(6)); + NpcMoveTo(NPC_SELF, SI_VAR(4), SI_VAR(2), 0); + } +}); + +Script N(init_80243E90) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_80243D28)); + SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE); +}); + +Script N(init_80243ECC) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_80243D28)); + SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE); +}); + +Script N(init_80243F08) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_80243D28)); + SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE); +}); + +Script N(init_80243F44) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_80243D28)); + SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE); +}); + +StaticNpc N(npcGroup_80243F80)[] = { + { + .id = 5, + .settings = &N(npcSettings_80241C3C), + .pos = { 36.0f, 277.0f, 140.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80243E90), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 6, + .settings = &N(npcSettings_80241C3C), + .pos = { 180.0f, 285.0f, 182.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80243ECC), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 7, + .settings = &N(npcSettings_80241C3C), + .pos = { 349.0f, 286.0f, 152.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80243F08), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 8, + .settings = &N(npcSettings_80241C3C), + .pos = { 490.0f, 324.0f, 128.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80243F44), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, +}; + +NpcGroupList N(npcGroupList_80244740) = { + NPC_GROUP(N(npcGroup_80243378), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243568), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243758), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243948), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243B38), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +NpcGroupList N(npcGroupList_80244788) = { + NPC_GROUP(N(npcGroup_80243378), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243568), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243758), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243948), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243B38), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80243F80), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +static s32 N(pad_47DC) = { + 0x00000000, +}; + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EA564, 300, 237, 60, 0, ITEM_COIN, MAKE_ENTITY_END); + AssignBlockFlag(SI_SAVE_FLAG(1007)); + MakeEntity(0x802E9A18, 250, 237, 125, 0, MAKE_ENTITY_END); +}); + +void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; +} + +void N(func_80240158_BDEEE8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x; + z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} + +#include "world/common/UnkNpcAIFunc1.inc.c" + +void N(func_802404C0_BDF250)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} + +void N(func_8024067C_BDF40C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; +} + +#include "world/common/NpcJumpFunc2.inc.c" + +#include "world/common/NpcJumpFunc.inc.c" + +#include "world/common/UnkNpcAIFunc13.inc.c" + +void N(func_8024094C_BDF6DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} + +#include "world/common/UnkNpcDurationFlagFunc.inc.c" + +void N(func_80240AD4_BDF864)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} + +ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + Bytecode* args = script->ptrReadPos; + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++); + f32 posX, posY, posZ, posW; + + territory.unk_00 = 0; + territory.shape = enemy->territory->patrol.detectShape; + territory.pointX = enemy->territory->patrol.detect.x; + territory.pointZ = enemy->territory->patrol.detect.z; + territory.sizeX = enemy->territory->patrol.detectSizeX; + territory.sizeZ = enemy->territory->patrol.detectSizeZ; + territory.unk_34 = 65.0f; + territory.unk_1C = 0; + + if (isInitialCall || enemy->unk_B0 & 4) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->currentAnim = enemy->animList[0]; + npc->flags &= ~0x800; + if (!enemy->territory->patrol.isFlying) { + npc->flags = (npc->flags | 0x200) & ~8; + } else { + npc->flags = (npc->flags & ~0x200) | 8; + } + + if (enemy->unk_B0 & 4) { + script->functionTemp[0].s = 99; + script->functionTemp[1].s = 0; + enemy->unk_B0 &= ~4; + } else if (enemy->flags & 0x40000000) { + script->functionTemp[0].s = 12; + enemy->flags &= 0xBFFFFFFF; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = 100.0f; + + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + npc->pos.y = posY; + } + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240000_BDED90)(script, npcAISettings, territoryPtr); + case 1: + N(func_80240158_BDEEE8)(script, npcAISettings, territoryPtr); + break; + case 2: + N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); + case 3: + N(func_802404C0_BDF250)(script, npcAISettings, territoryPtr); + break; + case 4: + N(func_8024067C_BDF40C)(script, npcAISettings, territoryPtr); + break; + case 10: + N(NpcJumpFunc2)(script, npcAISettings, territoryPtr); + case 11: + N(NpcJumpFunc)(script, npcAISettings, territoryPtr); + break; + case 12: + N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr); + case 13: + N(func_8024094C_BDF6DC)(script, npcAISettings, territoryPtr); + break; + case 14: + N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr); + break; + case 15: + N(func_80240AD4_BDF864)(script, npcAISettings, territoryPtr); + break; + case 99: + func_8004A73C(script); + } + return ApiStatus_BLOCK; +} + +void N(func_80240E90_BDFC20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f20; + f32 temp_f22; + + posX = npc->pos.x; + posZ = npc->pos.z; + temp_f22 = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x; + temp_f20 = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z; + + npc->yaw = atan2(posX, posZ, temp_f22, temp_f20); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + posX = npc->pos.x; + posY = npc->pos.y + (*(enemy->territory->patrol.points + script->functionTemp[2].s)).y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + posY += (*(enemy->territory->patrol.points + script->functionTemp[2].s)).y; + posW = posY - npc->pos.y; + if (posW > 2.0) { + npc->pos.y += 2.0; + } else if (posW < -2.0) { + npc->pos.y -= 2.0; + } else { + npc->pos.y = posY; + } + + posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20); + if (!(posW > npc->moveSpeed)) { + script->functionTemp[0].s = 2; + } +} + +void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration < 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s >= 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + npc->currentAnim = enemy->animList[0]; + } + } +} + +ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Bytecode* args = script->ptrReadPos; + Npc* npc = get_npc_unsafe(enemy->npcID); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++); + + territory.unk_00 = 0; + territory.shape = enemy->territory->patrol.detectShape; + territory.pointX = enemy->territory->patrol.detect.x; + territory.pointZ = enemy->territory->patrol.detect.z; + territory.sizeX = enemy->territory->patrol.detectSizeX; + territory.sizeZ = enemy->territory->patrol.detectSizeZ; + territory.unk_34 = 100.0f; + territory.unk_1C = 0; + + if (isInitialCall) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->flags &= ~0x800; + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240000_BDED90)(script, npcAISettings, territoryPtr); + case 1: + N(func_80240E90_BDFC20)(script, npcAISettings, territoryPtr); + break; + case 2: + N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr); + case 3: + N(func_80241068_BDFDF8)(script, npcAISettings, territoryPtr); + break; + case 4: + N(func_8024067C_BDF40C)(script, npcAISettings, territoryPtr); + break; + } + + enemy->varTable[0] = npc->pos.y; + return ApiStatus_BLOCK; +} + +ApiStatus N(func_802412B0_BE0040)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &N(D_80241C68_BE09F8); + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &N(D_80241C68_BE09F8); + heap_free(*ptr); + *ptr = NULL; + } + return ApiStatus_DONE2; +} + +#include "world/common/GetItemName.inc.c" + +#include "world/common/GetNpcCollisionHeight.inc.c" + +#include "world/common/SomeXYZFuncTodoRename.inc.c" + +ApiStatus N(func_802415F4_BE0384)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &N(D_80241CCC_BE0A5C); + *ptr = 0; + } + + ptr = &N(D_80241CCC_BE0A5C); + if (*ptr != NULL) { + ptr = &N(D_80241CCC_BE0A5C); + *ptr = 0; + set_variable(script, *args, N(D_80241CD0_BE0A60)); + return ApiStatus_DONE2; + } + + return ApiStatus_BLOCK; +} + +ApiStatus N(func_80241648_BE03D8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + N(D_80241CD0_BE0A60) = get_variable(script, *args); + N(D_80241CCC_BE0A5C) = 1; + return ApiStatus_DONE2; +} + +#ifdef NON_MATCHING +ApiStatus func_80241680_BE0410(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* temp_v0 = get_variable(script, *args); + s32* ptr = temp_v0; + s32 i; + + i = 0; + if (ptr != NULL) { + s32 new_var; + for (new_var = ptr[0]; new_var != 0; i++) { + *(D_80244A20 + i) = ptr[i]; + } + D_80244A20[i] = 0; + } else { + for (; i < 0x70; i++) { + *(D_80244A20 + i) = i + 16; + D_80244A20[0x70] = 0; + } + } + return ApiStatus_DONE2; +} +#else +INCLUDE_ASM(s32, "world/area_arn/arn_03/BDED90", arn_03_func_80241680_BE0410, ScriptInstance* script, s32 isInitialCall); +#endif + diff --git a/src/world/area_arn/arn_03/header.c b/src/world/area_arn/arn_03/header.c new file mode 100644 index 0000000000..67504343c9 --- /dev/null +++ b/src/world/area_arn/arn_03/header.c @@ -0,0 +1,29 @@ +#include "arn_03.h" + +EntryList N(entryList) = { + { -76.0, 165.0, 150.0, 90.0 }, + { 576.0, 225.0, 150.0, 270.0 }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .background = &gBackgroundImage, + .tattle = MSG_arn_03_tattle, +}; + +Script N(80241780) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_WOKE_UP { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } + PlayAmbientSounds(AMBIENT_WIND); +}); diff --git a/src/world/area_arn/arn_04/BE37B0.c b/src/world/area_arn/arn_04/BE37B0.c deleted file mode 100644 index d90de0cb3a..0000000000 --- a/src/world/area_arn/arn_04/BE37B0.c +++ /dev/null @@ -1,81 +0,0 @@ -#include "arn_04.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80240000_BE37B0); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80240158_BE3908); - -#include "world/common/UnkNpcAIFunc1.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_802404C0_BE3C70); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_8024067C_BE3E2C); - -#include "world/common/NpcJumpFunc2.inc.c" - -# include "world/common/NpcJumpFunc.inc.c" - -#include "world/common/UnkNpcAIFunc13.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_8024094C_BE40FC); - -#include "world/common/UnkNpcDurationFlagFunc.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80240AD4_BE4284); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80240B94_BE4344); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80240E90_BE4640); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80241040_BE47F0); - -#define NAMESPACE dup_arn_04 -#include "world/common/UnkNpcAIFunc1.inc.c" -#define NAMESPACE arn_04 - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80241728_BE4ED8); - -#include "world/common/UnkNpcAIFunc2.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80241AE4_BE5294); - -#include "world/common/UnkNpcAIFunc14.inc.c" - -#include "world/common/UnkNpcAIFunc3.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80241CE8_BE5498); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242078_BE5828); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_8024219C_BE594C); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242388_BE5B38); - -#include "world/common/UnkNpcAIFunc18.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_8024255C_BE5D0C); - -#include "world/common/UnkNpcAIFunc21.inc.c" - -#include "world/common/UnkNpcAIFunc20.inc.c" - -#include "world/common/UnkNpcAIFunc22.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242858_BE6008); - -#include "world/common/UnkNpcAIFunc16.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242A1C_BE61CC); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242BBC_BE636C); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242D0C_BE64BC); - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80242DB8_BE6568); - -#include "world/common/UnkNpcAIFunc19.inc.c" - -#include "world/common/UnkNpcAIFunc17.inc.c" - -#include "world/common/UnkDurationCheck.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", func_80243018_BE67C8); diff --git a/src/world/area_arn/arn_04/arn_04.h b/src/world/area_arn/arn_04/arn_04.h index dce87cf8b8..bd84d038b5 100644 --- a/src/world/area_arn/arn_04/arn_04.h +++ b/src/world/area_arn/arn_04/arn_04.h @@ -1,4 +1,17 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_04 + +s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3); +ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall); + +Script N(main); +Script N(802433D0); +NpcGroupList N(npcGroupList_80244000); +Script N(makeEntities); + +extern s16 D_8009A634; diff --git a/src/world/area_arn/arn_04/events.c b/src/world/area_arn/arn_04/events.c new file mode 100644 index 0000000000..2cf30a626c --- /dev/null +++ b/src/world/area_arn/arn_04/events.c @@ -0,0 +1,1272 @@ +#include "arn_04.h" +#include "sprite/npc/paragoomba.h" +#include "sprite/npc/goomba.h" +#include "sprite/npc/cleft.h" + +Script N(exitWalk_80243480) = EXIT_WALK_SCRIPT(60, 0, "arn_02", 1); + +Script N(exitWalk_802434DC) = EXIT_WALK_SCRIPT(60, 1, "dgb_00", 0); + +Script N(80243538) = SCRIPT({ + bind N(exitWalk_80243480) to TRIGGER_FLOOR_ABOVE 1; + bind N(exitWalk_802434DC) to TRIGGER_FLOOR_ABOVE 6; +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_GUSTY_GULCH; + SetSpriteShading(-1); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_80244000)); + await N(makeEntities); + spawn N(802433D0); + SI_VAR(0) = N(80243538); + spawn EnterWalk; + sleep 1; +}); + +static s32 N(pad_3654)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; + +NpcAISettings N(npcAISettings_80243660) = { + .moveSpeed = 1.5f, + .moveTime = 30, + .waitTime = 30, + .alertRadius = 130.0f, + .unk_14 = 1, + .chaseSpeed = 2.5f, + .unk_1C = 180, + .unk_20 = 3, + .chaseRadius = 150.0f, + .unk_2C = 1, +}; + +Script N(npcAI_80243690) = SCRIPT({ + N(func_80240B94_BE4344)(N(npcAISettings_80243660)); +}); + +NpcSettings N(npcSettings_802436B0) = { + .height = 20, + .radius = 23, + .ai = &N(npcAI_80243690), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, +}; + +f32 N(D_802436DC_BE6E8C)[] = { + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, +}; + +NpcAISettings N(npcAISettings_802436F4) = { + .moveSpeed = 1.8f, + .moveTime = 60, + .waitTime = 15, + .alertRadius = 120.0f, + .unk_14 = 3, + .chaseSpeed = 4.0f, + .unk_1C = 5, + .unk_20 = 1, + .chaseRadius = 150.0f, + .unk_2C = 1, +}; + +Script N(npcAI_80243724) = SCRIPT({ + SetSelfVar(0, 1); + SetSelfVar(5, -850); + SetSelfVar(6, 60); + SetSelfVar(1, 700); + N(func_8024219C_BE594C)(N(npcAISettings_802436F4)); +}); + +NpcSettings N(npcSettings_80243794) = { + .height = 18, + .radius = 20, + .ai = &N(npcAI_80243724), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, + .unk_2A = 1, +}; + +NpcAISettings N(npcAISettings_802437C0) = { + .moveSpeed = 1.0f, + .moveTime = 30, + .waitTime = 30, + .alertRadius = 120.0f, + .unk_14 = 3, + .chaseSpeed = 8.5f, + .unk_1C = 60, + .unk_20 = 3, + .chaseRadius = 100.0f, + .unk_28 = { .f = 60.0f }, + .unk_2C = 1, +}; + +Script N(npcAI_802437F0) = SCRIPT({ + N(func_80243018_BE67C8)(N(npcAISettings_802437C0), 8); +}); + +NpcSettings N(npcSettings_80243814) = { + .height = 24, + .radius = 24, + .ai = &N(npcAI_802437F0), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 15, +}; + +StaticNpc N(npcGroup_80243840) = { + .id = 0, + .settings = &N(npcSettings_80243794), + .pos = { -350.0f, 180.0f, 150.0f }, + .flags = NPC_FLAG_LOCK_ANIMS, + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { -350, 180, 150, 30, 0, -32767, 0, -350, 180, 150, 150 }, + .animations = { + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_3), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_5), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_80243A30) = { + .id = 1, + .settings = &N(npcSettings_802436B0), + .pos = { 360.0f, 208.0f, 100.0f }, + .flags = NPC_FLAG_LOCK_ANIMS, + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 360, 208, 100, 30, 0, -32767, 0, 360, 208, 100, 150 }, + .animations = { + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, walk), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_80243C20) = { + .id = 2, + .settings = &N(npcSettings_80243814), + .pos = { 150.0f, 177.0f, 160.0f }, + .flags = NPC_FLAG_LOCK_ANIMS, + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = STANDARD_HEART_DROPS(3), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .minCoinBonus = 1, + .maxCoinBonus = 3, + .movement = { 150, 177, 160, 30, 0, -32767, 0, 150, 177, 160, 150 }, + .animations = { + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_6), + NPC_ANIM(cleft, Palette_01, Anim_7), + NPC_ANIM(cleft, Palette_01, Anim_7), + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_8), + NPC_ANIM(cleft, Palette_01, Anim_8), + NPC_ANIM(cleft, Palette_01, Anim_14), + NPC_ANIM(cleft, Palette_01, Anim_17), + NPC_ANIM(cleft, Palette_01, Anim_13), + NPC_ANIM(cleft, Palette_01, Anim_15), + NPC_ANIM(cleft, Palette_01, Anim_10), + NPC_ANIM(cleft, Palette_01, Anim_11), + NPC_ANIM(cleft, Palette_01, Anim_16), + NPC_ANIM(cleft, Palette_01, Anim_0), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_80243E10) = { + .id = 3, + .settings = &N(npcSettings_80243814), + .pos = { 550.0f, 230.0f, 125.0f }, + .flags = NPC_FLAG_LOCK_ANIMS, + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = STANDARD_HEART_DROPS(3), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .minCoinBonus = 1, + .maxCoinBonus = 3, + .movement = { 550, 230, 125, 30, 0, -32767, 0, 550, 230, 125, 150 }, + .animations = { + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_6), + NPC_ANIM(cleft, Palette_01, Anim_7), + NPC_ANIM(cleft, Palette_01, Anim_7), + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_2), + NPC_ANIM(cleft, Palette_01, Anim_8), + NPC_ANIM(cleft, Palette_01, Anim_8), + NPC_ANIM(cleft, Palette_01, Anim_14), + NPC_ANIM(cleft, Palette_01, Anim_17), + NPC_ANIM(cleft, Palette_01, Anim_13), + NPC_ANIM(cleft, Palette_01, Anim_15), + NPC_ANIM(cleft, Palette_01, Anim_10), + NPC_ANIM(cleft, Palette_01, Anim_11), + NPC_ANIM(cleft, Palette_01, Anim_16), + NPC_ANIM(cleft, Palette_01, Anim_0), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +NpcGroupList N(npcGroupList_80244000) = { + NPC_GROUP(N(npcGroup_80243840), BATTLE_ID(14, 9, 0, 1)), + NPC_GROUP(N(npcGroup_80243A30), BATTLE_ID(14, 3, 0, 1)), + NPC_GROUP(N(npcGroup_80243C20), BATTLE_ID(14, 12, 0, 1)), + NPC_GROUP(N(npcGroup_80243E10), BATTLE_ID(14, 14, 0, 1)), + {}, +}; + +static s32 N(pad_403C)[] = { + 0x00000000, +}; + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EA564, 450, 285, 120, 0, ITEM_SUPER_SHROOM, MAKE_ENTITY_END); + AssignBlockFlag(SI_SAVE_FLAG(1008)); + MakeEntity(0x802EA564, 720, 333, 75, 0, ITEM_COIN, MAKE_ENTITY_END); + AssignBlockFlag(SI_SAVE_FLAG(1009)); + MakeEntity(0x802EA0E8, 600, 290, 200, 0, MAKE_ENTITY_END); + AssignBlockFlag(SI_SAVE_FLAG(1010)); + MakeItemEntity(ITEM_STAR_PIECE, 540, 230, 13, 17, SI_SAVE_FLAG(1019)); +}); + +void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, (*(enemy->territory->patrol.points + i)).x, enemy->territory->patrol.points[i].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; +} + +void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x; + z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} + +#include "world/common/UnkNpcAIFunc1.inc.c" + +void N(func_802404C0_BE3C70)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} + +void N(func_8024067C_BE3E2C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; +} + +#include "world/common/NpcJumpFunc2.inc.c" + +#include "world/common/NpcJumpFunc.inc.c" + +#include "world/common/UnkNpcAIFunc13.inc.c" + +void N(func_8024094C_BE40FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} + +#include "world/common/UnkNpcDurationFlagFunc.inc.c" + +void N(func_80240AD4_BE4284)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} + +ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + Bytecode* args = script->ptrReadPos; + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++); + f32 posX, posY, posZ, posW; + + territory.unk_00 = 0; + territory.shape = enemy->territory->patrol.detectShape; + territory.pointX = enemy->territory->patrol.detect.x; + territory.pointZ = enemy->territory->patrol.detect.z; + territory.sizeX = enemy->territory->patrol.detectSizeX; + territory.sizeZ = enemy->territory->patrol.detectSizeZ; + territory.unk_34 = 65.0f; + territory.unk_1C = 0; + + if (isInitialCall || enemy->unk_B0 & 4) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->currentAnim = enemy->animList[0]; + npc->flags &= ~0x800; + if (!enemy->territory->patrol.isFlying) { + npc->flags = (npc->flags | 0x200) & ~8; + } else { + npc->flags = (npc->flags & ~0x200) | 8; + } + + if (enemy->unk_B0 & 4) { + script->functionTemp[0].s = 99; + script->functionTemp[1].s = 0; + enemy->unk_B0 &= ~4; + } else if (enemy->flags & 0x40000000) { + script->functionTemp[0].s = 12; + enemy->flags &= 0xBFFFFFFF; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = 100.0f; + + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + npc->pos.y = posY; + } + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240000_BE37B0)(script, aiSettings, territoryPtr); + case 1: + N(func_80240158_BE3908)(script, aiSettings, territoryPtr); + break; + case 2: + N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); + case 3: + N(func_802404C0_BE3C70)(script, aiSettings, territoryPtr); + break; + case 4: + N(func_8024067C_BE3E2C)(script, aiSettings, territoryPtr); + break; + case 10: + N(NpcJumpFunc2)(script, aiSettings, territoryPtr); + case 11: + N(NpcJumpFunc)(script, aiSettings, territoryPtr); + break; + case 12: + N(UnkNpcAIFunc13)(script, aiSettings, territoryPtr); + case 13: + N(func_8024094C_BE40FC)(script, aiSettings, territoryPtr); + break; + case 14: + N(UnkNpcDurationFlagFunc)(script, aiSettings, territoryPtr); + break; + case 15: + N(func_80240AD4_BE4284)(script, aiSettings, territoryPtr); + break; + case 99: + func_8004A73C(script); + } + return ApiStatus_BLOCK; +} + +void N(func_80240E90_BE4640)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} + +#ifdef NON_MATCHING +// second func_800DCB7C call +void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 temp_f24; + f32 posX, posY, posZ, posW; + s32 var; + f32 temp_f0; + f32 phi_f4; + s32 phi_v0; + s32 phi_s4 = 0; + + f32 a = enemy->varTable[7]; + f32 temp_f2 = a / 100.0; + f32 b = enemy->varTable[3]; + f32 temp_f26 = b / 100.0; + f32 c = enemy->varTable[4]; + f32 temp_f20 = c / 100.0; + f32 d = enemy->varTable[1]; + f32 temp_f22 = d / 100.0; + + enemy->varTable[4] = npc->pos.y * 100.0; + temp_f24 = temp_f26 + temp_f2; + + if ((enemy->varTable[0] & 0x11) == 1) { + if (npc->flags & 8) { + if (temp_f22 < (temp_f24 - npc->pos.y)) { + enemy->varTable[0] |= 0x10; + } + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + if (temp_f22 < (temp_f26 - posW)) { + enemy->varTable[0] |= 0x10; + } + } + } + + if ((enemy->varTable[0] & 0x11) == 0x11) { + f64 test; + if (npc->flags & 8) { + phi_f4 = temp_f24; + test = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + npc->pos.y = test; + } else { + posX = npc->pos.x; + posY = temp_f20; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + phi_f4 = posY; + phi_f4 += temp_f26; + d = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + test = d; + npc->pos.y = test; + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + } + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + + if (fabsf(phi_f4 - npc->pos.y) < 1.0) { + npc->pos.y = phi_f4; + enemy->varTable[0] &= ~0x10; + } + } else if (enemy->varTable[1] > 0) { + temp_f0 = sin_deg(enemy->varTable[2]); + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + if (phi_v0) { + npc->pos.y = posY + temp_f26 + (temp_f0 * temp_f22); + } else { + npc->pos.y = temp_f24 + (temp_f0 * temp_f22); + } + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && + func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + } else { + enemy->varTable[9]--; + } + + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); + if (npc->moveSpeed < posW) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + phi_s4 = 1; + } + } + + if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) { + if (npc->unk_8C == 0) { + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } else { + return; + } + } + + enemy->varTable[4] = npc->pos.y * 100.0; + if (aiSettings->moveTime > 0) { + if ((npc->duration <= 0) || (--npc->duration <= 0)) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { + script->functionTemp[0].s = 0; + } + } + } +} +#else +INCLUDE_ASM(void, "world/area_arn/arn_04/BE37B0", arn_04_func_80241040_BE47F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +#endif + +#include "world/common/UnkNpcAIFunc1_copy.inc.c" + +void N(func_80241728_BE4ED8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} + +#include "world/common/UnkNpcAIFunc2.inc.c" + +void N(func_80241AE4_BE5294)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} + +#include "world/common/UnkNpcAIFunc14.inc.c" + +#include "world/common/UnkNpcAIFunc3.inc.c" + +void N(func_80241CE8_BE5498)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} + +void N(func_80242078_BE5828)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} + +ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Bytecode* args = script->ptrReadPos; + Npc* npc = get_npc_unsafe(enemy->npcID); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* aiSettings = get_variable(script, *args); + + territory.unk_00 = 0; + territory.shape = enemy->territory->wander.detectShape; + territory.pointX = enemy->territory->wander.detect.x; + territory.pointZ = enemy->territory->wander.detect.z; + territory.sizeX = enemy->territory->wander.detectSizeX; + territory.sizeZ = enemy->territory->wander.detectSizeZ; + territory.unk_34 = 120.0f; + territory.unk_1C = 0; + + if (isInitialCall) { + N(func_80242078_BE5828)(npc, enemy, script, aiSettings); + } + + npc->unk_AB = -2; + + if (enemy->unk_B0 & 4) { + if (enemy->unk_B4 != 0) { + return ApiStatus_BLOCK; + } + enemy->unk_B0 &= ~4; + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240E90_BE4640)(script, aiSettings, territoryPtr); + case 1: + N(func_80241040_BE47F0)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 2: + N(UnkNpcAIFunc1_copy)(script, aiSettings, territoryPtr); + case 3: + N(func_80241728_BE4ED8)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 10: + N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); + case 11: + N(func_80241AE4_BE5294)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 12: + N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 13: + N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 14: + N(func_80241CE8_BE5498)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + } + + return ApiStatus_BLOCK; +} + +#ifdef NON_MATCHING +s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + Camera* camera = CAM(D_8009A634); + f32 phi_f20; + s32 phi_s0 = 0; + + if (func_800493EC(enemy, 0, aiSettings->alertRadius, aiSettings->unk_10.f)) { + phi_s0 = 1; + } + phi_f20 = 270.0f; + if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) { + phi_f20 = 90.0f; + } + + playerStatus = &gPlayerStatusPtr; + if (fabsf(get_clamped_angle_diff(phi_f20, + atan2(npc->pos.x, npc->pos.z, + (*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) { + phi_s0 = 0; + } + if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) { + phi_s0 = 0; + } + if (D_8010EBB0.unk_03 == 9) { + phi_s0 = 0; + } + return phi_s0; +} +#else +INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", arn_04_func_80242388_BE5B38, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +#endif + +#include "world/common/UnkNpcAIFunc18.inc.c" + +void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + npc->currentAnim = enemy->animList[9]; + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + npc->duration = 12; + script->functionTemp[0].s = 2; + } + } + + script->functionTemp[1].s--; +} + +#include "world/common/UnkNpcAIFunc21.inc.c" + +#include "world/common/UnkNpcAIFunc20.inc.c" + +#include "world/common/UnkNpcAIFunc22.inc.c" + +void N(func_80242858_BE6008)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + playerStatus = &gPlayerStatusPtr; + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else { + npc->duration--; + if (npc->duration <= 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; + script->functionTemp[0].s = 0x28; + } + } + } +} + +#include "world/common/UnkNpcAIFunc16.inc.c" + +void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + if (npc->duration % 3 == 0) { + fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); + } + + npc->duration--; + if (npc->duration <= 0) { + playerStatus = &gPlayerStatusPtr; + + enemy->unk_10.x = npc->pos.x; + enemy->unk_10.y = npc->pos.y; + enemy->unk_10.z = npc->pos.z; + enemy->unk_07 = 1; + npc->moveSpeed = aiSettings->chaseSpeed; + npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; + if (npc->duration < 15) { + npc->duration = 15; + } + script->functionTemp[0].s = 0x16; + } +} + +void N(func_80242BBC_BE636C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ; + s32 phi_s1; + + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + phi_s1 = 0; + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { + phi_s1 = 1; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + + if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + phi_s1 = 1; + } + + npc->duration--; + if (npc->duration <= 0) { + phi_s1 = 1; + } + if (phi_s1) { + script->functionTemp[0].s = 4; + enemy->unk_07 = 0; + } +} + +void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} + +void N(func_80242DB8_BE6568)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->duration = 10; + script->functionTemp[0].s = 50; + } else if (npc->unk_8C == 0) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } +} + +#include "world/common/UnkNpcAIFunc19.inc.c" + +#include "world/common/UnkNpcAIFunc17.inc.c" + +#include "world/common/UnkDurationCheck.inc.c" + +ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + Bytecode* args = script->ptrReadPos; + NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + u32 var; + + enemy->varTable[10] = get_variable(script, *args++); + + territory.unk_00 = 0; + territory.shape = enemy->territory->wander.detectShape; + territory.pointX = enemy->territory->wander.detect.x; + territory.pointZ = enemy->territory->wander.detect.z; + territory.sizeX = enemy->territory->wander.detectSizeX; + territory.sizeZ = enemy->territory->wander.detectSizeZ; + territory.unk_34 = 40.0f; + territory.unk_1C = 0; + + if (isInitialCall) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->flags &= ~0x800; + if (!enemy->territory->wander.isFlying) { + npc->flags |= 0x200; + npc->flags &= ~0x8; + + } else { + npc->flags &= ~0x200; + npc->flags |= 0x8; + } + } + + if (enemy->unk_B0 & 4) { + if (enemy->unk_B4 != 0) { + return ApiStatus_BLOCK; + } + enemy->unk_B0 &= ~4; + } + + if ((u32)script->functionTemp[0].s - 12 < 3 && N(func_80242388_BE5B38)(script, aiSettings, territoryPtr)) { + script->functionTemp[0].s = 20; + } + + switch (script->functionTemp[0].s) { + case 0: + N(UnkNpcAIFunc18)(script, aiSettings, territoryPtr); + case 1: + N(func_8024255C_BE5D0C)(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 2) { + return ApiStatus_BLOCK; + } + case 2: + N(UnkNpcAIFunc21)(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 3) { + return ApiStatus_BLOCK; + } + case 3: + N(UnkNpcAIFunc20)(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 4) { + return ApiStatus_BLOCK; + } + case 4: + N(UnkNpcAIFunc22)(script, aiSettings, territoryPtr); + case 5: + N(func_80242858_BE6008)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 12: + func_80049F7C(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 13) { + return ApiStatus_BLOCK; + } + case 13: + func_8004A124(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 14) { + return ApiStatus_BLOCK; + } + case 14: + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[0].s = 40; + } + return ApiStatus_BLOCK; + case 20: + N(UnkNpcAIFunc16)(script, aiSettings, territoryPtr); + case 21: + N(func_80242A1C_BE61CC)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 22: + N(func_80242BBC_BE636C)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 40: + N(func_80242D0C_BE64BC)(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 41) { + return ApiStatus_BLOCK; + } + case 41: + N(func_80242DB8_BE6568)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 50: + N(UnkNpcAIFunc19)(script, aiSettings, territoryPtr); + case 51: + N(UnkNpcAIFunc17)(script, aiSettings, territoryPtr); + if (script->functionTemp[0].s != 52) { + return ApiStatus_BLOCK; + } + case 52: + N(UnkDurationCheck)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + } + + return ApiStatus_BLOCK; +} diff --git a/src/world/area_arn/arn_04/header.c b/src/world/area_arn/arn_04/header.c new file mode 100644 index 0000000000..7fead87ddd --- /dev/null +++ b/src/world/area_arn/arn_04/header.c @@ -0,0 +1,30 @@ +#include "arn_04.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -585.0, 60.0, 150.0, 90.0 }, + { 820.0, 285.0, 150.0, 270.0 }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .background = &gBackgroundImage, + .tattle = MSG_arn_04_tattle, +}; + +Script N(802433D0) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_WOKE_UP { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } + PlayAmbientSounds(AMBIENT_WIND); +}); diff --git a/src/world/area_arn/arn_05/BE7BE0.c b/src/world/area_arn/arn_05/BE7BE0.c deleted file mode 100644 index 3e91d29a50..0000000000 --- a/src/world/area_arn/arn_05/BE7BE0.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "arn_05.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80240000_BE7BE0); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80240158_BE7D38); - -#include "world/common/UnkNpcAIFunc1.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_802404C0_BE80A0); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_8024067C_BE825C); - -#include "world/common/NpcJumpFunc2.inc.c" - -# include "world/common/NpcJumpFunc.inc.c" - -#include "world/common/UnkNpcAIFunc13.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_8024094C_BE852C); - -#include "world/common/UnkNpcDurationFlagFunc.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80240AD4_BE86B4); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80240B94_BE8774); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80240E90_BE8A70); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_80241068_BE8C48); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_8024113C_BE8D1C); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_802412B0_BE8E90); - -INCLUDE_ASM(s32, "world/area_arn/arn_05/BE7BE0", func_802412C8_BE8EA8); diff --git a/src/world/area_arn/arn_05/arn_05.h b/src/world/area_arn/arn_05/arn_05.h index 86c007d11a..6b4716b35a 100644 --- a/src/world/area_arn/arn_05/arn_05.h +++ b/src/world/area_arn/arn_05/arn_05.h @@ -1,4 +1,19 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_05 + +ApiStatus func_802D2B50(void); +ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall); + +ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802412C8_BE8EA8)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall); + +Script N(main); +Script N(80241360); +NpcGroupList N(npcGroupList_80244FA4); +NpcGroupList N(npcGroupList_80244FC8); +Script N(makeEntities); +Script N(802441FC); diff --git a/src/world/area_arn/arn_05/events.c b/src/world/area_arn/arn_05/events.c new file mode 100644 index 0000000000..7f427b700c --- /dev/null +++ b/src/world/area_arn/arn_05/events.c @@ -0,0 +1,1347 @@ +#include "arn_05.h" +#include "sprite/npc/boo.h" +#include "sprite/npc/world_bow.h" +#include "sprite/npc/world_tubba.h" + +Script N(exitWalk_80241430) = EXIT_WALK_SCRIPT(60, 0, "arn_03", 1); + +Script N(exitWalk_8024148C) = EXIT_WALK_SCRIPT(60, 1, "arn_02", 0); + +Script N(802414E8) = SCRIPT({ + bind N(exitWalk_80241430) to TRIGGER_FLOOR_ABOVE 1; + bind N(exitWalk_8024148C) to TRIGGER_FLOOR_ABOVE 5; +}); + +Script N(enterWalk_80241530) = SCRIPT({ + GetLoadType(SI_VAR(1)); + if (SI_VAR(1) == 1) { + spawn EnterSavePoint; + spawn N(802414E8); + return; + } + SI_VAR(0) = N(802414E8); + spawn EnterWalk; + sleep 1; +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_GUSTY_GULCH; + SetSpriteShading(-1); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamEnabled(0, 1); + if (STORY_PROGRESS < STORY_CH3_DEFEATED_TUBBA_BLUBBA) { + MakeNpcs(0, N(npcGroupList_80244FA4)); + } else { + MakeNpcs(0, N(npcGroupList_80244FC8)); + } + await N(makeEntities); + spawn N(802441FC); + spawn N(80241360); + spawn N(enterWalk_80241530); +}); + +static s32 N(pad_16A8)[] = { + 0x00000000, 0x00000000, +}; + +NpcSettings N(npcSettings_802416B0) = { + .height = 90, + .radius = 65, + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 13, +}; + +NpcAISettings N(npcAISettings_802416DC) = { + .moveSpeed = 1.0f, + .moveTime = 25, + .waitTime = 30, + .alertRadius = 50.0f, + .unk_10 = { .f = 50.0f }, + .unk_14 = 10, + .chaseRadius = 100.0f, + .unk_28 = { .f = 80.0f }, + .unk_2C = 1, +}; + +Script N(npcAI_8024170C) = SCRIPT({ + N(func_8024113C_BE8D1C)(N(npcAISettings_802416DC)); +}); + +NpcSettings N(npcSettings_8024172C) = { + .height = 24, + .radius = 24, + .ai = &N(npcAI_8024170C), + .level = 99, +}; + +NpcSettings N(npcSettings_80241758) = { + .height = 24, + .radius = 24, + .level = 99, +}; + +Script N(idle_80241784) = SCRIPT({ + +}); + +Script N(interact_80241794) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(6) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0092)); + SI_AREA_FLAG(6) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0093)); + SI_AREA_FLAG(6) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0095)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0096)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0097)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0098)); + } + } +}); + +Script N(interact_802418F4) = SCRIPT({ + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0094)); +}); + +Script N(interact_80241924) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(7) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0099)); + SI_AREA_FLAG(7) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009A)); + SI_AREA_FLAG(7) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009C)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009D)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009E)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009F)); + } + } +}); + +Script N(interact_80241A84) = SCRIPT({ + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009B)); +}); + +Script N(interact_80241AB4) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {} + < STORY_CH3_DEFEATED_TUBBA_BLUBBA {} + < STORY_CH3_BEGAN_PEACH_MISSION {} + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00A9)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + if (SI_SAVE_FLAG(1014) == 1) { + if (SI_AREA_FLAG(9) == 1) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AE)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B0)); + } + } else { + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AA)); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_9)); + ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_9), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AB)); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_A)); + ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_A), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AC)); + ShowChoice(1966110); + match SI_VAR(0) { + == 0 { + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5)); + ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AD)); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_1)); + SI_SAVE_FLAG(1014) = 1; + SI_AREA_FLAG(9) = 1; + } + == 1 { + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5)); + ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AD)); + SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_1)); + SI_SAVE_FLAG(1014) = 1; + SI_AREA_FLAG(9) = 1; + } + == 2 { + ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AF)); + } + } + } + } + } +}); + +Script N(interact_80241D88) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {} + < STORY_CH3_DEFEATED_TUBBA_BLUBBA {} + < STORY_CH3_BEGAN_PEACH_MISSION {} + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B1)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B2)); + } + } +}); + +Script N(interact_80241E28) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + if (SI_AREA_FLAG(8) == 0) { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B3)); + SI_AREA_FLAG(8) = 1; + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B4)); + SI_AREA_FLAG(8) = 0; + } + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B6)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B7)); + } + < STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B8)); + } + >= STORY_CH5_STAR_SPRIT_DEPARTED { + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B9)); + } + } +}); + +Script N(interact_80241F88) = SCRIPT({ + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B5)); +}); + +Script N(init_80241FB8) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_SAW_TUBBA_EAT_BOO) { + BindNpcIdle(NPC_SELF, N(idle_80241784)); + } + BindNpcInteract(NPC_SELF, N(interact_80241794)); +}); + +Script N(init_80242008) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_80241924)); +}); + +Script N(init_8024202C) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_80241AB4)); + match STORY_PROGRESS { + < STORY_CH3_SAW_TUBBA_EAT_BOO { + SetNpcFlagBits(NPC_SELF, 0x00000100, TRUE); + } + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + RemoveNpc(NPC_SELF); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetNpcPos(NPC_SELF, 0, -1000, 0); + RemoveNpc(NPC_SELF); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + SetNpcPos(NPC_SELF, 0, -1000, 0); + RemoveNpc(NPC_SELF); + } + < STORY_CH5_STAR_SPRIT_DEPARTED {} + >= STORY_CH5_STAR_SPRIT_DEPARTED { + } + } +}); + +Script N(init_8024212C) = SCRIPT({ + BindNpcInteract(NPC_SELF, N(interact_80241D88)); + match STORY_PROGRESS { + < STORY_CH3_SAW_TUBBA_EAT_BOO { + RemoveNpc(NPC_SELF); + } + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + RemoveNpc(NPC_SELF); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + RemoveNpc(NPC_SELF); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + RemoveNpc(NPC_SELF); + } + < STORY_CH5_STAR_SPRIT_DEPARTED {} + >= STORY_CH5_STAR_SPRIT_DEPARTED { + } + } +}); + +Script N(init_802421EC) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_SAW_TUBBA_EAT_BOO) { + BindNpcIdle(NPC_SELF, N(idle_80241784)); + } + BindNpcInteract(NPC_SELF, N(interact_80241E28)); +}); + +StaticNpc N(npcGroup_8024223C)[] = { + { + .id = 0, + .settings = &N(npcSettings_8024172C), + .pos = { 55.0f, 195.0f, 160.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80241FB8), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .movement = { 2, 55, 10, 160, 75, 10, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 55, 195, 160, 50 }, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AE), + }, + { + .id = 1, + .settings = &N(npcSettings_80241758), + .pos = { 160.0f, 191.0f, 250.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80242008), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00AF), + }, + { + .id = 2, + .settings = &N(npcSettings_80241758), + .pos = { 390.0f, 190.0f, 255.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024202C), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00B0), + }, + { + .id = 3, + .settings = &N(npcSettings_80241758), + .pos = { 503.0f, 206.0f, 210.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024212C), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00B1), + }, + { + .id = 4, + .settings = &N(npcSettings_8024172C), + .pos = { 350.0f, 185.0f, 197.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_802421EC), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .movement = { 2, 350, 10, 197, 330, 10, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 350, 185, 197, 50 }, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x00B2), + }, +}; + +Script N(80242BEC) = SCRIPT({ + loop SI_VAR(0) { + PlaySoundAtNpc(0x5, 0x20F6, 0); + ShakeCam(0, 0, 10, 0.5); + sleep 5; + } +}); + +Script N(80242C50) = SCRIPT({ + DisablePlayerInput(TRUE); + NpcFacePlayer(0x2, 1); + PlaySoundAtNpc(0x2, 0x262, 0); + ShowEmote(2, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0); + sleep 20; + GetNpcPos(0x2, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + GetPlayerPos(SI_VAR(3), SI_VAR(4), SI_VAR(5)); + SI_VAR(0) -= SI_VAR(3); + SI_VAR(0) -= 50; + SI_VAR(1) -= SI_VAR(4); + SI_VAR(2) -= SI_VAR(5); + GetNpcPos(0x2, SI_VAR(3), SI_VAR(4), SI_VAR(5)); + SI_VAR(3) -= SI_VAR(0); + SI_VAR(4) -= SI_VAR(1); + SI_VAR(5) -= SI_VAR(2); + NpcMoveTo(0x2, SI_VAR(3), SI_VAR(5), 30); + SetCamType(0, 6, 1); + SetCamSpeed(0, 5.0); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 350); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00A0)); + PlaySoundAt(0x20F6, 0, 450, 200, 160); + ShakeCam(0, 0, 20, 0.80078125); + PlaySoundAtNpc(NPC_PLAYER, 0x262, 0); + PlaySoundAtNpc(0x1, 0x262, 0); + PlaySoundAtNpc(0x2, 0x262, 0); + PlaySoundAtNpc(0x4, 0x262, 0); + ShowEmote(0, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0); + ShowEmote(1, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0); + ShowEmote(2, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0); + ShowEmote(4, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0); + FadeOutMusic(0, 500); + ClearAmbientSounds(250); + sleep 20; + InterpNpcYaw(0x2, 90, 1); + InterpNpcYaw(0x4, 90, 1); + sleep 20; + PlaySound(SOUND_BOO_APPEAR); + SI_VAR(0) = 240.0; + loop 20 { + SI_VAR(0) -= 12.0; + func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + } + SetNpcPos(NPC_PLAYER, 420, 300, 220); + SetNpcPos(0x1, 460, 250, 210); + SetNpcPos(0x4, 0, -1000, 0); + EnableNpcShadow(NPC_PLAYER, FALSE); + EnableNpcShadow(0x1, FALSE); + EnableNpcShadow(0x4, FALSE); + PlaySound(SOUND_BOO_VANISH); + SI_VAR(0) = 0.0; + loop 20 { + SI_VAR(0) += 12.0; + func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + } + SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A1)); + GetCurrentPartnerID(SI_VAR(0)); + if (SI_VAR(0) != 9) { + N(func_802412C8_BE8EA8)(9); + spawn { + SI_MAP_VAR(0) = 0; + ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00A2), 160, 40); + SI_MAP_VAR(0) = 1; + } + sleep 50; + DisablePartnerAI(0); + SetNpcYaw(NPC_PARTNER, 90); + EnablePartnerAI(); + loop { + sleep 1; + if (SI_MAP_VAR(0) == 1) { + break loop; + } + } + } + DisablePartnerAI(0); + SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00A3)); + EnablePartnerAI(); + InterpPlayerYaw(90, 0); + sleep 5; + N(func_802412B0_BE8E90)(); + CloseMessage(); + func_802D2B50(); + sleep 60; + SetMusicTrack(0, SONG_TUBBAS_MANOR, 1, 8); + SetCamType(0, 6, 1); + SetCamSpeed(0, 90.0); + SetCamPitch(0, 17.0, -11.5); + SetCamDistance(0, 450); + SetCamPosA(0, -40, 206); + SetCamPosB(0, 530, 206); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 426, 190, 194); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + SetNpcFlagBits(0x5, 0x00000200, TRUE); + SetNpcSpeed(0x5, 2.5); + SetNpcPos(0x5, 675, 200, 180); + NpcFaceNpc(NPC_PLAYER, 0x5, 1); + NpcFaceNpc(0x1, 0x5, 1); + SetNpcPos(0x2, 272, 190, 214); + PlaySoundAtNpc(NPC_PLAYER, 0x262, 0); + PlaySoundAtNpc(0x1, 0x262, 0); + ShowEmote(0, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0); + ShowEmote(1, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0); + spawn { + PlaySound(SOUND_BOO_APPEAR); + sleep 20; + SI_VAR(0) = 240.0; + loop 20 { + SI_VAR(0) -= 12.0; + func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + } + SetNpcPos(NPC_PLAYER, 0, -1000, 0); + SetNpcPos(0x1, 0, -1000, 0); + sleep 10; + } + SI_VAR(0) = 4; + spawn N(80242BEC); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9)); + NpcMoveTo(0x5, 550, 196, 0); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + SetCamSpeed(0, 4.0); + SetCamPitch(0, 17.0, -11.5); + SetCamDistance(0, 375); + SetCamPosA(0, -40, 206); + SetCamPosB(0, 530, 206); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 426, 190, 194); + PanToTarget(0, 0, 1); + sleep 30; + SI_MAP_VAR(1) = 0; + spawn { + SI_VAR(0) = 7; + spawn N(80242BEC); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9)); + NpcMoveTo(0x5, 370, 220, 0); + GetNpcPos(0x2, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + NpcMoveTo(0x5, 330, SI_VAR(2), 0); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + SI_MAP_VAR(1) = 1; + } + SetCamSpeed(0, 90.0); + SetCamPitch(0, 17.0, -11.5); + SetCamDistance(0, 375); + SetCamPosA(0, -40, 206); + SetCamPosB(0, 530, 206); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 240, 169, 206); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A4)); + sleep 15; + loop { + sleep 1; + if (SI_MAP_VAR(1) == 1) { + break loop; + } + } + NpcFaceNpc(0x2, 0x5, 1); + sleep 30; + SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A5)); + SetNpcAnimation(0x2, NPC_ANIM(boo, Palette_01, Anim_9)); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1E)); + SetNpcJumpscale(0x2, 0.0); + NpcJump1(0x2, 265, 206, 212, 3); + sleep 20; + SpeakToPlayer(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1E), NPC_ANIM(world_tubba, Palette_00, Anim_1E), 5, MESSAGE_ID(0x0E, 0x00A6)); + SetNpcPos(0x2, 303, 237, 228); + SetNpcAnimation(0x2, NPC_ANIM(boo, Palette_01, Anim_6)); + EnableNpcShadow(0x2, FALSE); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1F)); + SetCamSpeed(0, 5.0); + SetCamPitch(0, 17.0, -17.0); + SetCamDistance(0, 250); + SetCamPosA(0, -40, 206); + SetCamPosB(0, 530, 206); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 280, 169, 206); + PanToTarget(0, 0, 1); + spawn { + sleep 50; + PlaySoundAtNpc(0x5, 0x315, 0); + } + sleep 40; + SetNpcPos(0x2, 0, -1000, 0); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_20)); + sleep 80; + SetCamSpeed(0, 90.0); + SetCamPitch(0, 17.0, -11.5); + SetCamDistance(0, 375); + SetCamPosA(0, -40, 206); + SetCamPosB(0, 530, 206); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 240, 169, 206); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + sleep 15; + SpeakToPlayer(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_21), NPC_ANIM(world_tubba, Palette_00, Anim_6), 5, MESSAGE_ID(0x0E, 0x00A7)); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_21)); + GetNpcPos(0x5, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) += -50; + SI_VAR(1) += 50; + SI_VAR(2) += 10; + PlayEffect(0x6, 1, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10, 0, 0, 0, 0, 0, 0, 0, 0); + sleep 20; + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + InterpNpcYaw(0x5, 90, 1); + sleep 30; + SI_VAR(0) = 7; + spawn N(80242BEC); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9)); + NpcMoveTo(0x5, 370, 220, 0); + NpcMoveTo(0x5, 550, 196, 0); + SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + SetNpcPos(0x5, 0, -1000, 0); + SetNpcFlagBits(0x5, 0x00000200, FALSE); + NpcFacePlayer(NPC_PLAYER, 3); + SetNpcPos(NPC_PLAYER, 55, 195, 160); + SetNpcPos(0x1, 160, 191, 250); + SetNpcPos(0x4, 350, 185, 197); + EnableNpcShadow(NPC_PLAYER, TRUE); + EnableNpcShadow(0x1, TRUE); + EnableNpcShadow(0x4, TRUE); + PlaySound(SOUND_BOO_VANISH); + SI_VAR(0) = 0.0; + loop 20 { + SI_VAR(0) += 12.5; + func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0); + func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + } + func_802CFD30(NPC_PLAYER, 0, 0, 0, 0, 0); + func_802CFD30(0x1, 0, 0, 0, 0, 0); + func_802CFD30(0x4, 0, 0, 0, 0, 0); + sleep 10; + SetCamType(0, 4, 0); + SetCamSpeed(0, 3.0); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + PanToTarget(0, 0, 0); + SpeakToPlayer(0x4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A8)); + DisablePlayerInput(FALSE); +}); + +Script N(802441FC) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_SAW_TUBBA_EAT_BOO) { + SetNpcPos(0x2, 330, 184, 240); + loop { + SI_VAR(10) = 0; + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + if (SI_VAR(2) >= 110) { + if (SI_VAR(0) >= 220) { + SI_VAR(10) = 1; + } + } + if (SI_VAR(10) == 1) { + break loop; + } + sleep 1; + } + func_802D2B6C(); + await N(80242C50); + BindNpcInteract(NPC_PLAYER, N(interact_802418F4)); + BindNpcInteract(0x1, N(interact_80241A84)); + BindNpcInteract(0x4, N(interact_80241F88)); + STORY_PROGRESS = STORY_CH3_SAW_TUBBA_EAT_BOO; + spawn N(80241360); + } +}); + +Script N(init_80244358) = SCRIPT({ + if (STORY_PROGRESS >= STORY_CH3_SAW_TUBBA_EAT_BOO) { + RemoveNpc(NPC_SELF); + } +}); + +NpcAnimID N(extraAnimationList_80244390)[] = { + NPC_ANIM(world_tubba, Palette_00, Anim_6), + NPC_ANIM(world_tubba, Palette_00, Anim_9), + NPC_ANIM(world_tubba, Palette_00, Anim_1E), + NPC_ANIM(world_tubba, Palette_00, Anim_1F), + NPC_ANIM(world_tubba, Palette_00, Anim_20), + NPC_ANIM(world_tubba, Palette_00, Anim_21), + ANIM_END, +}; + +StaticNpc N(npcGroup_802443AC) = { + .id = 5, + .settings = &N(npcSettings_802416B0), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80244358), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(world_tubba, Palette_00, Anim_6), + NPC_ANIM(world_tubba, Palette_00, Anim_9), + NPC_ANIM(world_tubba, Palette_00, Anim_C), + NPC_ANIM(world_tubba, Palette_00, Anim_C), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + }, + .extraAnimations = &N(extraAnimationList_80244390), +}; + +Script N(idle_8024459C) = SCRIPT({ + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(3) = SI_VAR(0); + SI_VAR(3) += -60; + SI_VAR(4) = SI_VAR(0); + SI_VAR(4) += 60; + loop { + RandInt(5, SI_VAR(5)); + SI_VAR(6) =f SI_VAR(5); + SI_VAR(6) *= 0.1005859375; + SI_VAR(6) += 0.80078125; + SetNpcSpeed(NPC_SELF, SI_VAR(6)); + NpcMoveTo(NPC_SELF, SI_VAR(3), SI_VAR(2), 0); + RandInt(5, SI_VAR(5)); + SI_VAR(6) =f SI_VAR(5); + SI_VAR(6) *= 0.1005859375; + SI_VAR(6) += 0.80078125; + SetNpcSpeed(NPC_SELF, SI_VAR(6)); + NpcMoveTo(NPC_SELF, SI_VAR(4), SI_VAR(2), 0); + } +}); + +Script N(init_80244704) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_8024459C)); + EnableNpcShadow(NPC_SELF, FALSE); +}); + +Script N(init_8024473C) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_8024459C)); + EnableNpcShadow(NPC_SELF, FALSE); +}); + +Script N(init_80244774) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_8024459C)); + EnableNpcShadow(NPC_SELF, FALSE); +}); + +Script N(init_802447AC) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_8024459C)); + EnableNpcShadow(NPC_SELF, FALSE); +}); + +StaticNpc N(npcGroup_802447E4)[] = { + { + .id = 6, + .settings = &N(npcSettings_80241758), + .pos = { 36.0f, 277.0f, 140.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80244704), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 7, + .settings = &N(npcSettings_80241758), + .pos = { 200.0f, 275.0f, 182.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_8024473C), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 8, + .settings = &N(npcSettings_80241758), + .pos = { 379.0f, 300.0f, 192.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_80244774), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, + { + .id = 9, + .settings = &N(npcSettings_80241758), + .pos = { 525.0f, 286.0f, 178.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000, + .init = &N(init_802447AC), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + }, +}; + +NpcGroupList N(npcGroupList_80244FA4) = { + NPC_GROUP(N(npcGroup_802443AC), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_8024223C), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +NpcGroupList N(npcGroupList_80244FC8) = { + NPC_GROUP(N(npcGroup_802443AC), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_8024223C), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_802447E4), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +static s32 N(pad_4FF8)[] = { + 0x00000000, 0x00000000, +}; + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EA7E0, 17, 238, 80, 0, MAKE_ENTITY_END); +}); + +void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; +} + +void N(func_80240158_BE7D38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} + +#include "world/common/UnkNpcAIFunc1.inc.c" + +void N(func_802404C0_BE80A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} + +void N(func_8024067C_BE825C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; +} + +#include "world/common/NpcJumpFunc2.inc.c" + +#include "world/common/NpcJumpFunc.inc.c" + +#include "world/common/UnkNpcAIFunc13.inc.c" + +void N(func_8024094C_BE852C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} + +#include "world/common/UnkNpcDurationFlagFunc.inc.c" + +void N(func_80240AD4_BE86B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} + +ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + Bytecode* args = script->ptrReadPos; + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++); + f32 posX, posY, posZ, posW; + + territory.unk_00 = 0; + territory.shape = enemy->territory->patrol.detectShape; + territory.pointX = enemy->territory->patrol.detect.x; + territory.pointZ = enemy->territory->patrol.detect.z; + territory.sizeX = enemy->territory->patrol.detectSizeX; + territory.sizeZ = enemy->territory->patrol.detectSizeZ; + territory.unk_34 = 65.0f; + territory.unk_1C = 0; + + if (isInitialCall || enemy->unk_B0 & 4) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->currentAnim = enemy->animList[0]; + npc->flags &= ~0x800; + if (!enemy->territory->patrol.isFlying) { + npc->flags = (npc->flags | 0x200) & ~8; + } else { + npc->flags = (npc->flags & ~0x200) | 8; + } + + if (enemy->unk_B0 & 4) { + script->functionTemp[0].s = 99; + script->functionTemp[1].s = 0; + enemy->unk_B0 &= ~4; + } else if (enemy->flags & 0x40000000) { + script->functionTemp[0].s = 12; + enemy->flags &= 0xBFFFFFFF; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = 100.0f; + + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + npc->pos.y = posY; + } + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240000_BE7BE0)(script, aiSettings, territoryPtr); + case 1: + N(func_80240158_BE7D38)(script, aiSettings, territoryPtr); + break; + case 2: + N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); + case 3: + N(func_802404C0_BE80A0)(script, aiSettings, territoryPtr); + break; + case 4: + N(func_8024067C_BE825C)(script, aiSettings, territoryPtr); + break; + case 10: + N(NpcJumpFunc2)(script, aiSettings, territoryPtr); + case 11: + N(NpcJumpFunc)(script, aiSettings, territoryPtr); + break; + case 12: + N(UnkNpcAIFunc13)(script, aiSettings, territoryPtr); + case 13: + N(func_8024094C_BE852C)(script, aiSettings, territoryPtr); + break; + case 14: + N(UnkNpcDurationFlagFunc)(script, aiSettings, territoryPtr); + break; + case 15: + N(func_80240AD4_BE86B4)(script, aiSettings, territoryPtr); + break; + case 99: + func_8004A73C(script); + } + + return ApiStatus_BLOCK; +} + +void N(func_80240E90_BE8A70)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f20; + f32 temp_f22; + + posX = npc->pos.x; + posZ = npc->pos.z; + temp_f22 = script->functionTemp[2].s[enemy->territory->patrol.points].x; + temp_f20 = script->functionTemp[2].s[enemy->territory->patrol.points].z; + + npc->yaw = atan2(posX, posZ, temp_f22, temp_f20); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + posX = npc->pos.x; + posY = npc->pos.y + script->functionTemp[2].s[enemy->territory->patrol.points].y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + posY += script->functionTemp[2].s[enemy->territory->patrol.points].y; + posW = posY - npc->pos.y; + if (posW > 2.0) { + npc->pos.y += 2.0; + } else if (posW < -2.0) { + npc->pos.y -= 2.0; + } else { + npc->pos.y = posY; + } + + posW = dist2D(npc->pos.x, npc->pos.z, temp_f22, temp_f20); + if (!(posW > npc->moveSpeed)) { + script->functionTemp[0].s = 2; + } +} + +void N(func_80241068_BE8C48)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration < 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s >= 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + npc->currentAnim = enemy->animList[0]; + } + } +} + +ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Bytecode* args = script->ptrReadPos; + Npc* npc = get_npc_unsafe(enemy->npcID); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++); + + territory.unk_00 = 0; + territory.shape = enemy->territory->patrol.detectShape; + territory.pointX = enemy->territory->patrol.detect.x; + territory.pointZ = enemy->territory->patrol.detect.z; + territory.sizeX = enemy->territory->patrol.detectSizeX; + territory.sizeZ = enemy->territory->patrol.detectSizeZ; + territory.unk_34 = 100.0f; + territory.unk_1C = 0; + + if (isInitialCall) { + script->functionTemp[0].s = 0; + npc->duration = 0; + npc->flags &= ~0x800; + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240000_BE7BE0)(script, aiSettings, territoryPtr); + case 1: + N(func_80240E90_BE8A70)(script, aiSettings, territoryPtr); + break; + case 2: + N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); + case 3: + N(func_80241068_BE8C48)(script, aiSettings, territoryPtr); + break; + case 4: + N(func_8024067C_BE825C)(script, aiSettings, territoryPtr); + } + + enemy->varTable[0] = npc->pos.y; + return ApiStatus_BLOCK; +} + +ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall) { + return (gGameStatusPtr->pressedButtons >> 1) & ApiStatus_DONE2; +} + +ApiStatus N(func_802412C8_BE8EA8)(ScriptInstance* script, s32 isInitialCall) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return ApiStatus_DONE2; +} diff --git a/src/world/area_arn/arn_05/header.c b/src/world/area_arn/arn_05/header.c new file mode 100644 index 0000000000..f90fc57896 --- /dev/null +++ b/src/world/area_arn/arn_05/header.c @@ -0,0 +1,33 @@ +#include "arn_05.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -77.0f, 135.0f, 150.0f, 90.0f }, + { 577.0f, 200.0f, 150.0f, 270.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .background = &gBackgroundImage, + .tattle = MSG_arn_05_tattle, +}; + +Script N(80241360) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_SAW_TUBBA_EAT_BOO { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + < STORY_CH3_TUBBA_WOKE_UP { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } + PlayAmbientSounds(AMBIENT_WIND); +}); diff --git a/src/world/area_arn/arn_07/BECDF0.c b/src/world/area_arn/arn_07/BECDF0.c index 60706296a9..88ed82c0df 100644 --- a/src/world/area_arn/arn_07/BECDF0.c +++ b/src/world/area_arn/arn_07/BECDF0.c @@ -1,13 +1,616 @@ #include "arn_07.h" +#include "sprite/npc/world_tubba.h" +#include "sprite/npc/tubbas_heart.h" -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_80240000_BECDF0); +void* func_800729B0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); +void* func_800726B0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_8024004C_BECE3C); +// This is a duplicate, search for others +// TODO figure out what this actually is +// func_800729B0 invokes gEffectTable[131]'s entryPoint function +// that function is currently typed to return void +// Assume it returns an Effect* and unk_0C is this EffectInstanceData: +// s32 unk_0C; //? Maybe EffectInstanceData too ? +struct N(temp2) { + char unk_00[0x4]; + f32 unk_04; + f32 unk_08; + f32 unk_0C; + f32 unk_10; + char unk_14[0x4]; + s32 unk_18; + s32 unk_1C; + s32 unk_20; + f32 unk_24; + s32 unk_28; + s32 unk_2C; + s32 unk_30; + s8 unk_34; + char unk_38[0x38]; + s32 unk_70; + s32 unk_74; +} N(temp2); -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_802401AC_BECF9C); +struct N(temp) { + char unk_00[0xC]; + struct N(temp2)* unk_0C; +} N(temp); -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_802405BC_BED3AC); +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ f32 unk_20; + /* 0x24 */ f32 unk_24; + /* 0x28 */ f32 unk_28; + /* 0x2C */ f32 unk_2C; + /* 0x30 */ f32 unk_30; + /* 0x34 */ f32 unk_34; + /* 0x38 */ s32 unk_38; + /* 0x3C */ s32 unk_3C; + /* 0x40 */ Shadow* unk_40; + /* 0x44 */ s16 unk_44; + /* 0x46 */ s16 unk_46; + /* 0x48 */ s16 unk_48; + /* 0x4A */ s16 unk_4A; + /* 0x4C */ s16 unk_4C; + /* 0x4E */ s16 unk_4E; + /* 0x50 */ struct N(temp)* unk_50; + /* 0x54 */ struct N(temp)* unk_54; +} arn_07_struct; // size = 0x58 -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_802405FC_BED3EC); +ApiStatus N(func_80240000_BECDF0)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; -INCLUDE_ASM(s32, "world/area_arn/arn_07/BECDF0", func_80240708_BED4F8); + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} + +ApiStatus N(func_8024004C_BECE3C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} + +ApiStatus N(func_802401AC_BECF9C)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + switch (ptr->unk_44) { + case 0: + ptr->unk_04 = update_lerp(5, ptr->unk_10, ptr->unk_1C, ptr->unk_46, ptr->unk_3C); + ptr->unk_00 = update_lerp(0, ptr->unk_0C, ptr->unk_18, ptr->unk_46, ptr->unk_3C); + ptr->unk_08 = update_lerp(0, ptr->unk_14, ptr->unk_20, ptr->unk_46, ptr->unk_3C); + ptr->unk_50->unk_0C->unk_08 = ptr->unk_00; + ptr->unk_50->unk_0C->unk_0C = ptr->unk_04; + ptr->unk_50->unk_0C->unk_10 = ptr->unk_08; + ptr->unk_46++; + if (ptr->unk_46 >= ptr->unk_3C) { + ptr->unk_44 = 1; + ptr->unk_46 = 0; + } + break; + + case 1: + ptr->unk_46++; + if (ptr->unk_46 >= 60) { + ptr->unk_44 = 2; + ptr->unk_46 = 0; + ptr->unk_50->unk_0C->unk_70 = 1; + ptr->unk_50->unk_0C->unk_74 = 0; + } + break; + + case 2: + ptr->unk_46++; + if (ptr->unk_46 >= 60) { + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_1C, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_44 = 3; + ptr->unk_46 = 0; + ptr->unk_2C = 0.0f; + ptr->unk_48 = 1; + ptr->unk_30 = 36.0f; + } + break; + + case 3: + ptr->unk_30 = update_lerp(0, 36.0f, 19.0f, ptr->unk_46, 120); + ptr->unk_46++; + if (ptr->unk_46 >= 120) { + ptr->unk_4C = 0; + ptr->unk_4A = 1; + ptr->unk_48 = 2; + ptr->unk_4E = 1; + ptr->unk_44 = 4; + ptr->unk_46 = 0; + ptr->unk_34 = ptr->unk_2C; + } + break; + + case 4: + break; + } + + switch (ptr->unk_4A) { + case 1: + ptr->unk_2C = update_lerp(4, ptr->unk_34, 1440.0f, ptr->unk_4C, 120); + ptr->unk_04 = update_lerp(0xA, ptr->unk_1C, ptr->unk_24, ptr->unk_4C, 120); + ptr->unk_4C++; + if (ptr->unk_4C >= 120) { + ptr->unk_4C = 0x10E; + ptr->unk_4A = 2; + ptr->unk_4E = 2; + } + break; + + case 2: + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (!(dist3D(playerStatus->position.x, playerStatus->position.y + 20.0f, playerStatus->position.z, + ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { + ptr->unk_4E = 3; + } + break; + } + + switch (ptr->unk_48) { + case 1: + ptr->unk_2C = clamp_angle(ptr->unk_2C + ptr->unk_30); + + case 2: + ptr->unk_54->unk_0C->unk_24 = ptr->unk_2C; + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + break; + } + + return ApiStatus_BLOCK; +} + +ApiStatus N(func_802405BC_BED3AC)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} + +ApiStatus N(func_802405FC_BED3EC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} + +ApiStatus N(func_80240708_BED4F8)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (dist2D(playerStatus->position.x, playerStatus->position.z, + ptr->unk_18, ptr->unk_20) <= 30.0f) { + ptr->unk_4E = 3; + } + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + + return ApiStatus_BLOCK; +} + +s32 N(itemList_80242040)[] = { + ITEM_MYSTICAL_KEY, + ITEM_NONE, +}; + +Script N(80242048) = SCRIPT({ + FadeOutMusic(0, 1000); + SI_VAR(0) = 0; + if (SI_VAR(0) == 0) { + DisablePlayerInput(TRUE); + UseSettingsFrom(0, 145, 65, 0); + SetCamSpeed(0, 0.6005859375); + SetPanTarget(0, 145, 30, 0); + GetCamDistance(0, SI_VAR(1)); + SI_VAR(1) -= 100; + SetCamDistance(0, SI_VAR(1)); + if (10000 != 10000) { + GetCamPitch(0, SI_VAR(2), SI_VAR(3)); + SetCamPitch(0, SI_VAR(2), 10000); + } + PanToTarget(0, 0, 1); + N(func_8024004C_BECE3C)(2, 50, 100, 31, -6, 145, 65, 0, 30, 0); + spawn { + N(func_802401AC_BECF9C)(); + } + spawn { + sleep 1; + PlaySound(0x80000067); + N(func_80240000_BECDF0)(); + StopSound(0x80000067); + PlaySoundAt(0xB2, 0, 145, 65, 0); + } + spawn { + sleep 12; + SetPlayerAnimation(0x1002A); + } + spawn { + sleep 50; + sleep 115; + PlaySoundAt(0x137, 0, 145, 65, 0); + } + N(func_802405BC_BED3AC)(1); + spawn { + sleep 80; + SetPlayerAnimation(ANIM_10002); + } + SI_VAR(1) += 100; + SetCamDistance(0, SI_VAR(1)); + SetPanTarget(0, 145, 0, 0); + N(func_802405BC_BED3AC)(2); + GetPlayerPos(SI_VAR(2), SI_VAR(3), SI_VAR(4)); + UseSettingsFrom(0, SI_VAR(2), SI_VAR(3), SI_VAR(4)); + SetCamSpeed(0, 1.0); + SetPanTarget(0, SI_VAR(2), SI_VAR(3), SI_VAR(4)); + WaitForCam(0, 1.0); + PanToTarget(0, 0, 0); + DisablePlayerInput(FALSE); + } else { + N(func_802405FC_BED3EC)(2, 145, 30, 0, 0); + spawn { + N(func_80240708_BED4F8)(); + } + sleep 1; + } + N(func_802405BC_BED3AC)(3); + PlaySoundAtPlayer(312, 0); + DisablePlayerInput(TRUE); + STORY_PROGRESS = STORY_CH3_STAR_SPIRIT_RESCUED; + GotoMapSpecial("kmr_23", 2, 14); + sleep 100; +}); + +Script N(80242498) = SCRIPT({ + SI_VAR(0) = 1; + if (SI_VAR(0) == 0) { + DisablePlayerInput(TRUE); + UseSettingsFrom(0, 145, 65, 0); + SetCamSpeed(0, 0.6005859375); + SetPanTarget(0, 145, 30, 0); + GetCamDistance(0, SI_VAR(1)); + SI_VAR(1) -= 100; + SetCamDistance(0, SI_VAR(1)); + if (10000 != 10000) { + GetCamPitch(0, SI_VAR(2), SI_VAR(3)); + SetCamPitch(0, SI_VAR(2), 10000); + } + PanToTarget(0, 0, 1); + N(func_8024004C_BECE3C)(2, 50, 100, 31, -6, 145, 65, 0, 30, 0); + spawn { + N(func_802401AC_BECF9C)(); + } + spawn { + sleep 1; + PlaySound(0x80000067); + N(func_80240000_BECDF0)(); + StopSound(0x80000067); + PlaySoundAt(0xB2, 0, 145, 65, 0); + } + spawn { + sleep 12; + SetPlayerAnimation(0x1002A); + } + spawn { + sleep 50; + sleep 115; + PlaySoundAt(0x137, 0, 145, 65, 0); + } + N(func_802405BC_BED3AC)(1); + spawn { + sleep 80; + SetPlayerAnimation(ANIM_10002); + } + SI_VAR(1) += 100; + SetCamDistance(0, SI_VAR(1)); + SetPanTarget(0, 145, 0, 0); + N(func_802405BC_BED3AC)(2); + GetPlayerPos(SI_VAR(2), SI_VAR(3), SI_VAR(4)); + UseSettingsFrom(0, SI_VAR(2), SI_VAR(3), SI_VAR(4)); + SetCamSpeed(0, 1.0); + SetPanTarget(0, SI_VAR(2), SI_VAR(3), SI_VAR(4)); + WaitForCam(0, 1.0); + PanToTarget(0, 0, 0); + DisablePlayerInput(FALSE); + } else { + N(func_802405FC_BED3EC)(2, 145, 30, 0, 0); + spawn { + N(func_80240708_BED4F8)(); + } + sleep 1; + } + N(func_802405BC_BED3AC)(3); + PlaySoundAtPlayer(312, 0); + DisablePlayerInput(TRUE); + STORY_PROGRESS = STORY_CH3_STAR_SPIRIT_RESCUED; + GotoMapSpecial("kmr_23", 2, 14); + sleep 100; +}); + +Script N(exitSingleDoor_802428D4) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 10; + SI_VAR(2) = 29; + SI_VAR(3) = 1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_08", 0); + sleep 100; +}); + +Script N(exitWalk_80242978) = EXIT_WALK_SCRIPT(60, 1, "arn_03", 0); + +Script N(exitWalk_802429D4) = EXIT_WALK_SCRIPT(60, 2, "mim_12", 1); + +Script N(80242A30) = SCRIPT({ + DisablePlayerInput(TRUE); + DisablePartnerAI(0); + SetPlayerPos(-28, 0, -333); + SetNpcPos(NPC_PARTNER, -28, 0, -333); + SetCamSpeed(0, 90.0); + SetCamType(0, 0, 0); + SetCamPitch(0, 25.0, -4.0); + SetCamDistance(0, 1100); + SetCamPosA(0, 500, 0); + SetCamPosB(0, 0, -500); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 5, 0, -147); + PanToTarget(0, 0, 1); + RotateModel(29, 80, 0, -1, 0); + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + SetNpcJumpscale(NPC_PLAYER, 2.5); + NpcJump0(NPC_PLAYER, 0, 20, -120, 8); + sleep 1; + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 0, 10, -60, 12); + sleep 1; + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 0, 0, 0, 12); + sleep 1; + SetNpcVar(0, 0, 0); + spawn { + loop { + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 0, 0, 0, 10); + sleep 1; + GetNpcVar(0, 0, SI_VAR(0)); + if (SI_VAR(0) == 1) { + break loop; + } + } + SetNpcVar(0, 0, 2); + } + spawn { + MakeLerp(80, 0, 10, 0); + loop { + UpdateLerp(); + RotateModel(29, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + PlaySoundAtCollider(10, 450, 0); + } + NpcFaceNpc(NPC_PLAYER, 0x1, 0); + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_A), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00C7)); + SetNpcVar(0, 0, 1); + loop { + GetNpcVar(0, 0, SI_VAR(0)); + if (SI_VAR(0) == 2) { + break loop; + } + sleep 1; + } + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 75, 0, 10, 12); + sleep 1; + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 150, 0, 20, 12); + sleep 1; + spawn { + sleep 4; + SetCamSpeed(0, 90.0); + SetCamPitch(0, 2.0, -9.0); + SetCamDistance(0, 700); + SetCamPosA(0, 500, 0); + SetCamPosB(0, 0, -500); + SetCamPosC(0, 0, 0); + SetPanTarget(0, 65, 0, -137); + PanToTarget(0, 0, 1); + SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_22)); + } + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, 298, 56, 31, 18); + SetNpcPos(NPC_PLAYER, 0, -1000, 0); + EnableNpcShadow(NPC_PLAYER, FALSE); + spawn { + SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_23)); + sleep 20; + SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_6)); + } + sleep 20; + spawn { + PlaySoundAtCollider(10, 449, 0); + MakeLerp(0, 80, 10, 0); + loop { + UpdateLerp(); + RotateModel(29, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + } + spawn { + sleep 30; + UseSettingsFrom(0, 236, 0, -46); + SetCamSpeed(0, 4.0); + SetCamPitch(0, 8.0, -9.0); + SetCamDistance(0, 450); + SetPanTarget(0, 250, 0, -46); + PanToTarget(0, 0, 1); + } + ModifyColliderFlags(0, 10, 0x7FFFFE00); + SetPlayerPos(0, 20, -195); + SetNpcPos(NPC_PARTNER, 0, 20, -195); + EnablePartnerAI(); + PlayerMoveTo(0, 0, 45); + ModifyColliderFlags(1, 10, 0x7FFFFE00); + spawn { + MakeLerp(80, 0, 10, 0); + loop { + UpdateLerp(); + RotateModel(29, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + PlaySoundAtCollider(10, 450, 0); + } + PlayerMoveTo(200, 0, 35); + sleep 5; + SpeakToPlayer(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 0, MESSAGE_ID(0x0E, 0x00C8)); + SetNpcVar(1, 0, 1); + sleep 30; + DisablePlayerInput(FALSE); +}); + +// *INDENT-OFF* +Script N(802433C8) = { + SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitWalk_80242978), TRIGGER_FLOOR_ABOVE, 5, 1, 0), + SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitWalk_802429D4), TRIGGER_FLOOR_ABOVE, 1, 1, 0), + SI_CMD(ScriptOpcode_IF_LT, SI_SAVE_VAR(0), -24), + SI_CMD(ScriptOpcode_BIND_PADLOCK, N(802439B0), TRIGGER_WALL_PRESS_A, 16384, N(itemList_80242040), 0, 1), + SI_CMD(ScriptOpcode_ELSE), + SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitSingleDoor_802428D4), TRIGGER_WALL_PRESS_A, 10, 1, 0), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_RETURN), + SI_CMD(ScriptOpcode_END) +}; +// *INDENT-ON* + +Script N(enterWalk_8024346C) = SCRIPT({ + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + if (STORY_PROGRESS == STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + await N(80242A30); + spawn N(802433C8); + } else { + SI_VAR(2) = 29; + SI_VAR(3) = 1; + await EnterSingleDoor; + spawn N(802433C8); + } + } + == 1 { + SI_VAR(0) = N(802433C8); + spawn EnterWalk; + sleep 1; + } + == 2 { + SI_VAR(0) = N(802433C8); + spawn EnterWalk; + sleep 1; + } + == 3 { + spawn N(802433C8); + sleep 1; + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_GUSTY_GULCH; + SetSpriteShading(-1); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + SI_SAVE_FLAG(1977) = 1; + match STORY_PROGRESS { + < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { + MakeNpcs(0, N(npcGroupList_802478B8)); + } + < STORY_CH3_BEGAN_PEACH_MISSION { + MakeNpcs(0, N(npcGroupList_8024787C)); + } + == STORY_CH3_BEGAN_PEACH_MISSION { + MakeNpcs(0, N(npcGroupList_802478E8)); + } + else { + MakeNpcs(0, N(npcGroupList_802478B8)); + } + } + await N(makeEntities); + if (STORY_PROGRESS == STORY_CH3_DEFEATED_TUBBA_BLUBBA) { + spawn N(80242498); + } + spawn N(enterWalk_8024346C); + GetEntryID(SI_VAR(0)); + if (SI_VAR(0) == 3) { + sleep 65; + } + spawn N(80243790); + spawn N(80241F10); + UseDoorSounds(0); + SetCamSpeed(0, 0.30078125); +}); diff --git a/src/world/area_arn/arn_07/BED5F0.c b/src/world/area_arn/arn_07/BED5F0.c index 3a68bd328a..10a4e2aeb3 100644 --- a/src/world/area_arn/arn_07/BED5F0.c +++ b/src/world/area_arn/arn_07/BED5F0.c @@ -1,3 +1,11 @@ #include "arn_07.h" -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED5F0", func_80240800_BED5F0); +ApiStatus N(func_80240800_BED5F0)(ScriptInstance* script, s32 isInitialCall) { + f32 temp_f0 = get_float_variable(script, SI_VAR(0)); + + if (temp_f0 >= 360.0) { + temp_f0 -= 360.0; + } + set_float_variable(script, SI_VAR(0), temp_f0); + return ApiStatus_DONE2; +} diff --git a/src/world/area_arn/arn_07/BED740.c b/src/world/area_arn/arn_07/BED740.c deleted file mode 100644 index 99b631ab67..0000000000 --- a/src/world/area_arn/arn_07/BED740.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "arn_07.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_80240950_BED740); - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_80240B00_BED8F0); - -#include "world/common/UnkNpcAIFunc1.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_802411E8_BEDFD8); - -#include "world/common/UnkNpcAIFunc2.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_802415A4_BEE394); - -#include "world/common/UnkNpcAIFunc14.inc.c" - -#include "world/common/UnkNpcAIFunc3.inc.c" - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_802417A8_BEE598); - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_80241B38_BEE928); - -INCLUDE_ASM(s32, "world/area_arn/arn_07/BED740", func_80241C5C_BEEA4C); - -ApiStatus PostChapter3StatUpdate(ScriptInstance* script, s32 isInitialCall) { - PlayerData* playerData = &gPlayerData; - - set_max_SP(3); - playerData->curHP = playerData->curMaxHP; - playerData->curFP = playerData->curMaxFP; - sync_status_menu(); - return ApiStatus_DONE2; -} diff --git a/src/world/area_arn/arn_07/arn_07.h b/src/world/area_arn/arn_07/arn_07.h index 49ab0ebd5c..b7597910cd 100644 --- a/src/world/area_arn/arn_07/arn_07.h +++ b/src/world/area_arn/arn_07/arn_07.h @@ -1,4 +1,35 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_07 + +void func_802D6420(void); +void func_802D6954(void); +void func_802CF56C(void); + +ApiStatus N(func_8024004C_BECE3C)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802401AC_BECF9C)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80240000_BECDF0)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802405BC_BED3AC)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_802405FC_BED3EC)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80240708_BED4F8)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80240800_BED5F0)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80241C5C_BEEA4C)(ScriptInstance* script, s32 isInitialCall); +ApiStatus PostChapter3StatUpdate(ScriptInstance* script, s32 isInitialCall); + +Script N(main); +Script N(80241F10); +Script N(80243790); +Script N(802439B0); +NpcGroupList N(npcGroupList_802478B8); +NpcGroupList N(npcGroupList_8024787C); +NpcGroupList N(npcGroupList_802478E8); +NpcGroupList N(npcGroupList_802478B8); +Script N(makeEntities); +Script N(80243790); +Script N(802437AC); +Script N(exitSingleDoor_802428D4); +Script N(80242048); diff --git a/src/world/area_arn/arn_07/events.c b/src/world/area_arn/arn_07/events.c new file mode 100644 index 0000000000..2ab1f7e447 --- /dev/null +++ b/src/world/area_arn/arn_07/events.c @@ -0,0 +1,1593 @@ +#include "arn_07.h" +#include "sprite/npc/world_tubba.h" +#include "sprite/npc/paragoomba.h" +#include "sprite/npc/world_skolar.h" +#include "sprite/npc/world_bow.h" +#include "sprite/npc/tubbas_heart.h" +#include "sprite/npc/boo.h" +#include "sprite/npc/bootler.h" + +Script N(80243790) = SCRIPT({ + spawn N(802437AC); +}); + +Script N(802437AC) = SCRIPT({ + SI_VAR(0) = 0.0; + SI_VAR(1) = 30; + PlaySoundAtModel(23, 0x8000004A, 0); +0: + SI_VAR(0) += 1.0; + N(func_80240800_BED5F0)(); + RotateModel(27, SI_VAR(0), 0, 0, 1); + sleep 1; + SI_VAR(1) -= 1; + if (SI_VAR(1) > 0) { + goto 0; + } + SI_VAR(1) = 30; + RandInt(100, SI_VAR(2)); + if (SI_VAR(2) > 10) { + goto 0; + } + SI_VAR(2) = 1.0; + loop 50 { + SI_VAR(2) -= 0.0107421875; + SI_VAR(0) +=f SI_VAR(2); + RotateModel(27, SI_VAR(0), 0, 0, 1); + sleep 1; + } + loop 50 { + SI_VAR(2) += 0.0107421875; + SI_VAR(0) +=f SI_VAR(2); + RotateModel(27, SI_VAR(0), 0, 0, 1); + sleep 1; + } + SI_VAR(1) = 30; + goto 0; +}); + +Script N(802439B0) = SCRIPT({ + group 0; + func_802D5830(1); + func_802D6420(); + if (SI_VAR(0) == 0) { + ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00D8), 160, 40); + func_802D6954(); + func_802D5830(0); + return; + } + if (SI_VAR(0) == -1) { + func_802D6954(); + func_802D5830(0); + return; + } + FindKeyItem(31, SI_VAR(0)); + RemoveKeyItemAt(SI_VAR(0)); + func_802D6954(); + STORY_PROGRESS = STORY_CH3_UNLOCKED_WINDY_MILL; + N(GetEntityPosition)(SI_MAP_VAR(0), SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PlaySoundAt(0x269, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) = SI_MAP_VAR(0); + N(SetEntityFlags100000)(); + func_802D5830(0); + unbind; +}); + +Script N(80243B28) = SCRIPT({ + bind N(exitSingleDoor_802428D4) to TRIGGER_WALL_PRESS_A 10; +}); + +Script N(makeEntities) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_UNLOCKED_WINDY_MILL) { + MakeEntity(0x802BCD68, 10, 30, -155, 0, MAKE_ENTITY_END); + AssignScript(N(80243B28)); + SI_MAP_VAR(0) = SI_VAR(0); + } +}); + +f32 N(D_80243BC0_BF09B0)[] = { + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, +}; + +NpcAISettings N(npcAISettings_80243BD8) = { + .moveSpeed = 1.8f, + .moveTime = 60, + .waitTime = 15, + .alertRadius = 120.0f, + .unk_14 = 3, + .chaseSpeed = 4.0f, + .unk_1C = 5, + .unk_20 = 1, + .chaseRadius = 150.0f, + .unk_2C = 1, +}; + +Script N(npcAI_80243C08) = SCRIPT({ + SetSelfVar(0, 1); + SetSelfVar(5, -850); + SetSelfVar(6, 60); + SetSelfVar(1, 700); + N(func_80241C5C_BEEA4C)(N(npcAISettings_80243BD8)); +}); + +NpcSettings N(npcSettings_80243C78) = { + .height = 18, + .radius = 20, + .ai = &N(npcAI_80243C08), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, + .unk_2A = 1, +}; + +Script N(80243CA4) = SCRIPT({ + +}); + +Script N(80243CB4) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_80243CC4) = { + .height = 24, + .radius = 24, + .otherAI = &N(80243CA4), + .onDefeat = &N(80243CB4), + .level = 13, +}; + +NpcSettings N(npcSettings_80243CF0) = { + .height = 90, + .radius = 65, + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 13, +}; + +NpcSettings N(npcSettings_80243D1C) = { + .height = 24, + .radius = 24, + .level = 99, +}; + +NpcSettings N(npcSettings_80243D48) = { + .height = 26, + .radius = 24, + .level = 99, +}; + +NpcSettings N(npcSettings_80243D74) = { + .height = 20, + .radius = 20, + .level = 99, +}; + +NpcSettings N(npcSettings_80243DA0) = { + .height = 22, + .radius = 24, + .level = 99, +}; + +Script N(80243DCC) = SCRIPT({ + loop { + PlaySoundAtNpc(0x1, 0x20F6, 0); + ShakeCam(0, 0, 3, 0.80078125); + } +}); + +Script N(80243E24) = SCRIPT({ + DisablePlayerInput(TRUE); + UseSettingsFrom(0, 236, 0, -46); + SetCamSpeed(0, 90.0); + SetPanTarget(0, 250, 0, -46); + PanToTarget(0, 0, 1); + SetPlayerAnimation(ANIM_10002); + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_8)); + SetNpcYaw(NPC_SELF, 90); + sleep 10; + SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_12), NPC_ANIM(world_tubba, Palette_00, Anim_8), 5, MESSAGE_ID(0x0E, 0x00CA)); + sleep 10; + InterpNpcYaw(NPC_SELF, 270, 0); + sleep 10; + SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_12), NPC_ANIM(world_tubba, Palette_00, Anim_8), 5, MESSAGE_ID(0x0E, 0x00CB)); + SetCamDistance(0, 300); + SetCamSpeed(0, 2.0); + SetCamPitch(0, 5.0, -16.0); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + WaitForCam(0, 1.0); +}); + +Script N(80243FE8) = SCRIPT({ + sleep 10; + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_22)); + sleep 15; + loop 4 { + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(3, 0, 1); + sleep 4; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(6, 0, 1); + sleep 4; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(2, 0, 1); + sleep 6; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(4, 0, 1); + sleep 8; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(5, 0, 1); + sleep 6; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(7, 0, 1); + sleep 6; + } + sleep 10; + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_23)); + sleep 30; + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_22)); + sleep 10; + PlaySoundAtNpc(NPC_SELF, 0xB0000010, 0); + SetNpcVar(3, 0, 1); + sleep 15; + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_21)); + sleep 45; + UseSettingsFrom(0, 236, 0, -46); + SetCamSpeed(0, 90.0); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) -= 50; + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PanToTarget(0, 0, 1); + sleep 5; + SetPlayerAnimation(ANIM_STAND_STILL); + SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_12), NPC_ANIM(world_tubba, Palette_00, Anim_8), 0, MESSAGE_ID(0x0E, 0x00CC)); + spawn { + sleep 5; + SetCamSpeed(0, 90.0); + loop 40 { + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + sleep 1; + } + } + spawn { + func_802CF56C(2); + loop 45 { + PlayerFaceNpc(-1, 1); + } + } + SI_VAR(10) = spawn N(80243DCC); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) -= 800; + NpcMoveTo(NPC_SELF, SI_VAR(0), SI_VAR(2), 80); + kill SI_VAR(10); + SetNpcPos(NPC_SELF, 0, -1000, 0); + EnableNpcShadow(NPC_SELF, FALSE); + STORY_PROGRESS = STORY_CH3_DEFEATED_TUBBA_BLUBBA; + SetMusicTrack(0, SONG_CHEERFUL_BOOS_MANSION, 0, 8); + GetCurrentPartnerID(SI_VAR(6)); + if (SI_VAR(6) == 9) { + SI_VAR(5) = -4; + func_802CF56C(0); + DisablePartnerAI(0); + SetNpcPos(NPC_PARTNER, 257, 25, 0); + } + SetCamSpeed(0, 90.0); + SetCamDistance(0, 300); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) += 30; + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + sleep 10; + if (SI_VAR(6) != 9) { + SI_VAR(5) = 8; + SetNpcPos(0x8, 257, 25, 0); + func_802CFD30(0x8, 7, 0, 0, 0, 0); + NpcFacePlayer(0x8, 0); + MakeLerp(0, 240, 20, 0); + loop { + UpdateLerp(); + func_802CFD30(0x8, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + func_802CF56C(0); + } + sleep 10; + spawn { + if (SI_VAR(6) != 9) { + DisablePartnerAI(0); + sleep 1; + NpcFaceNpc(NPC_PARTNER, 0x8, 0); + sleep 5; + } + } + SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00CD)); + InterpPlayerYaw(270, 0); + sleep 10; + GetNpcPos(SI_VAR(5), SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(1) += -20; + SetCamProperties(0, 2.0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 300.0, 15.0, -7.0); + PlayerFaceNpc(SI_VAR(5), 0); + sleep 10; + SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00CE)); + ShowChoice(1966093); + if (SI_VAR(0) == 0) { + ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00CF)); + } else { + ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00D0)); + } + SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00D1)); + UseSettingsFrom(0, 175, 0, 0); + SetCamSpeed(0, 4.0); + SetPanTarget(0, 175, 0, 0); + WaitForCam(0, 1.0); + SetNpcPos(0x9, 93, 160, -6); + InterpNpcYaw(0x9, 90, 0); + spawn { + sleep 10; + InterpPlayerYaw(270, 0); + } + spawn { + if (SI_VAR(6) != 9) { + sleep 12; + InterpNpcYaw(NPC_PARTNER, 270, 0); + } + } + MakeLerp(160, 31, 70, 0); + loop { + UpdateLerp(); + SetNpcPos(0x9, 93, SI_VAR(0), -6); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + spawn { + if (SI_VAR(6) != 9) { + InterpNpcYaw(NPC_PARTNER, 90, 0); + } + } + SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00D2)); + spawn { + if (SI_VAR(6) != 9) { + sleep 12; + InterpNpcYaw(NPC_PARTNER, 270, 0); + } + } + sleep 10; + InterpPlayerYaw(270, 0); + spawn N(80242048); + sleep 20; + spawn { + if (SI_VAR(6) != 9) { + MakeLerp(240, 0, 20, 0); + loop { + UpdateLerp(); + func_802CFD30(0x8, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + SetNpcPos(0x8, 0, -1000, 0); + EnablePartnerAI(); + } else { + sleep 20; + ClearPartnerMoveHistory(-4); + EnablePartnerAI(); + } + sleep 8; + func_802CF56C(2); + } + sleep 20; + DisablePlayerInput(FALSE); +}); + +Script N(idle_80244C54) = SCRIPT({ + loop { + GetSelfVar(0, SI_VAR(0)); + if (SI_VAR(0) == 1) { + break loop; + } + sleep 1; + } + StartBossBattle(11); +}); + +Script N(idle_80244CC8) = SCRIPT({ +10: + loop { + GetSelfVar(0, SI_VAR(0)); + if (SI_VAR(0) == 1) { + break loop; + } + sleep 1; + } + spawn { + SI_VAR(0) = 0.5; + MakeLerp(50, 80, 15, 0); + loop { + UpdateLerp(); + SI_VAR(2) =f SI_VAR(0); + SI_VAR(2) /=f 100; + SetNpcScale(NPC_SELF, SI_VAR(2), SI_VAR(2), SI_VAR(2)); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + } + spawn { + RandInt(80, SI_VAR(2)); + RandInt(10, SI_VAR(3)); + SI_VAR(3) += 5; + MakeLerp(SI_VAR(2), 240, SI_VAR(3), 0); + loop { + UpdateLerp(); + func_802CFD30(NPC_SELF, 7, SI_VAR(0), 0, 0, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + } + SetNpcPos(NPC_SELF, 293, 59, 21); + sleep 1; + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetNpcJumpscale(NPC_SELF, -0.2998046875); + RandInt(100, SI_VAR(3)); + SI_VAR(0) -= SI_VAR(3); + SI_VAR(1) += 100; + NpcJump0(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2), 20); + SetNpcPos(NPC_SELF, 0, -1000, 0); + SetSelfVar(0, 0); + goto 10; +}); + +Script N(defeat_80244FB8) = SCRIPT({ + SetEncounterStatusFlags(2, 1); + GetBattleOutcome(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SetMusicTrack(0, SONG_TUBBAS_MANOR, 1, 8); + await N(80243E24); + spawn N(80243FE8); + } + == 1 {} + == 2 { + } + } +}); + +Script N(init_80245058) = SCRIPT({ + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_80245090) = SCRIPT({ + SetSelfVar(0, 0); + BindNpcIdle(NPC_SELF, N(idle_80244C54)); + BindNpcDefeat(NPC_SELF, N(defeat_80244FB8)); + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_80245104) = SCRIPT({ + SetSelfVar(0, 0); + BindNpcIdle(NPC_SELF, N(idle_80244CC8)); + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_80245164) = SCRIPT({ + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_8024519C) = SCRIPT({ + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WINDY_MILL) { + RemoveNpc(NPC_SELF); + } +}); + +NpcAnimID N(extraAnimationList_802451D4)[] = { + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_22), + NPC_ANIM(world_tubba, Palette_00, Anim_23), + NPC_ANIM(world_tubba, Palette_00, Anim_6), + NPC_ANIM(world_tubba, Palette_00, Anim_10), + NPC_ANIM(world_tubba, Palette_00, Anim_8), + NPC_ANIM(world_tubba, Palette_00, Anim_F), + NPC_ANIM(world_tubba, Palette_00, Anim_12), + ANIM_END, +}; + +NpcAnimID N(extraAnimationList_802451F8)[] = { + NPC_ANIM(boo, Palette_00, Anim_0), + ANIM_END, +}; + +NpcAnimID N(extraAnimationList_80245200)[] = { + NPC_ANIM(boo, Palette_01, Anim_0), + ANIM_END, +}; + +NpcAnimID N(extraAnimationList_80245208)[] = { + NPC_ANIM(bootler, Palette_00, Anim_1), + ANIM_END, +}; + +Script N(idle_80245210) = SCRIPT({ + loop { + loop 10 { + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(1) -= 1; + SetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + sleep 1; + } + loop 10 { + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(1) += 1; + SetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + sleep 1; + } + } +}); + +Script N(80245304) = SCRIPT({ + DisablePartnerAI(0); + func_802CF56C(2); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(3) = SI_VAR(0); + SI_VAR(3) += -50; + SI_VAR(4) = SI_VAR(1); + SI_VAR(4) += 26; + SetNpcPos(0xD, SI_VAR(3), SI_VAR(4), SI_VAR(2)); + PlayerFaceNpc(13, 0); + NpcFaceNpc(NPC_PARTNER, 0xD, 0); + SI_VAR(0) += -25; + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 475.0); + SetCamPitch(0, 18, -8); + SetCamSpeed(0, 90.0); + PanToTarget(0, 0, 1); + sleep 1; + WaitForPlayerInputEnabled(); + DisablePlayerInput(TRUE); + sleep 40; + SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D3)); + SetCamDistance(0, 300.0); + SetCamPitch(0, 18, -9); + SetCamSpeed(0, 4.0); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + MakeLerp(0, 360, 10, 0); + loop { + UpdateLerp(); + SetNpcRotation(0xD, 0, SI_VAR(0), 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + EnableNpcAI(13, 0); + SetNpcAnimation(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_3)); + sleep 20; + SetPlayerAnimation(ANIM_GOT_ITEM); + PlaySoundAtPlayer(313, 0); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(3) = SI_VAR(1); + SI_VAR(1) += 50; + SI_VAR(2) += 10; + SI_VAR(3) += 30; + loop 5 { + PlayEffect(0x11, 3, SI_VAR(0), SI_VAR(1), SI_VAR(2), 20, 0, 0, 0, 0, 0, 0, 0, 0); + sleep 6; + PlayEffect(0x11, 1, SI_VAR(0), SI_VAR(3), SI_VAR(2), 20, 0, 0, 0, 0, 0, 0, 0, 0); + sleep 6; + } + sleep 20; + PlaySoundAtPlayer(392, 0); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(1) += 20; + PlayEffect(0x52, 4, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1, 30, 0, 0, 0, 0, 0, 0, 0); + sleep 30; + SetPlayerAnimation(ANIM_10002); + SetNpcAnimation(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_1)); + EnableNpcAI(13, 1); + PostChapter3StatUpdate(); + ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0193), 160, 40); + sleep 10; + GetNpcPos(0xD, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 250.0); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + sleep 10; + SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D4)); + sleep 10; + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) += -25; + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 300.0); + SetCamSpeed(0, 4.0); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + sleep 10; + SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D5)); + SetNpcFlagBits(0xD, 0x00040000, TRUE); + spawn { + loop 25 { + GetNpcPos(0xD, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PlayEffect(0x11, 4, SI_VAR(0), SI_VAR(1), SI_VAR(2), 20, 0, 0, 0, 0, 0, 0, 0, 0); + sleep 4; + } + } + spawn { + SI_VAR(2) = 0; + SI_VAR(3) = 1800; + MakeLerp(SI_VAR(2), SI_VAR(3), 100, 2); + loop { + UpdateLerp(); + SetNpcRotation(0xD, 0, SI_VAR(0), 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + } + spawn { + GetNpcPos(0xD, SI_VAR(2), SI_VAR(3), SI_VAR(4)); + SI_VAR(5) = SI_VAR(3); + SI_VAR(5) += 180; + MakeLerp(SI_VAR(3), SI_VAR(5), 100, 2); + loop { + UpdateLerp(); + SetNpcPos(0xD, SI_VAR(2), SI_VAR(0), SI_VAR(4)); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + SetNpcPos(0xD, 0, -1000, 0); + } + spawn { + sleep 15; + PlaySoundAtNpc(0xD, 0x2045, 0); + } + sleep 10; + SetPlayerAnimation(0x1002A); + sleep 90; + ResetCam(0, 3); + sleep 20; + SetPlayerAnimation(ANIM_10002); + STORY_PROGRESS = STORY_CH3_STAR_SPRIT_DEPARTED; + spawn N(80241F10); + EnablePartnerAI(); + DisablePlayerInput(FALSE); +}); + +Script N(init_80245C9C) = SCRIPT({ + GetEntryID(SI_VAR(0)); + if (SI_VAR(0) == 3) { + BindNpcIdle(NPC_SELF, N(idle_80245210)); + spawn N(80245304); + } else { + RemoveNpc(NPC_SELF); + } +}); + +StaticNpc N(npcGroup_80245D0C)[] = { + { + .id = 1, + .settings = &N(npcSettings_80243CF0), + .pos = { 309.0f, 0.0f, 11.0f }, + .flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000, + .init = &N(init_80245090), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(world_tubba, Palette_00, Anim_6), + NPC_ANIM(world_tubba, Palette_00, Anim_9), + NPC_ANIM(world_tubba, Palette_00, Anim_C), + NPC_ANIM(world_tubba, Palette_00, Anim_C), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + NPC_ANIM(world_tubba, Palette_00, Anim_0), + }, + .extraAnimations = &N(extraAnimationList_802451D4), + }, + { + .id = 0, + .settings = &N(npcSettings_80243CC4), + .pos = { -10.0f, 50.0f, -170.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000, + .init = &N(init_80245058), + .yaw = 90, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, + }, +}; + +StaticNpc N(npcGroup_802460EC)[] = { + { + .id = 2, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_80245200), + }, + { + .id = 3, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_80245200), + }, + { + .id = 4, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_80245200), + }, + { + .id = 5, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_2), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_1), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_0), + NPC_ANIM(boo, Palette_01, Anim_A), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + NPC_ANIM(boo, Palette_01, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_80245200), + }, + { + .id = 6, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_2), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_0), + NPC_ANIM(boo, Palette_00, Anim_0), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_802451F8), + }, + { + .id = 7, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245104), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_2), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_1), + NPC_ANIM(boo, Palette_00, Anim_0), + NPC_ANIM(boo, Palette_00, Anim_0), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + NPC_ANIM(boo, Palette_00, Anim_3), + }, + .extraAnimations = &N(extraAnimationList_802451F8), + }, +}; + +StaticNpc N(npcGroup_80246C8C) = { + .id = 8, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_80245164), + .yaw = 0, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(world_bow, Palette_00, Anim_1), + NPC_ANIM(world_bow, Palette_00, Anim_2), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_1), + NPC_ANIM(world_bow, Palette_00, Anim_1), + NPC_ANIM(world_bow, Palette_00, Anim_0), + NPC_ANIM(world_bow, Palette_00, Anim_0), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + NPC_ANIM(world_bow, Palette_00, Anim_3), + }, +}; + +StaticNpc N(npcGroup_80246E7C) = { + .id = 9, + .settings = &N(npcSettings_80243D1C), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000, + .init = &N(init_8024519C), + .yaw = 0, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(bootler, Palette_00, Anim_1), + NPC_ANIM(bootler, Palette_00, Anim_2), + NPC_ANIM(bootler, Palette_00, Anim_3), + NPC_ANIM(bootler, Palette_00, Anim_3), + NPC_ANIM(bootler, Palette_00, Anim_1), + NPC_ANIM(bootler, Palette_00, Anim_1), + NPC_ANIM(bootler, Palette_00, Anim_0), + NPC_ANIM(bootler, Palette_00, Anim_0), + NPC_ANIM(bootler, Palette_00, Anim_5), + NPC_ANIM(bootler, Palette_00, Anim_6), + NPC_ANIM(bootler, Palette_00, Anim_7), + NPC_ANIM(bootler, Palette_00, Anim_8), + NPC_ANIM(bootler, Palette_00, Anim_5), + NPC_ANIM(bootler, Palette_00, Anim_6), + NPC_ANIM(bootler, Palette_00, Anim_7), + NPC_ANIM(bootler, Palette_00, Anim_8), + }, + .extraAnimations = &N(extraAnimationList_80245208), +}; + +Script N(init_8024706C) = SCRIPT({ + if (STORY_PROGRESS >= STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER) { + if (STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) { + RemoveNpc(NPC_SELF); + } + } +}); + +StaticNpc N(npcGroup_802470BC) = { + .id = 10, + .settings = &N(npcSettings_80243C78), + .pos = { -216.0f, 60.0f, -10.0f }, + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024706C), + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { -216, 60, -10, 30, 0, -32767, 0, -216, 60, -10, 250 }, + .animations = { + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_3), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_5), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_802472AC) = { + .id = 11, + .settings = &N(npcSettings_80243C78), + .pos = { 0.0f, 60.0f, 150.0f }, + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024706C), + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 0, 60, 150, 30, 0, -32767, 0, 0, 60, 150, 250 }, + .animations = { + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_3), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_5), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_8024749C) = { + .id = 12, + .settings = &N(npcSettings_80243C78), + .pos = { 260.0f, 60.0f, 30.0f }, + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024706C), + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 260, 60, 30, 30, 0, -32767, 0, 260, 60, 30, 250 }, + .animations = { + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_3), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_1), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_6), + NPC_ANIM(paragoomba, Palette_02, Anim_5), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + NPC_ANIM(paragoomba, Palette_02, Anim_4), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +StaticNpc N(npcGroup_8024768C) = { + .id = 13, + .settings = &N(npcSettings_80243D48), + .pos = { 0.0f, -1000.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80245C9C), + .yaw = 0, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_0), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + NPC_ANIM(world_skolar, Palette_00, Anim_1), + }, +}; + +NpcGroupList N(npcGroupList_8024787C) = { + NPC_GROUP(N(npcGroup_80245D0C), BATTLE_ID(14, 16, 0, 2)), + NPC_GROUP(N(npcGroup_802460EC), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80246C8C), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80246E7C), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +NpcGroupList N(npcGroupList_802478B8) = { + NPC_GROUP(N(npcGroup_802470BC), BATTLE_ID(14, 6, 0, 2)), + NPC_GROUP(N(npcGroup_802472AC), BATTLE_ID(14, 7, 0, 2)), + NPC_GROUP(N(npcGroup_8024749C), BATTLE_ID(14, 8, 0, 2)), + {}, +}; + +NpcGroupList N(npcGroupList_802478E8) = { + NPC_GROUP(N(npcGroup_8024768C), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +void N(func_80240950_BED740)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} + +#ifdef NON_MATCHING +void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 temp_f24; + f32 posX, posY, posZ, posW; + s32 var; + f32 temp_f0; + f32 phi_f4; + s32 phi_v0; + s32 phi_s4 = 0; + + f32 a = enemy->varTable[7]; + f32 temp_f2 = a / 100.0; + f32 b = enemy->varTable[3]; + f32 temp_f26 = b / 100.0; + f32 c = enemy->varTable[4]; + f32 temp_f20 = c / 100.0; + f32 d = enemy->varTable[1]; + f32 temp_f22 = d / 100.0; + + enemy->varTable[4] = npc->pos.y * 100.0; + temp_f24 = temp_f26 + temp_f2; + + if ((enemy->varTable[0] & 0x11) == 1) { + if (npc->flags & 8) { + if (temp_f22 < (temp_f24 - npc->pos.y)) { + enemy->varTable[0] |= 0x10; + } + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + if (temp_f22 < (temp_f26 - posW)) { + enemy->varTable[0] |= 0x10; + } + } + } + + if ((enemy->varTable[0] & 0x11) == 0x11) { + f64 test; + if (npc->flags & 8) { + phi_f4 = temp_f24; + test = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + npc->pos.y = test; + } else { + posX = npc->pos.x; + posY = temp_f20; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + phi_f4 = posY; + phi_f4 += temp_f26; + d = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + test = d; + npc->pos.y = test; + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + } + //npc->pos.y = temp_f20 + ((phi_f4 - temp_f20) * 0.09); + + if (fabsf(phi_f4 - npc->pos.y) < 1.0) { + npc->pos.y = phi_f4; + enemy->varTable[0] &= ~0x10; + } + } else if (enemy->varTable[1] > 0) { + temp_f0 = sin_deg(enemy->varTable[2]); + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + if (phi_v0) { + npc->pos.y = posY + temp_f26 + (temp_f0 * temp_f22); + } else { + npc->pos.y = temp_f24 + (temp_f0 * temp_f22); + } + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && + func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + } else { + enemy->varTable[9]--; + } + + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); + if (npc->moveSpeed < posW) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + phi_s4 = 1; + } + } + + if (enemy->territory->wander.wanderSizeX | enemy->territory->wander.wanderSizeZ | phi_s4) { + if (npc->unk_8C == 0) { + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } else { + return; + } + } + + enemy->varTable[4] = npc->pos.y * 100.0; + if (aiSettings->moveTime > 0) { + if ((npc->duration <= 0) || (--npc->duration <= 0)) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->waitTime <= 0) || (script->functionTemp[1].s < 3)) { + script->functionTemp[0].s = 0; + } + } + } +} +#else +INCLUDE_ASM(void, "world/area_arn/arn_07/BED740", arn_07_func_80240B00_BED8F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +#endif + +#include "world/common/UnkNpcAIFunc1.inc.c" + +void N(func_802411E8_BEDFD8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} + +#include "world/common/UnkNpcAIFunc2.inc.c" + +void N(func_802415A4_BEE394)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_80243BC0_BF09B0)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} + +#include "world/common/UnkNpcAIFunc14.inc.c" + +#include "world/common/UnkNpcAIFunc3.inc.c" + +void N(func_802417A8_BEE598)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} + +void N(func_80241B38_BEE928)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} + +ApiStatus N(func_80241C5C_BEEA4C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Bytecode* args = script->ptrReadPos; + Npc* npc = get_npc_unsafe(enemy->npcID); + EnemyTerritoryThing territory; + EnemyTerritoryThing* territoryPtr = &territory; + NpcAISettings* aiSettings = get_variable(script, *args); + + territory.unk_00 = 0; + territory.shape = enemy->territory->wander.detectShape; + territory.pointX = enemy->territory->wander.detect.x; + territory.pointZ = enemy->territory->wander.detect.z; + territory.sizeX = enemy->territory->wander.detectSizeX; + territory.sizeZ = enemy->territory->wander.detectSizeZ; + territory.unk_34 = 120.0f; + territory.unk_1C = 0; + + if (isInitialCall) { + N(func_80241B38_BEE928)(npc, enemy, script, aiSettings); + } + + npc->unk_AB = -2; + + if (enemy->unk_B0 & 4) { + if (enemy->unk_B4 != 0) { + return ApiStatus_BLOCK; + } + enemy->unk_B0 &= ~4; + } + + switch (script->functionTemp[0].s) { + case 0: + N(func_80240950_BED740)(script, aiSettings, territoryPtr); + case 1: + N(func_80240B00_BED8F0)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 2: + N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr); + case 3: + N(func_802411E8_BEDFD8)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 10: + N(UnkNpcAIFunc2)(script, aiSettings, territoryPtr); + case 11: + N(func_802415A4_BEE394)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 12: + N(UnkNpcAIFunc14)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 13: + N(UnkNpcAIFunc3)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + case 14: + N(func_802417A8_BEE598)(script, aiSettings, territoryPtr); + return ApiStatus_BLOCK; + } + + return ApiStatus_BLOCK; +} + +ApiStatus PostChapter3StatUpdate(ScriptInstance* script, s32 isInitialCall) { + PlayerData* playerData = &gPlayerData; + + set_max_SP(3); + playerData->curHP = playerData->curMaxHP; + playerData->curFP = playerData->curMaxFP; + sync_status_menu(); + return ApiStatus_DONE2; +} + diff --git a/src/world/area_arn/arn_07/header.c b/src/world/area_arn/arn_07/header.c new file mode 100644 index 0000000000..6d00a766e9 --- /dev/null +++ b/src/world/area_arn/arn_07/header.c @@ -0,0 +1,41 @@ +#include "arn_07.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { 0.0f, 20.0f, -147.0f, 180.0f }, + { 485.0f, 0.0f, 0.0f, 270.0f }, + { -488.0f, 0.0f, 0.0f, 90.0f }, + { 194.0f, 0.0f, 0.0f, 0.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .background = &gBackgroundImage, + .tattle = MSG_arn_07_tattle, +}; + +Script N(80241F10) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_TUBBA_WOKE_UP { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + PlayAmbientSounds(AMBIENT_WIND); + } + < STORY_CH3_HEART_ESCAPED_WINDY_MILL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + PlayAmbientSounds(AMBIENT_WIND); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + PlayAmbientSounds(AMBIENT_WIND); + } + == STORY_CH3_BEGAN_PEACH_MISSION { + SetMusicTrack(0, SONG_STAR_SPIRIT_THEME, 1, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + PlayAmbientSounds(AMBIENT_WIND); + } + } +}); diff --git a/src/world/area_arn/arn_08/BF47A0.c b/src/world/area_arn/arn_08/BF47A0.c index 53d65754c3..495fb1243c 100644 --- a/src/world/area_arn/arn_08/BF47A0.c +++ b/src/world/area_arn/arn_08/BF47A0.c @@ -1,5 +1,25 @@ #include "arn_08.h" -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF47A0", func_80240000_BF47A0); +ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + f32 temp_f20; + f32 var; -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF47A0", func_8024008C_BF482C); + if (isInitialCall) { + script->functionTemp[0].s = 0; + func_800DFEFC(0x10007); + } + + temp_f20 = func_800E34D8(); + playerStatus->position.y = func_800E3514(temp_f20, &var); + script->functionTemp[0].s += fabsf(temp_f20); + do {} while(0); + return (script->functionTemp[0].s > 50) * ApiStatus_DONE2; +} + +ApiStatus N(func_8024008C_BF482C)(ScriptInstance *script, s32 isInitialCall) { + if (gPlayerStatus.position.y < -10.0f) { + return ApiStatus_DONE2; + } + return ApiStatus_BLOCK; +} diff --git a/src/world/area_arn/arn_08/BF4860.c b/src/world/area_arn/arn_08/BF4860.c deleted file mode 100644 index c15bb8e4aa..0000000000 --- a/src/world/area_arn/arn_08/BF4860.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "arn_08.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF4860", func_802400C0_BF4860); - -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF4860", func_802400D4_BF4874); - -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF4860", func_802400F4_BF4894); - -INCLUDE_ASM(s32, "world/area_arn/arn_08/BF4860", func_8024019C_BF493C); diff --git a/src/world/area_arn/arn_08/arn_08.h b/src/world/area_arn/arn_08/arn_08.h index 3a9a8f1f51..86003cafb3 100644 --- a/src/world/area_arn/arn_08/arn_08.h +++ b/src/world/area_arn/arn_08/arn_08.h @@ -1,4 +1,23 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_08 + +f32 func_800E3514(f32, f32*); +f32 func_800E34D8(void); + +ApiStatus N(func_8024008C_BF482C)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_802400C0_BF4860)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_802400D4_BF4874)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall); +ApiStatus N(func_8024019C_BF493C)(ScriptInstance *script, s32 isInitialCall); + +Script N(main); +Script N(80240300); +NpcGroupList N(npcGroupList_80241828); +Script N(makeEntities); +Script N(80240BA0); +Script N(8024118C); +Script N(80240B50); diff --git a/src/world/area_arn/arn_08/events.c b/src/world/area_arn/arn_08/events.c new file mode 100644 index 0000000000..322427ce61 --- /dev/null +++ b/src/world/area_arn/arn_08/events.c @@ -0,0 +1,472 @@ +#include "arn_08.h" +#include "sprite/npc/tubbas_heart.h" +#include "sprite/npc/yakkey.h" + +extern Npc* wPartnerNpc; +void func_800EF3C0(s32, s32); +void func_800EF3D4(s16); + +Script N(802403B0) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + ClearDefeatedEnemies(); + SI_VAR(0) = 0; + SI_VAR(1) = 6; + SI_VAR(2) = 0; + SI_VAR(4) = 1; + SI_VAR(3) = -1; + spawn 0x80285DFC; + sleep 17; + GotoMap("arn_07", 0); + sleep 100; +}); + +Script N(80240470) = SCRIPT({ + bind N(802403B0) to TRIGGER_WALL_PRESS_A 6; +}); + +Script N(8024049C) = SCRIPT({ + GetLoadType(SI_VAR(1)); + if (SI_VAR(1) == 1) { + spawn EnterSavePoint; + spawn N(80240470); + return; + } + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SI_VAR(4) = 1; + SI_VAR(2) = 0; + SI_VAR(3) = -1; + await 0x80285E24; + SI_AREA_FLAG(1) = 0; + spawn N(80240470); + } + == 1 { + DisablePlayerInput(TRUE); + DisablePlayerPhysics(TRUE); + if (STORY_PROGRESS == STORY_CH3_HEART_ESCAPED_WELL) { + SetPlayerPos(1000, 1000, 0); + SetNpcPos(NPC_PARTNER, 1000, 1000, 0); + RotateModel(0, 80, 0, -1, 0); + RotateModel(1, 80, 0, -1, 0); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6)); + SetNpcJumpscale(NPC_PLAYER, 2.5); + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, -50, 0, 50, 10); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7)); + sleep 1; + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6)); + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, -110, 0, 110, 10); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7)); + sleep 1; + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6)); + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, -180, 0, 180, 10); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7)); + sleep 1; + MakeLerp(80, 0, 10, 0); + loop { + UpdateLerp(); + RotateModel(0, SI_VAR(0), 0, -1, 0); + RotateModel(1, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + PlaySoundAtCollider(6, 450, 0); + sleep 20; + SetPlayerPos(0, 0, 0); + SetNpcPos(NPC_PARTNER, 0, 0, 0); + STORY_PROGRESS = STORY_CH3_HEART_ESCAPED_WINDY_MILL; + } + DisablePlayerPhysics(FALSE); + SetPlayerJumpscale(2.0); + PlayerJump(-10, 0, 75, 18); + DisablePlayerInput(FALSE); + spawn N(80240470); + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(-1); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + SI_SAVE_FLAG(1979) = 1; + if (STORY_PROGRESS >= STORY_CH4_FRYING_PAN_STOLEN) { + SI_SAVE_FLAG(1016) = 0; + SI_SAVE_FLAG(1017) = 0; + SI_SAVE_FLAG(1018) = 0; + } + MakeNpcs(0, N(npcGroupList_80241828)); + await N(makeEntities); + spawn N(80240BA0); + GetDemoState(SI_VAR(0)); + if (SI_VAR(0) != 0) { + await N(8024118C); + return; + } + spawn N(8024049C); + spawn N(80240B50); + spawn N(80240300); +}); + +static s32 N(pad_A6C)[] = { + 0x00000000, +}; + +Script N(80240A70) = SCRIPT({ + loop { + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WELL) { + break loop; + } + sleep 1; + } + N(func_8024008C_BF482C)(); + DisablePlayerInput(TRUE); + DisablePlayerPhysics(TRUE); + N(func_80240000_BF47A0)(); + SI_AREA_FLAG(1) = 1; + if (STORY_PROGRESS < STORY_CH3_WENT_DOWN_THE_WELL) { + STORY_PROGRESS = STORY_CH3_WENT_DOWN_THE_WELL; + } + GotoMap("arn_09", 1); + sleep 100; +}); + +Script N(80240B50) = SCRIPT({ + SetCamProperties(0, 90.0, 0, 0, 0, 470.0, 17.0, -7.0); + spawn N(80240A70); +}); + +static s32 N(pad_B98)[] = { + 0x00000000, 0x00000000, +}; + +Script N(80240BA0) = SCRIPT({ + PlaySound(0x8000004B); + spawn { + SI_VAR(0) = 0; + 10: + RotateModel(9, SI_VAR(0), 0, 0, 1); + RotateModel(15, SI_VAR(0), 0, 0, 1); + RotateModel(11, SI_VAR(0), 0, 0, 1); + RotateModel(13, SI_VAR(0), 0, 0, -1); + RotateModel(17, SI_VAR(0), 0, 0, -1); + SI_VAR(0) += 1; + sleep 1; + goto 10; + } +}); + +static s32 N(pad_CB4)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; + +Script N(80240CC0) = SCRIPT({ + N(func_802400C0_BF4860)(); + DemoJoystickXY(2, 0); + sleep 1; + DemoJoystickXY(12, 4); + sleep 1; + DemoJoystickXY(28, 11); + sleep 1; + DemoJoystickXY(47, 22); + sleep 1; + DemoJoystickXY(68, 38); + sleep 1; + DemoJoystickXY(67, 48); + sleep 1; + DemoJoystickXY(64, 59); + sleep 1; + DemoJoystickXY(64, 62); + sleep 4; + DemoSetButtons(32768); + sleep 10; + DemoJoystickXY(64, 58); + DemoSetButtons(0); + sleep 1; + DemoJoystickXY(70, 34); + sleep 1; + DemoJoystickXY(77, -2); + sleep 1; + DemoJoystickXY(74, -23); + sleep 1; + DemoJoystickXY(71, -36); + sleep 1; + DemoJoystickXY(69, -44); + sleep 1; + DemoJoystickXY(67, -49); + sleep 1; + DemoJoystickXY(30, -30); + sleep 1; + DemoJoystickXY(0, 0); + sleep 1; + DemoJoystickXY(0, -1); + sleep 8; + DemoSetButtons(32768); + sleep 2; + DemoJoystickXY(0, -2); + sleep 2; + DemoJoystickXY(0, -1); + sleep 2; + DemoJoystickXY(0, 0); + sleep 1; + DemoSetButtons(0); + sleep 1; + DemoJoystickXY(1, 0); + sleep 1; + DemoJoystickXY(0, 0); + N(func_802400D4_BF4874)(); + DemoSetButtons(32768); + sleep 12; + DemoSetButtons(0); + sleep 20; + if (SI_SAVE_FLAG(9) == 1) { + return; + } + SI_SAVE_FLAG(9) = 1; + GotoMapSpecial("arn_08", 2, 2); + sleep 100; +}); + +Script N(802410AC) = SCRIPT({ + sleep 10; + loop { + GetDemoState(SI_VAR(0)); + if (SI_VAR(0) == 2) { + break loop; + } + sleep 1; + } + if (SI_SAVE_FLAG(9) == 1) { + return; + } + SI_SAVE_FLAG(9) = 1; + GotoMapSpecial("arn_08", 2, 3); + sleep 35; +}); + +Script N(8024116C) = SCRIPT({ + N(func_802400F4_BF4894)(); +}); + +s32 N(D_80241188_BF5928) = { + 0x00000000, +}; + +Script N(8024118C) = SCRIPT({ + SetCamProperties(0, 90.0, 0, 0, 0, 470.0, 17.0, -7.0); + N(func_8024019C_BF493C)(); + SI_SAVE_FLAG(9) = 0; + spawn N(802410AC); + spawn N(80240CC0); +}); + +static s32 N(pad_11FC)[] = { + 0x00000000, +}; + +Script N(80241200) = SCRIPT({ + +}); + +Script N(80241210) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_80241220) = { + .height = 24, + .radius = 24, + .otherAI = &N(80241200), + .onDefeat = &N(80241210), + .level = 13, +}; + +NpcSettings N(npcSettings_8024124C) = { + .height = 24, + .radius = 24, + .level = 13, +}; + +Script N(idle_80241278) = SCRIPT({ + +}); + +Script N(init_80241288) = SCRIPT({ + if (STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WELL) { + SetNpcPos(NPC_SELF, 0, -1000, 0); + } else { + BindNpcIdle(NPC_SELF, N(idle_80241278)); + } +}); + +Script N(interact_802412E8) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH5_WHALE_MOUTH_OPEN { + SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BA)); + } + < STORY_CH6_FLOWER_GATE_OPEN { + SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BB)); + } + < STORY_CH7_INVITED_TO_STARBORN_VALLEY { + SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BC)); + } + < STORY_CH8_OPENED_PATH_TO_STAR_WAY { + SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BD)); + } + >= STORY_CH8_OPENED_PATH_TO_STAR_WAY { + SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BE)); + } + } +}); + +Script N(init_802413E8) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) { + SetNpcPos(NPC_SELF, 0, -1000, 0); + } else { + BindNpcInteract(NPC_SELF, N(interact_802412E8)); + } +}); + +StaticNpc N(npcGroup_80241448) = { + .id = 0, + .settings = &N(npcSettings_80241220), + .pos = { -23.0f, 75.0f, 31.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80241288), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +StaticNpc N(npcGroup_80241638) = { + .id = 1, + .settings = &N(npcSettings_8024124C), + .pos = { 38.0f, 0.0f, 97.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_802413E8), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + NPC_ANIM(yakkey, Palette_00, Anim_1), + }, + .tattle = MESSAGE_ID(0x1A, 0x00B4), +}; + +NpcGroupList N(npcGroupList_80241828) = { + NPC_GROUP(N(npcGroup_80241448), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_80241638), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +static s32 N(pad_184C)[] = { + 0x00000000, +}; + +Script N(makeEntities) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH3_WENT_DOWN_THE_WELL) { + MakeEntity(0x802BCE84, 0, 30, 0, 0, MAKE_ENTITY_END); + } +}); + +ApiStatus N(func_802400C0_BF4860)(ScriptInstance *script, s32 isInitialCall) { + gPlayerData.bootsLevel = 1; + return ApiStatus_DONE2; +} + +ApiStatus N(func_802400D4_BF4874)(ScriptInstance *script, s32 isInitialCall) { + func_800EF300(); + return ApiStatus_DONE2; +} + +ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + + if (isInitialCall) { + script->functionTemp[0].s = 0; + } + + if (!(playerStatus->position.y > -10.0f)) { + f32 temp_f20 = func_800E34D8(); + s32 var; + + playerStatus->position.y = func_800E3514(temp_f20, &var); + script->functionTemp[0].s += fabsf(temp_f20); + + return (script->functionTemp[0].s > 50) * ApiStatus_DONE2; + } + + return ApiStatus_BLOCK; +} + +ApiStatus N(func_8024019C_BF493C)(ScriptInstance *script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + s32* dataPtr = &N(D_80241188_BF5928); + + switch (*dataPtr) { + case 0: + *dataPtr = 1; + break; + case 1: + case 2: + (*dataPtr)++; + break; + case 3: { + Npc** partnerNpcPtr = &wPartnerNpc; + + clear_partner_move_history(*partnerNpcPtr); + func_800EF3C0(playerStatus->position.x, playerStatus->position.z); + func_800EF3D4(0); + set_npc_yaw(*partnerNpcPtr, 90.0f); + playerStatus->targetYaw = 90.0f; + playerStatus->currentYaw = 90.0f; + playerStatus->spriteFacingAngle = 0.0f; + return ApiStatus_DONE2; + } + } + + return ApiStatus_BLOCK; +} diff --git a/src/world/area_arn/arn_08/header.c b/src/world/area_arn/arn_08/header.c new file mode 100644 index 0000000000..47e696abf6 --- /dev/null +++ b/src/world/area_arn/arn_08/header.c @@ -0,0 +1,30 @@ +#include "arn_08.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -80.0f, 0.0f, 108.0f, 45.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + { -85.0f, 0.0f, 55.0f, 45.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_08_tattle, +}; + +Script N(80240300) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_HEART_FLED_FIRST_TUNNEL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } + ClearAmbientSounds(250); +}); diff --git a/src/world/area_arn/arn_09/BF6060.c b/src/world/area_arn/arn_09/BF6060.c deleted file mode 100644 index 904b5e0eb4..0000000000 --- a/src/world/area_arn/arn_09/BF6060.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "arn_09.h" - -INCLUDE_ASM(s32, "world/area_arn/arn_09/BF6060", func_80240000_BF6060); diff --git a/src/world/area_arn/arn_09/arn_09.h b/src/world/area_arn/arn_09/arn_09.h index b50f85d938..c9e7e71a29 100644 --- a/src/world/area_arn/arn_09/arn_09.h +++ b/src/world/area_arn/arn_09/arn_09.h @@ -1,4 +1,15 @@ #include "common.h" #include "map.h" +#include "../arn.h" #define NAMESPACE arn_09 + +ApiStatus func_802D2484(ScriptInstance* script, s32 isInitialCall); +ApiStatus N(func_80240000_BF6060)(ScriptInstance *script, s32 isInitialCall); + +Script N(main); +Script N(802400A0); +NpcGroupList N(npcGroupList_80240974); +Script N(makeEntities); +Script N(802404D0); + diff --git a/src/world/area_arn/arn_09/events.c b/src/world/area_arn/arn_09/events.c new file mode 100644 index 0000000000..ab651156fc --- /dev/null +++ b/src/world/area_arn/arn_09/events.c @@ -0,0 +1,188 @@ +#include "arn_09.h" +#include "sprite/npc/tubbas_heart.h" + +extern s32 D_000001E4; + +Script N(80240140) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 5; + SI_VAR(2) = 0; + SI_VAR(4) = 1; + SI_VAR(3) = 1; + spawn 0x80285DFC; + sleep 17; + GotoMap("arn_10", 0); + sleep 100; +}); + +Script N(802401F4) = SCRIPT({ + bind N(80240140) to TRIGGER_WALL_PRESS_A 5; +}); + +Script N(80240220) = SCRIPT({ + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SI_VAR(2) = 0; + SI_VAR(4) = 1; + SI_VAR(3) = 1; + await 0x80285E24; + spawn N(802401F4); + } + == 1 { + spawn N(802401F4); + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(524288); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_80240974)); + await N(makeEntities); + spawn N(80240220); + spawn N(802404D0); + spawn N(802400A0); +}); + +static s32 N(pad_398)[] = { + 0x00000000, 0x00000000, +}; + +Script N(802403A0) = SCRIPT({ + if (SI_AREA_FLAG(1) == 1) { + return; + } + SI_AREA_FLAG(1) = 1; + DisablePlayerInput(TRUE); + DisablePlayerPhysics(TRUE); + SetPlayerActionState(6); + sleep 1; + SetPlayerJumpscale(1.0); + PlayerJump(0, 200, 0, 30); + GotoMap("arn_08", 1); + sleep 100; + DisablePlayerInput(FALSE); + DisablePlayerPhysics(FALSE); +}); + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EAA30, 0, 0, 0, 0, MAKE_ENTITY_END); + AssignScript(N(802403A0)); +}); + +static s32 N(pad_4CC)[] = { + 0x00000000, +}; + +Script N(802404D0) = SCRIPT({ + if (SI_AREA_FLAG(1) == 0) { + return; + } + SI_AREA_FLAG(1) = 1; + DisablePlayerInput(TRUE); + SetPlayerActionState(8); + func_802D2484(); + SetPlayerActionState(6); + SetPlayerJumpscale(1.5); + PlayerJump(50, 0, 0, 16); + SetPlayerAnimation(ANIM_10002); + SI_AREA_FLAG(1) = 0; + DisablePlayerInput(FALSE); +}); + +static s32 N(pad_5A8)[] = { + 0x00000000, 0x00000000, +}; + +Script N(802405B0) = SCRIPT({ + +}); + +Script N(802405C0) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_802405D0) = { + .height = 24, + .radius = 24, + .otherAI = &N(802405B0), + .onDefeat = &N(802405C0), + .level = 13, +}; + +Script N(idle_802405FC) = SCRIPT({ + EnableNpcShadow(NPC_SELF, FALSE); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, 0, 25, -10, 6); + PlaySoundAtNpc(NPC_SELF, 0x2086, 0); + N(func_80240000_BF6060)(); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, 0, 200, 0, 15); + SetNpcPos(NPC_SELF, 0, -1000, 0); + STORY_PROGRESS = STORY_CH3_HEART_ESCAPED_WELL; +}); + +Script N(init_80240730) = SCRIPT({ + if (STORY_PROGRESS != STORY_CH3_HEART_FLED_SECOND_TUNNEL) { + RemoveNpc(NPC_SELF); + } else { + BindNpcIdle(NPC_SELF, N(idle_802405FC)); + } +}); + +StaticNpc N(npcGroup_80240784) = { + .id = 0, + .settings = &N(npcSettings_802405D0), + .pos = { 0.0f, 25.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80240730), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +NpcGroupList N(npcGroupList_80240974) = { + NPC_GROUP(N(npcGroup_80240784), BATTLE_ID(0, 0, 0, 0)), + {}, +}; + +ApiStatus N(func_80240000_BF6060)(ScriptInstance *script, s32 isInitialCall) { + Entity* entity = get_entity_by_index(0); + + if (entity == NULL) { + return ApiStatus_BLOCK; + } + + play_model_animation(entity->virtualModelIndex, &D_000001E4); + return ApiStatus_DONE2; +} diff --git a/src/world/area_arn/arn_09/header.c b/src/world/area_arn/arn_09/header.c new file mode 100644 index 0000000000..b8aa6e33bd --- /dev/null +++ b/src/world/area_arn/arn_09/header.c @@ -0,0 +1,28 @@ +#include "arn_09.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { 125.0f, 0.0f, 0.0f, 270.0f }, + { 0.0f, 200.0f, 0.0f, 90.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_09_tattle, +}; + +Script N(802400A0) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_HEART_FLED_FIRST_TUNNEL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } +}); diff --git a/src/world/area_arn/arn_10/arn_10.h b/src/world/area_arn/arn_10/arn_10.h new file mode 100644 index 0000000000..a81bc9c980 --- /dev/null +++ b/src/world/area_arn/arn_10/arn_10.h @@ -0,0 +1,10 @@ +#include "common.h" +#include "map.h" +#include "../arn.h" + +#define NAMESPACE arn_10 + +Script N(main); +Script N(80240060); +NpcGroupList N(npcGroupList_80240BB8); +Script N(makeEntities); diff --git a/src/world/area_arn/arn_10/events.c b/src/world/area_arn/arn_10/events.c new file mode 100644 index 0000000000..fc721f11c8 --- /dev/null +++ b/src/world/area_arn/arn_10/events.c @@ -0,0 +1,245 @@ +#include "arn_10.h" +#include "sprite/npc/tubbas_heart.h" +#include "sprite/npc/goomba.h" + +Script N(exitSingleDoor_80240100) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 6; + SI_VAR(2) = 0; + SI_VAR(3) = -1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_09", 0); + sleep 100; +}); + +Script N(exitSingleDoor_802401A4) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 1; + SI_VAR(1) = 11; + SI_VAR(2) = 2; + SI_VAR(3) = 1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_12", 0); + sleep 100; +}); + +Script N(80240248) = SCRIPT({ + bind N(exitSingleDoor_80240100) to TRIGGER_WALL_PRESS_A 6; + bind N(exitSingleDoor_802401A4) to TRIGGER_WALL_PRESS_A 11; +}); + +Script N(enterSingleDoor_80240290) = SCRIPT({ + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SI_VAR(2) = 0; + SI_VAR(3) = -1; + await EnterSingleDoor; + spawn N(80240248); + } + == 1 { + SI_VAR(2) = 2; + SI_VAR(3) = 1; + await EnterSingleDoor; + spawn N(80240248); + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(524289); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_80240BB8)); + await N(makeEntities); + spawn N(80240060); + spawn N(enterSingleDoor_80240290); + sleep 1; +}); + +static s32 N(pad_424)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; + +Script N(80240430) = SCRIPT({ + +}); + +Script N(80240440) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_80240450) = { + .height = 24, + .radius = 24, + .otherAI = &N(80240430), + .onDefeat = &N(80240440), + .level = 13, +}; + +NpcAISettings N(npcAISettings_8024047C) = { + .moveSpeed = 1.8f, + .moveTime = 40, + .waitTime = 15, + .alertRadius = 150.0f, + .unk_14 = 2, + .chaseSpeed = 3.3f, + .unk_1C = 70, + .unk_20 = 1, + .chaseRadius = 180.0f, + .unk_2C = 1, +}; + +Script N(npcAI_802404AC) = SCRIPT({ + DoBasicAI(N(npcAISettings_8024047C)); +}); + +NpcSettings N(npcSettings_802404CC) = { + .height = 20, + .radius = 23, + .ai = &N(npcAI_802404AC), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, +}; + +Script N(idle_802404F8) = SCRIPT({ + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SetNpcJumpscale(NPC_SELF, 3.0); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) -= 30; + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 8); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + EnableNpcShadow(NPC_SELF, FALSE); + SetNpcPos(NPC_SELF, 0, -1000, 0); + STORY_PROGRESS = STORY_CH3_HEART_FLED_SECOND_TUNNEL; +}); + +Script N(defeat_802406F4) = SCRIPT({ + SI_SAVE_FLAG(1016) = 1; + DoNpcDefeat(); +}); + +Script N(init_80240720) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_802404F8)); + if (STORY_PROGRESS != STORY_UNUSED_FFFFFFEC) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_8024076C) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) { + if (SI_SAVE_FLAG(1016) == 1) { + RemoveNpc(NPC_SELF); + return; + } + BindNpcDefeat(NPC_SELF, N(defeat_802406F4)); + } +}); + +StaticNpc N(npcGroup_802407D8) = { + .id = 0, + .settings = &N(npcSettings_80240450), + .pos = { 80.0f, 50.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80240720), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +StaticNpc N(npcGroup_802409C8) = { + .id = 1, + .settings = &N(npcSettings_802404CC), + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024076C), + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 0, 0, 0, 20, 0, -32767, 0, 0, 0, 0, 150, 0, 0, 1 }, + .animations = { + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, walk), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +NpcGroupList N(npcGroupList_80240BB8) = { + NPC_GROUP(N(npcGroup_802407D8), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_802409C8), BATTLE_ID(14, 0, 0, 5)), + {}, +}; + +static s32 N(pad_BDC)[] = { + 0x00000000, +}; + +Script N(80240BE0) = SCRIPT({ + DisablePlayerInput(TRUE); + ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0182), 160, 40); + DisablePlayerInput(FALSE); +}); + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END); + AssignScript(N(80240BE0)); +}); diff --git a/src/world/area_arn/arn_10/header.c b/src/world/area_arn/arn_10/header.c new file mode 100644 index 0000000000..fdb573a6c0 --- /dev/null +++ b/src/world/area_arn/arn_10/header.c @@ -0,0 +1,28 @@ +#include "arn_10.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -225.0f, 0.0f, 0.0f, 90.0f }, + { 225.0f, 0.0f, 0.0f, 270.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_10_tattle, +}; + +Script N(80240060) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_HEART_FLED_FIRST_TUNNEL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } +}); diff --git a/src/world/area_arn/arn_11/arn_11.h b/src/world/area_arn/arn_11/arn_11.h new file mode 100644 index 0000000000..7f21d3c7af --- /dev/null +++ b/src/world/area_arn/arn_11/arn_11.h @@ -0,0 +1,9 @@ +#include "common.h" +#include "map.h" +#include "../arn.h" + +#define NAMESPACE arn_11 + +Script N(main); +Script N(80240050); +NpcGroupList N(npcGroupList_802410DC); diff --git a/src/world/area_arn/arn_11/events.c b/src/world/area_arn/arn_11/events.c new file mode 100644 index 0000000000..95c5d7e95c --- /dev/null +++ b/src/world/area_arn/arn_11/events.c @@ -0,0 +1,283 @@ +#include "arn_11.h" +#include "sprite/npc/tubbas_heart.h" + +Script N(802400F0) = SCRIPT({ + SetCamType(0, 6, 1); + SetCamSpeed(0, 3.0); + UseSettingsFrom(0, 60, 30, 0); + SetPanTarget(0, 60, 30, 0); + SetCamPitch(0, 20.0, -13.0); + SetCamDistance(0, 275); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); +}); + +Script N(802401BC) = SCRIPT({ + DisablePlayerInput(TRUE); + sleep 30; + SetPlayerSpeed(3.0); + PlayerMoveTo(6, 0, 0); + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BF)); + sleep 10; + SetPlayerAnimation(0x80007); + sleep 40; + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C0)); + SetPlayerAnimation(ANIM_10002); + sleep 10; + SetPlayerAnimation(0x90000); + sleep 30; + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C1)); + SetPlayerAnimation(ANIM_10002); + sleep 20; + SetPlayerAnimation(0x90000); + spawn { + SetNpcJumpscale(NPC_PLAYER, 2.5); + GetNpcPos(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10); + sleep 1; + PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0); + NpcJump0(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10); + } + sleep 40; + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C2)); + SetPlayerAnimation(0x90000); + sleep 10; + SetNpcVar(0, 0, 1); + DisablePlayerInput(FALSE); +}); + +Script N(exitSingleDoor_80240428) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 2; + SI_VAR(2) = 0; + SI_VAR(3) = -1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_13", 1); + sleep 100; +}); + +Script N(802404CC) = SCRIPT({ + bind N(exitSingleDoor_80240428) to TRIGGER_WALL_PRESS_A 2; +}); + +Script N(enterSingleDoor_802404F8) = SCRIPT({ + DisablePlayerInput(TRUE); + SI_VAR(2) = 0; + SI_VAR(3) = -1; + await EnterSingleDoor; + spawn N(802404CC); + if (STORY_PROGRESS < STORY_CH3_HEART_FLED_FIRST_TUNNEL) { + sleep 10; + spawn N(802400F0); + spawn N(802401BC); + sleep 1; + } + DisablePlayerInput(FALSE); +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(524290); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_802410DC)); + spawn N(80240050); + spawn N(enterSingleDoor_802404F8); + sleep 1; +}); + +static s32 N(pad_674)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; + +Script N(80240680) = SCRIPT({ + +}); + +Script N(80240690) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_802406A0) = { + .height = 24, + .radius = 24, + .otherAI = &N(80240680), + .onDefeat = &N(80240690), + .level = 13, +}; + +Script N(idle_802406CC) = SCRIPT({ + loop { + GetSelfVar(0, SI_VAR(0)); + if (SI_VAR(0) != 0) { + break loop; + } + sleep 1; + } + spawn { + SetCamType(0, 6, 1); + SetCamSpeed(0, 4.0); + GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) += 50; + UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetCamDistance(0, 3000); + PanToTarget(0, 0, 1); + WaitForCam(0, 1.0); + } + StartBossBattle(11); +}); + +Script N(8024081C) = SCRIPT({ + sleep 15; + PlaySoundAtCollider(2, 449, 0); + MakeLerp(0, 80, 10, 0); + loop { + UpdateLerp(); + RotateModel(0, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } +}); + +Script N(802408D8) = SCRIPT({ + MakeLerp(80, 0, 10, 0); + loop { + UpdateLerp(); + RotateModel(0, SI_VAR(0), 0, -1, 0); + sleep 1; + if (SI_VAR(1) == 0) { + break loop; + } + } + PlaySoundAtCollider(2, 450, 0); +}); + +s32 N(intTable_80240988)[] = { + 0x00000064, 0x0000001E, 0x00000046, 0x00000019, 0x0000001E, 0x00000050, 0xFFFFD8F0, 0x00000000, + 0x00000000, 0xFFFFFFBA, 0x0000000A, 0x00000014, 0xFFFFFF4C, 0x00000000, 0x00000000, 0xFFFFFED4, + 0x00000000, 0x00000000, 0xFFFFD8F0, 0x00000000, 0x00000000, +}; + +// *INDENT-OFF* +Script N(defeat_802409DC) = { + SI_CMD(ScriptOpcode_SPAWN_THREAD), + SI_CMD(ScriptOpcode_CALL, SetCamType, 0, 6, 1), + SI_CMD(ScriptOpcode_CALL, SetCamSpeed, 0, SI_FIXED(90.0)), + SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_ADD, SI_VAR(0), 50), + SI_CMD(ScriptOpcode_CALL, UseSettingsFrom, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, SetPanTarget, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, SetCamDistance, 0, 450), + SI_CMD(ScriptOpcode_CALL, PanToTarget, 0, 0, 1), + SI_CMD(ScriptOpcode_END_SPAWN_THREAD), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 10), + SI_CMD(ScriptOpcode_CALL, PlayerFaceNpc, 0, 1), + SI_CMD(ScriptOpcode_LOOP, 2), + SI_CMD(ScriptOpcode_CALL, GetNpcPos, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, SetNpcJumpscale, 0, SI_FIXED(2.5)), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtNpc, -1, 8392, 0), + SI_CMD(ScriptOpcode_CALL, NpcJump0, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 12), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SPAWN_THREAD), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 10), + SI_CMD(ScriptOpcode_CALL, SetCamType, 0, 4, 1), + SI_CMD(ScriptOpcode_CALL, SetCamSpeed, 0, SI_FIXED(2.0)), + SI_CMD(ScriptOpcode_CALL, SetCamPitch, 0, SI_FIXED(17.0), SI_FIXED(-7.0)), + SI_CMD(ScriptOpcode_CALL, SetCamDistance, 0, 450), + SI_CMD(ScriptOpcode_CALL, SetCamPosA, 0, -56, 70), + SI_CMD(ScriptOpcode_CALL, SetCamPosB, 0, -90, 40), + SI_CMD(ScriptOpcode_CALL, SetCamPosC, 0, 0, 0), + SI_CMD(ScriptOpcode_CALL, PanToTarget, 0, 0, 1), + SI_CMD(ScriptOpcode_END_SPAWN_THREAD), + SI_CMD(ScriptOpcode_CALL, PlayerFaceNpc, 0, 1), + SI_CMD(ScriptOpcode_USE_BUFFER, N(intTable_80240988)), + SI_CMD(ScriptOpcode_LOOP, 0), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), -10000), + SI_CMD(ScriptOpcode_BREAK_LOOP), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtNpc, -1, 8392, 0), + SI_CMD(ScriptOpcode_CALL, NpcJump0, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 12), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SPAWN_SCRIPT, N(8024081C)), + SI_CMD(ScriptOpcode_LOOP, 0), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), -10000), + SI_CMD(ScriptOpcode_BREAK_LOOP), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtNpc, -1, 8392, 0), + SI_CMD(ScriptOpcode_CALL, NpcJump0, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2), 12), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SPAWN_SCRIPT, N(802408D8)), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 30), + SI_CMD(ScriptOpcode_CALL, SetCamType, 0, 6, 1), + SI_CMD(ScriptOpcode_CALL, SetCamSpeed, 0, SI_FIXED(90.0)), + SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, UseSettingsFrom, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, SetPanTarget, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2)), + SI_CMD(ScriptOpcode_CALL, SetCamDistance, 0, 450), + SI_CMD(ScriptOpcode_CALL, PanToTarget, 0, 0, 1), + SI_CMD(ScriptOpcode_CALL, WaitForCam, 0, SI_FIXED(1.0)), + SI_CMD(ScriptOpcode_CALL, PanToTarget, 0, 0, 0), + SI_CMD(ScriptOpcode_SET, SI_SAVE_VAR(0), -22), + SI_CMD(ScriptOpcode_RETURN), + SI_CMD(ScriptOpcode_END) +}; +// *INDENT-ON* + +Script N(init_80240E70) = SCRIPT({ + if (STORY_PROGRESS >= STORY_CH3_HEART_FLED_FIRST_TUNNEL) { + RemoveNpc(NPC_SELF); + } else { + SetSelfVar(0, 0); + BindNpcIdle(NPC_SELF, N(idle_802406CC)); + BindNpcDefeat(NPC_SELF, N(defeat_802409DC)); + } +}); + +StaticNpc N(npcGroup_80240EEC) = { + .id = 0, + .settings = &N(npcSettings_802406A0), + .pos = { 119.0f, 60.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000, + .init = &N(init_80240E70), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +NpcGroupList N(npcGroupList_802410DC) = { + NPC_GROUP(N(npcGroup_80240EEC), BATTLE_ID(14, 15, 0, 0)), + {}, +}; diff --git a/src/world/area_arn/arn_11/header.c b/src/world/area_arn/arn_11/header.c new file mode 100644 index 0000000000..18740c2037 --- /dev/null +++ b/src/world/area_arn/arn_11/header.c @@ -0,0 +1,27 @@ +#include "arn_11.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -165.0f, 0.0f, 0.0f, 90.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_11_tattle, +}; + +Script N(80240050) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_WENT_DOWN_THE_WELL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } +}); diff --git a/src/world/area_arn/arn_12/arn_12.h b/src/world/area_arn/arn_12/arn_12.h new file mode 100644 index 0000000000..80d8006cdc --- /dev/null +++ b/src/world/area_arn/arn_12/arn_12.h @@ -0,0 +1,10 @@ +#include "common.h" +#include "map.h" +#include "../arn.h" + +#define NAMESPACE arn_12 + +Script N(main); +Script N(80240060); +NpcGroupList N(npcGroupList_80240BBC); +Script N(makeEntities); diff --git a/src/world/area_arn/arn_12/events.c b/src/world/area_arn/arn_12/events.c new file mode 100644 index 0000000000..1acdf9c2dc --- /dev/null +++ b/src/world/area_arn/arn_12/events.c @@ -0,0 +1,241 @@ +#include "arn_12.h" +#include "sprite/npc/tubbas_heart.h" +#include "sprite/npc/goomba.h" + +Script N(exitSingleDoor_80240100) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 2; + SI_VAR(2) = 0; + SI_VAR(3) = -1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_10", 1); + sleep 100; +}); + +Script N(exitSingleDoor_802401A4) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 1; + SI_VAR(1) = 7; + SI_VAR(2) = 2; + SI_VAR(3) = 1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_13", 0); + sleep 100; +}); + +Script N(80240248) = SCRIPT({ + bind N(exitSingleDoor_80240100) to TRIGGER_WALL_PRESS_A 2; + bind N(exitSingleDoor_802401A4) to TRIGGER_WALL_PRESS_A 7; +}); + +Script N(enterSingleDoor_80240290) = SCRIPT({ + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SI_VAR(2) = 0; + SI_VAR(3) = -1; + await EnterSingleDoor; + spawn N(80240248); + } + == 1 { + SI_VAR(2) = 2; + SI_VAR(3) = 1; + await EnterSingleDoor; + spawn N(80240248); + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(524291); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_80240BBC)); + await N(makeEntities); + spawn N(enterSingleDoor_80240290); + spawn N(80240060); +}); + +static s32 N(pad_418)[] = { + 0x00000000, 0x00000000, +}; + +Script N(80240420) = SCRIPT({ + +}); + +Script N(80240430) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_80240440) = { + .height = 24, + .radius = 24, + .otherAI = &N(80240420), + .onDefeat = &N(80240430), + .level = 13, +}; + +NpcAISettings N(npcAISettings_8024046C) = { + .moveSpeed = 1.8f, + .moveTime = 40, + .waitTime = 15, + .alertRadius = 150.0f, + .unk_14 = 2, + .chaseSpeed = 3.3f, + .unk_1C = 70, + .unk_20 = 1, + .chaseRadius = 180.0f, + .unk_2C = 1, +}; + +Script N(npcAI_8024049C) = SCRIPT({ + DoBasicAI(N(npcAISettings_8024046C)); +}); + +NpcSettings N(npcSettings_802404BC) = { + .height = 20, + .radius = 23, + .ai = &N(npcAI_8024049C), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, +}; + +Script N(idle_802404E8) = SCRIPT({ + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SetNpcJumpscale(NPC_SELF, 3.0); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) -= 30; + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 8); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + EnableNpcShadow(NPC_SELF, FALSE); + SetNpcPos(NPC_SELF, 0, -1000, 0); + STORY_PROGRESS = STORY_UNUSED_FFFFFFEC; +}); + +Script N(defeat_802406E4) = SCRIPT({ + SI_SAVE_FLAG(1017) = 1; + DoNpcDefeat(); +}); + +Script N(init_80240710) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_802404E8)); + if (STORY_PROGRESS != STORY_UNUSED_FFFFFFEB) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_8024075C) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) { + if (SI_SAVE_FLAG(1017) == 1) { + RemoveNpc(NPC_SELF); + return; + } + BindNpcDefeat(NPC_SELF, N(defeat_802406E4)); + } + BindNpcDefeat(NPC_SELF, N(defeat_802406E4)); +}); + +StaticNpc N(npcGroup_802407DC) = { + .id = 0, + .settings = &N(npcSettings_80240440), + .pos = { 80.0f, 50.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80240710), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +StaticNpc N(npcGroup_802409CC) = { + .id = 1, + .settings = &N(npcSettings_802404BC), + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024075C), + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 0, 0, 0, 20, 0, -32767, 0, 0, 0, 0, 150, 0, 0, 1 }, + .animations = { + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, walk), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +NpcGroupList N(npcGroupList_80240BBC) = { + NPC_GROUP(N(npcGroup_802407DC), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_802409CC), BATTLE_ID(14, 1, 0, 5)), + {}, +}; + +Script N(80240BE0) = SCRIPT({ + DisablePlayerInput(TRUE); + ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0183), 160, 40); + DisablePlayerInput(FALSE); +}); + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END); + AssignScript(N(80240BE0)); +}); diff --git a/src/world/area_arn/arn_12/header.c b/src/world/area_arn/arn_12/header.c new file mode 100644 index 0000000000..809a5425c7 --- /dev/null +++ b/src/world/area_arn/arn_12/header.c @@ -0,0 +1,28 @@ +#include "arn_12.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -231.0f, 0.0f, 5.0f, 90.0f }, + { 231.0f, 0.0f, 5.0f, 270.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_12_tattle, +}; + +Script N(80240060) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_HEART_FLED_FIRST_TUNNEL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } +}); diff --git a/src/world/area_arn/arn_13/arn_13.h b/src/world/area_arn/arn_13/arn_13.h new file mode 100644 index 0000000000..5f56f665c2 --- /dev/null +++ b/src/world/area_arn/arn_13/arn_13.h @@ -0,0 +1,10 @@ +#include "common.h" +#include "map.h" +#include "../arn.h" + +#define NAMESPACE arn_13 + +Script N(main); +Script N(80240060); +NpcGroupList N(npcGroupList_80240BCC); +Script N(makeEntities); diff --git a/src/world/area_arn/arn_13/events.c b/src/world/area_arn/arn_13/events.c new file mode 100644 index 0000000000..c848a63112 --- /dev/null +++ b/src/world/area_arn/arn_13/events.c @@ -0,0 +1,242 @@ +#include "arn_13.h" +#include "sprite/npc/goomba.h" +#include "sprite/npc/tubbas_heart.h" + +Script N(exitSingleDoor_80240100) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 0; + SI_VAR(1) = 2; + SI_VAR(2) = 0; + SI_VAR(3) = -1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_12", 1); + sleep 100; +}); + +Script N(exitSingleDoor_802401A4) = SCRIPT({ + group 27; + DisablePlayerInput(TRUE); + SI_VAR(0) = 1; + SI_VAR(1) = 7; + SI_VAR(2) = 2; + SI_VAR(3) = 1; + spawn ExitSingleDoor; + sleep 17; + GotoMap("arn_11", 0); + sleep 100; +}); + +Script N(80240248) = SCRIPT({ + bind N(exitSingleDoor_80240100) to TRIGGER_WALL_PRESS_A 2; + bind N(exitSingleDoor_802401A4) to TRIGGER_WALL_PRESS_A 7; +}); + +Script N(enterSingleDoor_80240290) = SCRIPT({ + GetEntryID(SI_VAR(0)); + match SI_VAR(0) { + == 0 { + SI_VAR(2) = 0; + SI_VAR(3) = -1; + await EnterSingleDoor; + spawn N(80240248); + } + == 1 { + SI_VAR(2) = 2; + SI_VAR(3) = 1; + await EnterSingleDoor; + spawn N(80240248); + } + } +}); + +Script N(main) = SCRIPT({ + WORLD_LOCATION = LOCATION_WINDY_MILL; + SetSpriteShading(524292); + SetCamPerspective(0, 3, 25, 16, 4096); + SetCamBGColor(0, 0, 0, 0); + SetCamLeadPlayer(0, 0); + SetCamEnabled(0, 1); + MakeNpcs(0, N(npcGroupList_80240BCC)); + await N(makeEntities); + spawn N(80240060); + spawn N(enterSingleDoor_80240290); + sleep 1; +}); + +static s32 N(pad_424)[] = { + 0x00000000, 0x00000000, 0x00000000, +}; + +Script N(80240430) = SCRIPT({ + +}); + +Script N(80240440) = SCRIPT({ + +}); + +NpcSettings N(npcSettings_80240450) = { + .height = 24, + .radius = 24, + .otherAI = &N(80240430), + .onDefeat = &N(80240440), + .level = 13, +}; + +NpcAISettings N(npcAISettings_8024047C) = { + .moveSpeed = 1.8f, + .moveTime = 40, + .waitTime = 15, + .alertRadius = 150.0f, + .unk_14 = 2, + .chaseSpeed = 3.3f, + .unk_1C = 70, + .unk_20 = 1, + .chaseRadius = 180.0f, + .unk_2C = 1, +}; + +Script N(npcAI_802404AC) = SCRIPT({ + DoBasicAI(N(npcAISettings_8024047C)); +}); + +NpcSettings N(npcSettings_802404CC) = { + .height = 20, + .radius = 23, + .ai = &N(npcAI_802404AC), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 12, +}; + +Script N(idle_802404F8) = SCRIPT({ + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SetNpcJumpscale(NPC_SELF, 3.0); + GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SI_VAR(0) -= 30; + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 8); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_14)); + sleep 1; + SetNpcAnimation(NPC_SELF, NPC_ANIM(tubbas_heart, Palette_00, Anim_13)); + SI_VAR(0) -= 80; + SetNpcJumpscale(NPC_SELF, 2.5); + PlaySoundAtNpc(NPC_SELF, 0x20C8, 0); + NpcJump0(NPC_SELF, SI_VAR(0), 0, SI_VAR(2), 12); + EnableNpcShadow(NPC_SELF, FALSE); + SetNpcPos(NPC_SELF, 0, -1000, 0); + STORY_PROGRESS = STORY_CH3_HEART_FLED_SECOND_TUNNEL; +}); + +Script N(defeat_802406F4) = SCRIPT({ + SI_SAVE_FLAG(1018) = 1; + DoNpcDefeat(); +}); + +Script N(init_80240720) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(idle_802404F8)); + if (STORY_PROGRESS != STORY_CH3_HEART_FLED_FIRST_TUNNEL) { + RemoveNpc(NPC_SELF); + } +}); + +Script N(init_8024076C) = SCRIPT({ + if (STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) { + if (SI_SAVE_FLAG(1018) == 1) { + RemoveNpc(NPC_SELF); + return; + } + BindNpcDefeat(NPC_SELF, N(defeat_802406F4)); + } + BindNpcDefeat(NPC_SELF, N(defeat_802406F4)); +}); + +StaticNpc N(npcGroup_802407EC) = { + .id = 0, + .settings = &N(npcSettings_80240450), + .pos = { 80.0f, 50.0f, 0.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_80240720), + .yaw = 270, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + NPC_ANIM(tubbas_heart, Palette_00, Anim_1), + }, +}; + +StaticNpc N(npcGroup_802409DC) = { + .id = 1, + .settings = &N(npcSettings_802404CC), + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT, + .init = &N(init_8024076C), + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 20, + { ITEM_DRIED_SHROOM, 10, 0 }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 2, + .movement = { 0, 0, 0, 20, 0, -32767, 0, 0, 0, 0, 150, 0, 0, 1 }, + .animations = { + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, walk), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, idle), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, pain), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + NPC_ANIM(goomba, hyper, run), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, +}; + +NpcGroupList N(npcGroupList_80240BCC) = { + NPC_GROUP(N(npcGroup_802407EC), BATTLE_ID(0, 0, 0, 0)), + NPC_GROUP(N(npcGroup_802409DC), BATTLE_ID(14, 2, 0, 5)), + {}, +}; + +Script N(80240BF0) = SCRIPT({ + DisablePlayerInput(TRUE); + ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0184), 160, 40); + DisablePlayerInput(FALSE); +}); + +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END); + AssignScript(N(80240BF0)); +}); diff --git a/src/world/area_arn/arn_13/header.c b/src/world/area_arn/arn_13/header.c new file mode 100644 index 0000000000..3c6562a32e --- /dev/null +++ b/src/world/area_arn/arn_13/header.c @@ -0,0 +1,28 @@ +#include "arn_13.h" +#include "message_ids.h" + +EntryList N(entryList) = { + { -231.0f, 0.0f, 5.0f, 90.0f }, + { 231.0f, 0.0f, 5.0f, 270.0f }, +}; + +MapConfig N(config) = { + .main = N(main), + .entryList = N(entryList), + .entryCount = ENTRY_COUNT(N(entryList)), + .tattle = MSG_arn_13_tattle, +}; + +Script N(80240060) = SCRIPT({ + match STORY_PROGRESS { + < STORY_CH3_HEART_FLED_FIRST_TUNNEL { + SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); + } + < STORY_CH3_DEFEATED_TUBBA_BLUBBA { + SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); + } + else { + SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); + } + } +}); diff --git a/src/world/area_dgb/dgb_01/BFD9A0.c b/src/world/area_dgb/dgb_01/BFD9A0.c index ab750268b3..9dbfa99a98 100644 --- a/src/world/area_dgb/dgb_01/BFD9A0.c +++ b/src/world/area_dgb/dgb_01/BFD9A0.c @@ -1,24 +1,244 @@ #include "dgb_01.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80240120_BFD9A0); +/* +void N(func_80240120_BFD9A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_802402D0_BFDB50); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_802409B8_BFE238); +/* +void N(func_802409B8_BFE238)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80240D74_BFE5F4); +/* +void N(func_80240D74_BFE5F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80240F78_BFE7F8); +/* +void N(func_80240F78_BFE7F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80241308_BFEB88); +/* +void N(func_80241308_BFEB88)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_8024142C_BFECAC); @@ -45,28 +265,204 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80241F98_BFF818); INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_802422B0_BFFB30); INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_8024252C_BFFDAC); +/* +ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80242684_BFFF04); +/* +void N(func_80242684_BFFF04)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #define NAMESPACE dup_dgb_01 #include "world/common/UnkNpcAIFunc1.inc.c" #define NAMESPACE dgb_01 INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_802429EC_C0026C); +/* +void N(func_802429EC_C0026C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80242BA8_C00428); +/* +ApiStatus N(func_80242BA8_C00428)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80242E78_C006F8); +/* +ApiStatus N(func_80242E78_C006F8)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_80243000_C00880); +/* +void N(func_80243000_C00880)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_01/BFD9A0", func_802430C0_C00940); diff --git a/src/world/area_dgb/dgb_02/C2EBA0.c b/src/world/area_dgb/dgb_02/C2EBA0.c index cd14f2a961..03a93b3c19 100644 --- a/src/world/area_dgb/dgb_02/C2EBA0.c +++ b/src/world/area_dgb/dgb_02/C2EBA0.c @@ -25,6 +25,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240C74_C2F814); INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240D1C_C2F8BC); INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240E54_C2F9F4); +/* +void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240F00_C2FAA0); diff --git a/src/world/area_dgb/dgb_03/C31730.c b/src/world/area_dgb/dgb_03/C31730.c index f84aaecde6..c41c6f9544 100644 --- a/src/world/area_dgb/dgb_03/C31730.c +++ b/src/world/area_dgb/dgb_03/C31730.c @@ -15,26 +15,202 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_8024060C_C31AEC); INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_8024086C_C31D4C); INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_80240B20_C32000); +/* +ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_80240C78_C32158); +/* +void N(func_80240C78_C32158)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_80240FE0_C324C0); +/* +void N(func_80240FE0_C324C0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_8024119C_C3267C); +/* +ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_8024146C_C3294C); +/* +ApiStatus N(func_8024146C_C3294C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_802415F4_C32AD4); +/* +void N(func_802415F4_C32AD4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_802416B4_C32B94); @@ -51,6 +227,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_80242020_C33500); INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_802420C8_C335A8); INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_80242200_C336E0); +/* +void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C31730", func_802422AC_C3378C); diff --git a/src/world/area_dgb/dgb_04/C36530.c b/src/world/area_dgb/dgb_04/C36530.c index c8c6655814..d14975a44a 100644 --- a/src/world/area_dgb/dgb_04/C36530.c +++ b/src/world/area_dgb/dgb_04/C36530.c @@ -1,24 +1,244 @@ #include "dgb_04.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80240000_C36530); +/* +void N(func_80240000_C36530)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_802401B0_C366E0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80240898_C36DC8); +/* +void N(func_80240898_C36DC8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80240C54_C37184); +/* +void N(func_80240C54_C37184)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80240E58_C37388); +/* +void N(func_80240E58_C37388)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_802411E8_C37718); +/* +void N(func_802411E8_C37718)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_8024130C_C3783C); @@ -49,6 +269,12 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80242154_C38684); INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_802423EC_C3891C); INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_8024240C_C3893C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80242438_C38968); @@ -59,6 +285,12 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_802424F0_C38A20); INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_8024259C_C38ACC); INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_802427EC_C38D1C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_04/C36530", func_80242818_C38D48); diff --git a/src/world/area_dgb/dgb_05/C3AA10.c b/src/world/area_dgb/dgb_05/C3AA10.c index 054dc46d9a..220814d34e 100644 --- a/src/world/area_dgb/dgb_05/C3AA10.c +++ b/src/world/area_dgb/dgb_05/C3AA10.c @@ -27,6 +27,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240A20_C3B430); INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240AC8_C3B4D8); INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240C00_C3B610); +/* +void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240CAC_C3B6BC); diff --git a/src/world/area_dgb/dgb_06/C3D080.c b/src/world/area_dgb/dgb_06/C3D080.c index 08ae3e5fa4..bf2fa930ca 100644 --- a/src/world/area_dgb/dgb_06/C3D080.c +++ b/src/world/area_dgb/dgb_06/C3D080.c @@ -1,6 +1,29 @@ #include "dgb_06.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_06/C3D080", func_80240000_C3D080); +/* +ApiStatus N(func_80240000_C3D080)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_dgb/dgb_07/C3DBF0.c b/src/world/area_dgb/dgb_07/C3DBF0.c index d33b120d5b..2a7078945c 100644 --- a/src/world/area_dgb/dgb_07/C3DBF0.c +++ b/src/world/area_dgb/dgb_07/C3DBF0.c @@ -23,6 +23,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_802409C0_C3E5B0); INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240A68_C3E658); INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240BA0_C3E790); +/* +void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240C4C_C3E83C); diff --git a/src/world/area_dgb/dgb_08/C3FDB0.c b/src/world/area_dgb/dgb_08/C3FDB0.c index 9b2feb0889..f71b2414b8 100644 --- a/src/world/area_dgb/dgb_08/C3FDB0.c +++ b/src/world/area_dgb/dgb_08/C3FDB0.c @@ -1,26 +1,202 @@ #include "dgb_08.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80240000_C3FDB0); +/* +ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80240158_C3FF08); +/* +void N(func_80240158_C3FF08)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_802404C0_C40270); +/* +void N(func_802404C0_C40270)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_8024067C_C4042C); +/* +ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_8024094C_C406FC); +/* +ApiStatus N(func_8024094C_C406FC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80240AD4_C40884); +/* +void N(func_80240AD4_C40884)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80240B94_C40944); @@ -39,6 +215,31 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_8024124C_C40FFC); INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_802414AC_C4125C); INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80241760_C41510); +/* +void N(func_80241760_C41510)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80241910_C416C0); @@ -47,18 +248,213 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80241910_C416C0); #define NAMESPACE dgb_08 INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80241FF8_C41DA8); +/* +void N(func_80241FF8_C41DA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_802423B4_C42164); +/* +void N(func_802423B4_C42164)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_802425B8_C42368); +/* +void N(func_802425B8_C42368)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80242948_C426F8); +/* +void N(func_80242948_C426F8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_08/C3FDB0", func_80242A6C_C4281C); diff --git a/src/world/area_dgb/dgb_09/C46BE0.c b/src/world/area_dgb/dgb_09/C46BE0.c index d1e71ba66a..bf8441ad89 100644 --- a/src/world/area_dgb/dgb_09/C46BE0.c +++ b/src/world/area_dgb/dgb_09/C46BE0.c @@ -25,6 +25,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80240C74_C47854); INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80240D1C_C478FC); INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80240E54_C47A34); +/* +void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80240F00_C47AE0); @@ -33,24 +50,244 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80241078_C47C58); INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_802410D4_C47CB4); INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80241424_C48004); +/* +void N(func_80241424_C48004)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_802415D4_C481B4); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80241CBC_C4889C); +/* +void N(func_80241CBC_C4889C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80242078_C48C58); +/* +void N(func_80242078_C48C58)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_8024227C_C48E5C); +/* +void N(func_8024227C_C48E5C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_8024260C_C491EC); +/* +void N(func_8024260C_C491EC)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_09/C46BE0", func_80242730_C49310); diff --git a/src/world/area_dgb/dgb_12/C4DEF0.c b/src/world/area_dgb/dgb_12/C4DEF0.c index df5f5c27fc..00ea8dac04 100644 --- a/src/world/area_dgb/dgb_12/C4DEF0.c +++ b/src/world/area_dgb/dgb_12/C4DEF0.c @@ -1,6 +1,29 @@ #include "dgb_12.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_12/C4DEF0", func_80240000_C4DEF0); +/* +ApiStatus N(func_80240000_C4DEF0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_dgb/dgb_15/C4F510.c b/src/world/area_dgb/dgb_15/C4F510.c index a182e998af..ea0648e1c1 100644 --- a/src/world/area_dgb/dgb_15/C4F510.c +++ b/src/world/area_dgb/dgb_15/C4F510.c @@ -15,26 +15,202 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", update_starpoints_display_C4F8C INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_8024061C_C4FB2C); INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_802408D0_C4FDE0); +/* +ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240A28_C4FF38); +/* +void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240D90_C502A0); +/* +void N(func_80240D90_C502A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240F4C_C5045C); +/* +ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_8024121C_C5072C); +/* +ApiStatus N(func_8024121C_C5072C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_802413A4_C508B4); +/* +void N(func_802413A4_C508B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80241464_C50974); diff --git a/src/world/area_dgb/dgb_16/C52540.c b/src/world/area_dgb/dgb_16/C52540.c index fd0a87b082..591715ec6a 100644 --- a/src/world/area_dgb/dgb_16/C52540.c +++ b/src/world/area_dgb/dgb_16/C52540.c @@ -23,6 +23,23 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_16/C52540", func_802409C0_C52F00); INCLUDE_ASM(s32, "world/area_dgb/dgb_16/C52540", func_80240A68_C52FA8); INCLUDE_ASM(s32, "world/area_dgb/dgb_16/C52540", func_80240BA0_C530E0); +/* +void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_16/C52540", func_80240C4C_C5318C); diff --git a/src/world/area_dgb/dgb_18/C55F40.c b/src/world/area_dgb/dgb_18/C55F40.c index fb70a61209..d01eadbbbe 100644 --- a/src/world/area_dgb/dgb_18/C55F40.c +++ b/src/world/area_dgb/dgb_18/C55F40.c @@ -1,26 +1,202 @@ #include "dgb_18.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240000_C55F40); +/* +ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240158_C56098); +/* +void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_802404C0_C56400); +/* +void N(func_802404C0_C56400)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_8024067C_C565BC); +/* +ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_8024094C_C5688C); +/* +ApiStatus N(func_8024094C_C5688C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240AD4_C56A14); +/* +void N(func_80240AD4_C56A14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240B94_C56AD4); diff --git a/src/world/area_dgb/dgb_18/C56EF0.c b/src/world/area_dgb/dgb_18/C56EF0.c index 16efad6d8a..da4514a0bc 100644 --- a/src/world/area_dgb/dgb_18/C56EF0.c +++ b/src/world/area_dgb/dgb_18/C56EF0.c @@ -1,6 +1,29 @@ #include "dgb_18.h" INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C56EF0", func_80240FB0_C56EF0); +/* +ApiStatus N(func_80240FB0_C56EF0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_dro/dro_01/95B7E0.c b/src/world/area_dro/dro_01/95B7E0.c index b343d3f2a6..e4e9750795 100644 --- a/src/world/area_dro/dro_01/95B7E0.c +++ b/src/world/area_dro/dro_01/95B7E0.c @@ -3,30 +3,229 @@ #define UNK_ALPHA_FUNC_NPC 10 INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_802405E0_95B7E0); +/* +ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80240738_95B938); +/* +void N(func_80240738_95B938)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80240AA0_95BCA0); +/* +void N(func_80240AA0_95BCA0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80240C5C_95BE5C); +/* +ApiStatus N(func_80240C5C_95BE5C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80240F2C_95C12C); +/* +ApiStatus N(func_80240F2C_95C12C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_802410B4_95C2B4); +/* +void N(func_802410B4_95C2B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80241174_95C374); INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80241470_95C670); +/* +ApiStatus N(func_80241470_95C670)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -81,8 +280,38 @@ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_802424D4_95D6D4); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80242730_95D930); +/* +ApiStatus N(func_80242730_95D930)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_80242784_95D984); +/* +ApiStatus N(func_80242784_95D984)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_01/95B7E0", func_802427BC_95D9BC); diff --git a/src/world/area_dro/dro_01/95E660.c b/src/world/area_dro/dro_01/95E660.c index 017b5956e0..ec17084c30 100644 --- a/src/world/area_dro/dro_01/95E660.c +++ b/src/world/area_dro/dro_01/95E660.c @@ -1,6 +1,29 @@ #include "dro_01.h" INCLUDE_ASM(s32, "world/area_dro/dro_01/95E660", func_80243460_95E660); +/* +ApiStatus N(func_80243460_95E660)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup_dro_01 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_dro/dro_02/9694C0.c b/src/world/area_dro/dro_02/9694C0.c index b8464eb86b..47e7e5b3f0 100644 --- a/src/world/area_dro/dro_02/9694C0.c +++ b/src/world/area_dro/dro_02/9694C0.c @@ -3,6 +3,29 @@ #define UNK_ALPHA_FUNC_NPC 10 INCLUDE_ASM(s32, "world/area_dro/dro_02/9694C0", func_80240300_9694C0); +/* +ApiStatus N(func_80240300_9694C0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -79,8 +102,38 @@ INCLUDE_ASM(s32, "world/area_dro/dro_02/9694C0", func_80243068_96C228); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_dro/dro_02/9694C0", func_802432C0_96C480); +/* +ApiStatus N(func_802432C0_96C480)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_02/9694C0", func_80243314_96C4D4); +/* +ApiStatus N(func_80243314_96C4D4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_dro/dro_02/9694C0", func_8024334C_96C50C); diff --git a/src/world/area_flo/flo_00/C9DF60.c b/src/world/area_flo/flo_00/C9DF60.c index 6e7c9a1f1f..01292d7543 100644 --- a/src/world/area_flo/flo_00/C9DF60.c +++ b/src/world/area_flo/flo_00/C9DF60.c @@ -1,26 +1,202 @@ #include "flo_00.h" INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_80240040_C9DF60); +/* +ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_80240198_C9E0B8); +/* +void N(func_80240198_C9E0B8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_80240500_C9E420); +/* +void N(func_80240500_C9E420)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_802406BC_C9E5DC); +/* +ApiStatus N(func_802406BC_C9E5DC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_8024098C_C9E8AC); +/* +ApiStatus N(func_8024098C_C9E8AC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_80240B14_C9EA34); +/* +void N(func_80240B14_C9EA34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_00/C9DF60", func_80240BD4_C9EAF4); diff --git a/src/world/area_flo/flo_03/CA72E0.c b/src/world/area_flo/flo_03/CA72E0.c index 2619311070..a04e970439 100644 --- a/src/world/area_flo/flo_03/CA72E0.c +++ b/src/world/area_flo/flo_03/CA72E0.c @@ -1,6 +1,29 @@ #include "flo_03.h" INCLUDE_ASM(s32, "world/area_flo/flo_03/CA72E0", func_80240040_CA72E0); +/* +ApiStatus N(func_80240040_CA72E0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_flo/flo_07/CAC5D0.c b/src/world/area_flo/flo_07/CAC5D0.c index 46c5044b7a..fd67412ced 100644 --- a/src/world/area_flo/flo_07/CAC5D0.c +++ b/src/world/area_flo/flo_07/CAC5D0.c @@ -3,5 +3,28 @@ #include "world/common/SomeMatrixOperations.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_07/CAC5D0", func_8024061C_CAC80C); +/* +ApiStatus N(func_8024061C_CAC80C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_flo/flo_08/CAED40.c b/src/world/area_flo/flo_08/CAED40.c index 6410e59bcb..18ea2ce34e 100644 --- a/src/world/area_flo/flo_08/CAED40.c +++ b/src/world/area_flo/flo_08/CAED40.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_8024001C_CAED5C); INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_8024003C_CAED7C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240068_CAEDA8); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240120_CAEE60); INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_802401CC_CAEF0C); INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_8024041C_CAF15C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240448_CAF188); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240B38_CAF878); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240D08_CAFA48); +INCLUDE_ASM(s32, "world/area_flo/flo_08/CAED40", func_80240D08_CAFA48); \ No newline at end of file diff --git a/src/world/area_flo/flo_08/CAFAC0.c b/src/world/area_flo/flo_08/CAFAC0.c index 887f8af4b7..674ea644fa 100644 --- a/src/world/area_flo/flo_08/CAFAC0.c +++ b/src/world/area_flo/flo_08/CAFAC0.c @@ -13,8 +13,38 @@ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_8024150C_CB024C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_80241970_CB06B0); +/* +ApiStatus N(func_80241970_CB06B0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_802419C4_CB0704); +/* +ApiStatus N(func_802419C4_CB0704)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_802419FC_CB073C); @@ -25,4 +55,3 @@ INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_80241B5C_CB089C); INCLUDE_ASM(s32, "world/area_flo/flo_08/CAFAC0", func_80241BCC_CB090C); #include "world/common/SomeMatrixOperations.inc.c" - diff --git a/src/world/area_flo/flo_09/CB5320.c b/src/world/area_flo/flo_09/CB5320.c index c966521860..7b9c42f4ee 100644 --- a/src/world/area_flo/flo_09/CB5320.c +++ b/src/world/area_flo/flo_09/CB5320.c @@ -1,23 +1,243 @@ #include "flo_09.h" INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_80240320_CB5320); +/* +void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_802404D0_CB54D0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_80240BB8_CB5BB8); +/* +void N(func_80240BB8_CB5BB8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_80240F74_CB5F74); +/* +void N(func_80240F74_CB5F74)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_80241178_CB6178); +/* +void N(func_80241178_CB6178)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_80241508_CB6508); +/* +void N(func_80241508_CB6508)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_09/CB5320", func_8024162C_CB662C); diff --git a/src/world/area_flo/flo_10/CB9280.c b/src/world/area_flo/flo_10/CB9280.c index 3bccbc7983..ddfc022a91 100644 --- a/src/world/area_flo/flo_10/CB9280.c +++ b/src/world/area_flo/flo_10/CB9280.c @@ -1,6 +1,29 @@ #include "flo_10.h" INCLUDE_ASM(s32, "world/area_flo/flo_10/CB9280", func_80240080_CB9280); +/* +ApiStatus N(func_80240080_CB9280)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_flo/flo_12/CC0E70.c b/src/world/area_flo/flo_12/CC0E70.c index 2fa6cb0c65..9ebefdf977 100644 --- a/src/world/area_flo/flo_12/CC0E70.c +++ b/src/world/area_flo/flo_12/CC0E70.c @@ -4,6 +4,29 @@ INCLUDE_ASM(s32, "world/area_flo/flo_12/CC0E70", func_8024027C_CC10AC); +/* +ApiStatus N(func_8024027C_CC10AC)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -12,7 +35,37 @@ INCLUDE_ASM(s32, "world/area_flo/flo_12/CC0E70", func_8024027C_CC10AC); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_12/CC0E70", func_802405C0_CC13F0); +/* +ApiStatus N(func_802405C0_CC13F0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_12/CC0E70", func_80240614_CC1444); +/* +ApiStatus N(func_80240614_CC1444)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_12/CC0E70", func_8024064C_CC147C); diff --git a/src/world/area_flo/flo_13/CC3850.c b/src/world/area_flo/flo_13/CC3850.c index dcc072abfd..3eddce6794 100644 --- a/src/world/area_flo/flo_13/CC3850.c +++ b/src/world/area_flo/flo_13/CC3850.c @@ -3,24 +3,244 @@ INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_80240040_CC3850); INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_802401C4_CC39D4); +/* +void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_80240374_CC3B84); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_80240A5C_CC426C); +/* +void N(func_80240A5C_CC426C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_80240E18_CC4628); +/* +void N(func_80240E18_CC4628)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_8024101C_CC482C); +/* +void N(func_8024101C_CC482C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_802413AC_CC4BBC); +/* +void N(func_802413AC_CC4BBC)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_13/CC3850", func_802414D0_CC4CE0); diff --git a/src/world/area_flo/flo_14/CCBE20.c b/src/world/area_flo/flo_14/CCBE20.c index dcd4de0159..b61e30de5a 100644 --- a/src/world/area_flo/flo_14/CCBE20.c +++ b/src/world/area_flo/flo_14/CCBE20.c @@ -1,24 +1,244 @@ #include "flo_14.h" INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80240B10_CCBE20); +/* +void N(func_80240B10_CCBE20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80240CC0_CCBFD0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_802413A8_CCC6B8); +/* +void N(func_802413A8_CCC6B8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80241764_CCCA74); +/* +void N(func_80241764_CCCA74)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80241968_CCCC78); +/* +void N(func_80241968_CCCC78)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80241CF8_CCD008); +/* +void N(func_80241CF8_CCD008)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80241E1C_CCD12C); @@ -27,7 +247,37 @@ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80241E1C_CCD12C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80242234_CCD544); +/* +ApiStatus N(func_80242234_CCD544)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_80242288_CCD598); +/* +ApiStatus N(func_80242288_CCD598)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_14/CCBE20", func_802422C0_CCD5D0); diff --git a/src/world/area_flo/flo_16/CD1F10.c b/src/world/area_flo/flo_16/CD1F10.c index d50f9d866b..6f31f05432 100644 --- a/src/world/area_flo/flo_16/CD1F10.c +++ b/src/world/area_flo/flo_16/CD1F10.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_802400FC_CD1F2C); INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_8024011C_CD1F4C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240148_CD1F78); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240200_CD2030); INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_802402AC_CD20DC); INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_802404FC_CD232C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240528_CD2358); @@ -34,4 +46,4 @@ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240C18_CD2A48); INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240DE8_CD2C18); -INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240E18_CD2C48); +INCLUDE_ASM(s32, "world/area_flo/flo_16/CD1F10", func_80240E18_CD2C48); \ No newline at end of file diff --git a/src/world/area_flo/flo_16/CD2C80.c b/src/world/area_flo/flo_16/CD2C80.c index 4afa999fb5..c0e0fc0dff 100644 --- a/src/world/area_flo/flo_16/CD2C80.c +++ b/src/world/area_flo/flo_16/CD2C80.c @@ -1,24 +1,244 @@ #include "flo_16.h" INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_80240E50_CD2C80); +/* +void N(func_80240E50_CD2C80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_80241000_CD2E30); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_802416E8_CD3518); +/* +void N(func_802416E8_CD3518)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_80241AA4_CD38D4); +/* +void N(func_80241AA4_CD38D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_80241CA8_CD3AD8); +/* +void N(func_80241CA8_CD3AD8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_80242038_CD3E68); +/* +void N(func_80242038_CD3E68)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_16/CD2C80", func_8024215C_CD3F8C); diff --git a/src/world/area_flo/flo_17/CD7350.c b/src/world/area_flo/flo_17/CD7350.c index 8763043d77..7200527d3a 100644 --- a/src/world/area_flo/flo_17/CD7350.c +++ b/src/world/area_flo/flo_17/CD7350.c @@ -1,24 +1,244 @@ #include "flo_17.h" INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80240070_CD7350); +/* +void N(func_80240070_CD7350)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80240220_CD7500); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80240908_CD7BE8); +/* +void N(func_80240908_CD7BE8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80240CC4_CD7FA4); +/* +void N(func_80240CC4_CD7FA4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80240EC8_CD81A8); +/* +void N(func_80240EC8_CD81A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_80241258_CD8538); +/* +void N(func_80241258_CD8538)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_17/CD7350", func_8024137C_CD865C); diff --git a/src/world/area_flo/flo_21/CE6700.c b/src/world/area_flo/flo_21/CE6700.c index 06b97333b8..dc2c11f454 100644 --- a/src/world/area_flo/flo_21/CE6700.c +++ b/src/world/area_flo/flo_21/CE6700.c @@ -1,16 +1,101 @@ #include "flo_21.h" INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_80240000_CE6700); +/* +ApiStatus N(func_80240000_CE6700)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_8024004C_CE674C); +/* +ApiStatus N(func_8024004C_CE674C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_802401AC_CE68AC); INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_802405BC_CE6CBC); +/* +ApiStatus N(func_802405BC_CE6CBC)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_802405FC_CE6CFC); +/* +ApiStatus N(func_802405FC_CE6CFC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_21/CE6700", func_80240708_CE6E08); +/* +ApiStatus N(func_80240708_CE6E08)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (dist2D(playerStatus->position.x, playerStatus->position.z, + ptr->unk_18, ptr->unk_20) <= 30.0f) { + ptr->unk_4E = 3; + } + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + + return 0; +} +*/ #include "world/common/UnkTexturePanFunc.inc.c" diff --git a/src/world/area_flo/flo_23/CEE2A0.c b/src/world/area_flo/flo_23/CEE2A0.c index e24a01dc84..a184d61456 100644 --- a/src/world/area_flo/flo_23/CEE2A0.c +++ b/src/world/area_flo/flo_23/CEE2A0.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_23/CEE2A0", func_8024026C_CEE4CC); +/* +ApiStatus N(func_8024026C_CEE4CC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_23/CEE2A0", func_802402C0_CEE520); +/* +ApiStatus N(func_802402C0_CEE520)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_23/CEE2A0", func_802402F8_CEE558); diff --git a/src/world/area_flo/flo_25/CF2C10.c b/src/world/area_flo/flo_25/CF2C10.c index 6830bbad29..bb36d577e0 100644 --- a/src/world/area_flo/flo_25/CF2C10.c +++ b/src/world/area_flo/flo_25/CF2C10.c @@ -1,24 +1,244 @@ #include "flo_25.h" INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80240040_CF2C10); +/* +void N(func_80240040_CF2C10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_802401F0_CF2DC0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_802408D8_CF34A8); +/* +void N(func_802408D8_CF34A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80240C94_CF3864); +/* +void N(func_80240C94_CF3864)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80240E98_CF3A68); +/* +void N(func_80240E98_CF3A68)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241228_CF3DF8); +/* +void N(func_80241228_CF3DF8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_8024134C_CF3F1C); @@ -35,8 +255,38 @@ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241944_CF4514); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241D58_CF4928); +/* +ApiStatus N(func_80241D58_CF4928)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241DAC_CF497C); +/* +ApiStatus N(func_80241DAC_CF497C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_flo/flo_25/CF2C10", func_80241DE4_CF49B4); diff --git a/src/world/area_hos/hos_00/A0C4E0.c b/src/world/area_hos/hos_00/A0C4E0.c index 706e027c0e..1e00f29871 100644 --- a/src/world/area_hos/hos_00/A0C4E0.c +++ b/src/world/area_hos/hos_00/A0C4E0.c @@ -1,6 +1,29 @@ #include "hos_00.h" INCLUDE_ASM(s32, "world/area_hos/hos_00/A0C4E0", func_802407F0_A0C4E0); +/* +ApiStatus N(func_802407F0_A0C4E0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_hos/hos_01/A11020.c b/src/world/area_hos/hos_01/A11020.c index 9442c2dbe0..84e6f5aff2 100644 --- a/src/world/area_hos/hos_01/A11020.c +++ b/src/world/area_hos/hos_01/A11020.c @@ -30,5 +30,11 @@ void func_80240C34_A114B4(void) { INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240C84_A11504); INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CB0_A11530); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ -INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CDC_A1155C); +INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CDC_A1155C); \ No newline at end of file diff --git a/src/world/area_hos/hos_02/A17210.c b/src/world/area_hos/hos_02/A17210.c index 47476d2dc7..5e77330df1 100644 --- a/src/world/area_hos/hos_02/A17210.c +++ b/src/world/area_hos/hos_02/A17210.c @@ -1,24 +1,244 @@ #include "hos_02.h" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80240FF0_A17210); +/* +void N(func_80240FF0_A17210)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802411A0_A173C0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80241888_A17AA8); +/* +void N(func_80241888_A17AA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80241C44_A17E64); +/* +void N(func_80241C44_A17E64)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80241E48_A18068); +/* +void N(func_80241E48_A18068)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802421D8_A183F8); +/* +void N(func_802421D8_A183F8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802422FC_A1851C); diff --git a/src/world/area_hos/hos_03/A1BDB0.c b/src/world/area_hos/hos_03/A1BDB0.c index 0fc2bdcff3..c6574c7492 100644 --- a/src/world/area_hos/hos_03/A1BDB0.c +++ b/src/world/area_hos/hos_03/A1BDB0.c @@ -3,24 +3,244 @@ #define UNK_ALPHA_FUNC_NPC 7 INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80240CB0_A1BDB0); +/* +void N(func_80240CB0_A1BDB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80240E60_A1BF60); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80241548_A1C648); +/* +void N(func_80241548_A1C648)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80241904_A1CA04); +/* +void N(func_80241904_A1CA04)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80241B08_A1CC08); +/* +void N(func_80241B08_A1CC08)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80241E98_A1CF98); +/* +void N(func_80241E98_A1CF98)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80241FBC_A1D0BC); @@ -45,6 +265,29 @@ INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_802423BC_A1D4BC); INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_8024249C_A1D59C); INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_802424A4_A1D5A4); +/* +ApiStatus N(func_802424A4_A1D5A4)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_hos/hos_04/A27AA0.c b/src/world/area_hos/hos_04/A27AA0.c index 33b51a8aee..1d69251723 100644 --- a/src/world/area_hos/hos_04/A27AA0.c +++ b/src/world/area_hos/hos_04/A27AA0.c @@ -3,5 +3,11 @@ INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240BD0_A27AA0); INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240E40_A27D10); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ -INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240E6C_A27D3C); +INCLUDE_ASM(s32, "world/area_hos/hos_04/A27AA0", func_80240E6C_A27D3C); \ No newline at end of file diff --git a/src/world/area_hos/hos_05/A2EC30.c b/src/world/area_hos/hos_05/A2EC30.c index c95d022108..4f9ff1caf8 100644 --- a/src/world/area_hos/hos_05/A2EC30.c +++ b/src/world/area_hos/hos_05/A2EC30.c @@ -3,5 +3,11 @@ INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_802449F0_A2EC30); INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_80244C60_A2EEA0); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ -INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_80244C8C_A2EECC); +INCLUDE_ASM(s32, "world/area_hos/hos_05/A2EC30", func_80244C8C_A2EECC); \ No newline at end of file diff --git a/src/world/area_hos/hos_06/A397F0.c b/src/world/area_hos/hos_06/A397F0.c index aa6d04a08b..a0e31353db 100644 --- a/src/world/area_hos/hos_06/A397F0.c +++ b/src/world/area_hos/hos_06/A397F0.c @@ -1,6 +1,29 @@ #include "hos_06.h" INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240310_A397F0); +/* +ApiStatus N(func_80240310_A397F0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup2_hos_06 #include "world/common/GetItemName.inc.c" @@ -13,8 +36,38 @@ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240310_A397F0); #define NAMESPACE hos_06 INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_80240654_A39B34); +/* +ApiStatus N(func_80240654_A39B34)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_802406A8_A39B88); +/* +ApiStatus N(func_802406A8_A39B88)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A397F0", func_802406E0_A39BC0); diff --git a/src/world/area_hos/hos_06/A3A230.c b/src/world/area_hos/hos_06/A3A230.c index 4f8785e3b3..e0ce968148 100644 --- a/src/world/area_hos/hos_06/A3A230.c +++ b/src/world/area_hos/hos_06/A3A230.c @@ -5,12 +5,65 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80240F7C_A3A45C); +/* +ApiStatus N(func_80240F7C_A3A45C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80240FD0_A3A4B0); +/* +ApiStatus N(func_80240FD0_A3A4B0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_80241008_A3A4E8); INCLUDE_ASM(s32, "world/area_hos/hos_06/A3A230", func_802410A4_A3A584); +/* +ApiStatus N(func_802410A4_A3A584)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_hos/hos_06/A3B4B0.c b/src/world/area_hos/hos_06/A3B4B0.c index 2fa2810520..cd41935adc 100644 --- a/src/world/area_hos/hos_06/A3B4B0.c +++ b/src/world/area_hos/hos_06/A3B4B0.c @@ -1,6 +1,29 @@ #include "hos_06.h" INCLUDE_ASM(s32, "world/area_hos/hos_06/A3B4B0", func_80241FD0_A3B4B0); +/* +ApiStatus N(func_80241FD0_A3B4B0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup_hos_06 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_isk/isk_04/97BF60.c b/src/world/area_isk/isk_04/97BF60.c index 6be1f689b1..5d50a98cf9 100644 --- a/src/world/area_isk/isk_04/97BF60.c +++ b/src/world/area_isk/isk_04/97BF60.c @@ -1,5 +1,11 @@ #include "isk_04.h" INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_80240930_97BF60); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ -INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_8024095C_97BF8C); +INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_8024095C_97BF8C); \ No newline at end of file diff --git a/src/world/area_isk/isk_09/9864E0.c b/src/world/area_isk/isk_09/9864E0.c index 84e963a1d5..07be3ad32c 100644 --- a/src/world/area_isk/isk_09/9864E0.c +++ b/src/world/area_isk/isk_09/9864E0.c @@ -1,6 +1,29 @@ #include "isk_09.h" INCLUDE_ASM(s32, "world/area_isk/isk_09/9864E0", func_80240000_9864E0); +/* +ApiStatus N(func_80240000_9864E0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_isk/isk_10/988B60.c b/src/world/area_isk/isk_10/988B60.c index f5433dc642..29246fbb56 100644 --- a/src/world/area_isk/isk_10/988B60.c +++ b/src/world/area_isk/isk_10/988B60.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_8024001C_988B7C); INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_8024003C_988B9C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240068_988BC8); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240120_988C80); INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_802401CC_988D2C); INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_8024041C_988F7C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240448_988FA8); @@ -34,4 +46,4 @@ INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240B38_989698); INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240D08_989868); -INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240D38_989898); +INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_80240D38_989898); \ No newline at end of file diff --git a/src/world/area_isk/isk_16/9951F0.c b/src/world/area_isk/isk_16/9951F0.c index 25953993e3..d0cf698f7e 100644 --- a/src/world/area_isk/isk_16/9951F0.c +++ b/src/world/area_isk/isk_16/9951F0.c @@ -1,13 +1,80 @@ #include "isk_16.h" INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_80240000_9951F0); +/* +ApiStatus N(func_80240000_9951F0)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_8024004C_99523C); +/* +ApiStatus N(func_8024004C_99523C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_802401AC_99539C); INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_802405BC_9957AC); +/* +ApiStatus N(func_802405BC_9957AC)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_802405FC_9957EC); +/* +ApiStatus N(func_802405FC_9957EC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_isk/isk_16/9951F0", func_80240708_9958F8); diff --git a/src/world/area_iwa/iwa_00/90CC40.c b/src/world/area_iwa/iwa_00/90CC40.c index 1b335e2465..c365435293 100644 --- a/src/world/area_iwa/iwa_00/90CC40.c +++ b/src/world/area_iwa/iwa_00/90CC40.c @@ -1,6 +1,29 @@ #include "iwa_00.h" INCLUDE_ASM(s32, "world/area_iwa/iwa_00/90CC40", func_80240000_90CC40); +/* +ApiStatus N(func_80240000_90CC40)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_01/90FBD0.c b/src/world/area_iwa/iwa_01/90FBD0.c index a68deaa7a3..a26aae30c3 100644 --- a/src/world/area_iwa/iwa_01/90FBD0.c +++ b/src/world/area_iwa/iwa_01/90FBD0.c @@ -45,6 +45,26 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_802422C4_911974); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242498_911B48); +/* +void N(func_80242498_911B48)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + npc->currentAnim = enemy->animList[9]; + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + npc->duration = 12; + script->functionTemp[0].s = 2; + } + } + + script->functionTemp[1].s--; +} +*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -53,16 +73,143 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242498_911B48); #include "world/common/UnkNpcAIFunc22.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242794_911E44); +/* +void N(func_80242794_911E44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + playerStatus = &gPlayerStatusPtr; + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else { + npc->duration--; + if (npc->duration <= 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; + script->functionTemp[0].s = 0x28; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242958_912008); +/* +void N(func_80242958_912008)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + if (npc->duration % 3 == 0) { + fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); + } + + npc->duration--; + if (npc->duration <= 0) { + playerStatus = &gPlayerStatusPtr; + + enemy->unk_10.x = npc->pos.x; + enemy->unk_10.y = npc->pos.y; + enemy->unk_10.z = npc->pos.z; + enemy->unk_07 = 1; + npc->moveSpeed = aiSettings->chaseSpeed; + npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; + if (npc->duration < 15) { + npc->duration = 15; + } + script->functionTemp[0].s = 0x16; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242AF8_9121A8); +/* +void N(func_80242AF8_9121A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ; + s32 phi_s1; + + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + phi_s1 = 0; + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { + phi_s1 = 1; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + + if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + phi_s1 = 1; + } + + npc->duration--; + if (npc->duration <= 0) { + phi_s1 = 1; + } + if (phi_s1) { + script->functionTemp[0].s = 4; + enemy->unk_07 = 0; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242C48_9122F8); +/* +void N(func_80242C48_9122F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_01/90FBD0", func_80242CF4_9123A4); +/* +void N(func_80242CF4_9123A4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->duration = 10; + script->functionTemp[0].s = 50; + } else if (npc->unk_8C == 0) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } +} +*/ #include "world/common/UnkNpcAIFunc19.inc.c" diff --git a/src/world/area_iwa/iwa_02/915D70.c b/src/world/area_iwa/iwa_02/915D70.c index b8695848f7..b5f5243343 100644 --- a/src/world/area_iwa/iwa_02/915D70.c +++ b/src/world/area_iwa/iwa_02/915D70.c @@ -5,6 +5,26 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240000_915D70); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_802401D4_915F44); +/* +void N(func_802401D4_915F44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + npc->currentAnim = enemy->animList[9]; + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + npc->duration = 12; + script->functionTemp[0].s = 2; + } + } + + script->functionTemp[1].s--; +} +*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -13,16 +33,143 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_802401D4_915F44); #include "world/common/UnkNpcAIFunc22.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_802404D0_916240); +/* +void N(func_802404D0_916240)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + playerStatus = &gPlayerStatusPtr; + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else { + npc->duration--; + if (npc->duration <= 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; + script->functionTemp[0].s = 0x28; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240694_916404); +/* +void N(func_80240694_916404)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + if (npc->duration % 3 == 0) { + fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); + } + + npc->duration--; + if (npc->duration <= 0) { + playerStatus = &gPlayerStatusPtr; + + enemy->unk_10.x = npc->pos.x; + enemy->unk_10.y = npc->pos.y; + enemy->unk_10.z = npc->pos.z; + enemy->unk_07 = 1; + npc->moveSpeed = aiSettings->chaseSpeed; + npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; + if (npc->duration < 15) { + npc->duration = 15; + } + script->functionTemp[0].s = 0x16; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240834_9165A4); +/* +void N(func_80240834_9165A4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ; + s32 phi_s1; + + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + phi_s1 = 0; + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { + phi_s1 = 1; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + + if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + phi_s1 = 1; + } + + npc->duration--; + if (npc->duration <= 0) { + phi_s1 = 1; + } + if (phi_s1) { + script->functionTemp[0].s = 4; + enemy->unk_07 = 0; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240984_9166F4); +/* +void N(func_80240984_9166F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240A30_9167A0); +/* +void N(func_80240A30_9167A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->duration = 10; + script->functionTemp[0].s = 50; + } else if (npc->unk_8C == 0) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } +} +*/ #include "world/common/UnkNpcAIFunc19.inc.c" @@ -33,5 +180,28 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240A30_9167A0); INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240C90_916A00); INCLUDE_ASM(s32, "world/area_iwa/iwa_02/915D70", func_80240FE0_916D50); +/* +ApiStatus N(func_80240FE0_916D50)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_03/918BB0.c b/src/world/area_iwa/iwa_03/918BB0.c index 5a85b2942f..fd724416ad 100644 --- a/src/world/area_iwa/iwa_03/918BB0.c +++ b/src/world/area_iwa/iwa_03/918BB0.c @@ -1,6 +1,29 @@ #include "iwa_03.h" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918BB0", func_80240000_918BB0); +/* +ApiStatus N(func_80240000_918BB0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_03/918EF0.c b/src/world/area_iwa/iwa_03/918EF0.c index e69e547df6..3ddc538ff9 100644 --- a/src/world/area_iwa/iwa_03/918EF0.c +++ b/src/world/area_iwa/iwa_03/918EF0.c @@ -5,6 +5,26 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240340_918EF0); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240514_9190C4); +/* +void N(func_80240514_9190C4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + npc->currentAnim = enemy->animList[9]; + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + npc->duration = 12; + script->functionTemp[0].s = 2; + } + } + + script->functionTemp[1].s--; +} +*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -13,16 +33,143 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240514_9190C4); #include "world/common/UnkNpcAIFunc22.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240810_9193C0); +/* +void N(func_80240810_9193C0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + playerStatus = &gPlayerStatusPtr; + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else { + npc->duration--; + if (npc->duration <= 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; + script->functionTemp[0].s = 0x28; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_802409D4_919584); +/* +void N(func_802409D4_919584)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + if (npc->duration % 3 == 0) { + fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); + } + + npc->duration--; + if (npc->duration <= 0) { + playerStatus = &gPlayerStatusPtr; + + enemy->unk_10.x = npc->pos.x; + enemy->unk_10.y = npc->pos.y; + enemy->unk_10.z = npc->pos.z; + enemy->unk_07 = 1; + npc->moveSpeed = aiSettings->chaseSpeed; + npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; + if (npc->duration < 15) { + npc->duration = 15; + } + script->functionTemp[0].s = 0x16; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240B74_919724); +/* +void N(func_80240B74_919724)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ; + s32 phi_s1; + + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + phi_s1 = 0; + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { + phi_s1 = 1; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + + if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + phi_s1 = 1; + } + + npc->duration--; + if (npc->duration <= 0) { + phi_s1 = 1; + } + if (phi_s1) { + script->functionTemp[0].s = 4; + enemy->unk_07 = 0; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240CC4_919874); +/* +void N(func_80240CC4_919874)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_03/918EF0", func_80240D70_919920); +/* +void N(func_80240D70_919920)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->duration = 10; + script->functionTemp[0].s = 50; + } else if (npc->unk_8C == 0) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } +} +*/ #include "world/common/UnkNpcAIFunc19.inc.c" diff --git a/src/world/area_iwa/iwa_04/91B8E0.c b/src/world/area_iwa/iwa_04/91B8E0.c index b98d60a258..52f5af99f4 100644 --- a/src/world/area_iwa/iwa_04/91B8E0.c +++ b/src/world/area_iwa/iwa_04/91B8E0.c @@ -7,6 +7,26 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240080_91B960); #include "world/common/UnkNpcAIFunc18.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240254_91BB34); +/* +void N(func_80240254_91BB34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) { + npc->currentAnim = enemy->animList[9]; + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + func_800494C0(npc, 0x2F4, 0x200000); + npc->duration = 12; + script->functionTemp[0].s = 2; + } + } + + script->functionTemp[1].s--; +} +*/ #include "world/common/UnkNpcAIFunc21.inc.c" @@ -15,16 +35,143 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240254_91BB34); #include "world/common/UnkNpcAIFunc22.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240550_91BE30); +/* +void N(func_80240550_91BE30)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + PlayerStatus** playerStatus; + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + playerStatus = &gPlayerStatusPtr; + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else { + npc->duration--; + if (npc->duration <= 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->duration = 15; + script->functionTemp[0].s = 0x28; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc16.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240714_91BFF4); +/* +void N(func_80240714_91BFF4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + if (npc->duration % 3 == 0) { + fx_walk_normal(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); + } + + npc->duration--; + if (npc->duration <= 0) { + playerStatus = &gPlayerStatusPtr; + + enemy->unk_10.x = npc->pos.x; + enemy->unk_10.y = npc->pos.y; + enemy->unk_10.z = npc->pos.z; + enemy->unk_07 = 1; + npc->moveSpeed = aiSettings->chaseSpeed; + npc->duration = dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) / npc->moveSpeed + 0.9; + if (npc->duration < 15) { + npc->duration = 15; + } + script->functionTemp[0].s = 0x16; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_802408B4_91C194); +/* +void N(func_802408B4_91C194)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ; + s32 phi_s1; + + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + phi_s1 = 0; + if (is_point_within_region(enemy->territory->wander.detectShape, + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { + phi_s1 = 1; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + + if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + phi_s1 = 1; + } + + npc->duration--; + if (npc->duration <= 0) { + phi_s1 = 1; + } + if (phi_s1) { + script->functionTemp[0].s = 4; + enemy->unk_07 = 0; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240A04_91C2E4); +/* +void N(func_80240A04_91C2E4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + + npc->duration--; + if (npc->duration <= 0) { + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 0x29; + } +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_04/91B8E0", func_80240AB0_91C390); +/* +void N(func_80240AB0_91C390)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + PlayerStatus** playerStatus = &gPlayerStatusPtr; + + if (func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z); + script->functionTemp[0].s = 12; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->duration = 10; + script->functionTemp[0].s = 50; + } else if (npc->unk_8C == 0) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + } +} +*/ #include "world/common/UnkNpcAIFunc19.inc.c" diff --git a/src/world/area_iwa/iwa_10/91E5B0.c b/src/world/area_iwa/iwa_10/91E5B0.c index d16d6121ca..e55f47f916 100644 --- a/src/world/area_iwa/iwa_10/91E5B0.c +++ b/src/world/area_iwa/iwa_10/91E5B0.c @@ -1,5 +1,28 @@ #include "iwa_10.h" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E5B0", func_80240040_91E5B0); +/* +ApiStatus N(func_80240040_91E5B0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_iwa/iwa_10/91E6D0.c b/src/world/area_iwa/iwa_10/91E6D0.c index d22c73a004..4f6e5e6cbd 100644 --- a/src/world/area_iwa/iwa_10/91E6D0.c +++ b/src/world/area_iwa/iwa_10/91E6D0.c @@ -7,6 +7,12 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_8024030C_91E87C); INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_8024032C_91E89C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240358_91E8C8); @@ -17,6 +23,12 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240410_91E980); INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_802404BC_91EA2C); INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_8024070C_91EC7C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240738_91ECA8); @@ -34,4 +46,4 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240E28_91F398); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240FF8_91F568); +INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_80240FF8_91F568); \ No newline at end of file diff --git a/src/world/area_iwa/iwa_10/91F5A0.c b/src/world/area_iwa/iwa_10/91F5A0.c index 07883accba..55882e5920 100644 --- a/src/world/area_iwa/iwa_10/91F5A0.c +++ b/src/world/area_iwa/iwa_10/91F5A0.c @@ -7,7 +7,37 @@ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_80241030_91F5A0); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_802413E0_91F950); +/* +ApiStatus N(func_802413E0_91F950)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_80241434_91F9A4); +/* +ApiStatus N(func_80241434_91F9A4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91F5A0", func_8024146C_91F9DC); diff --git a/src/world/area_jan/jan_00/B20540.c b/src/world/area_jan/jan_00/B20540.c index cfbc2e292a..61d65cbdcc 100644 --- a/src/world/area_jan/jan_00/B20540.c +++ b/src/world/area_jan/jan_00/B20540.c @@ -9,6 +9,29 @@ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_8024030C_B2084C); INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240340_B20880); INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_802403F4_B20934); +/* +ApiStatus N(func_802403F4_B20934)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -17,8 +40,38 @@ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_802403F4_B20934); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_80240738_B20C78); +/* +ApiStatus N(func_80240738_B20C78)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_8024078C_B20CCC); +/* +ApiStatus N(func_8024078C_B20CCC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_00/B20540", func_802407C4_B20D04); diff --git a/src/world/area_jan/jan_02/B2C8A0.c b/src/world/area_jan/jan_02/B2C8A0.c index f25a48ed8b..2708d51ac9 100644 --- a/src/world/area_jan/jan_02/B2C8A0.c +++ b/src/world/area_jan/jan_02/B2C8A0.c @@ -3,26 +3,202 @@ #define UNK_ALPHA_FUNC_NPC 5 INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240430_B2C8A0); +/* +ApiStatus N(func_80240430_B2C8A0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240588_B2C9F8); +/* +void N(func_80240588_B2C9F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_802408F0_B2CD60); +/* +void N(func_802408F0_B2CD60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240AAC_B2CF1C); +/* +ApiStatus N(func_80240AAC_B2CF1C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240D7C_B2D1EC); +/* +ApiStatus N(func_80240D7C_B2D1EC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240F04_B2D374); +/* +void N(func_80240F04_B2D374)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240FC4_B2D434); @@ -31,12 +207,65 @@ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240FC4_B2D434); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_802414EC_B2D95C); +/* +ApiStatus N(func_802414EC_B2D95C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80241540_B2D9B0); +/* +ApiStatus N(func_80241540_B2D9B0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80241578_B2D9E8); INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80241614_B2DA84); +/* +ApiStatus N(func_80241614_B2DA84)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_jan/jan_03/B34BD0.c b/src/world/area_jan/jan_03/B34BD0.c index f3b925fcb9..2e415a5a88 100644 --- a/src/world/area_jan/jan_03/B34BD0.c +++ b/src/world/area_jan/jan_03/B34BD0.c @@ -21,26 +21,202 @@ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240034_B34C04); INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802405EC_B351BC); INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240620_B351F0); +/* +ApiStatus N(func_80240620_B351F0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240778_B35348); +/* +void N(func_80240778_B35348)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240AE0_B356B0); +/* +void N(func_80240AE0_B356B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240C9C_B3586C); +/* +ApiStatus N(func_80240C9C_B3586C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240F6C_B35B3C); +/* +ApiStatus N(func_80240F6C_B35B3C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802410F4_B35CC4); +/* +void N(func_802410F4_B35CC4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802411B4_B35D84); @@ -69,14 +245,67 @@ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802417A4_B36374); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802419D8_B365A8); +/* +ApiStatus N(func_802419D8_B365A8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80241A2C_B365FC); +/* +ApiStatus N(func_80241A2C_B365FC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80241A64_B36634); INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80241B00_B366D0); INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80241B9C_B3676C); +/* +ApiStatus N(func_80241B9C_B3676C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_jan/jan_04/B44AC0.c b/src/world/area_jan/jan_04/B44AC0.c index 26bb0f5f45..be06836d03 100644 --- a/src/world/area_jan/jan_04/B44AC0.c +++ b/src/world/area_jan/jan_04/B44AC0.c @@ -1,6 +1,29 @@ #include "jan_04.h" INCLUDE_ASM(s32, "world/area_jan/jan_04/B44AC0", func_80240350_B44AC0); +/* +ApiStatus N(func_80240350_B44AC0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_jan/jan_08/B5E910.c b/src/world/area_jan/jan_08/B5E910.c index 473d8dad9b..f5a9044402 100644 --- a/src/world/area_jan/jan_08/B5E910.c +++ b/src/world/area_jan/jan_08/B5E910.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024067C_B5E92C); INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024069C_B5E94C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_802406C8_B5E978); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80240780_B5EA30); INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024082C_B5EADC); INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80240A7C_B5ED2C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80240AA8_B5ED58); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80241198_B5F448); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80241368_B5F618); +INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80241368_B5F618); \ No newline at end of file diff --git a/src/world/area_jan/jan_22/B84180.c b/src/world/area_jan/jan_22/B84180.c index 80d8a8c183..ec40c1b299 100644 --- a/src/world/area_jan/jan_22/B84180.c +++ b/src/world/area_jan/jan_22/B84180.c @@ -1,30 +1,229 @@ #include "jan_22.h" INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240000_B84180); +/* +ApiStatus N(func_80240000_B84180)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240158_B842D8); +/* +void N(func_80240158_B842D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_802404C0_B84640); +/* +void N(func_802404C0_B84640)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_8024067C_B847FC); +/* +ApiStatus N(func_8024067C_B847FC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_8024094C_B84ACC); +/* +ApiStatus N(func_8024094C_B84ACC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240AD4_B84C54); +/* +void N(func_80240AD4_B84C54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240B94_B84D14); INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240E90_B85010); +/* +ApiStatus N(func_80240E90_B85010)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kkj/kkj_00/ABB340.c b/src/world/area_kkj/kkj_00/ABB340.c index fb0d3f4612..c63cefd8b9 100644 --- a/src/world/area_kkj/kkj_00/ABB340.c +++ b/src/world/area_kkj/kkj_00/ABB340.c @@ -1,26 +1,202 @@ #include "kkj_00.h" INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_802400B0_ABB340); +/* +ApiStatus N(func_802400B0_ABB340)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_80240208_ABB498); +/* +void N(func_80240208_ABB498)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_80240570_ABB800); +/* +void N(func_80240570_ABB800)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_8024072C_ABB9BC); +/* +ApiStatus N(func_8024072C_ABB9BC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_802409FC_ABBC8C); +/* +ApiStatus N(func_802409FC_ABBC8C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_80240B84_ABBE14); +/* +void N(func_80240B84_ABBE14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_80240C44_ABBED4); diff --git a/src/world/area_kkj/kkj_01/AC5170.c b/src/world/area_kkj/kkj_01/AC5170.c index a8675248a9..2622b2254a 100644 --- a/src/world/area_kkj/kkj_01/AC5170.c +++ b/src/world/area_kkj/kkj_01/AC5170.c @@ -1,25 +1,201 @@ #include "kkj_01.h" INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240000_AC5170); +/* +ApiStatus N(func_80240000_AC5170)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240158_AC52C8); +/* +void N(func_80240158_AC52C8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_802404C0_AC5630); +/* +void N(func_802404C0_AC5630)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_8024067C_AC57EC); +/* +ApiStatus N(func_8024067C_AC57EC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_8024094C_AC5ABC); +/* +ApiStatus N(func_8024094C_AC5ABC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240AD4_AC5C44); +/* +void N(func_80240AD4_AC5C44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240B94_AC5D04); diff --git a/src/world/area_kkj/kkj_17/AF1C60.c b/src/world/area_kkj/kkj_17/AF1C60.c index c656a4150f..6fa9987d3b 100644 --- a/src/world/area_kkj/kkj_17/AF1C60.c +++ b/src/world/area_kkj/kkj_17/AF1C60.c @@ -1,6 +1,29 @@ #include "kkj_17.h" INCLUDE_ASM(s32, "world/area_kkj/kkj_17/AF1C60", func_80240000_AF1C60); +/* +ApiStatus N(func_80240000_AF1C60)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kkj/kkj_18/AF2FE0.c b/src/world/area_kkj/kkj_18/AF2FE0.c index 442f409eab..f990dc8ef1 100644 --- a/src/world/area_kkj/kkj_18/AF2FE0.c +++ b/src/world/area_kkj/kkj_18/AF2FE0.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_8024056C_AF320C); +/* +ApiStatus N(func_8024056C_AF320C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_802405C0_AF3260); +/* +ApiStatus N(func_802405C0_AF3260)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_18/AF2FE0", func_802405F8_AF3298); diff --git a/src/world/area_kkj/kkj_19/AF7C00.c b/src/world/area_kkj/kkj_19/AF7C00.c index 0ac98055e5..8a0e976bf0 100644 --- a/src/world/area_kkj/kkj_19/AF7C00.c +++ b/src/world/area_kkj/kkj_19/AF7C00.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_802404DC_AF7E2C); +/* +ApiStatus N(func_802404DC_AF7E2C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_80240530_AF7E80); +/* +ApiStatus N(func_80240530_AF7E80)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kkj/kkj_19/AF7C00", func_80240568_AF7EB8); diff --git a/src/world/area_kkj/kkj_20/AFDB40.c b/src/world/area_kkj/kkj_20/AFDB40.c index 2e108f9795..4cc9f2c9cf 100644 --- a/src/world/area_kkj/kkj_20/AFDB40.c +++ b/src/world/area_kkj/kkj_20/AFDB40.c @@ -1,6 +1,29 @@ #include "kkj_20.h" INCLUDE_ASM(s32, "world/area_kkj/kkj_20/AFDB40", func_80240000_AFDB40); +/* +ApiStatus N(func_80240000_AFDB40)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_02/8B0070.c b/src/world/area_kmr/kmr_02/8B0070.c index ac3b597173..c030594482 100644 --- a/src/world/area_kmr/kmr_02/8B0070.c +++ b/src/world/area_kmr/kmr_02/8B0070.c @@ -19,6 +19,29 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_802402E0_8B0350); INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_80240370_8B03E0); INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_80240390_8B0400); +/* +ApiStatus N(func_80240390_8B0400)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -72,15 +95,15 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_80241424_8B1494); INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_802414D8_8B1548); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_80241964_8B19D4); @@ -97,8 +120,38 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_80242014_8B2084); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_8024226C_8B22DC); +/* +ApiStatus N(func_8024226C_8B22DC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_802422C0_8B2330); +/* +ApiStatus N(func_802422C0_8B2330)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_802422F8_8B2368); diff --git a/src/world/area_kmr/kmr_03/8C7F90.c b/src/world/area_kmr/kmr_03/8C7F90.c index eb9d2b57e4..c14523a482 100644 --- a/src/world/area_kmr/kmr_03/8C7F90.c +++ b/src/world/area_kmr/kmr_03/8C7F90.c @@ -2,9 +2,9 @@ #include "message_ids.h" #include "../../partners.h" -Script N(Main); +Script N(main); -ApiStatus func_80240000_8C7F90(ScriptInstance* script, s32 isInitialCall) { +ApiStatus N(func_80240000_8C7F90)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PlayerData* playerData = &gPlayerData; NpcID npcID = get_variable(script, *args++); @@ -51,20 +51,20 @@ ApiStatus func_80240000_8C7F90(ScriptInstance* script, s32 isInitialCall) { #include "world/common/CheckPartnerFlags1000.inc.c" -Vec4f N(entryList)[] = { +EntryList N(entryList) = { { -340.0f, 0.0f, 348.0f, 48.0f }, { 480.0f, 0.0f, 0.0f, 270.0f }, { -310.0f, 20.0f, -80.0f, 135.0f }, }; MapConfig N(config) = { - .main = N(Main), + .main = N(main), .entryList = N(entryList), .entryCount = ENTRY_COUNT(N(entryList)), .background = &gBackgroundImage, .tattle = MSG_kmr_03_tattle, }; -Script N(Script_802406C0) = SCRIPT({ - SetMusicTrack(0, 17, 0, 8); +Script N(802406C0) = SCRIPT({ + SetMusicTrack(0, SONG_PLEASANT_PATH, 0, 8); }); diff --git a/src/world/area_kmr/kmr_03/8C8140.c b/src/world/area_kmr/kmr_03/8C8140.c index 71ae042061..100fc034a0 100644 --- a/src/world/area_kmr/kmr_03/8C8140.c +++ b/src/world/area_kmr/kmr_03/8C8140.c @@ -1,11 +1,12 @@ #include "kmr_03.h" +#include "sprite/npc/goompa.h" -s32 N(npcGroupList_80241450)[]; -Script N(MakeEntities); -Script N(Script_802422B8); -Script N(Script_80242340); +NpcGroupList N(npcGroupList_80241450); +Script N(makeEntities); +Script N(802422B8); +Script N(80242340); -ApiStatus func_802401B0_8C8140(ScriptInstance* script, s32 isInitialCall) { +ApiStatus N(func_802401B0_8C8140)(ScriptInstance* script, s32 isInitialCall) { Npc* npc = get_npc_unsafe(0); script->varTable[1] = func_800E0088(npc->pos.x, npc->pos.z) / npc->moveSpeed * 0.8f; @@ -14,17 +15,16 @@ ApiStatus func_802401B0_8C8140(ScriptInstance* script, s32 isInitialCall) { #include "world/common/UnkPositionFunc.inc.c" -// 8C8680 -Script N(ExitWalk_802406F0) = EXIT_WALK_SCRIPT(60, 0, "kmr_04", 0); +Script N(exitWalk_802406F0) = EXIT_WALK_SCRIPT(60, 0, "kmr_04", 0); -Script N(ExitWalk_8024074C) = EXIT_WALK_SCRIPT(60, 1, "kmr_05", 0); +Script N(exitWalk_8024074C) = EXIT_WALK_SCRIPT(60, 1, "kmr_05", 0); -Script N(Script_802407A8) = SCRIPT({ - bind N(ExitWalk_802406F0) to 0x80000 3; - bind N(ExitWalk_8024074C) to 0x80000 5; +Script N(802407A8) = SCRIPT({ + bind N(exitWalk_802406F0) to TRIGGER_FLOOR_ABOVE 3; + bind N(exitWalk_8024074C) to TRIGGER_FLOOR_ABOVE 5; }); -Script N(Main) = SCRIPT({ +Script N(main) = SCRIPT({ WORLD_LOCATION = LOCATION_GOOMBA_VILLAGE; SetSpriteShading(-1); SetCamPerspective(0, 3, 25, 16, 4096); @@ -34,43 +34,46 @@ Script N(Main) = SCRIPT({ SI_AREA_FLAG(8) = 0; MakeNpcs(0, N(npcGroupList_80241450)); ClearDefeatedEnemies(); - await N(MakeEntities); - await N(Script_802422B8); - spawn N(Script_802406C0); + await N(makeEntities); + await N(802422B8); + spawn N(802406C0); GetEntryID(SI_VAR(0)); if (SI_VAR(0) != 2) { - SI_VAR(0) = N(Script_802407A8); + SI_VAR(0) = N(802407A8); spawn EnterWalk; } else { - spawn N(Script_802407A8); - spawn N(Script_80242340); + spawn N(802407A8); + spawn N(80242340); } sleep 1; }); -s32 padding[] = {0, 0}; - -// 8C88E0 -s32 N(npcSettings_80240950)[] = { - 0x00000000, 0x00160018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00630010, +static s32 N(pad_948)[] = { + 0x00000000, 0x00000000, }; -Script N(Script_8024097C) = SCRIPT({ +NpcSettings N(npcSettings_80240950) = { + .height = 22, + .radius = 24, + .level = 99, + .unk_2A = 16, +}; + +Script N(8024097C) = SCRIPT({ 1: if (SI_AREA_FLAG(8) == 1) { -100: + 100: AwaitPlayerLeave(294, 123, 170); EnableNpcAI(0, 0); - DisablePlayerInput(1); - SetNpcSpeed(0, 4.0); - SetNpcAnimation(0, 0x9D0003); - func_802401B0_8C8140(); + DisablePlayerInput(TRUE); + SetNpcSpeed(NPC_PLAYER, 4.0); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_3)); + N(func_802401B0_8C8140)(); GetAngleToPlayer(0, SI_VAR(2)); loop SI_VAR(1) { - GetNpcPos(0, SI_VAR(7), SI_VAR(8), SI_VAR(9)); + GetNpcPos(NPC_PLAYER, SI_VAR(7), SI_VAR(8), SI_VAR(9)); AddVectorPolar(SI_VAR(7), SI_VAR(9), 4.0, SI_VAR(2)); - SetNpcPos(0, SI_VAR(7), SI_VAR(8), SI_VAR(9)); + SetNpcPos(NPC_PLAYER, SI_VAR(7), SI_VAR(8), SI_VAR(9)); sleep 1; } PlayerFaceNpc(0, 3); @@ -78,33 +81,33 @@ Script N(Script_8024097C) = SCRIPT({ PlayerMoveTo(243, 243, 0); SetNpcVar(0, 0, 1); EnableNpcAI(0, 1); - DisablePlayerInput(0); + DisablePlayerInput(FALSE); goto 100; } sleep 1; goto 1; }); -Script N(NpcAI_80240B50) = SCRIPT({ +Script N(npcAI_80240B50) = SCRIPT({ 1: match STORY_PROGRESS { == STORY_CH0_FELL_OFF_CLIFF { -89: - N(UnkPositionFunc)(0xFFFFFF8A, 86, 0xFFFFFFBA, 0xFFFFFFF1); + 89: + N(UnkPositionFunc)(-118, 86, -70, -15); sleep 1; if (SI_VAR(0) == 0) { goto 89; } - DisablePlayerInput(1); - SetNpcAux(0, 0); - PlaySoundAtNpc(0, 610, 0); - ShowEmote(0, 0, 45, 15, 1, 0, 0, 0, 0); + DisablePlayerInput(TRUE); + SetNpcAux(NPC_PLAYER, 0); + PlaySoundAtNpc(NPC_PLAYER, 0x262, 0); + ShowEmote(0, EMOTE_EXCLAMATION, 45, 15, 1, 0, 0, 0, 0); sleep 15; - NpcFacePlayer(-1, 5); + NpcFacePlayer(NPC_SELF, 5); sleep 10; - SpeakToPlayer(0, 0x9D0008, 0x9D0001, 0, 0xB00A6); - UseSettingsFrom(0, 0xFFFFFF24, 20, 0xFFFFFFB8); - SetPanTarget(0, 0xFFFFFFEC, 0, 68); + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_8), NPC_ANIM(goompa, Palette_00, Anim_1), 0, MESSAGE_ID(0x0B, 0x00A6)); + UseSettingsFrom(0, -220, 20, -72); + SetPanTarget(0, -20, 0, 68); SetCamPitch(0, 15.0, -8.5); SetCamDistance(0, 275); SetCamSpeed(0, 1.5); @@ -112,23 +115,23 @@ Script N(NpcAI_80240B50) = SCRIPT({ spawn { sleep 20; SetPlayerSpeed(2.0); - PlayerMoveTo(0xFFFFFFDA, 68, 0); + PlayerMoveTo(-38, 68, 0); } - GetNpcPos(0, SI_VAR(7), SI_VAR(8), SI_VAR(9)); - SetNpcSpeed(0, 4.0); - SetNpcAnimation(0, 0x9D0003); - NpcMoveTo(0, 0, 70, 0); - SetNpcAnimation(0, 0x9D0001); - InterpNpcYaw(0, 276, 20); + GetNpcPos(NPC_PLAYER, SI_VAR(7), SI_VAR(8), SI_VAR(9)); + SetNpcSpeed(NPC_PLAYER, 4.0); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_3)); + NpcMoveTo(NPC_PLAYER, 0, 70, 0); + SetNpcAnimation(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_1)); + InterpNpcYaw(NPC_PLAYER, 276, 20); sleep 30; - SpeakToPlayer(0, 0x9D0008, 0x9D0001, 0, 0xB00A7); + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_8), NPC_ANIM(goompa, Palette_00, Anim_1), 0, MESSAGE_ID(0x0B, 0x00A7)); sleep 5; SetPlayerAnimation(0x80007); sleep 30; - SpeakToPlayer(0, 0x9D0008, 0x9D0001, 0, 0xB00A8); - func_80240000_8C7F90(0, 5); + SpeakToPlayer(NPC_PLAYER, NPC_ANIM(goompa, Palette_00, Anim_8), NPC_ANIM(goompa, Palette_00, Anim_1), 0, MESSAGE_ID(0x0B, 0x00A8)); + N(func_80240000_8C7F90)(0, 5); STORY_PROGRESS = STORY_CH0_GOOMPA_JOINED_PARTY; - UseSettingsFrom(0, 0xFFFFFF24, 20, 0xFFFFFFB8); + UseSettingsFrom(0, -220, 20, -72); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetCamSpeed(0, 3.0); @@ -136,16 +139,16 @@ Script N(NpcAI_80240B50) = SCRIPT({ WaitForCam(0, 1.0); PanToTarget(0, 0, 0); EnablePartnerAI(); - DisablePlayerInput(0); + DisablePlayerInput(FALSE); sleep 1; } } }); -Script N(Hit_80240F64) = SCRIPT({ - SetNpcAnimation(-1, 0x9D0007); +Script N(hit_80240F64) = SCRIPT({ + SetNpcAnimation(NPC_SELF, NPC_ANIM(goompa, Palette_00, Anim_7)); sleep 10; - SetNpcAnimation(-1, 0x9D0001); + SetNpcAnimation(NPC_SELF, NPC_ANIM(goompa, Palette_00, Anim_1)); SI_MAP_VAR(0) += 1; if (SI_MAP_VAR(0) < 3) { GetOwnerEncounterTrigger(SI_VAR(0)); @@ -168,68 +171,83 @@ Script N(Hit_80240F64) = SCRIPT({ } } sleep 10; - SetNpcAnimation(-1, 0x9D0003); + SetNpcAnimation(NPC_SELF, NPC_ANIM(goompa, Palette_00, Anim_3)); } else { sleep 10; - GetNpcPos(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); - SetNpcPos(0xFFFFFFFC, SI_VAR(0), SI_VAR(1), SI_VAR(2)); - SetNpcFlagBits(0xFFFFFFFC, 512, 1); - SetNpcPos(0, 0, 0xFFFFFC18, 0); - SetNpcFlagBits(0, 256, 0); + GetNpcPos(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetNpcPos(NPC_PARTNER, SI_VAR(0), SI_VAR(1), SI_VAR(2)); + SetNpcFlagBits(NPC_PARTNER, 0x00000200, TRUE); + SetNpcPos(NPC_PLAYER, 0, -1000, 0); + SetNpcFlagBits(NPC_PLAYER, 0x00000100, FALSE); EnablePartnerAI(); - SetNpcAux(-1, N(Script_8024097C)); - BindNpcAI(-1, N(NpcAI_80240B50)); + SetNpcAux(NPC_SELF, N(8024097C)); + BindNpcAI(NPC_SELF, N(npcAI_80240B50)); } }); -Script N(Init_802411A8) = SCRIPT({ - BindNpcIdle(-1, N(NpcAI_80240B50)); - BindNpcAux(-1, N(Script_8024097C)); - BindNpcHit(-1, N(Hit_80240F64)); +Script N(init_802411A8) = SCRIPT({ + BindNpcIdle(NPC_SELF, N(npcAI_80240B50)); + BindNpcAux(-1, N(8024097C)); + BindNpcHit(-1, N(hit_80240F64)); match STORY_PROGRESS { - >= 0xFFFFFF87 { - SetNpcFlagBits(-1, 512, 0); - SetNpcFlagBits(-1, 8, 1); - SetNpcPos(-1, 0, 0xFFFFFC18, 0); + >= STORY_CH0_GOOMPA_JOINED_PARTY { + SetNpcFlagBits(NPC_SELF, 0x00000200, FALSE); + SetNpcFlagBits(NPC_SELF, 0x00000008, TRUE); + SetNpcPos(NPC_SELF, 0, -1000, 0); } } }); -s32 N(npcGroup_80241260)[] = { - 0x00000000, N(npcSettings_80240950), 0xC2480000, 0x00000000, 0x42A00000, 0x00400105, N(Init_802411A8), 0x00000000, - 0x00000000, 0x0000002D, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x009D0001, 0x009D0002, 0x009D0003, 0x009D0003, 0x009D0001, 0x009D0001, 0x009D0000, 0x009D0000, - 0x009D0003, 0x009D0003, 0x009D0003, 0x009D0003, 0x009D0003, 0x009D0003, 0x009D0003, 0x009D0003, - 0x00000000, 0x00000000, 0x00000000, 0x001A0063, +StaticNpc N(npcGroup_80241260) = { + .id = 0, + .settings = &N(npcSettings_80240950), + .pos = { -50.0f, 0.0f, 80.0f }, + .flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_400000, + .init = &N(init_802411A8), + .yaw = 45, + .dropFlags = 0x80, + .heartDrops = NO_DROPS, + .flowerDrops = NO_DROPS, + .animations = { + NPC_ANIM(goompa, Palette_00, Anim_1), + NPC_ANIM(goompa, Palette_00, Anim_2), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_1), + NPC_ANIM(goompa, Palette_00, Anim_1), + NPC_ANIM(goompa, Palette_00, Anim_0), + NPC_ANIM(goompa, Palette_00, Anim_0), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + NPC_ANIM(goompa, Palette_00, Anim_3), + }, + .tattle = MESSAGE_ID(0x1A, 0x0063), }; -s32 N(npcGroupList_80241450)[] = { - 0x00000001, N(npcGroup_80241260), 0x00020000, 0x00000000, 0x00000000, 0x00000000, +NpcGroupList N(npcGroupList_80241450) = { + NPC_GROUP(N(npcGroup_80241260), BATTLE_ID(0, 2, 0, 0)), + {}, }; -s32 N(padding2)[] = {0, 0}; +static s32 N(pad_1468)[] = { + 0x00000000, 0x00000000, +}; -Script N(Script_80241470) = SCRIPT({ +Script N(80241470) = SCRIPT({ ModifyColliderFlags(0, 9, 0x7FFFFE00); STORY_PROGRESS = STORY_CH0_LEFT_THE_PLAYGROUND; }); -Script N(Script_802414A8) = SCRIPT({ +Script N(802414A8) = SCRIPT({ SI_SAVE_FLAG(54) = 1; }); -Script N(Script_802414C8) = SCRIPT({ +Script N(802414C8) = SCRIPT({ 0: GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetCamTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2)); @@ -237,31 +255,31 @@ Script N(Script_802414C8) = SCRIPT({ goto 0; }); -Script N(MakeEntities) = SCRIPT({ +Script N(makeEntities) = SCRIPT({ if (STORY_PROGRESS < STORY_CH0_LEFT_THE_PLAYGROUND) { - MakeEntity(0x802EA10C, 45, 0, 70, 15, 0x80000000); - AssignScript(N(Script_80241470)); + MakeEntity(0x802EA10C, 45, 0, 70, 15, MAKE_ENTITY_END); + AssignScript(N(80241470)); } else { ModifyColliderFlags(0, 9, 0x7FFFFE00); } if (SI_SAVE_FLAG(54) == 0) { - MakeEntity(0x802EA19C, 230, 0, 310, 15, 0x80000000); - AssignScript(N(Script_802414A8)); + MakeEntity(0x802EA19C, 230, 0, 310, 15, MAKE_ENTITY_END); + AssignScript(N(802414A8)); } - MakeEntity(0x802EA588, 230, 60, 310, 15, 151, 0x80000000); + MakeEntity(0x802EA588, 230, 60, 310, 15, ITEM_REPEL_GEL, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(52)); - MakeEntity(0x802EA0C4, 230, 50, 0xFFFFFF60, 15, 0x80000000); - MakeEntity(0x802EA0C4, 165, 0, 380, 20, 0x80000000); - MakeEntity(0x802EA564, 0xFFFFFF56, 0, 370, 43, 343, 0x80000000); + MakeEntity(0x802EA0C4, 230, 50, -160, 15, MAKE_ENTITY_END); + MakeEntity(0x802EA0C4, 165, 0, 380, 20, MAKE_ENTITY_END); + MakeEntity(0x802EA564, -170, 0, 370, 43, ITEM_COIN, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(50)); - MakeEntity(0x802EAA54, 345, 75, 0xFFFFFF06, 0, 100, 0x80000000); - MakeItemEntity(343, 345, 205, 0xFFFFFF06, 17, SI_SAVE_FLAG(56)); - MakeItemEntity(343, 345, 230, 0xFFFFFF06, 17, SI_SAVE_FLAG(57)); - MakeItemEntity(343, 345, 255, 0xFFFFFF06, 17, SI_SAVE_FLAG(58)); - MakeItemEntity(343, 345, 280, 0xFFFFFF06, 17, SI_SAVE_FLAG(59)); - MakeItemEntity(128, 229, 250, 0xFFFFFF64, 17, SI_SAVE_FLAG(49)); - MakeEntity(0x802EAB04, 300, 0, 150, 0, 18, 0x80000000); + MakeEntity(0x802EAA54, 345, 75, -250, 0, ITEM_WATER, MAKE_ENTITY_END); + MakeItemEntity(ITEM_COIN, 345, 205, -250, 17, SI_SAVE_FLAG(56)); + MakeItemEntity(ITEM_COIN, 345, 230, -250, 17, SI_SAVE_FLAG(57)); + MakeItemEntity(ITEM_COIN, 345, 255, -250, 17, SI_SAVE_FLAG(58)); + MakeItemEntity(ITEM_COIN, 345, 280, -250, 17, SI_SAVE_FLAG(59)); + MakeItemEntity(ITEM_FIRE_FLOWER, 229, 250, -156, 17, SI_SAVE_FLAG(49)); + MakeEntity(0x802EAB04, 300, 0, 150, 0, ITEM_PULSE_STONE, MAKE_ENTITY_END); AssignPanelFlag(SI_SAVE_FLAG(88)); - MakeEntity(0x802EA7E0, 130, 60, 0, 0, 0x80000000); + MakeEntity(0x802EA7E0, 130, 60, 0, 0, MAKE_ENTITY_END); }); diff --git a/src/world/area_kmr/kmr_03/8C83A0.c b/src/world/area_kmr/kmr_03/8C83A0.c index 02c5dddfb1..3d173fee87 100644 --- a/src/world/area_kmr/kmr_03/8C83A0.c +++ b/src/world/area_kmr/kmr_03/8C83A0.c @@ -3,7 +3,7 @@ #include "world/common/SomeMatrixOperations.inc.c" // *INDENT-OFF* -Script N(SearchBush_802417F0) = { +Script N(searchBush_802417F0) = { SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(0)), SI_CMD(ScriptOpcode_BUFFER_READ_4, SI_VAR(1), SI_VAR(2), SI_VAR(3), SI_VAR(4)), SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(5), SI_VAR(15), SI_VAR(7)), @@ -66,8 +66,10 @@ Script N(SearchBush_802417F0) = { SI_CMD(ScriptOpcode_RETURN), SI_CMD(ScriptOpcode_END) }; +// *INDENT-ON* -Script N(ShakeTree_80241B50) = { +// *INDENT-OFF* +Script N(shakeTree_80241B50) = { SI_CMD(ScriptOpcode_SET_TIMESCALE, SI_FIXED(2.0)), SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(0)), SI_CMD(ScriptOpcode_BUFFER_READ_4, SI_VAR(1), SI_VAR(2), SI_VAR(3), SI_VAR(4)), @@ -203,7 +205,7 @@ s32 N(treeEffectVectors_Tree1)[] = { 0x00000002, 0xFFFFFFB0, 0x00000082, 0x00000012, 0x0000001C, 0x00000082, 0x00000027, }; -Script N(Tree1_Callback) = SCRIPT({ +Script N(tree1_Callback) = SCRIPT({ if (SI_SAVE_FLAG(53) == 1) { return; } @@ -212,27 +214,27 @@ Script N(Tree1_Callback) = SCRIPT({ } sleep 10; GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); - if (SI_VAR(0) < 0xFFFFFFE2) { - MakeItemEntity(138, 0xFFFFFFE9, 100, 35, 13, SI_SAVE_FLAG(53)); + if (SI_VAR(0) < -30) { + MakeItemEntity(ITEM_MUSHROOM, -23, 100, 35, 13, SI_SAVE_FLAG(53)); } else { - MakeItemEntity(138, 0xFFFFFFAB, 100, 16, 13, SI_SAVE_FLAG(53)); + MakeItemEntity(ITEM_MUSHROOM, -85, 100, 16, 13, SI_SAVE_FLAG(53)); } SI_MAP_FLAG(10) = 1; }); s32 N(shakeTreeEvent_Tree1)[] = { - N(treeModelList_Tree1_Leaves), N(treeModelList_Tree1_Trunk), 0x00000000, N(treeEffectVectors_Tree1), N(Tree1_Callback), + N(treeModelList_Tree1_Leaves), N(treeModelList_Tree1_Trunk), 0x00000000, N(treeEffectVectors_Tree1), N(tree1_Callback), }; s32 N(triggerCoord_802422A8)[] = { 0xC2280000, 0x00000000, 0xC1500000, 0x00000000, }; -Script N(Script_802422B8) = SCRIPT({ +Script N(802422B8) = SCRIPT({ SI_VAR(0) = N(searchBushEvent_Bush1); - bind N(SearchBush_802417F0) to TRIGGER_WALL_PRESS_A 53; + bind N(searchBush_802417F0) to TRIGGER_WALL_PRESS_A 53; SI_VAR(0) = N(shakeTreeEvent_Tree1); - bind N(ShakeTree_80241B50) to TRIGGER_WALL_HAMMER 52; - bind N(ShakeTree_80241B50) to TRIGGER_POINT_BOMB N(triggerCoord_802422A8); + bind N(shakeTree_80241B50) to TRIGGER_WALL_HAMMER 52; + bind N(shakeTree_80241B50) to TRIGGER_POINT_BOMB N(triggerCoord_802422A8); }); diff --git a/src/world/area_kmr/kmr_03/8C85E0.c b/src/world/area_kmr/kmr_03/8C85E0.c index cb9bd003af..2ef930b3dd 100644 --- a/src/world/area_kmr/kmr_03/8C85E0.c +++ b/src/world/area_kmr/kmr_03/8C85E0.c @@ -1,16 +1,16 @@ #include "kmr_03.h" -Script N(Script_80242340) = SCRIPT({ - UseSettingsFrom(0, 0xFFFFFEF2, 20, 0xFFFFFFB0); - SetPanTarget(0, 0xFFFFFEF2, 20, 0xFFFFFFB0); +Script N(80242340) = SCRIPT({ + UseSettingsFrom(0, -270, 20, -80); + SetPanTarget(0, -270, 20, -80); SetCamDistance(0, 700.0); SetCamSpeed(0, 90.0); PanToTarget(0, 0, 1); if (STORY_PROGRESS >= STORY_CH0_FOUND_HAMMER) { - SetPlayerPos(0, 0xFFFFFC18, 0); - DisablePlayerInput(1); - SetPlayerPos(0xFFFFFF20, 20, 0xFFFFFFB0); - SetNpcPos(0xFFFFFFFC, 0xFFFFFF20, 20, 0xFFFFFFB0); + SetPlayerPos(0, -1000, 0); + DisablePlayerInput(TRUE); + SetPlayerPos(-224, 20, -80); + SetNpcPos(NPC_PARTNER, -224, 20, -80); sleep 20; SetCamSpeed(0, 3.0); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); @@ -19,13 +19,13 @@ Script N(Script_80242340) = SCRIPT({ PanToTarget(0, 0, 1); WaitForCam(0, 1.0); PanToTarget(0, 0, 0); - DisablePlayerInput(0); + DisablePlayerInput(FALSE); return; } - DisablePlayerInput(1); - DisablePlayerPhysics(1); + DisablePlayerInput(TRUE); + DisablePlayerPhysics(TRUE); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); - SetPlayerPos(SI_VAR(0), 0xFFFFFC18, SI_VAR(2)); + SetPlayerPos(SI_VAR(0), -1000, SI_VAR(2)); sleep 30; SetCamDistance(0, 220); SetCamSpeed(0, 1.0); @@ -39,38 +39,38 @@ Script N(Script_80242340) = SCRIPT({ sleep 28; PlaySoundAtPlayer(373, 0); } - HidePlayerShadow(1); - SetPlayerAnimation(0x10002); - SetPlayerPos(0xFFFFFF20, 120, 0xFFFFFFB0); + HidePlayerShadow(TRUE); + SetPlayerAnimation(ANIM_10002); + SetPlayerPos(-224, 120, -80); InterpPlayerYaw(90, 0); -0: // TODO: this is a do..while +0: sleep 1; GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); - SI_VAR(1) += 0xFFFFFFFE; + SI_VAR(1) += -2; SetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); if (SI_VAR(1) > 86) { goto 0; } - SetPlayerPos(0xFFFFFECA, 20, 0xFFFFFFB0); + SetPlayerPos(-310, 20, -80); spawn { sleep 20; - SetPanTarget(0, 0xFFFFFECA, 20, 0xFFFFFFB0); + SetPanTarget(0, -310, 20, -80); SetCamSpeed(0, 0.2001953125); PanToTarget(0, 0, 1); } - 0x802D286C(0x2800); - 0x802D2520(0x10002, 5, 5, 1, 1, 0); + func_802D286C(10240); + func_802D2520(ANIM_10002, 5, 5, 1, 1, 0); sleep 100; WaitForCam(0, 1.0); - 0x802D2520(0x10002, 0, 0, 0, 0, 0); - HidePlayerShadow(0); - SetPlayerAnimation(0x10006); + func_802D2520(ANIM_10002, 0, 0, 0, 0, 0); + HidePlayerShadow(FALSE); + SetPlayerAnimation(ANIM_BEFORE_JUMP); sleep 10; - SetPlayerAnimation(0x10007); + SetPlayerAnimation(ANIM_MIDAIR_STILL); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetPlayerJumpscale(1.0); PlayerJump(SI_VAR(0), SI_VAR(1), SI_VAR(2), 10); - SetPlayerAnimation(0x10002); + SetPlayerAnimation(ANIM_10002); spawn { SetCamSpeed(0, 3.0); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); @@ -81,6 +81,6 @@ Script N(Script_80242340) = SCRIPT({ PanToTarget(0, 0, 0); } sleep 30; - DisablePlayerPhysics(0); - DisablePlayerInput(0); + DisablePlayerPhysics(FALSE); + DisablePlayerInput(FALSE); }); diff --git a/src/world/area_kmr/kmr_03/kmr_03.h b/src/world/area_kmr/kmr_03/kmr_03.h index 6878c0fd34..9da2c645df 100644 --- a/src/world/area_kmr/kmr_03/kmr_03.h +++ b/src/world/area_kmr/kmr_03/kmr_03.h @@ -4,6 +4,8 @@ #define NAMESPACE kmr_03 -ApiStatus func_80240000_8C7F90(ScriptInstance* script, s32 isInitialCall); -Script N(Main); -Script N(Script_802406C0); +ApiStatus N(func_80240000_8C7F90)(ScriptInstance* script, s32 isInitialCall); +ApiStatus func_802D286C(ScriptInstance* script, s32 isInitialCall); +ApiStatus func_802D2520(ScriptInstance* script, s32 isInitialCall); +Script N(main); +Script N(802406C0); diff --git a/src/world/area_kmr/kmr_04/8CA960.c b/src/world/area_kmr/kmr_04/8CA960.c index 9a838bf384..47965e9012 100644 --- a/src/world/area_kmr/kmr_04/8CA960.c +++ b/src/world/area_kmr/kmr_04/8CA960.c @@ -7,6 +7,29 @@ #define NAMESPACE kmr_04 INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_802402C8_8CABC8); +/* +ApiStatus N(func_802402C8_8CABC8)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_05/8CE070.c b/src/world/area_kmr/kmr_05/8CE070.c index e672971627..a4c6333e3b 100644 --- a/src/world/area_kmr/kmr_05/8CE070.c +++ b/src/world/area_kmr/kmr_05/8CE070.c @@ -1,23 +1,243 @@ #include "kmr_05.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240000_8CE070); +/* +void N(func_80240000_8CE070)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_802401B0_8CE220); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240898_8CE908); +/* +void N(func_80240898_8CE908)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240C54_8CECC4); +/* +void N(func_80240C54_8CECC4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240E58_8CEEC8); +/* +void N(func_80240E58_8CEEC8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_802411E8_8CF258); +/* +void N(func_802411E8_8CF258)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_8024130C_8CF37C); diff --git a/src/world/area_kmr/kmr_06/8D1510.c b/src/world/area_kmr/kmr_06/8D1510.c index 2a1e76af19..e5f8332da6 100644 --- a/src/world/area_kmr/kmr_06/8D1510.c +++ b/src/world/area_kmr/kmr_06/8D1510.c @@ -1,23 +1,243 @@ #include "kmr_06.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240000_8D1510); +/* +void N(func_80240000_8D1510)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_802401B0_8D16C0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240898_8D1DA8); +/* +void N(func_80240898_8D1DA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240C54_8D2164); +/* +void N(func_80240C54_8D2164)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240E58_8D2368); +/* +void N(func_80240E58_8D2368)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_802411E8_8D26F8); +/* +void N(func_802411E8_8D26F8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_8024130C_8D281C); diff --git a/src/world/area_kmr/kmr_07/8D3DC0.c b/src/world/area_kmr/kmr_07/8D3DC0.c index b138422dcb..07f63150af 100644 --- a/src/world/area_kmr/kmr_07/8D3DC0.c +++ b/src/world/area_kmr/kmr_07/8D3DC0.c @@ -4,15 +4,15 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_07/8D3DC0", func_80240000_8D3DC0); INCLUDE_ASM(s32, "world/area_kmr/kmr_07/8D3DC0", func_802400B4_8D3E74); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_07/8D3DC0", func_80240540_8D4300); diff --git a/src/world/area_kmr/kmr_09/8D5E00.c b/src/world/area_kmr/kmr_09/8D5E00.c index fc9ea8ac4a..747e8bf3e2 100644 --- a/src/world/area_kmr/kmr_09/8D5E00.c +++ b/src/world/area_kmr/kmr_09/8D5E00.c @@ -1,24 +1,244 @@ #include "kmr_09.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240000_8D5E00); +/* +void N(func_80240000_8D5E00)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802401B0_8D5FB0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240898_8D6698); +/* +void N(func_80240898_8D6698)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240C54_8D6A54); +/* +void N(func_80240C54_8D6A54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240E58_8D6C58); +/* +void N(func_80240E58_8D6C58)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802411E8_8D6FE8); +/* +void N(func_802411E8_8D6FE8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_8024130C_8D710C); diff --git a/src/world/area_kmr/kmr_10/8D84D0.c b/src/world/area_kmr/kmr_10/8D84D0.c index a01192fcd3..30384af4c0 100644 --- a/src/world/area_kmr/kmr_10/8D84D0.c +++ b/src/world/area_kmr/kmr_10/8D84D0.c @@ -1,6 +1,29 @@ #include "kmr_10.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_10/8D84D0", func_80240000_8D84D0); +/* +ApiStatus N(func_80240000_8D84D0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kmr/kmr_11/8DA3A0.c b/src/world/area_kmr/kmr_11/8DA3A0.c index 0cf875e209..c665873518 100644 --- a/src/world/area_kmr/kmr_11/8DA3A0.c +++ b/src/world/area_kmr/kmr_11/8DA3A0.c @@ -8,15 +8,15 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_11/8DA3A0", func_80240370_8DA470); INCLUDE_ASM(s32, "world/area_kmr/kmr_11/8DA3A0", func_80240424_8DA524); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_kmr/kmr_11/8DA3A0", func_802408B0_8DA9B0); diff --git a/src/world/area_kmr/kmr_12/events.c b/src/world/area_kmr/kmr_12/events.c index 62d8deeb6a..223084c72b 100644 --- a/src/world/area_kmr/kmr_12/events.c +++ b/src/world/area_kmr/kmr_12/events.c @@ -201,13 +201,13 @@ Script N(ReadEastSign) = SCRIPT({ group 0; func_802D5830(1); - DisablePlayerInput(1); + DisablePlayerInput(TRUE); ShowMessageAtScreenPos(MSG_kmr_12_sign_to_fortress, 160, 40); - DisablePlayerInput(0); + DisablePlayerInput(FALSE); func_802D5830(0); }); Script N(MakeEntities) = SCRIPT({ - MakeEntity(0x802EAFDC, 436, 0, -42, 0, 0x80000000); + MakeEntity(0x802EAFDC, 436, 0, -42, 0, MAKE_ENTITY_END); AssignScript(N(ReadEastSign)); }); diff --git a/src/world/area_kmr/kmr_12/header.c b/src/world/area_kmr/kmr_12/header.c index 7f9ffc8944..dc7c679628 100644 --- a/src/world/area_kmr/kmr_12/header.c +++ b/src/world/area_kmr/kmr_12/header.c @@ -1,7 +1,7 @@ #include "kmr_12.h" #include "message_ids.h" -Vec4f N(entryList)[] = { +EntryList N(entryList) = { { -126.0f, 0.0f, 12.0f, 90.0f }, // west, towards Red/Blue Goomba miniboss room { 471.0f, 0.0f, 12.0f, 270.0f }, // east, towards Goomba King's Fortress }; diff --git a/src/world/area_kmr/kmr_20/8ED440.c b/src/world/area_kmr/kmr_20/8ED440.c index 4ed9ae7291..49ad544edc 100644 --- a/src/world/area_kmr/kmr_20/8ED440.c +++ b/src/world/area_kmr/kmr_20/8ED440.c @@ -1,6 +1,29 @@ #include "kmr_20.h" INCLUDE_ASM(s32, "world/area_kmr/kmr_20/8ED440", func_80241620_8ED440); +/* +ApiStatus N(func_80241620_8ED440)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_14/A57830.c b/src/world/area_kpa/kpa_14/A57830.c index 98dc749486..56e95fb42b 100644 --- a/src/world/area_kpa/kpa_14/A57830.c +++ b/src/world/area_kpa/kpa_14/A57830.c @@ -1,6 +1,29 @@ #include "kpa_14.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_14/A57830", func_80240380_A57830); +/* +ApiStatus N(func_80240380_A57830)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_15/A596A0.c b/src/world/area_kpa/kpa_15/A596A0.c index d311dc3f57..e20a2ac2b1 100644 --- a/src/world/area_kpa/kpa_15/A596A0.c +++ b/src/world/area_kpa/kpa_15/A596A0.c @@ -1,6 +1,29 @@ #include "kpa_15.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_15/A596A0", func_80240310_A596A0); +/* +ApiStatus N(func_80240310_A596A0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kpa/kpa_81/A78510.c b/src/world/area_kpa/kpa_81/A78510.c index e87e2318c4..091feed5c3 100644 --- a/src/world/area_kpa/kpa_81/A78510.c +++ b/src/world/area_kpa/kpa_81/A78510.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_8024027C_A7873C); +/* +ApiStatus N(func_8024027C_A7873C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_802402D0_A78790); +/* +ApiStatus N(func_802402D0_A78790)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_81/A78510", func_80240308_A787C8); diff --git a/src/world/area_kpa/kpa_82/A7A550.c b/src/world/area_kpa/kpa_82/A7A550.c index 47a0a45ba9..53d0d29cea 100644 --- a/src/world/area_kpa/kpa_82/A7A550.c +++ b/src/world/area_kpa/kpa_82/A7A550.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_8024027C_A7A77C); +/* +ApiStatus N(func_8024027C_A7A77C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_802402D0_A7A7D0); +/* +ApiStatus N(func_802402D0_A7A7D0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_82/A7A550", func_80240308_A7A808); diff --git a/src/world/area_kpa/kpa_91/A86A50.c b/src/world/area_kpa/kpa_91/A86A50.c index 41bf56864a..7963f268a3 100644 --- a/src/world/area_kpa/kpa_91/A86A50.c +++ b/src/world/area_kpa/kpa_91/A86A50.c @@ -1,26 +1,202 @@ #include "kpa_91.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240000_A86A50); +/* +ApiStatus N(func_80240000_A86A50)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240158_A86BA8); +/* +void N(func_80240158_A86BA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_802404C0_A86F10); +/* +void N(func_802404C0_A86F10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_8024067C_A870CC); +/* +ApiStatus N(func_8024067C_A870CC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_8024094C_A8739C); +/* +ApiStatus N(func_8024094C_A8739C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240AD4_A87524); +/* +void N(func_80240AD4_A87524)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240B94_A875E4); diff --git a/src/world/area_kpa/kpa_95/A8CB60.c b/src/world/area_kpa/kpa_95/A8CB60.c index 5486b87b3c..44de64ea55 100644 --- a/src/world/area_kpa/kpa_95/A8CB60.c +++ b/src/world/area_kpa/kpa_95/A8CB60.c @@ -1,26 +1,202 @@ #include "kpa_95.h" INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_802400E0_A8CB60); +/* +ApiStatus N(func_802400E0_A8CB60)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240238_A8CCB8); +/* +void N(func_80240238_A8CCB8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_802405A0_A8D020); +/* +void N(func_802405A0_A8D020)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_8024075C_A8D1DC); +/* +ApiStatus N(func_8024075C_A8D1DC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240A2C_A8D4AC); +/* +ApiStatus N(func_80240A2C_A8D4AC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240BB4_A8D634); +/* +void N(func_80240BB4_A8D634)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240C74_A8D6F4); diff --git a/src/world/area_kzn/kzn_02/C5AC20.c b/src/world/area_kzn/kzn_02/C5AC20.c index c25d9c03d4..35fa36b3a3 100644 --- a/src/world/area_kzn/kzn_02/C5AC20.c +++ b/src/world/area_kzn/kzn_02/C5AC20.c @@ -1,24 +1,244 @@ #include "kzn_02.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802404E0_C5AC20); +/* +void N(func_802404E0_C5AC20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80240690_C5ADD0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80240D78_C5B4B8); +/* +void N(func_80240D78_C5B4B8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241134_C5B874); +/* +void N(func_80241134_C5B874)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241338_C5BA78); +/* +void N(func_80241338_C5BA78)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802416C8_C5BE08); +/* +void N(func_802416C8_C5BE08)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802417EC_C5BF2C); @@ -31,6 +251,29 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241D88_C5C4C8); INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241DE4_C5C524); INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241FCC_C5C70C); +/* +ApiStatus N(func_80241FCC_C5C70C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -39,8 +282,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80241FCC_C5C70C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80242310_C5CA50); +/* +ApiStatus N(func_80242310_C5CA50)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80242364_C5CAA4); +/* +ApiStatus N(func_80242364_C5CAA4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_8024239C_C5CADC); diff --git a/src/world/area_kzn/kzn_03/C61020.c b/src/world/area_kzn/kzn_03/C61020.c index 5b5f44be77..db64a7912b 100644 --- a/src/world/area_kzn/kzn_03/C61020.c +++ b/src/world/area_kzn/kzn_03/C61020.c @@ -43,6 +43,29 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80242260_C62F70); INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024234C_C6305C); INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024259C_C632AC); +/* +ApiStatus N(func_8024259C_C632AC)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -51,8 +74,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024259C_C632AC); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_802428E0_C635F0); +/* +ApiStatus N(func_802428E0_C635F0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_80242934_C63644); +/* +ApiStatus N(func_80242934_C63644)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024296C_C6367C); diff --git a/src/world/area_kzn/kzn_04/C68440.c b/src/world/area_kzn/kzn_04/C68440.c index 1f2a7f7b51..2b9d78823e 100644 --- a/src/world/area_kzn/kzn_04/C68440.c +++ b/src/world/area_kzn/kzn_04/C68440.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_8024032C_C6845C); INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_8024034C_C6847C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80240378_C684A8); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80240430_C68560); INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_802404DC_C6860C); INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_8024072C_C6885C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80240758_C68888); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80240E48_C68F78); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80241018_C69148); +INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_80241018_C69148); \ No newline at end of file diff --git a/src/world/area_kzn/kzn_07/C6EA50.c b/src/world/area_kzn/kzn_07/C6EA50.c index e8d5140a9c..2997de9c70 100644 --- a/src/world/area_kzn/kzn_07/C6EA50.c +++ b/src/world/area_kzn/kzn_07/C6EA50.c @@ -5,24 +5,244 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80240720_C6EA50); INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802407F4_C6EB24); INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80240820_C6EB50); +/* +void N(func_80240820_C6EB50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802409D0_C6ED00); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802410B8_C6F3E8); +/* +void N(func_802410B8_C6F3E8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241474_C6F7A4); +/* +void N(func_80241474_C6F7A4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241678_C6F9A8); +/* +void N(func_80241678_C6F9A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241A08_C6FD38); +/* +void N(func_80241A08_C6FD38)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80241B2C_C6FE5C); diff --git a/src/world/area_kzn/kzn_08/C71C10.c b/src/world/area_kzn/kzn_08/C71C10.c index df32b34791..89ed25f8f5 100644 --- a/src/world/area_kzn/kzn_08/C71C10.c +++ b/src/world/area_kzn/kzn_08/C71C10.c @@ -1,6 +1,29 @@ #include "kzn_08.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71C10", func_80240790_C71C10); +/* +ApiStatus N(func_80240790_C71C10)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_kzn/kzn_08/C71ED0.c b/src/world/area_kzn/kzn_08/C71ED0.c index 6d1e4dfad0..08cc2d1848 100644 --- a/src/world/area_kzn/kzn_08/C71ED0.c +++ b/src/world/area_kzn/kzn_08/C71ED0.c @@ -1,24 +1,244 @@ #include "kzn_08.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240A50_C71ED0); +/* +void N(func_80240A50_C71ED0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240C00_C72080); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_802412E8_C72768); +/* +void N(func_802412E8_C72768)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_802416A4_C72B24); +/* +void N(func_802416A4_C72B24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_802418A8_C72D28); +/* +void N(func_802418A8_C72D28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80241C38_C730B8); +/* +void N(func_80241C38_C730B8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80241D5C_C731DC); diff --git a/src/world/area_kzn/kzn_09/C76CE0.c b/src/world/area_kzn/kzn_09/C76CE0.c index d780ac7568..0918139bd1 100644 --- a/src/world/area_kzn/kzn_09/C76CE0.c +++ b/src/world/area_kzn/kzn_09/C76CE0.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_8024001C_C76CFC); INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_8024003C_C76D1C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240068_C76D48); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240120_C76E00); INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_802401CC_C76EAC); INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_8024041C_C770FC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240448_C77128); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240B38_C77818); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240D08_C779E8); +INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_80240D08_C779E8); \ No newline at end of file diff --git a/src/world/area_kzn/kzn_09/C77D00.c b/src/world/area_kzn/kzn_09/C77D00.c index 06a6498e2c..b51646a881 100644 --- a/src/world/area_kzn/kzn_09/C77D00.c +++ b/src/world/area_kzn/kzn_09/C77D00.c @@ -43,6 +43,29 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80242D58_C79A38); #include "world/common/AwaitPlayerNearNpc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802432AC_C79F8C); +/* +ApiStatus N(func_802432AC_C79F8C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -51,8 +74,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802432AC_C79F8C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_802435F0_C7A2D0); +/* +ApiStatus N(func_802435F0_C7A2D0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80243644_C7A324); +/* +ApiStatus N(func_80243644_C7A324)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_8024367C_C7A35C); diff --git a/src/world/area_kzn/kzn_11/C80600.c b/src/world/area_kzn/kzn_11/C80600.c index 8657ab3a60..54af25a357 100644 --- a/src/world/area_kzn/kzn_11/C80600.c +++ b/src/world/area_kzn/kzn_11/C80600.c @@ -1,24 +1,244 @@ #include "kzn_11.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240460_C80600); +/* +void N(func_80240460_C80600)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240610_C807B0); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240CF8_C80E98); +/* +void N(func_80240CF8_C80E98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_802410B4_C81254); +/* +void N(func_802410B4_C81254)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_802412B8_C81458); +/* +void N(func_802412B8_C81458)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80241648_C817E8); +/* +void N(func_80241648_C817E8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_8024176C_C8190C); diff --git a/src/world/area_kzn/kzn_17/C85DC0.c b/src/world/area_kzn/kzn_17/C85DC0.c index 696a4b76b2..e8bc81262e 100644 --- a/src/world/area_kzn/kzn_17/C85DC0.c +++ b/src/world/area_kzn/kzn_17/C85DC0.c @@ -43,6 +43,29 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242048_C87AF8); #include "world/common/AwaitPlayerNearNpc.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_8024259C_C8804C); +/* +ApiStatus N(func_8024259C_C8804C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -51,8 +74,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_8024259C_C8804C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_802428E0_C88390); +/* +ApiStatus N(func_802428E0_C88390)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80242934_C883E4); +/* +ApiStatus N(func_80242934_C883E4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_8024296C_C8841C); diff --git a/src/world/area_kzn/kzn_19/C8DBB0.c b/src/world/area_kzn/kzn_19/C8DBB0.c index 8f1f330e34..44d3dce900 100644 --- a/src/world/area_kzn/kzn_19/C8DBB0.c +++ b/src/world/area_kzn/kzn_19/C8DBB0.c @@ -5,16 +5,101 @@ #include "world/common/UnkTexturePanFunc2.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_8024030C_C8DEBC); +/* +ApiStatus N(func_8024030C_C8DEBC)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80240358_C8DF08); +/* +ApiStatus N(func_80240358_C8DF08)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802404B8_C8E068); INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802408C8_C8E478); +/* +ApiStatus N(func_802408C8_C8E478)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80240908_C8E4B8); +/* +ApiStatus N(func_80240908_C8E4B8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80240A14_C8E5C4); +/* +ApiStatus N(func_80240A14_C8E5C4)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (dist2D(playerStatus->position.x, playerStatus->position.z, + ptr->unk_18, ptr->unk_20) <= 30.0f) { + ptr->unk_4E = 3; + } + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80240B00_C8E6B0); @@ -33,6 +118,29 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802413FC_C8EFAC); INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_8024140C_C8EFBC); INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241468_C8F018); +/* +ApiStatus N(func_80241468_C8F018)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -41,8 +149,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241468_C8F018); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_802417AC_C8F35C); +/* +ApiStatus N(func_802417AC_C8F35C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241800_C8F3B0); +/* +ApiStatus N(func_80241800_C8F3B0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_19/C8DBB0", func_80241838_C8F3E8); diff --git a/src/world/area_kzn/kzn_20/C96240.c b/src/world/area_kzn/kzn_20/C96240.c index 65c2519f7d..757e467596 100644 --- a/src/world/area_kzn/kzn_20/C96240.c +++ b/src/world/area_kzn/kzn_20/C96240.c @@ -1,6 +1,29 @@ #include "kzn_20.h" INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240310_C96240); +/* +ApiStatus N(func_80240310_C96240)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240310_C96240); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_80240654_C96584); +/* +ApiStatus N(func_80240654_C96584)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_802406A8_C965D8); +/* +ApiStatus N(func_802406A8_C965D8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_kzn/kzn_20/C96240", func_802406E0_C96610); diff --git a/src/world/area_mac/mac_00/7EB340.c b/src/world/area_mac/mac_00/7EB340.c index d1390e980c..435f9cc020 100644 --- a/src/world/area_mac/mac_00/7EB340.c +++ b/src/world/area_mac/mac_00/7EB340.c @@ -3,6 +3,29 @@ #define UNK_ALPHA_FUNC_NPC 6 INCLUDE_ASM(s32, "world/area_mac/mac_00/7EB340", func_80240630_7EB340); +/* +ApiStatus N(func_80240630_7EB340)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -57,8 +80,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_00/7EB340", func_80241694_7EC3A4); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_00/7EB340", func_802418F0_7EC600); +/* +ApiStatus N(func_802418F0_7EC600)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7EB340", func_80241944_7EC654); +/* +ApiStatus N(func_80241944_7EC654)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7EB340", func_8024197C_7EC68C); diff --git a/src/world/area_mac/mac_00/7ED280.c b/src/world/area_mac/mac_00/7ED280.c index 1aaade429c..7f47d8bfd8 100644 --- a/src/world/area_mac/mac_00/7ED280.c +++ b/src/world/area_mac/mac_00/7ED280.c @@ -1,30 +1,229 @@ #include "mac_00.h" INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242570_7ED280); +/* +ApiStatus N(func_80242570_7ED280)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_802426C8_7ED3D8); +/* +void N(func_802426C8_7ED3D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242A30_7ED740); +/* +void N(func_80242A30_7ED740)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242BEC_7ED8FC); +/* +ApiStatus N(func_80242BEC_7ED8FC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); -# include "world/common/NpcJumpFunc2.inc.c" + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc2.inc.c" + +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242EBC_7EDBCC); +/* +ApiStatus N(func_80242EBC_7EDBCC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243044_7EDD54); +/* +void N(func_80243044_7EDD54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243104_7EDE14); INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243400_7EE110); +/* +ApiStatus N(func_80243400_7EE110)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup_mac_00 #include "world/common/GetItemName.inc.c" @@ -39,8 +238,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243400_7EE110); #define NAMESPACE mac_00 INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243744_7EE454); +/* +ApiStatus N(func_80243744_7EE454)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80243798_7EE4A8); +/* +ApiStatus N(func_80243798_7EE4A8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_802437D0_7EE4E0); diff --git a/src/world/area_mac/mac_01/8017D0.c b/src/world/area_mac/mac_01/8017D0.c index 34d7376970..4beb806a66 100644 --- a/src/world/area_mac/mac_01/8017D0.c +++ b/src/world/area_mac/mac_01/8017D0.c @@ -7,16 +7,151 @@ extern u8 D_80258407_818C87; #include "world/common/UnkMusicFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241080_801900); +/* +ApiStatus N(func_80241080_801900)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_802411D8_801A58); +/* +void N(func_802411D8_801A58)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #define NAMESPACE dup_mac_01 #include "world/common/UnkNpcAIFunc1.inc.c" #define NAMESPACE mac_01 INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241540_801DC0); +/* +void N(func_80241540_801DC0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_802416FC_801F7C); +/* +ApiStatus N(func_802416FC_801F7C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #define NAMESPACE dup_mac_01 #include "world/common/NpcJumpFunc2.inc.c" @@ -31,16 +166,80 @@ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_802416FC_801F7C); #define NAMESPACE mac_01 INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_802419CC_80224C); +/* +ApiStatus N(func_802419CC_80224C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #define NAMESPACE dup_mac_01 #include "world/common/UnkNpcDurationFlagFunc.inc.c" #define NAMESPACE mac_01 INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241B54_8023D4); +/* +void N(func_80241B54_8023D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241C14_802494); INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241F10_802790); +/* +ApiStatus N(func_80241F10_802790)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -131,8 +330,38 @@ ApiStatus func_80243AA0_804320(ScriptInstance* script, s32 isInitialCall) { #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80243CD4_804554); +/* +ApiStatus N(func_80243CD4_804554)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80243D28_8045A8); +/* +ApiStatus N(func_80243D28_8045A8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80243D60_8045E0); diff --git a/src/world/area_mac/mac_01/805DD0.c b/src/world/area_mac/mac_01/805DD0.c index 83f8bf3b3c..318e677410 100644 --- a/src/world/area_mac/mac_01/805DD0.c +++ b/src/world/area_mac/mac_01/805DD0.c @@ -1,26 +1,202 @@ #include "mac_01.h" INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245550_805DD0); +/* +ApiStatus N(func_80245550_805DD0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_802456A8_805F28); +/* +void N(func_802456A8_805F28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245A10_806290); +/* +void N(func_80245A10_806290)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245BCC_80644C); +/* +ApiStatus N(func_80245BCC_80644C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245E9C_80671C); +/* +ApiStatus N(func_80245E9C_80671C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80246024_8068A4); +/* +void N(func_80246024_8068A4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_802460E4_806964); diff --git a/src/world/area_mac/mac_02/823BF0.c b/src/world/area_mac/mac_02/823BF0.c index a12c34bbeb..f7ce884d1e 100644 --- a/src/world/area_mac/mac_02/823BF0.c +++ b/src/world/area_mac/mac_02/823BF0.c @@ -3,30 +3,229 @@ #define UNK_ALPHA_FUNC_NPC 12 INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240930_823BF0); +/* +ApiStatus N(func_80240930_823BF0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240A88_823D48); +/* +void N(func_80240A88_823D48)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240DF0_8240B0); +/* +void N(func_80240DF0_8240B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240FAC_82426C); +/* +ApiStatus N(func_80240FAC_82426C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_8024127C_82453C); +/* +ApiStatus N(func_8024127C_82453C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80241404_8246C4); +/* +void N(func_80241404_8246C4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_802414C4_824784); INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_802417C0_824A80); +/* +ApiStatus N(func_802417C0_824A80)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -81,8 +280,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80242824_825AE4); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80242A80_825D40); +/* +ApiStatus N(func_80242A80_825D40)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80242AD4_825D94); +/* +ApiStatus N(func_80242AD4_825D94)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80242B0C_825DCC); diff --git a/src/world/area_mac/mac_03/831B20.c b/src/world/area_mac/mac_03/831B20.c index d1c54d8144..04d83e15a8 100644 --- a/src/world/area_mac/mac_03/831B20.c +++ b/src/world/area_mac/mac_03/831B20.c @@ -5,6 +5,29 @@ #include "common/UnkFloatFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_03/831B20", func_802404B0_831CB0); +/* +ApiStatus N(func_802404B0_831CB0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -59,8 +82,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_03/831B20", func_80241514_832D14); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_03/831B20", func_80241770_832F70); +/* +ApiStatus N(func_80241770_832F70)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_03/831B20", func_802417C4_832FC4); +/* +ApiStatus N(func_802417C4_832FC4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_03/831B20", func_802417FC_832FFC); diff --git a/src/world/area_mac/mac_04/843030.c b/src/world/area_mac/mac_04/843030.c index be13c4beab..e88bdb37e2 100644 --- a/src/world/area_mac/mac_04/843030.c +++ b/src/world/area_mac/mac_04/843030.c @@ -3,6 +3,29 @@ #define UNK_ALPHA_FUNC_NPC 20 INCLUDE_ASM(s32, "world/area_mac/mac_04/843030", func_80240460_843030); +/* +ApiStatus N(func_80240460_843030)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -57,8 +80,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_04/843030", func_802414C4_844094); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_04/843030", func_80241720_8442F0); +/* +ApiStatus N(func_80241720_8442F0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_04/843030", func_80241774_844344); +/* +ApiStatus N(func_80241774_844344)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_04/843030", func_802417AC_84437C); diff --git a/src/world/area_mac/mac_05/852170.c b/src/world/area_mac/mac_05/852170.c index 94deac4ce6..379ba77360 100644 --- a/src/world/area_mac/mac_05/852170.c +++ b/src/world/area_mac/mac_05/852170.c @@ -11,30 +11,229 @@ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024030C_85247C); INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024047C_8525EC); INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240490_852600); +/* +ApiStatus N(func_80240490_852600)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_802405E8_852758); +/* +void N(func_802405E8_852758)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240950_852AC0); +/* +void N(func_80240950_852AC0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240B0C_852C7C); +/* +ApiStatus N(func_80240B0C_852C7C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240DDC_852F4C); +/* +ApiStatus N(func_80240DDC_852F4C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240F64_8530D4); +/* +void N(func_80240F64_8530D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80241024_853194); INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80241320_853490); +/* +ApiStatus N(func_80241320_853490)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -89,8 +288,38 @@ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80242384_8544F4); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_802425E0_854750); +/* +ApiStatus N(func_802425E0_854750)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80242634_8547A4); +/* +ApiStatus N(func_80242634_8547A4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024266C_8547DC); diff --git a/src/world/area_mgm/mgm_00/E0E7A0.c b/src/world/area_mgm/mgm_00/E0E7A0.c index ed552eeb1b..935209d1a0 100644 --- a/src/world/area_mgm/mgm_00/E0E7A0.c +++ b/src/world/area_mgm/mgm_00/E0E7A0.c @@ -13,26 +13,202 @@ INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240034_E0E7D4); #include "world/common/SomeXYZFunc2.inc.c" INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_802402E0_E0EA80); +/* +ApiStatus N(func_802402E0_E0EA80)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240438_E0EBD8); +/* +void N(func_80240438_E0EBD8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_802407A0_E0EF40); +/* +void N(func_802407A0_E0EF40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_8024095C_E0F0FC); +/* +ApiStatus N(func_8024095C_E0F0FC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240C2C_E0F3CC); +/* +ApiStatus N(func_80240C2C_E0F3CC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240DB4_E0F554); +/* +void N(func_80240DB4_E0F554)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_80240E74_E0F614); diff --git a/src/world/area_mim/mim_02/B97C70.c b/src/world/area_mim/mim_02/B97C70.c index 99a76e7503..f6b8fb3f7b 100644 --- a/src/world/area_mim/mim_02/B97C70.c +++ b/src/world/area_mim/mim_02/B97C70.c @@ -21,7 +21,37 @@ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_80240C60_B98860); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_802410B0_B98CB0); +/* +ApiStatus N(func_802410B0_B98CB0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_80241104_B98D04); +/* +ApiStatus N(func_80241104_B98D04)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_mim/mim_02/B97C70", func_8024113C_B98D3C); diff --git a/src/world/area_mim/mim_04/B9DB60.c b/src/world/area_mim/mim_04/B9DB60.c index 2353199354..f0060a107f 100644 --- a/src/world/area_mim/mim_04/B9DB60.c +++ b/src/world/area_mim/mim_04/B9DB60.c @@ -17,5 +17,28 @@ INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80240AAC_B9E40C); INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80240DF0_B9E750); INCLUDE_ASM(s32, "world/area_mim/mim_04/B9DB60", func_80241014_B9E974); +/* +ApiStatus N(func_80241014_B9E974)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_mim/mim_08/BAD940.c b/src/world/area_mim/mim_08/BAD940.c index b0f26d3f74..47325f8b40 100644 --- a/src/world/area_mim/mim_08/BAD940.c +++ b/src/world/area_mim/mim_08/BAD940.c @@ -5,24 +5,244 @@ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240000_BAD940); INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240068_BAD9A8); INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_802400A0_BAD9E0); +/* +void N(func_802400A0_BAD9E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240250_BADB90); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240938_BAE278); +/* +void N(func_80240938_BAE278)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240CF4_BAE634); +/* +void N(func_80240CF4_BAE634)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240EF8_BAE838); +/* +void N(func_80240EF8_BAE838)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80241288_BAEBC8); +/* +void N(func_80241288_BAEBC8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_802413AC_BAECEC); diff --git a/src/world/area_nok/nok_01/9C53E0.c b/src/world/area_nok/nok_01/9C53E0.c index e14d4eaca3..341f9fb27d 100644 --- a/src/world/area_nok/nok_01/9C53E0.c +++ b/src/world/area_nok/nok_01/9C53E0.c @@ -6,15 +6,15 @@ INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80240000_9C53E0); INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_802400B4_9C5494); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80240540_9C5920); @@ -43,6 +43,29 @@ INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80240C80_9C6060); INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80240D60_9C6140); INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80240D68_9C6148); +/* +ApiStatus N(func_80240D68_9C6148)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -97,8 +120,38 @@ INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80241DCC_9C71AC); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_80242028_9C7408); +/* +ApiStatus N(func_80242028_9C7408)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_8024207C_9C745C); +/* +ApiStatus N(func_8024207C_9C745C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_01/9C53E0", func_802420B4_9C7494); diff --git a/src/world/area_nok/nok_02/9D7020.c b/src/world/area_nok/nok_02/9D7020.c index 6aaf8ab9af..f867655703 100644 --- a/src/world/area_nok/nok_02/9D7020.c +++ b/src/world/area_nok/nok_02/9D7020.c @@ -13,6 +13,29 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_80240034_9D7054); #include "world/common/SomeXYZFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_802402E0_9D7300); +/* +ApiStatus N(func_802402E0_9D7300)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup_nok_02 #include "world/common/GetItemName.inc.c" @@ -27,7 +50,37 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_802402E0_9D7300); #define NAMESPACE nok_02 INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_80240624_9D7644); +/* +ApiStatus N(func_80240624_9D7644)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_80240678_9D7698); +/* +ApiStatus N(func_80240678_9D7698)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7020", func_802406B0_9D76D0); diff --git a/src/world/area_nok/nok_02/9D7AA0.c b/src/world/area_nok/nok_02/9D7AA0.c index 93f18345b4..1e9ee94651 100644 --- a/src/world/area_nok/nok_02/9D7AA0.c +++ b/src/world/area_nok/nok_02/9D7AA0.c @@ -3,30 +3,229 @@ #define UNK_ALPHA_FUNC_NPC 19 INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80240A80_9D7AA0); +/* +ApiStatus N(func_80240A80_9D7AA0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80240BD8_9D7BF8); +/* +void N(func_80240BD8_9D7BF8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80240F40_9D7F60); +/* +void N(func_80240F40_9D7F60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_802410FC_9D811C); +/* +ApiStatus N(func_802410FC_9D811C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_802413CC_9D83EC); +/* +ApiStatus N(func_802413CC_9D83EC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80241554_9D8574); +/* +void N(func_80241554_9D8574)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80241614_9D8634); INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80241910_9D8930); +/* +ApiStatus N(func_80241910_9D8930)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -81,8 +280,38 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242974_9D9994); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242BD0_9D9BF0); +/* +ApiStatus N(func_80242BD0_9D9BF0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242C24_9D9C44); +/* +ApiStatus N(func_80242C24_9D9C44)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242C5C_9D9C7C); @@ -95,6 +324,12 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242F74_9D9F94); INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242FB8_9D9FD8); INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242FE4_9DA004); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80243010_9DA030); diff --git a/src/world/area_nok/nok_02/9DA8F0.c b/src/world/area_nok/nok_02/9DA8F0.c index f8133585c3..e2a1143491 100644 --- a/src/world/area_nok/nok_02/9DA8F0.c +++ b/src/world/area_nok/nok_02/9DA8F0.c @@ -11,14 +11,67 @@ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_802438D0_9DA8F0); #define NAMESPACE nok_02 INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243BEC_9DAC0C); +/* +ApiStatus N(func_80243BEC_9DAC0C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243C40_9DAC60); +/* +ApiStatus N(func_80243C40_9DAC60)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243C78_9DAC98); INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243D14_9DAD34); INCLUDE_ASM(s32, "world/area_nok/nok_02/9DA8F0", func_80243DB0_9DADD0); +/* +ApiStatus N(func_80243DB0_9DADD0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup2_nok_02 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_nok/nok_11/9F4A40.c b/src/world/area_nok/nok_11/9F4A40.c index ee5b7fbe4c..4f5b3ce5cb 100644 --- a/src/world/area_nok/nok_11/9F4A40.c +++ b/src/world/area_nok/nok_11/9F4A40.c @@ -11,24 +11,244 @@ INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_8024007C_9F4ABC); INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240394_9F4DD4); INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_802407D4_9F5214); +/* +void N(func_802407D4_9F5214)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240984_9F53C4); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_8024106C_9F5AAC); +/* +void N(func_8024106C_9F5AAC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80241428_9F5E68); +/* +void N(func_80241428_9F5E68)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_8024162C_9F606C); +/* +void N(func_8024162C_9F606C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_802419BC_9F63FC); +/* +void N(func_802419BC_9F63FC)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80241AE0_9F6520); diff --git a/src/world/area_nok/nok_12/9FAD60.c b/src/world/area_nok/nok_12/9FAD60.c index f5f0a515ed..47f1323907 100644 --- a/src/world/area_nok/nok_12/9FAD60.c +++ b/src/world/area_nok/nok_12/9FAD60.c @@ -11,26 +11,202 @@ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802405EC_9FADDC); INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240904_9FB0F4); INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240D44_9FB534); +/* +ApiStatus N(func_80240D44_9FB534)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240E9C_9FB68C); +/* +void N(func_80240E9C_9FB68C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80241204_9FB9F4); +/* +void N(func_80241204_9FB9F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802413C0_9FBBB0); +/* +ApiStatus N(func_802413C0_9FBBB0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80241690_9FBE80); +/* +ApiStatus N(func_80241690_9FBE80)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80241818_9FC008); +/* +void N(func_80241818_9FC008)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802418D8_9FC0C8); diff --git a/src/world/area_nok/nok_14/A02A00.c b/src/world/area_nok/nok_14/A02A00.c index 68d0318e84..bb47bb0c54 100644 --- a/src/world/area_nok/nok_14/A02A00.c +++ b/src/world/area_nok/nok_14/A02A00.c @@ -11,24 +11,244 @@ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_8024023C_A02A7C); INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240554_A02D94); INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240994_A031D4); +/* +void N(func_80240994_A031D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240B44_A03384); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_8024122C_A03A6C); +/* +void N(func_8024122C_A03A6C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_802415E8_A03E28); +/* +void N(func_802415E8_A03E28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_802417EC_A0402C); +/* +void N(func_802417EC_A0402C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80241B7C_A043BC); +/* +void N(func_80241B7C_A043BC)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80241CA0_A044E0); diff --git a/src/world/area_nok/nok_15/A06F00.c b/src/world/area_nok/nok_15/A06F00.c index 81a577ab46..35582a5357 100644 --- a/src/world/area_nok/nok_15/A06F00.c +++ b/src/world/area_nok/nok_15/A06F00.c @@ -23,24 +23,244 @@ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_8024035C_A0725C); INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240674_A07574); INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240AB4_A079B4); +/* +void N(func_80240AB4_A079B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240C64_A07B64); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_8024134C_A0824C); +/* +void N(func_8024134C_A0824C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241708_A08608); +/* +void N(func_80241708_A08608)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_8024190C_A0880C); +/* +void N(func_8024190C_A0880C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241C9C_A08B9C); +/* +void N(func_80241C9C_A08B9C)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80241DC0_A08CC0); diff --git a/src/world/area_obk/obk_01/BBD980.c b/src/world/area_obk/obk_01/BBD980.c index dd192270bc..3de24bfbd5 100644 --- a/src/world/area_obk/obk_01/BBD980.c +++ b/src/world/area_obk/obk_01/BBD980.c @@ -1,6 +1,29 @@ #include "obk_01.h" INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_802407E0_BBD980); +/* +ApiStatus N(func_802407E0_BBD980)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_802407E0_BBD980); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240B24_BBDCC4); +/* +ApiStatus N(func_80240B24_BBDCC4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240B78_BBDD18); +/* +ApiStatus N(func_80240B78_BBDD18)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_obk/obk_01/BBD980", func_80240BB0_BBDD50); diff --git a/src/world/area_obk/obk_03/BC43F0.c b/src/world/area_obk/obk_03/BC43F0.c index 3bb996ce90..3f555fe674 100644 --- a/src/world/area_obk/obk_03/BC43F0.c +++ b/src/world/area_obk/obk_03/BC43F0.c @@ -1,6 +1,29 @@ #include "obk_03.h" INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240170_BC43F0); +/* +ApiStatus N(func_80240170_BC43F0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240170_BC43F0); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_802404B4_BC4734); +/* +ApiStatus N(func_802404B4_BC4734)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240508_BC4788); +/* +ApiStatus N(func_80240508_BC4788)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_obk/obk_03/BC43F0", func_80240540_BC47C0); diff --git a/src/world/area_obk/obk_04/BC7EB0.c b/src/world/area_obk/obk_04/BC7EB0.c index 73bdc7cdf6..ee07a3fdc6 100644 --- a/src/world/area_obk/obk_04/BC7EB0.c +++ b/src/world/area_obk/obk_04/BC7EB0.c @@ -19,6 +19,29 @@ INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240624_BC8484); INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240910_BC8770); INCLUDE_ASM(s32, "world/area_obk/obk_04/BC7EB0", func_80240940_BC87A0); +/* +ApiStatus N(func_80240940_BC87A0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_obk/obk_07/BCEBF0.c b/src/world/area_obk/obk_07/BCEBF0.c index 2b40c4a695..6664d239d3 100644 --- a/src/world/area_obk/obk_07/BCEBF0.c +++ b/src/world/area_obk/obk_07/BCEBF0.c @@ -1,6 +1,29 @@ #include "obk_07.h" INCLUDE_ASM(s32, "world/area_obk/obk_07/BCEBF0", func_80240000_BCEBF0); +/* +ApiStatus N(func_80240000_BCEBF0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_02/D9D510.c b/src/world/area_omo/omo_02/D9D510.c index a81ad4c881..ec621aa0f4 100644 --- a/src/world/area_omo/omo_02/D9D510.c +++ b/src/world/area_omo/omo_02/D9D510.c @@ -20,15 +20,15 @@ INCLUDE_ASM(s32, "world/area_omo/omo_02/D9D510", func_80240EDC_D9E3AC); INCLUDE_ASM(s32, "world/area_omo/omo_02/D9D510", func_80240F90_D9E460); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_02/D9D510", func_8024141C_D9E8EC); diff --git a/src/world/area_omo/omo_04/DAD400.c b/src/world/area_omo/omo_04/DAD400.c index 48897625fc..8386e0b65b 100644 --- a/src/world/area_omo/omo_04/DAD400.c +++ b/src/world/area_omo/omo_04/DAD400.c @@ -1,6 +1,29 @@ #include "omo_04.h" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240000_DAD400); +/* +ApiStatus N(func_80240000_DAD400)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -15,24 +38,244 @@ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240000_DAD400); INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802402F4_DAD6F4); INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802403A0_DAD7A0); +/* +void N(func_802403A0_DAD7A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240550_DAD950); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240C38_DAE038); +/* +void N(func_80240C38_DAE038)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240FF4_DAE3F4); +/* +void N(func_80240FF4_DAE3F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802411F8_DAE5F8); +/* +void N(func_802411F8_DAE5F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80241588_DAE988); +/* +void N(func_80241588_DAE988)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802416AC_DAEAAC); diff --git a/src/world/area_omo/omo_05/DB22C0.c b/src/world/area_omo/omo_05/DB22C0.c index 5619dc903c..000b3c5a5c 100644 --- a/src/world/area_omo/omo_05/DB22C0.c +++ b/src/world/area_omo/omo_05/DB22C0.c @@ -17,24 +17,244 @@ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802405BC_DB287C); INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240780_DB2A40); INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240A54_DB2D14); +/* +void N(func_80240A54_DB2D14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240C04_DB2EC4); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802412EC_DB35AC); +/* +void N(func_802412EC_DB35AC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802416A8_DB3968); +/* +void N(func_802416A8_DB3968)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802418AC_DB3B6C); +/* +void N(func_802418AC_DB3B6C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80241C3C_DB3EFC); +/* +void N(func_80241C3C_DB3EFC)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80241D60_DB4020); @@ -43,8 +263,38 @@ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80241D60_DB4020); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242178_DB4438); +/* +ApiStatus N(func_80242178_DB4438)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802421CC_DB448C); +/* +ApiStatus N(func_802421CC_DB448C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80242204_DB44C4); diff --git a/src/world/area_omo/omo_06/DB8180.c b/src/world/area_omo/omo_06/DB8180.c index fa7b3fb67c..df0927858e 100644 --- a/src/world/area_omo/omo_06/DB8180.c +++ b/src/world/area_omo/omo_06/DB8180.c @@ -1,6 +1,29 @@ #include "omo_06.h" INCLUDE_ASM(s32, "world/area_omo/omo_06/DB8180", func_80240870_DB8180); +/* +ApiStatus N(func_80240870_DB8180)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_07/DBD2B0.c b/src/world/area_omo/omo_07/DBD2B0.c index 36485033e9..42a0ecba56 100644 --- a/src/world/area_omo/omo_07/DBD2B0.c +++ b/src/world/area_omo/omo_07/DBD2B0.c @@ -11,26 +11,202 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802401D8_DBD488); INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240238_DBD4E8); INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_8024056C_DBD81C); +/* +ApiStatus N(func_8024056C_DBD81C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802406C4_DBD974); +/* +void N(func_802406C4_DBD974)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240A2C_DBDCDC); +/* +void N(func_80240A2C_DBDCDC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240BE8_DBDE98); +/* +ApiStatus N(func_80240BE8_DBDE98)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240EB8_DBE168); +/* +ApiStatus N(func_80240EB8_DBE168)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241040_DBE2F0); +/* +void N(func_80241040_DBE2F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241100_DBE3B0); @@ -45,6 +221,31 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802415D4_DBE884); INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241634_DBE8E4); INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241978_DBEC28); +/* +void N(func_80241978_DBEC28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241B28_DBEDD8); @@ -53,18 +254,213 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241B28_DBEDD8); #define NAMESPACE omo_07 INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80242210_DBF4C0); +/* +void N(func_80242210_DBF4C0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802425CC_DBF87C); +/* +void N(func_802425CC_DBF87C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802427D0_DBFA80); +/* +void N(func_802427D0_DBFA80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80242B60_DBFE10); +/* +void N(func_80242B60_DBFE10)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80242C84_DBFF34); diff --git a/src/world/area_omo/omo_07/DC01D0.c b/src/world/area_omo/omo_07/DC01D0.c index b0f70af2c5..396b4dd65b 100644 --- a/src/world/area_omo/omo_07/DC01D0.c +++ b/src/world/area_omo/omo_07/DC01D0.c @@ -1,6 +1,29 @@ #include "omo_07.h" INCLUDE_ASM(s32, "world/area_omo/omo_07/DC01D0", func_80242F20_DC01D0); +/* +ApiStatus N(func_80242F20_DC01D0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_09/DCD3F0.c b/src/world/area_omo/omo_09/DCD3F0.c index 2c926ed605..c69297163a 100644 --- a/src/world/area_omo/omo_09/DCD3F0.c +++ b/src/world/area_omo/omo_09/DCD3F0.c @@ -1,6 +1,29 @@ #include "omo_09.h" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD3F0", func_80240720_DCD3F0); +/* +ApiStatus N(func_80240720_DCD3F0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_09/DCD6B0.c b/src/world/area_omo/omo_09/DCD6B0.c index 9ba5ef6cd6..9336529ce0 100644 --- a/src/world/area_omo/omo_09/DCD6B0.c +++ b/src/world/area_omo/omo_09/DCD6B0.c @@ -11,26 +11,202 @@ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240BB8_DCD888); INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240C18_DCD8E8); INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240F4C_DCDC1C); +/* +ApiStatus N(func_80240F4C_DCDC1C)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_802410A4_DCDD74); +/* +void N(func_802410A4_DCDD74)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_8024140C_DCE0DC); +/* +void N(func_8024140C_DCE0DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_802415C8_DCE298); +/* +ApiStatus N(func_802415C8_DCE298)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80241898_DCE568); +/* +ApiStatus N(func_80241898_DCE568)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80241A20_DCE6F0); +/* +void N(func_80241A20_DCE6F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80241AE0_DCE7B0); diff --git a/src/world/area_omo/omo_11/DDCFC0.c b/src/world/area_omo/omo_11/DDCFC0.c index 1d3e990d42..07f1cab3d5 100644 --- a/src/world/area_omo/omo_11/DDCFC0.c +++ b/src/world/area_omo/omo_11/DDCFC0.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802407AC_DDCFDC); INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802407CC_DDCFFC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802407F8_DDD028); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802408B0_DDD0E0); INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_8024095C_DDD18C); INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80240BAC_DDD3DC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80240BD8_DDD408); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_802412C8_DDDAF8); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80241498_DDDCC8); +INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80241498_DDDCC8); \ No newline at end of file diff --git a/src/world/area_omo/omo_13/DE2710.c b/src/world/area_omo/omo_13/DE2710.c index 071468f7d7..02574e5eb6 100644 --- a/src/world/area_omo/omo_13/DE2710.c +++ b/src/world/area_omo/omo_13/DE2710.c @@ -21,8 +21,38 @@ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240A00_DE2E90); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F00_DE3390); +/* +ApiStatus N(func_80240F00_DE3390)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F54_DE33E4); +/* +ApiStatus N(func_80240F54_DE33E4)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_13/DE2710", func_80240F8C_DE341C); diff --git a/src/world/area_omo/omo_13/DE36C0.c b/src/world/area_omo/omo_13/DE36C0.c index 81b3f5db67..ec6f12965f 100644 --- a/src/world/area_omo/omo_13/DE36C0.c +++ b/src/world/area_omo/omo_13/DE36C0.c @@ -1,6 +1,29 @@ #include "omo_13.h" INCLUDE_ASM(s32, "world/area_omo/omo_13/DE36C0", func_80241230_DE36C0); +/* +ApiStatus N(func_80241230_DE36C0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_omo/omo_15/DE8770.c b/src/world/area_omo/omo_15/DE8770.c index 444f4b2a4a..d2b4dfc344 100644 --- a/src/world/area_omo/omo_15/DE8770.c +++ b/src/world/area_omo/omo_15/DE8770.c @@ -1,13 +1,80 @@ #include "omo_15.h" INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_80240000_DE8770); +/* +ApiStatus N(func_80240000_DE8770)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_8024004C_DE87BC); +/* +ApiStatus N(func_8024004C_DE87BC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_802401AC_DE891C); INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_802405BC_DE8D2C); +/* +ApiStatus N(func_802405BC_DE8D2C)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_802405FC_DE8D6C); +/* +ApiStatus N(func_802405FC_DE8D6C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_15/DE8770", func_80240708_DE8E78); diff --git a/src/world/area_omo/omo_17/DEF400.c b/src/world/area_omo/omo_17/DEF400.c index 05f57f9984..5ff0bb3ec5 100644 --- a/src/world/area_omo/omo_17/DEF400.c +++ b/src/world/area_omo/omo_17/DEF400.c @@ -17,24 +17,244 @@ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240B1C_DEF9BC); INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240CE0_DEFB80); INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240FB4_DEFE54); +/* +void N(func_80240FB4_DEFE54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241164_DF0004); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_8024184C_DF06EC); +/* +void N(func_8024184C_DF06EC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241C08_DF0AA8); +/* +void N(func_80241C08_DF0AA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241E0C_DF0CAC); +/* +void N(func_80241E0C_DF0CAC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_8024219C_DF103C); +/* +void N(func_8024219C_DF103C)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_802422C0_DF1160); diff --git a/src/world/area_osr/osr_01/AB0350.c b/src/world/area_osr/osr_01/AB0350.c index d9b4085158..bdb6016451 100644 --- a/src/world/area_osr/osr_01/AB0350.c +++ b/src/world/area_osr/osr_01/AB0350.c @@ -1,6 +1,29 @@ #include "osr_01.h" INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240360_AB0350); +/* +ApiStatus N(func_80240360_AB0350)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240360_AB0350); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_802406A4_AB0694); +/* +ApiStatus N(func_802406A4_AB0694)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_802406F8_AB06E8); +/* +ApiStatus N(func_802406F8_AB06E8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_osr/osr_01/AB0350", func_80240730_AB0720); diff --git a/src/world/area_pra/pra_01/D4D060.c b/src/world/area_pra/pra_01/D4D060.c index 2003f48ec6..4ba10f6c5e 100644 --- a/src/world/area_pra/pra_01/D4D060.c +++ b/src/world/area_pra/pra_01/D4D060.c @@ -38,8 +38,38 @@ ApiStatus func_80240F60_D4DFA0(ScriptInstance* script, s32 isInitialCall) { #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_802411AC_D4E1EC); +/* +ApiStatus N(func_802411AC_D4E1EC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_80241200_D4E240); +/* +ApiStatus N(func_80241200_D4E240)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_01/D4D060", func_80241238_D4E278); diff --git a/src/world/area_pra/pra_02/D50010.c b/src/world/area_pra/pra_02/D50010.c index f5de96cbb0..508d02bc59 100644 --- a/src/world/area_pra/pra_02/D50010.c +++ b/src/world/area_pra/pra_02/D50010.c @@ -31,8 +31,38 @@ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_80240D3C_D50D2C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_8024114C_D5113C); +/* +ApiStatus N(func_8024114C_D5113C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_802411A0_D51190); +/* +ApiStatus N(func_802411A0_D51190)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_02/D50010", func_802411D8_D511C8); diff --git a/src/world/area_pra/pra_05/D55BD0.c b/src/world/area_pra/pra_05/D55BD0.c index 29288acfdb..8b8457e608 100644 --- a/src/world/area_pra/pra_05/D55BD0.c +++ b/src/world/area_pra/pra_05/D55BD0.c @@ -27,6 +27,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_05/D55BD0", func_80240D3C_D568EC); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_05/D55BD0", func_80240F20_D56AD0); +/* +ApiStatus N(func_80240F20_D56AD0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_09/D588B0.c b/src/world/area_pra/pra_09/D588B0.c index 63731301a7..90df43bb69 100644 --- a/src/world/area_pra/pra_09/D588B0.c +++ b/src/world/area_pra/pra_09/D588B0.c @@ -31,8 +31,38 @@ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_80240D3C_D595CC); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_8024114C_D599DC); +/* +ApiStatus N(func_8024114C_D599DC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_802411A0_D59A30); +/* +ApiStatus N(func_802411A0_D59A30)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_09/D588B0", func_802411D8_D59A68); diff --git a/src/world/area_pra/pra_11/D61520.c b/src/world/area_pra/pra_11/D61520.c index d5511551a2..26f97a3b3f 100644 --- a/src/world/area_pra/pra_11/D61520.c +++ b/src/world/area_pra/pra_11/D61520.c @@ -27,6 +27,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_11/D61520", func_80240D3C_D6223C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_11/D61520", func_80240F20_D62420); +/* +ApiStatus N(func_80240F20_D62420)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_12/D62D10.c b/src/world/area_pra/pra_12/D62D10.c index ce25baaba8..5e3dc0806f 100644 --- a/src/world/area_pra/pra_12/D62D10.c +++ b/src/world/area_pra/pra_12/D62D10.c @@ -29,6 +29,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_12/D62D10", func_80240D6C_D63A7C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_12/D62D10", func_80240F50_D63C60); +/* +ApiStatus N(func_80240F50_D63C60)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_13/D64600.c b/src/world/area_pra/pra_13/D64600.c index 311d6f954f..9da02c702e 100644 --- a/src/world/area_pra/pra_13/D64600.c +++ b/src/world/area_pra/pra_13/D64600.c @@ -31,8 +31,38 @@ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_80240D3C_D6531C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_8024114C_D6572C); +/* +ApiStatus N(func_8024114C_D6572C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802411A0_D65780); +/* +ApiStatus N(func_802411A0_D65780)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802411D8_D657B8); @@ -41,6 +71,12 @@ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_80241274_D65854); INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_80241310_D658F0); INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802413A4_D65984); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_13/D64600", func_802413D0_D659B0); diff --git a/src/world/area_pra/pra_14/D67D20.c b/src/world/area_pra/pra_14/D67D20.c index ea0b755ceb..de8f2046a6 100644 --- a/src/world/area_pra/pra_14/D67D20.c +++ b/src/world/area_pra/pra_14/D67D20.c @@ -27,6 +27,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_14/D67D20", func_80240D3C_D68A3C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_14/D67D20", func_80240F20_D68C20); +/* +ApiStatus N(func_80240F20_D68C20)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_19/D6E9D0.c b/src/world/area_pra/pra_19/D6E9D0.c index c70df8e4ca..7b3f682510 100644 --- a/src/world/area_pra/pra_19/D6E9D0.c +++ b/src/world/area_pra/pra_19/D6E9D0.c @@ -31,8 +31,38 @@ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_80240D3C_D6F6EC); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_8024114C_D6FAFC); +/* +ApiStatus N(func_8024114C_D6FAFC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_802411A0_D6FB50); +/* +ApiStatus N(func_802411A0_D6FB50)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_19/D6E9D0", func_802411D8_D6FB88); diff --git a/src/world/area_pra/pra_27/D799F0.c b/src/world/area_pra/pra_27/D799F0.c index 1b47aa6d8a..a0a4681c90 100644 --- a/src/world/area_pra/pra_27/D799F0.c +++ b/src/world/area_pra/pra_27/D799F0.c @@ -29,6 +29,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_27/D799F0", func_80240D6C_D7A75C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_27/D799F0", func_80240F50_D7A940); +/* +ApiStatus N(func_80240F50_D7A940)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_28/D7B2A0.c b/src/world/area_pra/pra_28/D7B2A0.c index 701566273d..6fb13920d2 100644 --- a/src/world/area_pra/pra_28/D7B2A0.c +++ b/src/world/area_pra/pra_28/D7B2A0.c @@ -29,6 +29,29 @@ INCLUDE_ASM(s32, "world/area_pra/pra_28/D7B2A0", func_80240D6C_D7C00C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_28/D7B2A0", func_80240F50_D7C1F0); +/* +ApiStatus N(func_80240F50_D7C1F0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_pra/pra_31/D7ED80.c b/src/world/area_pra/pra_31/D7ED80.c index fe487c7e75..39bf4a9c81 100644 --- a/src/world/area_pra/pra_31/D7ED80.c +++ b/src/world/area_pra/pra_31/D7ED80.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_8024024C_D7EFAC); +/* +ApiStatus N(func_8024024C_D7EFAC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_802402A0_D7F000); +/* +ApiStatus N(func_802402A0_D7F000)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_31/D7ED80", func_802402D8_D7F038); diff --git a/src/world/area_pra/pra_32/D86A20.c b/src/world/area_pra/pra_32/D86A20.c index feadebf700..8ff1a8113b 100644 --- a/src/world/area_pra/pra_32/D86A20.c +++ b/src/world/area_pra/pra_32/D86A20.c @@ -1,15 +1,100 @@ #include "pra_32.h" INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_80240020_D86A20); +/* +ApiStatus N(func_80240020_D86A20)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_8024006C_D86A6C); +/* +ApiStatus N(func_8024006C_D86A6C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_802401CC_D86BCC); INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_802405DC_D86FDC); +/* +ApiStatus N(func_802405DC_D86FDC)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_8024061C_D8701C); +/* +ApiStatus N(func_8024061C_D8701C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_80240728_D87128); +/* +ApiStatus N(func_80240728_D87128)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (dist2D(playerStatus->position.x, playerStatus->position.z, + ptr->unk_18, ptr->unk_20) <= 30.0f) { + ptr->unk_4E = 3; + } + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_32/D86A20", func_80240814_D87214); diff --git a/src/world/area_pra/pra_35/D8D270.c b/src/world/area_pra/pra_35/D8D270.c index a257f04cda..e5b7030141 100644 --- a/src/world/area_pra/pra_35/D8D270.c +++ b/src/world/area_pra/pra_35/D8D270.c @@ -27,26 +27,202 @@ INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80240D3C_D8DF8C); #include "world/common/SetPartnerFlags20000.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80240F20_D8E170); +/* +ApiStatus N(func_80240F20_D8E170)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80241078_D8E2C8); +/* +void N(func_80241078_D8E2C8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_802413E0_D8E630); +/* +void N(func_802413E0_D8E630)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_8024159C_D8E7EC); +/* +ApiStatus N(func_8024159C_D8E7EC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_8024186C_D8EABC); +/* +ApiStatus N(func_8024186C_D8EABC)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_802419F4_D8EC44); +/* +void N(func_802419F4_D8EC44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80241AB4_D8ED04); diff --git a/src/world/area_pra/pra_35/D8FBA0.c b/src/world/area_pra/pra_35/D8FBA0.c index ad243b6b9f..d714c2a86a 100644 --- a/src/world/area_pra/pra_35/D8FBA0.c +++ b/src/world/area_pra/pra_35/D8FBA0.c @@ -1,6 +1,29 @@ #include "pra_35.h" INCLUDE_ASM(s32, "world/area_pra/pra_35/D8FBA0", func_80242950_D8FBA0); +/* +ApiStatus N(func_80242950_D8FBA0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_01/CF7E80.c b/src/world/area_sam/sam_01/CF7E80.c index da13b9d1a6..467095c907 100644 --- a/src/world/area_sam/sam_01/CF7E80.c +++ b/src/world/area_sam/sam_01/CF7E80.c @@ -7,14 +7,67 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_8024053C_CF80AC); +/* +ApiStatus N(func_8024053C_CF80AC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80240590_CF8100); +/* +ApiStatus N(func_80240590_CF8100)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_802405C8_CF8138); INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80240664_CF81D4); INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80240700_CF8270); +/* +ApiStatus N(func_80240700_CF8270)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -77,6 +130,29 @@ INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80241A54_CF95C4); INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80241B20_CF9690); INCLUDE_ASM(s32, "world/area_sam/sam_01/CF7E80", func_80241C90_CF9800); +/* +ApiStatus N(func_80241C90_CF9800)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #define NAMESPACE dup_sam_01 #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_02/D05F60.c b/src/world/area_sam/sam_02/D05F60.c index 3793b69096..f87e7dbb5e 100644 --- a/src/world/area_sam/sam_02/D05F60.c +++ b/src/world/area_sam/sam_02/D05F60.c @@ -23,6 +23,29 @@ INCLUDE_ASM(s32, "world/area_sam/sam_02/D05F60", func_80240A44_D06174); INCLUDE_ASM(s32, "world/area_sam/sam_02/D05F60", func_80240B24_D06254); INCLUDE_ASM(s32, "world/area_sam/sam_02/D05F60", func_80240B2C_D0625C); +/* +ApiStatus N(func_80240B2C_D0625C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_04/D138E0.c b/src/world/area_sam/sam_04/D138E0.c index 2e6cde6873..1df2b9025f 100644 --- a/src/world/area_sam/sam_04/D138E0.c +++ b/src/world/area_sam/sam_04/D138E0.c @@ -5,8 +5,38 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_8024053C_D13B0C); +/* +ApiStatus N(func_8024053C_D13B0C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_80240590_D13B60); +/* +ApiStatus N(func_80240590_D13B60)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_04/D138E0", func_802405C8_D13B98); diff --git a/src/world/area_sam/sam_06/D203E0.c b/src/world/area_sam/sam_06/D203E0.c index e65cba4c07..1bf2586376 100644 --- a/src/world/area_sam/sam_06/D203E0.c +++ b/src/world/area_sam/sam_06/D203E0.c @@ -1,28 +1,271 @@ #include "sam_06.h" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240550_D203E0); +/* +void N(func_80240550_D203E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240700_D20590); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240DE8_D20C78); +/* +void N(func_80240DE8_D20C78)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_802411A4_D21034); +/* +void N(func_802411A4_D21034)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_802413A8_D21238); +/* +void N(func_802413A8_D21238)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241738_D215C8); +/* +void N(func_80241738_D215C8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_8024185C_D216EC); INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241A48_D218D8); +/* +ApiStatus N(func_80241A48_D218D8)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -31,8 +274,38 @@ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241A48_D218D8); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241D8C_D21C1C); +/* +ApiStatus N(func_80241D8C_D21C1C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241DE0_D21C70); +/* +ApiStatus N(func_80241DE0_D21C70)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80241E18_D21CA8); diff --git a/src/world/area_sam/sam_08/D2FC80.c b/src/world/area_sam/sam_08/D2FC80.c index 0950957036..81e49c645d 100644 --- a/src/world/area_sam/sam_08/D2FC80.c +++ b/src/world/area_sam/sam_08/D2FC80.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_8024001C_D2FC9C); INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_8024003C_D2FCBC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240068_D2FCE8); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240120_D2FDA0); INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_802401CC_D2FE4C); INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_8024041C_D3009C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240448_D300C8); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240B38_D307B8); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240D08_D30988); +INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_80240D08_D30988); \ No newline at end of file diff --git a/src/world/area_sam/sam_09/D362F0.c b/src/world/area_sam/sam_09/D362F0.c index 562292e010..8da1ccdc1b 100644 --- a/src/world/area_sam/sam_09/D362F0.c +++ b/src/world/area_sam/sam_09/D362F0.c @@ -1,6 +1,29 @@ #include "sam_09.h" INCLUDE_ASM(s32, "world/area_sam/sam_09/D362F0", func_80240000_D362F0); +/* +ApiStatus N(func_80240000_D362F0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_10/D37800.c b/src/world/area_sam/sam_10/D37800.c index 0f9904054e..89c8bcd59e 100644 --- a/src/world/area_sam/sam_10/D37800.c +++ b/src/world/area_sam/sam_10/D37800.c @@ -1,6 +1,29 @@ #include "sam_10.h" INCLUDE_ASM(s32, "world/area_sam/sam_10/D37800", func_80240000_D37800); +/* +ApiStatus N(func_80240000_D37800)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sam/sam_11/D3ADA0.c b/src/world/area_sam/sam_11/D3ADA0.c index cf93878904..b94dfcd84d 100644 --- a/src/world/area_sam/sam_11/D3ADA0.c +++ b/src/world/area_sam/sam_11/D3ADA0.c @@ -3,6 +3,29 @@ #define UNK_ALPHA_FUNC_NPC 17 INCLUDE_ASM(s32, "world/area_sam/sam_11/D3ADA0", func_802407D0_D3ADA0); +/* +ApiStatus N(func_802407D0_D3ADA0)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sbk/sbk_00/929270.c b/src/world/area_sbk/sbk_00/929270.c index d4193388d6..58945c2cac 100644 --- a/src/world/area_sbk/sbk_00/929270.c +++ b/src/world/area_sbk/sbk_00/929270.c @@ -1,11 +1,12 @@ #include "sbk_00.h" +#include "message_ids.h" #include "world/common/SpawnSunEffect.inc.c" -Script N(Main); +Script N(main); s32 N(npcGroupList_80240768)[]; -Vec4f N(entryList)[] = { +EntryList N(entryList) = { { -475.0f, 0.0f, 0.0f, 90.0f }, { 475.0f, 0.0f, 0.0f, 270.0f }, { 0.0f, 0.0f, -475.0f, 180.0f }, @@ -13,35 +14,23 @@ Vec4f N(entryList)[] = { }; MapConfig N(config) = { - .main = N(Main), + .main = N(main), .entryList = N(entryList), .entryCount = ENTRY_COUNT(N(entryList)), .background = &gBackgroundImage, - .tattle = 0x190060, + .tattle = MSG_sbk_00_tattle, }; -Script N(ExitWalk_802400E0) = SCRIPT({ - group 27; - UseExitHeading(60, 1); - spawn ExitWalk; - GotoMap("sbk_01", 0); - sleep 100; +Script N(exitWalk_802400E0) = EXIT_WALK_SCRIPT(60, 1, "sbk_01", 0); + +Script N(exitWalk_8024013C) = EXIT_WALK_SCRIPT(60, 3, "sbk_10", 2); + +Script N(80240198) = SCRIPT({ + bind N(exitWalk_802400E0) to TRIGGER_FLOOR_ABOVE 3; + bind N(exitWalk_8024013C) to TRIGGER_FLOOR_ABOVE 6; }); -Script N(ExitWalk_8024013C) = SCRIPT({ - group 27; - UseExitHeading(60, 3); - spawn ExitWalk; - GotoMap("sbk_10", 2); - sleep 100; -}); - -Script N(Script_80240198) = SCRIPT({ - bind N(ExitWalk_802400E0) to 524288 3; - bind N(ExitWalk_8024013C) to 524288 6; -}); - -Script N(Main) = SCRIPT({ +Script N(main) = SCRIPT({ WORLD_LOCATION = LOCATION_DRY_DRY_DESERT; SetSpriteShading(-1); if (STORY_PROGRESS == STORY_CH2_GOT_PULSE_STONE) { @@ -52,9 +41,9 @@ Script N(Main) = SCRIPT({ SetCamEnabled(0, 1); SetCamLeadPlayer(0, 0); MakeNpcs(0, N(npcGroupList_80240768)); - await N(MakeEntities); + await N(makeEntities); N(SpawnSunEffect)(); SetMusicTrack(0, SONG_DRY_DRY_DESERT, 0, 8); - SI_VAR(0) = N(Script_80240198); + SI_VAR(0) = N(80240198); spawn EnterWalk; }); diff --git a/src/world/area_sbk/sbk_00/9292B0.c b/src/world/area_sbk/sbk_00/9292B0.c index a5bf1882ad..6df54ca577 100644 --- a/src/world/area_sbk/sbk_00/9292B0.c +++ b/src/world/area_sbk/sbk_00/9292B0.c @@ -1,70 +1,122 @@ #include "sbk_00.h" +#include "sprite/npc/pokey.h" #include "world/common/SetNpcB5_3.inc.c" -s32 N(aISettings_80240300)[] = { - 0x3FE66666, 0x00000032, 0x0000000A, 0x437A0000, 0x00000000, 0x00000002, 0x40600000, 0x0000002D, - 0x00000006, 0x43960000, 0x00000000, 0x00000001, +NpcAISettings N(npcAISettings_80240300) = { + .moveSpeed = 1.8f, + .moveTime = 50, + .waitTime = 10, + .alertRadius = 250.0f, + .unk_14 = 2, + .chaseSpeed = 3.5f, + .unk_1C = 45, + .unk_20 = 6, + .chaseRadius = 300.0f, + .unk_2C = 1, }; -Script N(NpcAI_80240330) = SCRIPT({ +Script N(npcAI_80240330) = SCRIPT({ N(SetNpcB5_3)(); - DoBasicAI(N(aISettings_80240300)); + DoBasicAI(N(npcAISettings_80240300)); }); -s32 N(npcSettings_8024035C)[] = { - 0x00000000, 0x0048000F, 0x00000000, 0x00000000, N(NpcAI_80240330), 0x80077F70, 0x00000000, 0x8007809C, - 0x00000000, 0x00000000, 0x00090000, +NpcSettings N(npcSettings_8024035C) = { + .height = 72, + .radius = 15, + .ai = &N(npcAI_80240330), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 9, }; -s32 N(npcGroup_80240388)[] = { - 0x00000000, N(npcSettings_8024035C), 0xC2200000, 0x00000000, 0x43200000, 0x00000800, 0x00000000, 0x00000000, - 0x00000000, 0x0000005A, 0x800F00A8, 0x00090000, 0x00890001, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, - 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, - 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, - 0xFFFFFFD8, 0x00000000, 0x000000A0, 0x00000064, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x000003E8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00310004, 0x00310008, 0x00310008, 0x00310008, 0x00310004, 0x00310004, 0x0031000C, 0x0031000C, - 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, - 0x00000001, 0x00000000, 0x00000000, 0x00000000, +StaticNpc N(npcGroup_80240388) = { + .id = 0, + .settings = &N(npcSettings_8024035C), + .pos = { -40.0f, 0.0f, 160.0f }, + .flags = NPC_FLAG_IGNORE_HEIGHT, + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 15, + .itemDrops = { + { ITEM_DRIED_FRUIT, 9, 0 }, + { ITEM_TASTY_TONIC, 1, 0 }, + }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 1, + .movement = { -40, 0, 160, 100, 0, -32767, 0, 0, 0, 0, 1000, 0, 0, 1 }, + .animations = { + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -s32 N(npcGroup_80240578)[] = { - 0x00000001, N(npcSettings_8024035C), 0x43750000, 0x00000000, 0x42960000, 0x00000800, 0x00000000, 0x00000000, - 0x00000000, 0x0000010E, 0x800F00A8, 0x00090000, 0x00890001, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, - 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, - 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, - 0x000000F5, 0x00000000, 0x0000004B, 0x00000064, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x000003E8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00310004, 0x00310008, 0x00310008, 0x00310008, 0x00310004, 0x00310004, 0x0031000C, 0x0031000C, - 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, - 0x00000001, 0x00000000, 0x00000000, 0x00000000, +StaticNpc N(npcGroup_80240578) = { + .id = 1, + .settings = &N(npcSettings_8024035C), + .pos = { 245.0f, 0.0f, 75.0f }, + .flags = NPC_FLAG_IGNORE_HEIGHT, + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 15, + .itemDrops = { + { ITEM_DRIED_FRUIT, 9, 0 }, + { ITEM_TASTY_TONIC, 1, 0 }, + }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 1, + .movement = { 245, 0, 75, 100, 0, -32767, 0, 0, 0, 0, 1000, 0, 0, 1 }, + .animations = { + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -s32 N(npcGroupList_80240768)[] = { - 0x00000001, N(npcGroup_80240388), 0x0A000001, 0x00000001, N(npcGroup_80240578), 0x0A010001, 0x00000000, 0x00000000, +NpcGroupList N(npcGroupList_80240768) = { + NPC_GROUP(N(npcGroup_80240388), BATTLE_ID(10, 0, 0, 1)), + NPC_GROUP(N(npcGroup_80240578), BATTLE_ID(10, 1, 0, 1)), + {}, +}; + +static s32 N(pad_78C) = { 0x00000000, }; -static s32 padding = 0; - -Script N(MakeEntities) = SCRIPT({ - MakeEntity(0x802EA564, 0xFFFFFF1A, 0, 155, 0, 152, 0x80000000); +Script N(makeEntities) = SCRIPT({ + MakeEntity(0x802EA564, -230, 0, 155, 0, ITEM_FRIGHT_JAR, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(797)); - MakeEntity(0x802EA564, 160, 0, 205, 0, 343, 0x80000000); + MakeEntity(0x802EA564, 160, 0, 205, 0, ITEM_COIN, MAKE_ENTITY_END); AssignBlockFlag(SI_SAVE_FLAG(798)); }); diff --git a/src/world/area_sbk/sbk_00/sbk_00.h b/src/world/area_sbk/sbk_00/sbk_00.h index 9f09f12738..d783b8fee3 100644 --- a/src/world/area_sbk/sbk_00/sbk_00.h +++ b/src/world/area_sbk/sbk_00/sbk_00.h @@ -3,4 +3,4 @@ #define NAMESPACE sbk_00 -Script N(MakeEntities); +Script N(makeEntities); diff --git a/src/world/area_sbk/sbk_01/929A90.c b/src/world/area_sbk/sbk_01/929A90.c index 959c100ce8..2bb7a8f2ce 100644 --- a/src/world/area_sbk/sbk_01/929A90.c +++ b/src/world/area_sbk/sbk_01/929A90.c @@ -1,11 +1,12 @@ #include "sbk_01.h" +#include "message_ids.h" #include "world/common/SpawnSunEffect.inc.c" -Script N(Main); -s32 N(npcGroupList_802407D8)[]; +Script N(main); +NpcGroupList N(npcGroupList_802407D8); -Vec4f N(entryList)[] = { +EntryList N(entryList) = { { -475.0f, 0.0f, 0.0f, 90.0f }, { 475.0f, 0.0f, 0.0f, 270.0f }, { 0.0f, 0.0f, -475.0f, 180.0f }, @@ -13,44 +14,26 @@ Vec4f N(entryList)[] = { }; MapConfig N(config) = { - .main = N(Main), + .main = N(main), .entryList = N(entryList), .entryCount = ENTRY_COUNT(N(entryList)), .background = &gBackgroundImage, - .tattle = 0x190061, + .tattle = MSG_sbk_01_tattle, }; -Script N(ExitWalk_802400E0) = SCRIPT({ - group 27; - UseExitHeading(60, 0); - spawn ExitWalk; - GotoMap("sbk_00", 1); - sleep 100; +Script N(exitWalk_802400E0) = EXIT_WALK_SCRIPT(60, 0, "sbk_00", 1); + +Script N(exitWalk_8024013C) = EXIT_WALK_SCRIPT(60, 1, "sbk_02", 0); + +Script N(exitWalk_80240198) = EXIT_WALK_SCRIPT(60, 3, "sbk_11", 2); + +Script N(802401F4) = SCRIPT({ + bind N(exitWalk_802400E0) to TRIGGER_FLOOR_ABOVE 7; + bind N(exitWalk_8024013C) to TRIGGER_FLOOR_ABOVE 3; + bind N(exitWalk_80240198) to TRIGGER_FLOOR_ABOVE 5; }); -Script N(ExitWalk_8024013C) = SCRIPT({ - group 27; - UseExitHeading(60, 1); - spawn ExitWalk; - GotoMap("sbk_02", 0); - sleep 100; -}); - -Script N(ExitWalk_80240198) = SCRIPT({ - group 27; - UseExitHeading(60, 3); - spawn ExitWalk; - GotoMap("sbk_11", 2); - sleep 100; -}); - -Script N(Script_802401F4) = SCRIPT({ - bind N(ExitWalk_802400E0) to 524288 7; - bind N(ExitWalk_8024013C) to 524288 3; - bind N(ExitWalk_80240198) to 524288 5; -}); - -Script N(Main) = SCRIPT({ +Script N(main) = SCRIPT({ WORLD_LOCATION = LOCATION_DRY_DRY_DESERT; SetSpriteShading(-1); if (STORY_PROGRESS == STORY_CH2_GOT_PULSE_STONE) { @@ -63,6 +46,6 @@ Script N(Main) = SCRIPT({ MakeNpcs(0, N(npcGroupList_802407D8)); N(SpawnSunEffect)(); SetMusicTrack(0, SONG_DRY_DRY_DESERT, 0, 8); - SI_VAR(0) = N(Script_802401F4); + SI_VAR(0) = N(802401F4); spawn EnterWalk; }); diff --git a/src/world/area_sbk/sbk_01/929AD0.c b/src/world/area_sbk/sbk_01/929AD0.c index 530c2aaf6b..6134fa28ba 100644 --- a/src/world/area_sbk/sbk_01/929AD0.c +++ b/src/world/area_sbk/sbk_01/929AD0.c @@ -1,61 +1,111 @@ #include "sbk_01.h" +#include "sprite/npc/pokey.h" #include "world/common/SetNpcB5_3.inc.c" -s32 N(aISettings_80240370)[] = { - 0x3FE66666, 0x00000032, 0x0000000A, 0x437A0000, 0x00000000, 0x00000002, 0x40600000, 0x0000002D, - 0x00000006, 0x43960000, 0x00000000, 0x00000001, +NpcAISettings N(npcAISettings_80240370) = { + .moveSpeed = 1.8f, + .moveTime = 50, + .waitTime = 10, + .alertRadius = 250.0f, + .unk_14 = 2, + .chaseSpeed = 3.5f, + .unk_1C = 45, + .unk_20 = 6, + .chaseRadius = 300.0f, + .unk_2C = 1, }; -Script N(NpcAI_802403A0) = SCRIPT({ +Script N(npcAI_802403A0) = SCRIPT({ N(SetNpcB5_3)(); - DoBasicAI(N(aISettings_80240370)); + DoBasicAI(N(npcAISettings_80240370)); }); -s32 N(npcSettings_802403CC)[] = { - 0x00000000, 0x0048000F, 0x00000000, 0x00000000, N(NpcAI_802403A0), 0x80077F70, 0x00000000, 0x8007809C, - 0x00000000, 0x00000000, 0x00090000, +NpcSettings N(npcSettings_802403CC) = { + .height = 72, + .radius = 15, + .ai = &N(npcAI_802403A0), + .onHit = EnemyNpcHit, + .onDefeat = EnemyNpcDefeat, + .level = 9, }; -s32 N(npcGroup_802403F8)[] = { - 0x00000000, N(npcSettings_802403CC), 0x434D0000, 0x00000000, 0xC2700000, 0x00002C00, 0x00000000, 0x00000000, - 0x00000000, 0x0000005A, 0x800F00A8, 0x00090000, 0x00890001, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, - 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, - 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, - 0x000000CD, 0x00000000, 0xFFFFFFC4, 0x00000064, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x000003E8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00310004, 0x00310008, 0x00310008, 0x00310008, 0x00310004, 0x00310004, 0x0031000C, 0x0031000C, - 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, - 0x00000001, 0x00000000, 0x00000000, 0x00000000, +StaticNpc N(npcGroup_802403F8) = { + .id = 0, + .settings = &N(npcSettings_802403CC), + .pos = { 205.0f, 0.0f, -60.0f }, + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_PROJECT_SHADOW, + .yaw = 90, + .dropFlags = 0x80, + .itemDropChance = 15, + .itemDrops = { + { ITEM_DRIED_FRUIT, 9, 0 }, + { ITEM_TASTY_TONIC, 1, 0 }, + }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 1, + .movement = { 205, 0, -60, 100, 0, -32767, 0, 0, 0, 0, 1000, 0, 0, 1 }, + .animations = { + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -s32 N(npcGroup_802405E8)[] = { - 0x00000001, N(npcSettings_802403CC), 0xC3480000, 0x00000000, 0x43340000, 0x00002C00, 0x00000000, 0x00000000, - 0x00000000, 0x0000010E, 0x800F00A8, 0x00090000, 0x00890001, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, - 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, - 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, - 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, - 0xFFFFFF38, 0x00000000, 0x000000B4, 0x00000064, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x000003E8, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00310004, 0x00310008, 0x00310008, 0x00310008, 0x00310004, 0x00310004, 0x0031000C, 0x0031000C, - 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, 0x00310008, - 0x00000001, 0x00000000, 0x00000000, 0x00000000, +StaticNpc N(npcGroup_802405E8) = { + .id = 1, + .settings = &N(npcSettings_802403CC), + .pos = { -200.0f, 0.0f, 180.0f }, + .flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_PROJECT_SHADOW, + .yaw = 270, + .dropFlags = 0x80, + .itemDropChance = 15, + .itemDrops = { + { ITEM_DRIED_FRUIT, 9, 0 }, + { ITEM_TASTY_TONIC, 1, 0 }, + }, + .heartDrops = STANDARD_HEART_DROPS(2), + .flowerDrops = STANDARD_FLOWER_DROPS(2), + .maxCoinBonus = 1, + .movement = { -200, 0, 180, 100, 0, -32767, 0, 0, 0, 0, 1000, 0, 0, 1 }, + .animations = { + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_4), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_C), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + NPC_ANIM(pokey, Palette_00, Anim_8), + }, + .unk_1E0 = { 00, 00, 00, 01, 00, 00, 00, 00}, }; -s32 N(npcGroupList_802407D8)[] = { - 0x00000001, N(npcGroup_802403F8), 0x0A030001, 0x00000001, N(npcGroup_802405E8), 0x0A010001, 0x00000000, 0x00000000, - 0x00000000, +NpcGroupList N(npcGroupList_802407D8) = { + NPC_GROUP(N(npcGroup_802403F8), BATTLE_ID(10, 3, 0, 1)), + NPC_GROUP(N(npcGroup_802405E8), BATTLE_ID(10, 1, 0, 1)), + {}, }; diff --git a/src/world/area_sbk/sbk_02/92A9A0.c b/src/world/area_sbk/sbk_02/92A9A0.c index a5d383420f..73626516c3 100644 --- a/src/world/area_sbk/sbk_02/92A9A0.c +++ b/src/world/area_sbk/sbk_02/92A9A0.c @@ -5,12 +5,65 @@ #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_8024091C_92ABCC); +/* +ApiStatus N(func_8024091C_92ABCC)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_80240970_92AC20); +/* +ApiStatus N(func_80240970_92AC20)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_802409A8_92AC58); INCLUDE_ASM(s32, "world/area_sbk/sbk_02/92A9A0", func_80240A44_92ACF4); +/* +ApiStatus N(func_80240A44_92ACF4)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_sbk/sbk_30/93F5B0.c b/src/world/area_sbk/sbk_30/93F5B0.c index 4325efb9ae..340d91c09d 100644 --- a/src/world/area_sbk/sbk_30/93F5B0.c +++ b/src/world/area_sbk/sbk_30/93F5B0.c @@ -12,15 +12,15 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240370_93F920); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240424_93F9D4); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_802408B0_93FE60); @@ -29,6 +29,29 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_8024095C_93FF0C); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240B64_940114); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240DDC_94038C); +/* +ApiStatus N(func_80240DDC_94038C)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -37,8 +60,38 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80240DDC_94038C); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241120_9406D0); +/* +ApiStatus N(func_80241120_9406D0)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241174_940724); +/* +ApiStatus N(func_80241174_940724)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_802411AC_94075C); @@ -53,4 +106,3 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_80241560_940B10); INCLUDE_ASM(s32, "world/area_sbk/sbk_30/93F5B0", func_802415A4_940B54); #include "world/common/SomeMatrixOperations.inc.c" - diff --git a/src/world/area_sbk/sbk_34/945F10.c b/src/world/area_sbk/sbk_34/945F10.c index 4e4ba5cbc0..e306f14a73 100644 --- a/src/world/area_sbk/sbk_34/945F10.c +++ b/src/world/area_sbk/sbk_34/945F10.c @@ -1,6 +1,29 @@ #include "sbk_34.h" INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240040_945F10); +/* +ApiStatus N(func_80240040_945F10)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -9,8 +32,38 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240040_945F10); #include "world/common/SomeXYZFuncTodoRename.inc.c" INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240384_946254); +/* +ApiStatus N(func_80240384_946254)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32* ptr; + + if (isInitialCall) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + } + + ptr = &D_80241CCC_BE0A5C; + if (*ptr != NULL) { + ptr = &D_80241CCC_BE0A5C; + *ptr = 0; + set_variable(script, *args, D_80241CD0_BE0A60); + return 2; + } + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_802403D8_9462A8); +/* +ApiStatus N(func_802403D8_9462A8)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + D_80241CD0_BE0A60 = get_variable(script, *args); + D_80241CCC_BE0A5C = 1; + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_34/945F10", func_80240410_9462E0); diff --git a/src/world/area_sbk/sbk_56/953FC0.c b/src/world/area_sbk/sbk_56/953FC0.c index 98249a3aca..854b886560 100644 --- a/src/world/area_sbk/sbk_56/953FC0.c +++ b/src/world/area_sbk/sbk_56/953FC0.c @@ -11,6 +11,12 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024005C_95401C); INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024009C_95405C); INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_802400BC_95407C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_802400E8_9540A8); @@ -21,6 +27,12 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_802401A0_954160); INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024024C_95420C); INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024049C_95445C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_802404C8_954488); @@ -38,4 +50,4 @@ INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_80240BB8_954B78); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_80240D88_954D48); +INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_80240D88_954D48); \ No newline at end of file diff --git a/src/world/area_tik/tik_02/86CA50.c b/src/world/area_tik/tik_02/86CA50.c index ae8715539d..6ace843749 100644 --- a/src/world/area_tik/tik_02/86CA50.c +++ b/src/world/area_tik/tik_02/86CA50.c @@ -1,6 +1,29 @@ #include "tik_02.h" INCLUDE_ASM(s32, "world/area_tik/tik_02/86CA50", func_80240310_86CA50); +/* +ApiStatus N(func_80240310_86CA50)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_05/8750D0.c b/src/world/area_tik/tik_05/8750D0.c index 8cb8d387b6..940b4aa787 100644 --- a/src/world/area_tik/tik_05/8750D0.c +++ b/src/world/area_tik/tik_05/8750D0.c @@ -3,6 +3,29 @@ INCLUDE_ASM(s32, "world/area_tik/tik_05/8750D0", func_80240310_8750D0); INCLUDE_ASM(s32, "world/area_tik/tik_05/8750D0", func_80240680_875440); +/* +ApiStatus N(func_80240680_875440)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_07/879BE0.c b/src/world/area_tik/tik_07/879BE0.c index 0146842a7d..46b0641946 100644 --- a/src/world/area_tik/tik_07/879BE0.c +++ b/src/world/area_tik/tik_07/879BE0.c @@ -17,6 +17,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240034_879C14); INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802402FC_879EDC); INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_8024031C_879EFC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240348_879F28); @@ -27,6 +33,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240400_879FE0); INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802404AC_87A08C); INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802406FC_87A2DC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240728_87A308); @@ -44,4 +56,4 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240E18_87A9F8); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240FE8_87ABC8); +INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_80240FE8_87ABC8); \ No newline at end of file diff --git a/src/world/area_tik/tik_07/87AC00.c b/src/world/area_tik/tik_07/87AC00.c index 259990cfcf..87972bca7a 100644 --- a/src/world/area_tik/tik_07/87AC00.c +++ b/src/world/area_tik/tik_07/87AC00.c @@ -5,23 +5,243 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241020_87AC00); INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241390_87AF70); INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802413F0_87AFD0); +/* +void N(func_802413F0_87AFD0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802415A0_87B180); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241C88_87B868); +/* +void N(func_80241C88_87B868)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80242044_87BC24); +/* +void N(func_80242044_87BC24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80242248_87BE28); +/* +void N(func_80242248_87BE28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802425D8_87C1B8); +/* +void N(func_802425D8_87C1B8)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802426FC_87C2DC); diff --git a/src/world/area_tik/tik_10/8866D0.c b/src/world/area_tik/tik_10/8866D0.c index d5c2fdec98..0d32a0281a 100644 --- a/src/world/area_tik/tik_10/8866D0.c +++ b/src/world/area_tik/tik_10/8866D0.c @@ -7,6 +7,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240310_8866D0); INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_8024069C_886A5C); INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_802406BC_886A7C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_802406E8_886AA8); @@ -17,6 +23,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_802407A0_886B60); INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_8024084C_886C0C); INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240A9C_886E5C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240AC8_886E88); @@ -34,4 +46,4 @@ INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_802411B8_887578); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80241388_887748); +INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80241388_887748); \ No newline at end of file diff --git a/src/world/area_tik/tik_12/8891C0.c b/src/world/area_tik/tik_12/8891C0.c index 43b12e5416..a9f1f67218 100644 --- a/src/world/area_tik/tik_12/8891C0.c +++ b/src/world/area_tik/tik_12/8891C0.c @@ -3,6 +3,29 @@ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_802405F0_8891C0); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240960_889530); +/* +ApiStatus N(func_80240960_889530)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" @@ -15,6 +38,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240960_889530); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240C38_889808); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240C58_889828); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240C84_889854); @@ -25,6 +54,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240D3C_88990C); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240DE8_8899B8); INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80241038_889C08); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80241064_889C34); diff --git a/src/world/area_tik/tik_15/890190.c b/src/world/area_tik/tik_15/890190.c index 591062a7a9..b70b12e0db 100644 --- a/src/world/area_tik/tik_15/890190.c +++ b/src/world/area_tik/tik_15/890190.c @@ -3,6 +3,29 @@ INCLUDE_ASM(s32, "world/area_tik/tik_15/890190", func_802405F0_890190); INCLUDE_ASM(s32, "world/area_tik/tik_15/890190", func_80240960_890500); +/* +ApiStatus N(func_80240960_890500)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_tik/tik_17/892A50.c b/src/world/area_tik/tik_17/892A50.c index 8588723dd5..1a84b3da41 100644 --- a/src/world/area_tik/tik_17/892A50.c +++ b/src/world/area_tik/tik_17/892A50.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_8024004C_892A6C); INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_8024006C_892A8C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240098_892AB8); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240150_892B70); INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_802401FC_892C1C); INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_8024044C_892E6C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240478_892E98); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240B68_893588); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240D38_893758); +INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_80240D38_893758); \ No newline at end of file diff --git a/src/world/area_tik/tik_19/897BD0.c b/src/world/area_tik/tik_19/897BD0.c index b2a48b1003..2f30b317b0 100644 --- a/src/world/area_tik/tik_19/897BD0.c +++ b/src/world/area_tik/tik_19/897BD0.c @@ -5,6 +5,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_8024060C_897BEC); INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_8024062C_897C0C); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240658_897C38); @@ -15,6 +21,12 @@ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240710_897CF0); INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802407BC_897D9C); INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240A0C_897FEC); +/* +s) { + func_800EB168(get_variable(script, *script->ptrReadPos)); + return 2; +} +*/ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240A38_898018); @@ -32,4 +44,4 @@ INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80241128_898708); #include "world/common/UnkPartnerPosFuncs.inc.c" -INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802412F8_8988D8); +INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802412F8_8988D8); \ No newline at end of file diff --git a/src/world/area_trd/trd_00/999F80.c b/src/world/area_trd/trd_00/999F80.c index 19386980cc..66560b7dfd 100644 --- a/src/world/area_trd/trd_00/999F80.c +++ b/src/world/area_trd/trd_00/999F80.c @@ -1,6 +1,29 @@ #include "trd_00.h" INCLUDE_ASM(s32, "world/area_trd/trd_00/999F80", func_80240310_999F80); +/* +ApiStatus N(func_80240310_999F80)(ScriptInstance* script, s32 isInitialCall) { + s32** ptr = &D_80241C68_BE09F8; + s32 i; + s32* test; + + if (*ptr == NULL) { + i = heap_malloc(16 * sizeof(s32)); + *ptr = i; + for (i = 0, test = *ptr; i < 16; i++) { + *test++ = script->varTable[i]; + } + } else { + for (i = 0, test = *ptr; i < 16; i++) { + script->varTable[i] = *test++; + } + ptr = &D_80241C68_BE09F8; + heap_free(*ptr); + *ptr = NULL; + } + return 2; +} +*/ #include "world/common/GetItemName.inc.c" diff --git a/src/world/area_trd/trd_01/99CD80.c b/src/world/area_trd/trd_01/99CD80.c index a9fb2bd9f0..9cd5cd291e 100644 --- a/src/world/area_trd/trd_01/99CD80.c +++ b/src/world/area_trd/trd_01/99CD80.c @@ -14,15 +14,15 @@ INCLUDE_ASM(s32, "world/area_trd/trd_01/99CD80", func_80240BC4_99D554); INCLUDE_ASM(s32, "world/area_trd/trd_01/99CD80", func_80240C78_99D608); -# include "world/common/NpcJumpFunc3.inc.c" +#include "world/common/NpcJumpFunc3.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13_2.inc.c" -# include "world/common/UnkNpcAIFunc11.inc.c" +#include "world/common/UnkNpcAIFunc11.inc.c" -# include "world/common/UnkNpcAIFunc10.inc.c" +#include "world/common/UnkNpcAIFunc10.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_01/99CD80", func_80241104_99DA94); diff --git a/src/world/area_trd/trd_02/9A10C0.c b/src/world/area_trd/trd_02/9A10C0.c index 693ce9d9e5..39b68ae9d5 100644 --- a/src/world/area_trd/trd_02/9A10C0.c +++ b/src/world/area_trd/trd_02/9A10C0.c @@ -11,26 +11,202 @@ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_8024015C_9A113C); INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240474_9A1454); INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_802408B4_9A1894); +/* +ApiStatus N(func_802408B4_9A1894)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240A0C_9A19EC); +/* +void N(func_80240A0C_9A19EC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240D74_9A1D54); +/* +void N(func_80240D74_9A1D54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240F30_9A1F10); +/* +ApiStatus N(func_80240F30_9A1F10)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80241200_9A21E0); +/* +ApiStatus N(func_80241200_9A21E0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80241388_9A2368); +/* +void N(func_80241388_9A2368)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80241448_9A2428); diff --git a/src/world/area_trd/trd_04/9A88A0.c b/src/world/area_trd/trd_04/9A88A0.c index fc19378301..10dbcb10e8 100644 --- a/src/world/area_trd/trd_04/9A88A0.c +++ b/src/world/area_trd/trd_04/9A88A0.c @@ -11,32 +11,233 @@ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_8024052C_9A891C); INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80240844_9A8C34); INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80240C84_9A9074); +/* +ApiStatus N(func_80240C84_9A9074)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc *npc = get_npc_unsafe(enemy->npcID); + f32 ret; + f32 max; + f32 posX; + f32 posZ; + s32 i; + s32 j; + + script->functionTemp[1].s = 0; + max = 32767.0f; + posX = npc->pos.x; + posZ = npc->pos.z; + script->functionTemp[2].s = 0; + + for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) { + ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z); + if (ret < max) { + max = ret; + script->functionTemp[2].s = j; + } + } + + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + + script->functionTemp[0].s = 1; + return 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80240DDC_9A91CC); +/* +void N(func_80240DDC_9A91CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 x, z; + s32 var; + + if (aiSettings->unk_14 >= 0) { + if (script->functionTemp[1].s <= 0) { + script->functionTemp[1].s = aiSettings->unk_14; + if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } + script->functionTemp[1].s--; + } + + if (npc->unk_8C == 0) { + if (npc->moveSpeed < 4.0) { + func_8003D660(npc, 0); + } else { + func_8003D660(npc, 1); + } + + x = script->functionTemp[2].s[enemy->territory->patrol.points].x; + z = script->functionTemp[2].s[enemy->territory->patrol.points].z; + npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) { + script->functionTemp[0].s = 2; + script->functionTemp[1].s = (rand_int(1000) % 3) + 2; + if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) || + (aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) { + script->functionTemp[0].s = 4; + } + if (rand_int(10000) % 100 < aiSettings->moveTime) { + script->functionTemp[0].s = 4; + } + } + } +} +*/ #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241144_9A9534); +/* +void N(func_80241144_9A9534)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + func_800494C0(npc, 0x2F4, 0x200000); + if (!(enemy->npcSettings->unk_2A & 1)) { + script->functionTemp[0].s = 12; + } else { + script->functionTemp[0].s = 10; + } + } else if (npc->unk_8C == 0) { + npc->duration--; + if (npc->duration == 0) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s != 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); + } else { + script->functionTemp[0].s = 4; + } + } + } +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241300_9A96F0); +/* +ApiStatus N(func_80241300_9A96F0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + script->functionTemp[2].s++; + if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { + script->functionTemp[2].s = 0; + } + npc->currentAnim = enemy->animList[1]; + if (enemy->territory->patrol.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0; + } + script->functionTemp[0].s = 1; + return 1; +} +*/ #include "world/common/NpcJumpFunc2.inc.c" -# include "world/common/NpcJumpFunc.inc.c" +#include "world/common/NpcJumpFunc.inc.c" #include "world/common/UnkNpcAIFunc13.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_802415D0_9A99C0); +/* +ApiStatus N(func_802415D0_9A99C0)(ScriptInstance* script, s32 isInitialCall) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 var; + + if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); + npc->currentAnim = enemy->animList[0]; + npc->duration = 25; + script->functionTemp[0].s = 14; + } else { + func_8003D660(npc, 1); + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + if (npc->duration > 0) { + npc->duration--; + } else { + script->functionTemp[0].s = 12; + } + } +} +*/ #include "world/common/UnkNpcDurationFlagFunc.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241758_9A9B48); +/* +void N(func_80241758_9A9B48)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + s32 i; + + for (i = script->functionTemp[2].s; i < enemy->territory->patrol.numPoints; i++) { + if (i[enemy->territory->patrol.points].y <= npc->pos.y) { + script->functionTemp[2].s = i; + break; + } + } + + npc->moveSpeed = aiSettings->moveSpeed; + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241818_9A9C08); INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241B14_9A9F04); INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241E18_9AA208); +/* +void N(func_80241E18_9AA208)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241FC8_9AA3B8); @@ -45,18 +246,213 @@ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80241FC8_9AA3B8); #define NAMESPACE trd_04 INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_802426B0_9AAAA0); +/* +void N(func_802426B0_9AAAA0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80242A6C_9AAE5C); +/* +void N(func_80242A6C_9AAE5C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80242C70_9AB060); +/* +void N(func_80242C70_9AB060)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80243000_9AB3F0); +/* +void N(func_80243000_9AB3F0)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_04/9A88A0", func_80243124_9AB514); diff --git a/src/world/area_trd/trd_07/9B6C90.c b/src/world/area_trd/trd_07/9B6C90.c index 41b8208409..0dbc7ab715 100644 --- a/src/world/area_trd/trd_07/9B6C90.c +++ b/src/world/area_trd/trd_07/9B6C90.c @@ -11,24 +11,244 @@ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_8024038C_9B6D0C); INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_802406A4_9B7024); INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80240AE4_9B7464); +/* +void N(func_80240AE4_9B7464)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); + if (is_point_within_region(enemy->territory->wander.wanderShape, + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); + } else { + npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); + } + npc->currentAnim = enemy->animList[1]; + script->functionTemp[1].s = 0; + if (enemy->territory->wander.moveSpeedOverride < 0) { + npc->moveSpeed = aiSettings->moveSpeed; + } else { + npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0; + } + enemy->varTable[4] = npc->pos.y * 100.0; + script->functionTemp[0].s = 1; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80240C94_9B7614); #include "world/common/UnkNpcAIFunc1.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_8024137C_9B7CFC); +/* +void N(func_8024137C_9B7CFC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f24 = (f32)enemy->varTable[3] / 100.0; + f32 temp_f26 = temp_f24 + (f32)((f32)enemy->varTable[7] / 100.0); + s32 var; + + if (npc->duration > 0) { + npc->duration--; + } + + if (enemy->varTable[1] > 0) { + f32 temp_f22 = (f32)enemy->varTable[1] / 100.0; + f32 sin_degrees = sin_deg(enemy->varTable[2]); + s32 phi_v0; + + if (npc->flags & 8) { + phi_v0 = FALSE; + } else { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } + + if (phi_v0) { + npc->pos.y = posY + temp_f24 + (sin_degrees * temp_f22); + } else { + npc->pos.y = temp_f26 + (sin_degrees * temp_f22); + } + + enemy->varTable[2] = clamp_angle(enemy->varTable[2] + 10); + } + + if (enemy->varTable[9] <= 0) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) { + fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); + npc->moveToPos.y = npc->pos.y; + func_800494C0(npc, 0x2F4, 0x200000); + if (enemy->npcSettings->unk_2A & 1) { + script->functionTemp[0].s = 10; + } else { + script->functionTemp[0].s = 12; + } + return; + } + } else { + enemy->varTable[9]--; + } + + if ((npc->unk_8C == 0) && (npc->duration <= 0)) { + script->functionTemp[1].s--; + if (script->functionTemp[1].s > 0) { + if (!(enemy->npcSettings->unk_2A & 0x10)) { + npc->yaw = clamp_angle(npc->yaw + 180.0f); + } + npc->duration = (rand_int(1000) % 11) + 5; + } else { + script->functionTemp[0].s = 0; + } + } +} +*/ #include "world/common/UnkNpcAIFunc2.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241738_9B80B8); +/* +void N(func_80241738_9B80B8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->pos.y += N(D_802436DC_BE6E8C)[npc->duration++]; + if (npc->duration >= 5) { + script->functionTemp[0].s = 12; + } +} +*/ #include "world/common/UnkNpcAIFunc14.inc.c" #include "world/common/UnkNpcAIFunc3.inc.c" INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_8024193C_9B82BC); +/* +void N(func_8024193C_9B82BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + f32 posX, posY, posZ, posW; + f32 temp_f0_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + s32 phi_v0; + f32 phi_f20; + f32 a = enemy->varTable[3]; + f32 b = enemy->varTable[7]; + + npc->jumpVelocity += npc->jumpScale; + temp_f20 = a / 100.0; + temp_f22 = b / 100.0; + npc_move_heading(npc, npc->moveSpeed, npc->yaw); + + if (npc->jumpVelocity >= 0.0) { + npc->pos.y += npc->jumpVelocity; + npc->currentAnim = enemy->animList[9]; + enemy->unk_07 = 0; + if (!(npc->flags & 8)) { + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + phi_v0 = func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + } else { + phi_v0 = FALSE; + } + if (phi_v0) { + temp_f2 = posY + temp_f20; + if (temp_f2 <= npc->pos.y) { + npc->pos.y = temp_f2; + script->functionTemp[0].s = 0; + } + } else if (npc->pos.y >= npc->moveToPos.y) { + script->functionTemp[0].s = 0; + } + } else if (npc->jumpVelocity < 0.0) { + npc->duration++; + if (npc->duration >= aiSettings->unk_20) { + npc->duration = 0; + phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20); + if (aiSettings->unk_1C < fabsf(temp_f0_2)) { + phi_f20 = npc->yaw; + if (temp_f0_2 < 0.0f) { + phi_f20 += -aiSettings->unk_1C; + } else { + phi_f20 += aiSettings->unk_1C; + } + } + npc->yaw = clamp_angle(phi_f20); + } + + if (npc->flags & 8) { + if (npc->pos.y + npc->jumpVelocity < temp_f22) { + npc->pos.y = temp_f22; + npc->jumpVelocity = 0.0f; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } + + posX = npc->pos.x; + posY = npc->pos.y + npc->collisionHeight; + posZ = npc->pos.z; + posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) { + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { + npc->jumpVelocity = 0.0f; + npc->pos.y = posY; + } else { + npc->pos.y += npc->jumpVelocity; + } + return; + } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVelocity; + return; + } + npc->jumpVelocity = 0.0f; + } +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241CCC_9B864C); +/* +void N(func_80241CCC_9B864C)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { + f32 posX, posY, posZ, posW; + s32 temp_a1; + s32 temp_v1; + s32 phi_v0; + + script->functionTemp[0].s = 0; + npc->duration = 0; + temp_v1 = npc->flags & ~0x200; + npc->flags = (npc->flags & ~0x200) | 0x800; + if (enemy->territory->wander.isFlying) { + npc->flags = temp_v1 | 0x808; + } else { + npc->flags = npc->flags & ~8; + } + + posX = npc->pos.x; + posY = npc->pos.y; + posZ = npc->pos.z; + posW = 1000.0f; + func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW); + enemy->varTable[2] = 0; + enemy->varTable[9] = 0; + enemy->varTable[3] = ((posW * 100.0) + 0.5); + enemy->varTable[7] = ((posY * 100.0) + 0.5); + script->functionTemp[1].s = aiSettings->unk_14; + enemy->unk_B0 |= 0x10; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_07/9B6C90", func_80241DF0_9B8770); diff --git a/src/world/area_trd/trd_10/9C2910.c b/src/world/area_trd/trd_10/9C2910.c index 7aca97017a..5a7ff91397 100644 --- a/src/world/area_trd/trd_10/9C2910.c +++ b/src/world/area_trd/trd_10/9C2910.c @@ -1,15 +1,100 @@ #include "trd_10.h" INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_80240000_9C2910); +/* +ApiStatus N(func_80240000_9C2910)(ScriptInstance* script, s32 isInitialCall) { + arn_07_struct* ptr = script->varTable[0]; + + sfx_adjust_env_sound_pos(0xA2, 0, ptr->unk_00, ptr->unk_04, ptr->unk_08); + return ((ptr->unk_44 < 2) == 0) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_8024004C_9C295C); +/* +ApiStatus N(func_8024004C_9C295C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + set_variable(NULL, SI_MAP_VAR(1), ptr); + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_3C = get_variable(script, *args++); + ptr->unk_0C = get_float_variable(script, *args++); + ptr->unk_10 = get_float_variable(script, *args++); + ptr->unk_14 = get_float_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_1C = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_50 = (struct N(temp)*)func_800729B0(2, ptr->unk_0C, ptr->unk_10, ptr->unk_14, 1.0f, 0); + ptr->unk_4E = 0; + ptr->unk_48 = 0; + ptr->unk_4A = 0; + ptr->unk_44 = 0; + ptr->unk_46 = 0; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_802401AC_9C2ABC); INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_802405BC_9C2ECC); +/* +ApiStatus N(func_802405BC_9C2ECC)(ScriptInstance* script, s32 isInitialCall) { + s32 var = get_variable(script, *script->ptrReadPos); + arn_07_struct* ptr = script->varTable[0]; + + return (ptr->unk_4E == var) * ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_802405FC_9C2F0C); +/* +ApiStatus N(func_802405FC_9C2F0C)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + arn_07_struct* ptr = heap_malloc(sizeof(arn_07_struct)); + script->varTable[0] = ptr; + ptr->unk_38 = get_variable(script, *args++); + ptr->unk_18 = get_float_variable(script, *args++); + ptr->unk_24 = get_float_variable(script, *args++); + ptr->unk_20 = get_float_variable(script, *args++); + ptr->unk_28 = get_float_variable(script, *args++); + ptr->unk_54 = func_800726B0(1, ptr->unk_18, ptr->unk_24, ptr->unk_20, 1.0f, 0); + ptr->unk_54->unk_0C->unk_34 = ptr->unk_38; + ptr->unk_54->unk_0C->unk_20 = 0; + ptr->unk_40 = create_shadow_type(0, ptr->unk_18, ptr->unk_28, ptr->unk_20); + ptr->unk_4C = 0x10E; + } + + return ApiStatus_DONE2; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_80240708_9C3018); +/* +ApiStatus N(func_80240708_9C3018)(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + arn_07_struct* ptr = script->varTable[0]; + + ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); + ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); + if (dist2D(playerStatus->position.x, playerStatus->position.z, + ptr->unk_18, ptr->unk_20) <= 30.0f) { + ptr->unk_4E = 3; + } + ptr->unk_54->unk_0C->unk_04 = ptr->unk_18; + ptr->unk_54->unk_0C->unk_08 = ptr->unk_04; + ptr->unk_54->unk_0C->unk_0C = ptr->unk_20; + + return 0; +} +*/ INCLUDE_ASM(s32, "world/area_trd/trd_10/9C2910", func_802407F4_9C3104); diff --git a/src/world/common/NpcJumpFunc.inc.c b/src/world/common/NpcJumpFunc.inc.c index 6b5ce4adb3..bea712fabb 100644 --- a/src/world/common/NpcJumpFunc.inc.c +++ b/src/world/common/NpcJumpFunc.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(NpcJumpFunc)(ScriptInstance* script) { +void N(NpcJumpFunc)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); npc->pos.y += npc->jumpVelocity; diff --git a/src/world/common/NpcJumpFunc2.inc.c b/src/world/common/NpcJumpFunc2.inc.c index f9ba1f5472..ffd9ef85d5 100644 --- a/src/world/common/NpcJumpFunc2.inc.c +++ b/src/world/common/NpcJumpFunc2.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(NpcJumpFunc2)(ScriptInstance* script) { +void N(NpcJumpFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/SomeXYZFuncTodoRename.inc.c b/src/world/common/SomeXYZFuncTodoRename.inc.c index 4c7325756a..bc473a1545 100644 --- a/src/world/common/SomeXYZFuncTodoRename.inc.c +++ b/src/world/common/SomeXYZFuncTodoRename.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(SomeXYZFuncTodoRename)(ScriptInstance* script, s32 isInitialStatus) { +ApiStatus N(SomeXYZFuncTodoRename)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; Bytecode* args = script->ptrReadPos; s32 xVar = *args++; diff --git a/src/world/common/UnkDurationCheck.inc.c b/src/world/common/UnkDurationCheck.inc.c index 2825525ea0..5d1e2b4b8a 100644 --- a/src/world/common/UnkDurationCheck.inc.c +++ b/src/world/common/UnkDurationCheck.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkDurationCheck)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing* shape) { +void N(UnkDurationCheck)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); npc->duration--; diff --git a/src/world/common/UnkNpcAIFunc1.inc.c b/src/world/common/UnkNpcAIFunc1.inc.c index c17c1c3176..cb1ca277d6 100644 --- a/src/world/common/UnkNpcAIFunc1.inc.c +++ b/src/world/common/UnkNpcAIFunc1.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc1)(ScriptInstance* script, NpcAISettings* aiSettings) { +void N(UnkNpcAIFunc1)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc13.inc.c b/src/world/common/UnkNpcAIFunc13.inc.c index 2701a26b7a..b4605cbda7 100644 --- a/src/world/common/UnkNpcAIFunc13.inc.c +++ b/src/world/common/UnkNpcAIFunc13.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 tempAngle; diff --git a/src/world/common/UnkNpcAIFunc14.inc.c b/src/world/common/UnkNpcAIFunc14.inc.c index 957445b302..439788c699 100644 --- a/src/world/common/UnkNpcAIFunc14.inc.c +++ b/src/world/common/UnkNpcAIFunc14.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings) { +void N(UnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 vt5 = enemy->varTable[5]; diff --git a/src/world/common/UnkNpcAIFunc16.inc.c b/src/world/common/UnkNpcAIFunc16.inc.c index d49b180949..29deeefff1 100644 --- a/src/world/common/UnkNpcAIFunc16.inc.c +++ b/src/world/common/UnkNpcAIFunc16.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc17.inc.c b/src/world/common/UnkNpcAIFunc17.inc.c index c0c9d56d89..68ffad1335 100644 --- a/src/world/common/UnkNpcAIFunc17.inc.c +++ b/src/world/common/UnkNpcAIFunc17.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc17)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc17)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc18.inc.c b/src/world/common/UnkNpcAIFunc18.inc.c index a7f23cd7cc..73f49130cc 100644 --- a/src/world/common/UnkNpcAIFunc18.inc.c +++ b/src/world/common/UnkNpcAIFunc18.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc18)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc19.inc.c b/src/world/common/UnkNpcAIFunc19.inc.c index fbee4c6891..8a602a8afa 100644 --- a/src/world/common/UnkNpcAIFunc19.inc.c +++ b/src/world/common/UnkNpcAIFunc19.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc19)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc19)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc1_copy.inc.c b/src/world/common/UnkNpcAIFunc1_copy.inc.c new file mode 100644 index 0000000000..32761f89ec --- /dev/null +++ b/src/world/common/UnkNpcAIFunc1_copy.inc.c @@ -0,0 +1,12 @@ +#include "common.h" +#include "map.h" + +void N(UnkNpcAIFunc1_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { + Enemy* enemy = script->owner1.enemy; + Npc* npc = get_npc_unsafe(enemy->npcID); + + npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); + npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); + npc->currentAnim = *enemy->animList; + script->functionTemp[0].s = 3; +} diff --git a/src/world/common/UnkNpcAIFunc2.inc.c b/src/world/common/UnkNpcAIFunc2.inc.c index 90f33b85a4..069479e9c8 100644 --- a/src/world/common/UnkNpcAIFunc2.inc.c +++ b/src/world/common/UnkNpcAIFunc2.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc2)(ScriptInstance* script) { +void N(UnkNpcAIFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); PlayerStatus* playerStatus = gPlayerStatusPtr; diff --git a/src/world/common/UnkNpcAIFunc20.inc.c b/src/world/common/UnkNpcAIFunc20.inc.c index be11fc7ab2..ca5af0032d 100644 --- a/src/world/common/UnkNpcAIFunc20.inc.c +++ b/src/world/common/UnkNpcAIFunc20.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc20)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); npc->duration--; diff --git a/src/world/common/UnkNpcAIFunc21.inc.c b/src/world/common/UnkNpcAIFunc21.inc.c index bade2eebff..6b84181f7b 100644 --- a/src/world/common/UnkNpcAIFunc21.inc.c +++ b/src/world/common/UnkNpcAIFunc21.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc21)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc21)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc22.inc.c b/src/world/common/UnkNpcAIFunc22.inc.c index 7484e37881..e093171299 100644 --- a/src/world/common/UnkNpcAIFunc22.inc.c +++ b/src/world/common/UnkNpcAIFunc22.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc22)(ScriptInstance* script, NpcAISettings* aiSettings, s32 arg2) { +void N(UnkNpcAIFunc22)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkNpcAIFunc3.inc.c b/src/world/common/UnkNpcAIFunc3.inc.c index deb19e483f..ac9c7cbca0 100644 --- a/src/world/common/UnkNpcAIFunc3.inc.c +++ b/src/world/common/UnkNpcAIFunc3.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcAIFunc3)(ScriptInstance* script) { +void N(UnkNpcAIFunc3)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); if ((npc->duration <= 0) || (--npc->duration <= 0)) { diff --git a/src/world/common/UnkNpcDurationFlagFunc.inc.c b/src/world/common/UnkNpcDurationFlagFunc.inc.c index 6c917b861a..8c3641a967 100644 --- a/src/world/common/UnkNpcDurationFlagFunc.inc.c +++ b/src/world/common/UnkNpcDurationFlagFunc.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkNpcDurationFlagFunc)(ScriptInstance* script) { +void N(UnkNpcDurationFlagFunc)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/world.c b/src/world/world.c index acd9fde276..976ed59287 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -643,18 +643,19 @@ Map obk_maps[] = { }; /// Gusty Gulch +#include "area_arn/arn.h" Map arn_maps[] = { - { MAP_UNSPLIT(arn_02, 0x80241000), .bgName = "arn_bg" }, - { MAP_UNSPLIT(arn_03, 0x80241740), .bgName = "arn_bg" }, - { MAP_UNSPLIT(arn_04, 0x80243390), .bgName = "arn_bg" }, - { MAP_UNSPLIT(arn_05, 0x80241320), .bgName = "arn_bg" }, - { MAP_UNSPLIT(arn_07, 0x80241ED0), .bgName = "arn_bg" }, - { MAP_UNSPLIT(arn_08, 0x802402C0), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, - { MAP_UNSPLIT(arn_09, 0x80240060), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, - { MAP_UNSPLIT(arn_10, 0x80240020), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, - { MAP_UNSPLIT(arn_11, 0x80240010), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, - { MAP_UNSPLIT(arn_12, 0x80240020), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, - { MAP_UNSPLIT(arn_13, 0x80240020), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_02), .bgName = "arn_bg" }, + { MAP(arn_03), .bgName = "arn_bg" }, + { MAP(arn_04), .bgName = "arn_bg" }, + { MAP(arn_05), .bgName = "arn_bg" }, + { MAP(arn_07), .bgName = "arn_bg" }, + { MAP(arn_08), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_09), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_10), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_11), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_12), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, + { MAP(arn_13), .unk_1C = { .bytes = { .songVariation = 1, .flags = 1 } } }, }; /// Tubba Blubba's Castle diff --git a/tools/assist_copy_paste.py b/tools/assist_copy_paste.py new file mode 100644 index 0000000000..55ffe5e3ee --- /dev/null +++ b/tools/assist_copy_paste.py @@ -0,0 +1,132 @@ +import sys +from pathlib import Path + +def get_file_name(name): + out = "" + decomp = False + if name: + if "matches total" in name: + name = name.split(" - ",1)[0] + decomp = True + if name[3] == "_": + name = name[7:] + else: + name = name.split(" - ",1)[1] + if "(decompiled)" in name: + decomp = True + name = name.split(" ",1)[0] + if name[3] == "_": + name = name[7:] + name = name.strip() + out = name + return out, decomp + +def find_file_path(looking_for): + global map_ + file_name, decomp = get_file_name(looking_for) + file_path = "" + if file_name: + for i,line in enumerate(map_): + if file_name in line: + x = i + while not map_[x].startswith(" .text"): + x -= 1 + x -= 1 + file_path = map_[x].split(".o",1)[0].split("build/",1)[1].strip() + break + if file_path: + if not "src/world/area_" in file_path: + file_path = "" + return file_name, file_path, decomp + +map_file = (Path(__file__).parent.parent / "ver" / "current" / "build" / "papermario.map").read_text().splitlines() +# cut out half the map +map_ = [] +found_header = False +for line in map_file: + if line.startswith(".header"): + found_header = True + if found_header: + map_.append(line) + +del map_file + +files = sys.stdin.read().splitlines() + +if not files or "found no matches" in files[0]: + print(f"Could not find any matching functions") + exit() + +#first get the decomped code +function_text = "" + +function, file_path, decomp = find_file_path(files[0]) +if decomp and file_path != "": + file_path = (Path(__file__).parent.parent / file_path).resolve() + func_file = file_path.read_text().splitlines() + for i,line in enumerate(func_file): + if line: + line = line.strip() + split_line = line.split(" ") + if len(split_line) > 2 and function in split_line[1] and (split_line[0] == "void" or split_line[0] == "s32" or split_line[0] == "ApiStatus"): + out = ["/*"] + while not func_file[i].startswith("}"): + out.append(func_file[i]) + i += 1 + out.append("}") + out.append("*/") + + func_name_start = out[1].find("N(") + func_name_end = out[1].find(")") + out[1] = out[1][:func_name_start+2] + out[1][func_name_end:] + + function_text = "\n".join(out) + +if function_text == "": + print(f"Unable to find a decompiled function to copy code from") + exit() + +for file in files[1:]: + if not file: + continue + function, file_path, decomp = find_file_path(file) + + if file_path == "": + continue + + if not function: + print(f"Failed to find {file}") + continue + + print(f"Func:\"{function}\" path:\"{file_path}\" Decomped: {decomp}") + + file_path = (Path(__file__).parent.parent / file_path).resolve() + + # don't want to try and replace already-decompiled functions + if decomp: + print(f"{file_path} already has this function decompiled") + continue + + func_file = file_path.read_text().splitlines() + new_func_file = [] + for i,line in enumerate(func_file): + if line: + stripped_line = line.strip() + split_line = stripped_line.split(" ") + + if len(split_line) > 2 and "INCLUDE_ASM" in split_line[0] and function in split_line[2] and i+1 < len(func_file) and "/*" not in func_file[i+1]: + new_func_file.append(stripped_line) + temp = function_text.splitlines() + temp[1] = temp[1].replace("N()", f"N({function})") + new_func_file.append("\n".join(temp)) + elif len(split_line) > 2 and "INCLUDE_ASM" in split_line[0] and function in split_line[2] and i+1 < len(func_file) and "/*" in func_file[i+1]: + print(f"{file_path} already has this function commented out") + new_func_file.append(line) + else: + new_func_file.append(line) + else: + new_func_file.append(line) + + #print(f"Altering {file_path}") + #print("\n".join(new_func_file)) + file_path.write_text("\n".join(new_func_file)) diff --git a/tools/compile_dsl_macros.py b/tools/compile_dsl_macros.py index 31621e7afb..0987dad119 100755 --- a/tools/compile_dsl_macros.py +++ b/tools/compile_dsl_macros.py @@ -5,7 +5,8 @@ from lark import Lark, exceptions, Tree, Transformer, Visitor, v_args, Token from lark.visitors import Discard import traceback -DEBUG_OUTPUT = None # "debug.i" +DEBUG_OUTPUT = "debug.i" # None # + def eprint(*args, **kwargs): print(*args, file=stderr, **kwargs) @@ -43,6 +44,8 @@ script_parser = Lark(r""" | "goto" label -> label_goto | "return" -> return_stmt | "break" -> break_stmt + | "break match" -> break_match_stmt + | "break loop" -> break_loop_stmt | "sleep" expr -> sleep_stmt | "sleep" expr "secs" -> sleep_secs_stmt | "spawn" expr -> spawn_stmt @@ -461,6 +464,12 @@ class Compile(Transformer): def break_stmt(self, tree): return BreakCmd(meta=tree.meta) + def break_match_stmt(self, tree): + return Cmd("ScriptOpcode_BREAK_MATCH", meta=tree.meta) + + def break_loop_stmt(self, tree): + return Cmd("ScriptOpcode_BREAK_LOOP", meta=tree.meta) + def set_group(self, tree): return Cmd("ScriptOpcode_SET_GROUP", tree.children[0], meta=tree.meta) @@ -667,14 +676,14 @@ def compile_script(s): return commands -def read_until_closing_paren(depth=1, lex_strings=False): +def read_until_closing_paren(f, depth=1, lex_strings=False): text = "" in_string = False string_escape = False while True: - char = stdin.read(1) + char = f.read(1) if len(char) == 0: # EOF @@ -697,11 +706,11 @@ def read_until_closing_paren(depth=1, lex_strings=False): return text -def read_line(): +def read_line(f): line = "" while True: - char = stdin.read(1) + char = f.read(1) if len(char) == 0: # EOF @@ -733,9 +742,21 @@ def gen_line_map(source, source_line_no = 1): return output, line_map # Expects output from C preprocessor on argv +SINGLE_FILE = False +import sys + if __name__ == "__main__": if DEBUG_OUTPUT is not None: DEBUG_OUTPUT = open(DEBUG_OUTPUT, "w") + ''' + while char := stdin.read(1): + DEBUG_OUTPUT.write(char) + exit() + ''' + + in_file = stdin + if SINGLE_FILE: + in_file = open(sys.argv[1], "r") line_no = 1 char_no = 1 @@ -745,7 +766,7 @@ if __name__ == "__main__": macro_name = "" # captures recent UPPER_CASE identifier prev_char = "" while not error: - char = stdin.read(1) + char = in_file.read(1) if len(char) == 0: # EOF @@ -754,7 +775,7 @@ if __name__ == "__main__": if char == "#" and (prev_char == "\n" or prev_char == ""): # cpp line/file marker - line = read_line() + line = read_line(in_file) line_split = line[1:].split(" ") line_no = int(line_split[0]) @@ -762,11 +783,15 @@ if __name__ == "__main__": write("#" + line + "\n") elif char == "(": - filename = file_info[0][1:-1] + if SINGLE_FILE: + filename = sys.argv[1] + else: + filename = file_info[0][1:-1] # SCRIPT(...) if macro_name == "SCRIPT": - script_source, line_map = gen_line_map(read_until_closing_paren(lex_strings=True), source_line_no=line_no) + read_data = read_until_closing_paren(in_file, lex_strings=True) + script_source, line_map = gen_line_map(read_data, source_line_no=line_no) try: commands = compile_script(script_source) diff --git a/tools/disasm_script.py b/tools/disasm_script.py index 8599225b60..ea9babcf55 100755 --- a/tools/disasm_script.py +++ b/tools/disasm_script.py @@ -54,7 +54,7 @@ def script_lib(offset): _script_lib[vaddr] = [] _script_lib[vaddr].append([int(raddr, 16), name]) - # Sort the symbols for each vram address by the difference + # Sort the symbols for each vram address by the difference # between their rom address and the offset passed in. # If offset - rom address goes below 0, it's part of the # previous file, so treat it as min priority, same as a default. @@ -74,9 +74,12 @@ def get_constants(): global CONSTANTS global VALID_SAVE_VARS - valid_enums = { "StoryProgress", "ItemIDs", "PlayerAnims", "ActorIDs", "Events", "SoundIDs", "SongIDs", "Locations" } + valid_enums = { "StoryProgress", "ItemIDs", "PlayerAnims", + "ActorIDs", "Events", "SoundIDs", "SongIDs", "Locations", + "AmbientSounds", "NpcIDs", "Emotes", "NpcFlags" } for enum in valid_enums: CONSTANTS[enum] = {} + CONSTANTS["NPC_SPRITE"] = {} [SAVE_VARS.add(x) for x in ["WORLD_LOCATION", "STORY_PROGRESS"]] @@ -84,7 +87,7 @@ def get_constants(): enums = Path(include_path / "enums.h").read_text().splitlines() ''' - # define stuff + # defines for line in enums: this_enum = "" for enum in valid_defines: @@ -106,18 +109,23 @@ def get_constants(): enum_name = line.split(" ",1)[1].split(" {",1)[0] if enum_name in valid_enums: CONSTANTS[enum_name] = {} - last_num = 0 + last_num = -1 i += 1 while "}" not in enums[i]: if not enums[i]: i += 1 continue - name = enums[i].strip() + if "//" in enums[i]: + name = enums[i].split("//",1)[0].strip() + else: + name = enums[i].strip() val = last_num+1 if "=" in name: name, val = name.split(" = ") val = int(val[:-1], 0) + if val >= 0x80000000: + val -= 0x100000000 else: name = name[:-1] name = name.strip() @@ -127,72 +135,205 @@ def get_constants(): i += 1 last_num = val + # sprites + sprite_path = Path(Path(__file__).resolve().parent.parent / "ver" / "current" / "build" / "include" / "sprite" / "npc") + for file in sprite_path.iterdir(): + fd = file.read_text() + for line in fd.splitlines(): + if "#define _NPC_SPRITE_" in line: + enum = "NPC_SPRITE" + elif "#define _NPC_PALETTE_" in line: + enum = "NPC_PALETTE" + elif "#define _NPC_ANIM_" in line: + enum = "NPC_ANIM" + else: + continue + + name = line.split(" ",2)[1] + id_ = line.split("0x", 1)[1] + if " " in id_: + id_ = id_.split(" ",1)[0] + name = name.split(f"_{enum}_", 1)[1] + if enum == "NPC_SPRITE": + saved_name = name + saved_id = id_ + else: + name = name.rsplit(f"{saved_name}_")[1] + + if enum == "NPC_SPRITE": + if int(id_, 16) not in CONSTANTS["NPC_SPRITE"]: + CONSTANTS[enum][int(id_, 16)] = {"name":"", "palettes":{}, "anims":{}} + CONSTANTS[enum][int(id_, 16)]["name"] = name + elif enum == "NPC_PALETTE": + CONSTANTS["NPC_SPRITE"][int(saved_id, 16)]["palettes"][int(id_, 16)] = name + elif enum == "NPC_ANIM": + CONSTANTS["NPC_SPRITE"][int(saved_id, 16)]["anims"][int(id_, 16)] = name + return -def fix_args(args, info): +def fix_args(self, func, args, info): global CONSTANTS new_args = [] for i,arg in enumerate(args.split(", ")): + if ((arg == "D_80000000") or (arg.startswith("D_B")) or + (i == 0 and func == "MakeEntity" and arg.startswith("D_"))): + arg = "0x" + arg[2:] + if "0x" in arg and int(arg, 16) >= 0xF0000000: + arg = f"{int(arg, 16) - 0x100000000}" if i in info: - if "0x" in arg: - argNum = int(arg, 16) - else: - argNum = int(arg, 10) + if "_" in arg: + new_args.append(f"{arg}") + continue + argNum = int(arg, 0) - if argNum in CONSTANTS[info[i]]: + if info[i] == "Bool": + new_args.append(f"{'TRUE' if argNum == True else 'FALSE'}") + elif info[i] == "Hex": + new_args.append(f"0x{argNum:08X}") + elif info[i] == "CustomAnim": + sprite = (argNum & 0xFF0000) >> 16 + palette = (argNum & 0xFF00) >> 8 + anim = (argNum & 0xFF) >> 0 + + if argNum in CONSTANTS["PlayerAnims"]: + call = f"{CONSTANTS['PlayerAnims'][argNum]}" + else: + if sprite == 0: + print(f"Sprite was 0, is this really valid? Arg 0x{argNum:X} -- sprite: {sprite}, palette: {palette}, anim: {anim}") + call = "NPC_ANIM(" + if sprite in CONSTANTS["NPC_SPRITE"]: + call += f"{CONSTANTS['NPC_SPRITE'][sprite]['name']}, " + if palette in CONSTANTS["NPC_SPRITE"][sprite]["palettes"]: + call += f"{CONSTANTS['NPC_SPRITE'][sprite]['palettes'][palette]}, " + else: + call += f"0x{palette:02X}, " + if anim in CONSTANTS["NPC_SPRITE"][sprite]["anims"]: + call += f"{CONSTANTS['NPC_SPRITE'][sprite]['anims'][anim]}" + else: + call += f"0x{anim:02X}" + call += ")" + self.INCLUDES_NEEDED["npcs"].add(CONSTANTS['NPC_SPRITE'][sprite]['name']) + else: + call += f"0x{sprite:02X}, 0x{palette:02X}, 0x{anim:02X})" + + new_args.append(call) + elif info[i] == "CustomMsg": + type_ = (argNum & 0xFF0000) >> 16 + num_ = (argNum & 0xFFFF) >> 0 + new_args.append(f"MESSAGE_ID(0x{type_:02X}, 0x{num_:04X})") + + elif argNum in CONSTANTS[info[i]]: new_args.append(f"{CONSTANTS[info[i]][argNum]}") else: - print(f"{argNum:X} was not found within {info[i]} CONSTANTS, add it.") - if info[i] == "SoundIDs": - # Ethan wanted sound IDs in hex instead, so convert it back - if "0x" not in arg: - argNum = int(arg, 10) - arg = f"0x{argNum:X}" - new_args.append(f"{arg}") + if not (info[i] == "NpcIDs" and argNum > 0): + print(f"0x{argNum:X} was not found within {info[i]} constants, add it.") + #Print the unknowns in hex + new_args.append(f"0x{int(argNum):X}") else: new_args.append(f"{arg}") return ", ".join(new_args) replace_funcs = { + "AddActorDecoration" :{0:"ActorIDs"}, + "AddKeyItem" :{0:"ItemIDs"}, + "AddGoalPos" :{0:"ActorIDs"}, + + "BattleCamTargetActor" :{0:"ActorIDs"}, + "BindNpcAI" :{0:"NpcIDs"}, + "BindNpcDefeat" :{0:"NpcIDs"}, + "BindNpcIdle" :{0:"NpcIDs"}, + "BindNpcInteract" :{0:"NpcIDs"}, + + "ContinueSpeech" :{1:"CustomAnim", 2:"CustomAnim", 4:"CustomMsg"}, + + "DisablePlayerInput" :{0:"Bool"}, + "DisablePlayerPhysics" :{0:"Bool"}, "DispatchDamagePlayerEvent" :{1:"Events"}, "DispatchEvent" :{0:"ActorIDs"}, + "EnableIdleScript" :{0:"ActorIDs"}, + "EnableNpcShadow" :{0:"NpcIDs", 1:"Bool"}, + "EnemyDamageTarget" :{0:"ActorIDs"}, + "EnemyTestTarget" :{0:"ActorIDs"}, + "ForceHomePos" :{0:"ActorIDs"}, - + + "func_802CFE2C" :{0:"NpcIDs"}, + "func_802CFD30" :{0:"NpcIDs"}, + "func_802D2520" :{0:"PlayerAnims"}, + "GetActorPos" :{0:"ActorIDs"}, "GetGoalPos" :{0:"ActorIDs"}, "GetItemPower" :{0:"ItemIDs"}, + "GetLastEvent" :{0:"ActorIDs"}, + "GetNpcPos" :{0:"NpcIDs"}, + + "HidePlayerShadow" :{0:"Bool"}, + "HPBarToHome" :{0:"ActorIDs"}, + + "InterpNpcYaw" :{0:"NpcIDs"}, "JumpToGoal" :{0:"ActorIDs"}, - "MakeEntity" :{5:"ItemIDs"}, + "MakeEntity" :{0:"Hex", 5:"ItemIDs"}, "MakeItemEntity" :{0:"ItemIDs"}, - + "ModifyColliderFlags" :{2:"Hex"}, + + "NpcFaceNpc" :{0:"NpcIDs", 1:"NpcIDs"}, + "NpcFacePlayer" :{0:"NpcIDs"}, + "NpcJump0" :{0:"NpcIDs"}, + "NpcJump1" :{0:"NpcIDs"}, + "NpcMoveTo" :{0:"NpcIDs"}, + + "PlayAmbientSounds" :{0:"AmbientSounds"}, "PlaySound" :{0:"SoundIDs"}, + "PlaySoundAt" :{0:"SoundIDs"}, "PlaySoundAtActor" :{0:"ActorIDs", 1:"SoundIDs"}, - + "PlaySoundAtNpc" :{0:"NpcIDs", 1:"SoundIDs"}, + + "RemoveActorDecoration" :{0:"ActorIDs"}, + "RemoveNpc" :{0:"NpcIDs"}, + "RunToGoal" :{0:"ActorIDs"}, + + "SetActorDispOffset" :{0:"ActorIDs"}, "SetActorJumpGravity" :{0:"ActorIDs"}, + "SetActorRotation" :{0:"ActorIDs"}, "SetActorSpeed" :{0:"ActorIDs"}, "SetActorScale" :{0:"ActorIDs"}, "SetActorYaw" :{0:"ActorIDs"}, - "SetAnimation" :{0:"ActorIDs", 2:"PlayerAnims"}, + "SetAnimation" :{0:"ActorIDs", 2:"CustomAnim"}, + "SetAnimationRate" :{0:"ActorIDs"}, "SetGoalPos" :{0:"ActorIDs"}, "SetGoalToHome" :{0:"ActorIDs"}, "SetGoalToTarget" :{0:"ActorIDs"}, "SetJumpAnimations" :{0:"ActorIDs", 2:"PlayerAnims", 3:"PlayerAnims", 4:"PlayerAnims"}, "SetMusicTrack" :{1:"SongIDs"}, + "SetNpcAnimation" :{0:"NpcIDs", 1:"CustomAnim"}, + "SetNpcAux" :{0:"NpcIDs"}, + "SetNpcFlagBits" :{0:"NpcIDs", 1:"Hex", 2:"Bool"}, + "SetNpcJumpscale" :{0:"NpcIDs"}, + "SetNpcPos" :{0:"NpcIDs"}, + "SetNpcRotation" :{0:"NpcIDs"}, + "SetNpcScale" :{0:"NpcIDs"}, + "SetNpcSpeed" :{0:"NpcIDs"}, + "SetNpcYaw" :{0:"NpcIDs"}, + "SetPlayerAnimation" :{0:"PlayerAnims"}, + "SetSelfEnemyFlagBits" :{0:"Hex", 1:"Bool"}, + #"SetSelfVar" :{1:"Bool"}, # apparently this was a bool in some scripts but it passes non-0/1 values, including negatives "SetTargetActor" :{0:"ActorIDs"}, - - "UseIdleAnimation" :{0:"ActorIDs"}, + "ShowEmote" :{1:"Emotes"}, + "ShowMessageAtScreenPos" :{0:"CustomMsg"}, + "SpeakToPlayer" :{0:"NpcIDs", 1:"CustomAnim", 2:"CustomAnim", 4:"CustomMsg"}, + "UseIdleAnimation" :{0:"ActorIDs"}, } -def replace_constants(func, args): +def replace_constants(self, func, args): global replace_funcs if func in replace_funcs: - return fix_args(args, replace_funcs[func]) + return fix_args(self, func, args, replace_funcs[func]) elif func == "PlayEffect": argsZ = args.split(", ") if "0x" not in argsZ[0]: @@ -201,11 +342,14 @@ def replace_constants(func, args): return args class ScriptDisassembler: - def __init__(self, bytes, script_name = "script", symbol_map = {}): + def __init__(self, bytes, script_name = "script", symbol_map = {}, romstart = 0, INCLUDES_NEEDED = {}, INCLUDED = {}): self.bytes = bytes self.script_name = script_name self.symbol_map = { **script_lib(self.bytes.tell()), **symbol_map } + self.romstart = romstart + self.INCLUDES_NEEDED = INCLUDES_NEEDED + self.INCLUDED = INCLUDED self.out = "" self.prefix = "" @@ -224,6 +368,8 @@ class ScriptDisassembler: opcode = self.read_word() argc = self.read_word() + #print(f"Op {opcode:X}, argc {argc}") + if opcode > 0xFF or argc > 0xFF: raise Exception(f"script '{self.script_name}' is malformed") @@ -231,6 +377,8 @@ class ScriptDisassembler: for i in range(0, argc): argv.append(self.read_word()) + #print(argv) + self.disassemble_command(opcode, argc, argv) self.instructions += 1 @@ -274,29 +422,67 @@ class ScriptDisassembler: if arg == 0xFFFFFFFF: return "-1" - elif ((arg & 0xFF000000) == 0x80000000) or arg > 10000: + elif (arg & 0xFF000000) == 0x80000000: return f"0x{arg:X}" + elif arg >= 0x80000000: + return f"{arg - 0x100000000}" else: return f"{arg}" + def replace_star_rod_function_name(self, name): + vram = int(name.split("_",1)[1], 16) + name = name.replace("function", "func") + f"_{(vram - 0x80240000)+self.romstart:X}" + return name + + def replace_star_rod_prefix(self, addr): + if addr in self.symbol_map: + name = self.symbol_map[addr][0][1] + toReplace = True + suffix = "" + if name.startswith("N(func_"): + prefix = "ApiStatus " + name = self.replace_star_rod_function_name(name[2:-1]) + suffix = "(ScriptInstance* script, s32 isInitialCall)" + elif name.startswith("802"): + prefix = "Script " + elif name.startswith("npcAISettings_"): + prefix = "NpcAISettings " + elif name.startswith("npcSettings_"): + prefix = "NpcSettings " + elif name.startswith("npcGroup_"): + prefix = "StaticNpc " + elif name.startswith("entryList_"): + prefix = "Vec4f " + elif name.startswith("npcGroupList_"): + prefix = "NpcGroupList " + else: + toReplace = False + + if toReplace: + name = "N(" + name + ")" + if name not in self.INCLUDED["functions"]: + self.INCLUDES_NEEDED["forward"].append(prefix + name + suffix + ";") + return name + return addr + def addr_ref(self, addr): if addr in self.symbol_map: - return self.symbol_map[addr][0][1] + return self.replace_star_rod_prefix(addr) return f"0x{addr:08X}" def trigger(self, trigger): - if trigger == 0x00000080: trigger = "TriggerFlag_FLOOR_TOUCH" - if trigger == 0x00800000: trigger = "TriggerFlag_FLOOR_ABOVE" - if trigger == 0x00000800: trigger = "TriggerFlag_FLOOR_INTERACT" - if trigger == 0x00000200: trigger = "TriggerFlag_FLOOR_JUMP" - if trigger == 0x00000400: trigger = "TriggerFlag_WALL_TOUCH" - if trigger == 0x00000040: trigger = "TriggerFlag_WALL_PUSH" - if trigger == 0x00000100: trigger = "TriggerFlag_WALL_INTERACT" - if trigger == 0x00001000: trigger = "TriggerFlag_WALL_HAMMER" - if trigger == 0x00040000: trigger = "TriggerFlag_CEILING_TOUCH" - if trigger == 0x00010000: trigger = "TriggerFlag_SAVE_FLAG_SET" - if trigger == 0x00020000: trigger = "TriggerFlag_AREA_FLAG_SET" - if trigger == 0x00100000: trigger = "TriggerFlag_BOMB" + if trigger == 0x00000040: trigger = "TRIGGER_WALL_PUSH" + if trigger == 0x00000080: trigger = "TRIGGER_FLOOR_TOUCH" + if trigger == 0x00000100: trigger = "TRIGGER_WALL_PRESS_A" + if trigger == 0x00000200: trigger = "TRIGGER_FLOOR_JUMP" + if trigger == 0x00000400: trigger = "TRIGGER_WALL_TOUCH" + if trigger == 0x00000800: trigger = "TRIGGER_FLOOR_PRESS_A" + if trigger == 0x00001000: trigger = "TRIGGER_WALL_HAMMER" + if trigger == 0x00010000: trigger = "TRIGGER_GAME_FLAG_SET" + if trigger == 0x00020000: trigger = "TRIGGER_AREA_FLAG_SET" + if trigger == 0x00040000: trigger = "TRIGGER_CEILING_TOUCH" + if trigger == 0x00080000: trigger = "TRIGGER_FLOOR_ABOVE" + if trigger == 0x00100000: trigger = "TRIGGER_POINT_BOMB" return f"0x{trigger:X}" if type(trigger) is int else trigger def read_word(self): @@ -472,7 +658,7 @@ class ScriptDisassembler: elif opcode == 0x43: args = ["ScriptOpcode_CALL", self.addr_ref(argv[0]), *map(self.var, argv[1:])] self.write_line(f"SI_CMD({', '.join(args)}),") - elif opcode == 0x44: self.write_line(f"SI_CMD(ScriptOpcode_SPAWN, {self.addr_ref(argv[0])}),") + elif opcode == 0x44: self.write_line(f"SI_CMD(ScriptOpcode_SPAWN_SCRIPT, {self.addr_ref(argv[0])}),") elif opcode == 0x45: self.write_line(f"SI_CMD(ScriptOpcode_SPAWN_GET_ID, {self.addr_ref(argv[0])}, {self.var(argv[1])}),") elif opcode == 0x46: self.write_line(f"SI_CMD(ScriptOpcode_AWAIT_SCRIPT, {self.addr_ref(argv[0])}),") elif opcode == 0x47: @@ -485,7 +671,7 @@ class ScriptDisassembler: elif opcode == 0x4C: self.write_line(f"SI_CMD(ScriptOpcode_SET_TIMESCALE, {self.var(argv[0])}),") elif opcode == 0x4D: self.write_line(f"SI_CMD(ScriptOpcode_SET_GROUP, {self.var(argv[0])}),") elif opcode == 0x4E: - args = ["ScriptOpcode_BIND_TRIGGER", self.addr_ref(argv[0]), self.trigger(argv[1]), *map(self.var, argv[2:])] + args = ["ScriptOpcode_BIND_PADLOCK", self.addr_ref(argv[0]), self.trigger(argv[1]), *map(self.var, argv[2:])] self.write_line(f"SI_CMD({', '.join(args)}),") elif opcode == 0x4F: self.write_line(f"SI_CMD(ScriptOpcode_SUSPEND_GROUP, {self.var(argv[0])}),") elif opcode == 0x50: self.write_line(f"SI_CMD(ScriptOpcode_RESUME_GROUP, {self.var(argv[0])}),") @@ -538,13 +724,15 @@ class ScriptDSLDisassembler(ScriptDisassembler): def var(self, arg): if arg in self.symbol_map: return self.symbol_map[arg][0][1] + elif type(arg) is str: + return arg v = arg - 2**32 # convert to s32 if v > -250000000: if v <= -220000000: return str((v + 230000000) / 1024) elif v <= -200000000: return f"SI_ARRAY_FLAG({v + 210000000})" elif v <= -180000000: return f"SI_ARRAY({v + 190000000})" - elif v <= -160000000: + elif v <= -160000000: if v + 170000000 == 0: self.save_variable = "STORY_PROGRESS" elif v + 170000000 == 425: @@ -562,8 +750,10 @@ class ScriptDSLDisassembler(ScriptDisassembler): if arg == 0xFFFFFFFF: return "-1" - elif ((arg & 0xFF000000) == 0x80000000) or arg > 10000: + elif (arg & 0xFF000000) == 0x80000000: return f"0x{arg:X}" + elif arg >= 0x80000000: + return f"{arg - 0x100000000}" else: return f"{arg}" @@ -576,6 +766,7 @@ class ScriptDSLDisassembler(ScriptDisassembler): def replace_enum(self, var, case=False): varO = self.var(var) + if case: self.save_variable = "" @@ -588,11 +779,11 @@ class ScriptDSLDisassembler(ScriptDisassembler): var -= 0x100000000 # put cases for replacing vars here - if (( case and self.case_variable == "STORY_PROGRESS") or + if (( case and self.case_variable == "STORY_PROGRESS") or (not case and self.save_variable == "STORY_PROGRESS")): if var in CONSTANTS["StoryProgress"]: return CONSTANTS["StoryProgress"][var] - elif (( case and self.case_variable == "WORLD_LOCATION") or + elif (( case and self.case_variable == "WORLD_LOCATION") or (not case and self.save_variable == "WORLD_LOCATION")): if var in CONSTANTS["Locations"]: return CONSTANTS["Locations"][var] @@ -600,6 +791,10 @@ class ScriptDSLDisassembler(ScriptDisassembler): return varO def disassemble_command(self, opcode, argc, argv): + # hacky hacky + if opcode == 0x43 and len(argv) > 1 and argv[-1] == 0x80000000: + argv[-1] = "MAKE_ENTITY_END" + # write case block braces if self.in_case == "CASE" or self.in_case == "MULTI": if opcode == 0x1D: # multi case @@ -642,6 +837,8 @@ class ScriptDSLDisassembler(ScriptDisassembler): self.indent -= 1 + self.INCLUDED["functions"].add(self.script_name) + self.prefix_line(f"Script {self.script_name} = SCRIPT({{") self.write_line("});") @@ -661,7 +858,7 @@ class ScriptDSLDisassembler(ScriptDisassembler): elif opcode == 0x06: self.indent -= 1 self.write_line("}") - elif opcode == 0x07: self.write_line(f"break;") + elif opcode == 0x07: self.write_line(f"break loop;") elif opcode == 0x08: self.write_line(f"sleep {self.var(argv[0])};") elif opcode == 0x09: self.write_line(f"sleep {self.var(argv[0])} secs;") elif opcode == 0x0A: @@ -731,22 +928,22 @@ class ScriptDSLDisassembler(ScriptDisassembler): self.case_stack.append("MATCH") elif opcode == 0x16: self.case_stack.append("CASE") - self.write(f"== {argv[0]}") + self.write(f"== {self.var(argv[0])}") elif opcode == 0x17: self.case_stack.append("CASE") - self.write(f"!= {argv[0]}") + self.write(f"!= {self.var(argv[0])}") elif opcode == 0x18: self.case_stack.append("CASE") - self.write(f"< {argv[0]}") + self.write(f"< {self.var(argv[0])}") elif opcode == 0x19: self.case_stack.append("CASE") - self.write(f"> {argv[0]}") + self.write(f"> {self.var(argv[0])}") elif opcode == 0x1A: self.case_stack.append("CASE") - self.write(f"<= {argv[0]}") + self.write(f"<= {self.var(argv[0])}") elif opcode == 0x1B: self.case_stack.append("CASE") - self.write(f">= {argv[0]}") + self.write(f">= {self.var(argv[0])}") elif opcode == 0x1C: self.case_stack.append("CASE") self.write(f"else") @@ -771,7 +968,7 @@ class ScriptDSLDisassembler(ScriptDisassembler): self.indent -= 1 self.write_line(f"{self.var(argv[0])}..{self.var(argv[1])}") self.indent += 1 - elif opcode == 0x22: self.write_line("break") + elif opcode == 0x22: self.write_line("break match;") elif opcode == 0x23: # close open case if needed if self.in_case != "MATCH": @@ -786,9 +983,11 @@ class ScriptDSLDisassembler(ScriptDisassembler): self.indent -= 1 self.case_variable = "" self.write_line("}") - elif opcode == 0x24: + elif opcode == 0x24: varA = self.replace_enum(argv[0]) varB = self.replace_enum(argv[1]) + if varB.startswith("script_"): + varB = "N(" + varB + ")" self.write_line(f"{varA} = {varB};") elif opcode == 0x25: self.write_line(f"{self.var(argv[0])} =c 0x{argv[1]:X};") elif opcode == 0x26: @@ -828,15 +1027,19 @@ class ScriptDSLDisassembler(ScriptDisassembler): self.write_line(f"{self.var(argv[0])} /=f {lhs};") elif opcode == 0x3F: self.write_line(f"{self.var(argv[0])} &= {self.var(argv[1])};") elif opcode == 0x40: self.write_line(f"{self.var(argv[0])} |= {self.var(argv[1])};") - elif opcode == 0x41: self.write_line(f"{self.var(argv[0])} &=c {argv[1]:X};") - elif opcode == 0x42: self.write_line(f"{self.var(argv[0])} |=c {argv[1]:X};") + elif opcode == 0x41: self.write_line(f"{self.var(argv[0])} &=c 0x{argv[1]:X};") + elif opcode == 0x42: self.write_line(f"{self.var(argv[0])} |=c 0x{argv[1]:X};") elif opcode == 0x43: addr = argv[0] if addr in self.symbol_map: - func_name = self.symbol_map[addr][0][1] + func_name = self.addr_ref(addr) + if func_name.startswith("N("): + self.INCLUDED["functions"].add(func_name) + for i,arg in enumerate(argv): + argv[i] = self.replace_star_rod_prefix(arg) argv_str = ", ".join(self.var(arg) for arg in argv[1:]) - argv_str = replace_constants(func_name, argv_str) + argv_str = replace_constants(self, func_name, argv_str) self.write_line(f"{func_name}({argv_str});") else: @@ -887,14 +1090,17 @@ if __name__ == "__main__": parser.add_argument("file", type=str, help="File to dissassemble from") parser.add_argument("offset", type=lambda x: int(x, 16), default=0, help="Offset to start dissassembling from") parser.add_argument("-end", "-e", "--e", type=lambda x: int(x, 16), default=0, dest="end", required=False, help="End offset to stop dissassembling from.\nOnly used as a way to find valid scripts.") + parser.add_argument("-vram", "-v", "--v", type=lambda x: int(x, 16), default=0, dest="vram", required=False, help="VRAM start will be tracked and used for the script output name") args = parser.parse_args() - + vram_base = args.vram get_constants() if args.end > args.offset: # Search the given memory range and report scripts with open(args.file, "rb") as f: + gap = False + first_print = False while args.offset < args.end: f.seek(args.offset) @@ -902,20 +1108,46 @@ if __name__ == "__main__": try: script_text = script.disassemble() - if script.instructions > 1 and "SI_CMD" not in script_text and "break;" not in script_text: - print(f"Script read from 0x{script.start_pos:X} to 0x{script.end_pos:X} " - f"(0x{script.end_pos - script.start_pos:X} bytes, {script.instructions} instructions)") - print() + if script.instructions > 1 and "SI_CMD" not in script_text: + if gap and first_print: + potential_struct_sizes = { "StaticNpc": 0x1F0, "NpcAISettings":0x30, "NpcSettings":0x2C, "NpcGroupList":0xC } + gap_size = args.offset - gap_start + potential_struct = "Unknown data" + potential_count = 1 + for k,v in potential_struct_sizes.items(): + if gap_size % v == 0: + potential_struct = k + potential_count = gap_size // v + + print(f"========== 0x{gap_size:X} byte gap ({potential_count} {potential_struct}?) 0x{gap_start:X} - 0x{args.offset:X} ==========") + print() + gap = False + #print(f"Script read from 0x{script.start_pos:X} to 0x{script.end_pos:X} " + # f"(0x{script.end_pos - script.start_pos:X} bytes, {script.instructions} instructions)") + #print() + vram = f"{args.vram:X}_" if vram_base > 0 else f"" + script_text = script_text.replace("Script script = SCRIPT({", f"Script N(D_{vram}{args.offset:X}) = " + "SCRIPT({") print(script_text, end="") print() #print(f"Valid script found at 0x{args.offset:X}") + args.vram += script.end_pos - args.offset args.offset = script.end_pos + first_print = True else: + if not gap: + gap_start = args.offset + gap = True args.offset += 4 + args.vram += 4 except Exception: + if not gap: + gap_start = args.offset + gap = True args.offset += 4 + args.vram += 4 else: with open(args.file, "rb") as f: + f.seek(args.offset) script = ScriptDSLDisassembler(f) @@ -928,4 +1160,5 @@ if __name__ == "__main__": print(script_text, end="") except UnsupportedScript: + f.seek(args.offset) print(ScriptDisassembler(f).disassemble(), end="") diff --git a/tools/make_npc_structs.py b/tools/make_npc_structs.py index 06c88d579a..6145106fc3 100644 --- a/tools/make_npc_structs.py +++ b/tools/make_npc_structs.py @@ -2,17 +2,21 @@ from pathlib import Path import argparse from struct import unpack_from -constants = {} +CONSTANTS = {} def get_constants(): - global constants - valid_enums = { "ItemId", "PlayerAnim", "ActorID", "Event", "SoundId" } + global CONSTANTS + valid_enums = { "StoryProgress", "ItemIDs", "PlayerAnims", + "ActorIDs", "Events", "SoundIDs", "SongIDs", "Locations", + "AmbientSounds", "NpcIDs", "Emotes" } for enum in valid_enums: - constants[enum] = {} - constants["NPC_SPRITE"] = {} + CONSTANTS[enum] = {} + CONSTANTS["NPC_SPRITE"] = {} include_path = Path(Path(__file__).resolve().parent.parent / "include") - enums = Path(include_path / "enums.h").read_text() + enums = Path(include_path / "enums.h").read_text().splitlines() + # defines + ''' for line in enums.splitlines(): this_enum = "" for enum in valid_enums: @@ -25,8 +29,40 @@ def get_constants(): id_ = line.split("0x", 1)[1] if " " in id_: id_ = id_.split(" ",1)[0] - constants[this_enum][int(id_, 16)] = name + CONSTANTS[this_enum][int(id_, 16)] = name + ''' + + # enums + for i,line in enumerate(enums): + if line.startswith("enum "): + enum_name = line.split(" ",1)[1].split(" {",1)[0] + if enum_name in valid_enums: + CONSTANTS[enum_name] = {} + last_num = 0 + i += 1 + while "}" not in enums[i]: + if not enums[i]: + i += 1 + continue + + name = enums[i].strip() + val = last_num+1 + if "=" in name: + name, val = name.split(" = ") + val = int(val[:-1], 0) + if val >= 0x80000000: + val -= 0x100000000 + else: + name = name[:-1] + name = name.strip() + #print("\"" + name + "\"", "===", val) + + CONSTANTS[enum_name][val] = name.strip() + i += 1 + last_num = val + + # sprites sprite_path = Path(Path(__file__).resolve().parent.parent / "ver" / "current" / "build" / "include" / "sprite" / "npc") for file in sprite_path.iterdir(): fd = file.read_text() @@ -52,13 +88,13 @@ def get_constants(): name = name.rsplit(f"{saved_name}_")[1] if enum == "NPC_SPRITE": - if int(id_, 16) not in constants["NPC_SPRITE"]: - constants[enum][int(id_, 16)] = {"name":"", "palettes":{}, "anims":{}} - constants[enum][int(id_, 16)]["name"] = name + if int(id_, 16) not in CONSTANTS["NPC_SPRITE"]: + CONSTANTS[enum][int(id_, 16)] = {"name":"", "palettes":{}, "anims":{}} + CONSTANTS[enum][int(id_, 16)]["name"] = name elif enum == "NPC_PALETTE": - constants["NPC_SPRITE"][int(saved_id, 16)]["palettes"][int(id_, 16)] = name + CONSTANTS["NPC_SPRITE"][int(saved_id, 16)]["palettes"][int(id_, 16)] = name elif enum == "NPC_ANIM": - constants["NPC_SPRITE"][int(saved_id, 16)]["anims"][int(id_, 16)] = name + CONSTANTS["NPC_SPRITE"][int(saved_id, 16)]["anims"][int(id_, 16)] = name return STRUCTS = {} @@ -144,11 +180,14 @@ def get_structs(): parse_file(Path(Path(__file__).parent.parent / "include" / "common_structs.h")) def get_vals(fd, offset, var): + global STRUCTS + out = [] arr = [] for i in range(var["num"]): if var["type"] in STRUCTS: type_ = "struct" + fmt = "s" data = [] for var2 in STRUCTS[var["type"]]: out3, offset = get_vals(fd, offset, var2) @@ -159,56 +198,67 @@ def get_vals(fd, offset, var): #out.append(out2) else: type_ = "int" + fmt = "d" if var["type"] == "s8" or var["type"] == "char": if var["type"] == "char": type_ = "hex" + fmt = "X" data = unpack_from('>b', fd, offset)[0] offset += 1 elif var["type"] == "u8": data = unpack_from('>B', fd, offset)[0] + fmt = "d" offset += 1 - elif var["type"] == "s16" or var["type"] in ("ItemId"): + elif var["type"] == "s16" or var["type"] in ("ItemID"): offset += offset % 2 data = unpack_from('>h', fd, offset)[0] + fmt = "d" offset += 2 elif var["type"] == "u16": offset += offset % 2 data = unpack_from('>H', fd, offset)[0] + fmt = "d" offset += 2 - elif var["type"] == "s32" or var["type"] in ("NpcId", "NpcAnimID", "MessageID"): + elif var["type"] == "s32" or var["type"] in ("NpcID", "NpcAnimID", "MessageID", "BattleID"): poff = offset offset += offset % 4 data = unpack_from('>i', fd, offset)[0] + fmt = "d" offset += 4 elif var["type"] == "u32": offset += offset % 4 data = unpack_from('>I', fd, offset)[0] + fmt = "d" offset += 4 elif var["type"] == "f32": offset += offset % 4 data = unpack_from('>f', fd, offset)[0] type_ = "float" + fmt = ".01f" offset += 4 elif var["type"] == "X32": offset += offset % 4 data = unpack_from('>f', fd, offset)[0] - type_ = "float" + type_ = "Xfloat" + fmt = ".01f" if data < -1000.0 or data > 1000.0: - type_ = "int" + type_ = "Xint" + fmt = "d" data = unpack_from('>i', fd, offset)[0] offset += 4 elif var["ptr"]: offset += offset % 4 data = unpack_from('>I', fd, offset)[0] type_ = "ptr" + fmt = "08X" offset += 4 else: print(f"Unknown data type \"{var['type']}\"") exit() if var["num"] == 1: - out.append({"name":var["name"], "type":type_, "data":data}) + out.append({"name":var["name"], "type":type_, "fmt":fmt, "data":data}) else: - arr.append({"name":var["name"], "type":type_, "data":data}) + arr.append({"name":var["name"], "type":type_, "fmt":fmt, "data":data}) if var["num"] > 1: out.append(arr) @@ -245,15 +295,20 @@ def print_data(vals, indent, needs_name, is_array=False, is_struct=False): if x > 0: line += ", " #line += f".{val2['name']} = " + fmt = val2["fmt"] if val2["type"] == "float": - line += f"{val2['data']:.01f}f" + line += f"{val2['data']:{fmt}}f" + elif val["type"] == "Xfloat": + line += "{ .f = " + f"{val['data']:{fmt}}f" + " }" + elif val["type"] == "Xint": + line += "{ .s = " + f"{val['data']:{fmt}}" + " }" elif val2["type"] == "hex": - line += f"0x{val2['data']:X}" + line += f"0x{val2['data']:{fmt}}" elif val2["type"] == "ptr": if val2["data"] == 0: line += f"NULL" else: - line += f"0x{val2['data']:08X}" + line += f"0x{val2['data']:{fmt}}" else: line += f"{val2['data']}" line += " }" @@ -263,20 +318,30 @@ def print_data(vals, indent, needs_name, is_array=False, is_struct=False): if "flags" in val["name"].lower() or "animations" in val["name"].lower(): if val["name"] == "flags": - val["type"] = "ptr" - elif val["name"] == "dropFlags": + val["fmt"] = "08X" val["type"] = "hex" + elif "flag" in val["name"].lower(): + val["type"] = "hex" + val["fmt"] = "X" val["data"] = abs(val["data"]) - + elif "tattle" in val["name"]: + val["fmt"] = "06X" + val["type"] = "hex" + + fmt = val["fmt"] if val["type"] == "float": - line += f"{val['data']:.01f}f" + line += f"{val['data']:{fmt}}f" + elif val["type"] == "Xfloat": + line += "{ .f = " + f"{val['data']:{fmt}}f" + " }" + elif val["type"] == "Xint": + line += "{ .s = " + f"{val['data']:{fmt}}" + " }" elif val["type"] == "hex": - line += f"0x{val['data']:X}" + line += f"0x{val['data']:{fmt}}" elif val["type"] == "ptr": if val["data"] == 0: line += f"NULL" else: - line += f"0x{val['data']:08X}" + line += f"0x{val['data']:{fmt}}" else: line += f"{val['data']}" @@ -287,20 +352,19 @@ def print_data(vals, indent, needs_name, is_array=False, is_struct=False): return out -def output_type2(fd, offset, var): - vals = [] - for var in STRUCTS[args.type]: - tmp, offset = get_vals(fd, offset, var) - vals.extend(tmp) +def output_type2(fd, count, offset, var): + ultra_out = [] + for i in range(count): + out = [f"{args.type} = " + "{"] + vals = [] + for var in STRUCTS[args.type]: + tmp, offset = get_vals(fd, offset, var) + vals.extend(tmp) - #print(vals) - #print() - out = [f"{args.type} = " + "{"] - out.extend(print_data(vals, 1, True)) - out.append("};") - #print("END======") - #print("\n".join(out)) - return "\n".join(out) + out.extend(print_data(vals, 1, True)) + out.append("};") + ultra_out.append(out) + return offset, ultra_out #"\n".join(out) def check_list(vals, depth = 0): for x,val in enumerate(vals): @@ -333,7 +397,10 @@ def get_single_struct_vals(fd, i): for x in temp: x = x.strip() if x != "": - a.append(int(x, 0)) + if "." in x: + a.append(float(x[:-1])) + else: + a.append(int(x, 0)) vals.append(a) i += 1 else: @@ -343,11 +410,14 @@ def get_single_struct_vals(fd, i): for x in temp: x = x.strip() if x != "": - a.append(int(x, 0)) + if "." in x: + a.append(float(x[:-1])) + else: + a.append(int(x, 0)) vals.extend(a) return vals, i -def cull_struct(fd, i): +def cull_struct(fd, i, entirely=False): out = [] vals = [] #print(f"Culling Starting at {fd[i]}") @@ -365,6 +435,8 @@ def cull_struct(fd, i): out.append(fd[old_i]) old_i += 1 + if entirely: + x = len(vals) for y in range(x): out.append(fd[old_i]) old_i += 1 @@ -384,6 +456,8 @@ def cull_struct(fd, i): return None, i #out.append(prefix) + if entirely: + x = len(vals) temp = "" for z,y in enumerate(range(x)): if z > 0: @@ -394,19 +468,42 @@ def cull_struct(fd, i): return "\n".join(out), i def MacroReplaceStaticNPC(fd): - replace_cull = { "unk_1C", "movement" } + structs = { "unk_1C":True, "movement":False, "unk_1E0":True } + #replace_cull_struct = { "unk_1C", "movement", "unk_1E0" } + #replace_cull = { "tattle", "extraAnimations", "itemDropChance" } fd = fd.splitlines() out = [] i = 0 while i < len(fd): - if any(f".{x}" in fd[i] for x in replace_cull): - vals, i = cull_struct(fd, i) + found = "" + for x in structs: + if f".{x}" in fd[i]: + found = x + break; + if found: + # just cull it if possible + vals, i = cull_struct(fd, i, structs[found]) if vals: out.append(vals) i += 1 continue + name = fd[i].split(" = ",1)[0].strip()[1:] + if name not in structs and "{" not in fd[i] and name != ";": + val = fd[i].split(" = ",1)[1][:-1] + if "0x" in val: + val = int(val, 16) + elif "NULL" in val: + val = 0 + elif "." in val: + val = float(val) + else: + val = int(val, 10) + if val == 0 and name != "id": + i += 1 + continue + if ".itemDrops" in fd[i]: vals, x = cull_struct(fd, i) @@ -427,7 +524,7 @@ def MacroReplaceStaticNPC(fd): continue added_item = True - item_name = constants["ItemId"][item[0]] + item_name = CONSTANTS["ItemIDs"][item[0]] new_line += " " * (indent+1) + "{ " + item_name + f", {item[1]}, {item[2]}" + " },\n" if added_item: @@ -445,9 +542,9 @@ def MacroReplaceStaticNPC(fd): sprite_id = (val & 0x00FF0000) >> 16 palette_id = (val & 0x0000FF00) >> 8 anim_id = (val & 0x000000FF) >> 0 - sprite = constants["NPC_SPRITE"][sprite_id]["name"] - palette = constants["NPC_SPRITE"][sprite_id]["palettes"][palette_id] - anim = constants["NPC_SPRITE"][sprite_id]["anims"][anim_id] + sprite = CONSTANTS["NPC_SPRITE"][sprite_id]["name"] + palette = CONSTANTS["NPC_SPRITE"][sprite_id]["palettes"][palette_id] + anim = CONSTANTS["NPC_SPRITE"][sprite_id]["anims"][anim_id] new_line += " " * (indent+1) + f"NPC_ANIM({sprite}, {palette}, {anim}),\n" new_line += " " * indent + "}," out.append(new_line) @@ -467,6 +564,8 @@ def MacroReplaceStaticNPC(fd): new_line += f"GENEROUS_HEART_DROPS({attempts})," elif round(vals[0][1] / 327.67, 2) == 80 and round(vals[0][3] / 327.67, 2) == 60: new_line += f"GENEROUS_WHEN_LOW_HEART_DROPS({attempts})," + elif round(vals[0][0] / 327.67, 2) == 100 and round(vals[0][1] / 327.67, 2) == 0 and round(vals[0][2] / 327.67, 2) == 0: + new_line += f"NO_DROPS," else: print(f"Unknown heart drop macro, values were {round(vals[0][1] / 327.67, 2)} and {round(vals[0][3] / 327.67, 2)}") exit() @@ -477,8 +576,10 @@ def MacroReplaceStaticNPC(fd): new_line += f"GENEROUS_WHEN_LOW_FLOWER_DROPS({attempts})," elif round(vals[0][1] / 327.67, 2) == 40 and round(vals[0][3] / 327.67, 2) == 40: new_line += f"REDUCED_FLOWER_DROPS({attempts})," + elif round(vals[0][0] / 327.67, 2) == 100 and round(vals[0][1] / 327.67, 2) == 0 and round(vals[0][2] / 327.67, 2) == 0: + new_line += f"NO_DROPS," else: - print(f"Unknown heart drop macro, values were {round(vals[0][1] / 327.67, 2)} and {round(vals[0][3] / 327.67, 2)}") + print(f"Unknown flower drop macro, values were {round(vals[0][1] / 327.67, 2)} and {round(vals[0][3] / 327.67, 2)}") exit() out.append(new_line) @@ -504,10 +605,33 @@ def MacroReplaceNpcSettings(fd): i += 1 return "\n".join(out) +def MacroReplaceNpcGroupList(fd): + fd = fd.splitlines() + out = [] + vals = [] + i = 1 + while i < len(fd): + fd[i] = fd[i].strip() + if ";" not in fd[i]: + if "NULL" in fd[i]: + val = 0 + else: + if "0x" in fd[i]: + val = int(fd[i].split(" = ",1)[1][:-1], 16) + else: + val = int(fd[i].split(" = ",1)[1][:-1], 10) + + vals.append(val) + i += 1 + + out.append(f" NPC_GROUP(N(D_{vals[1]:X}), BATTLE_ID({(vals[2] & 0xFF000000) >> 24}, {(vals[2] & 0xFF0000) >> 16}, {(vals[2] & 0xFF00) >> 8}, {vals[2] & 0xFF})),") + return "\n".join(out) + parser = argparse.ArgumentParser() parser.add_argument("file", type=str, help="File to decompile struct from") -parser.add_argument("offset", type=lambda x: int(x, 0), help="Offset to decompile struct from") parser.add_argument("type", type=str, help="Struct type to decompile") +parser.add_argument("offset", type=lambda x: int(x, 0), help="Offset to decompile struct from") +parser.add_argument("--count", "-c", "--c", type=int, default=0, help="Num to try and decompile (NpcGroupList)") args = parser.parse_args() get_constants() @@ -526,14 +650,28 @@ for var in STRUCTS[args.type]: out.append("};") ''' +if args.count == 0: + args.count = 1 + fd = Path(args.file).resolve().read_bytes() -out = output_type2(fd, args.offset, STRUCTS[args.type]) +offset, out = output_type2(fd, args.count, args.offset, STRUCTS[args.type]) + +for i,entry in enumerate(out): + out[i] = "\n".join(entry) + +print(f"Script range 0x{args.offset:08X} - 0x{offset:08X}") +print() if args.type.lower() == "staticnpc": - print(MacroReplaceStaticNPC(out)) + print(MacroReplaceStaticNPC(out[0])) elif args.type.lower() == "npcaisettings": - print(out) + print(out[0]) elif args.type.lower() == "npcsettings": - print(MacroReplaceNpcSettings(out)) + print(MacroReplaceNpcSettings(out[0])) +elif args.type.lower() == "npcgrouplist": + print("NpcGroupList N(npcGroupList) = {") + for i in range(args.count): + print(MacroReplaceNpcGroupList(out[i])) + print("};") else: print(f"Add me type: {args.type}") diff --git a/tools/mapheaders.py b/tools/mapheaders.py index a07b672fab..d5b61e5f72 100755 --- a/tools/mapheaders.py +++ b/tools/mapheaders.py @@ -13,6 +13,10 @@ root_dir = script_dir + "/../" src_dir = root_dir + "src/world/" asm_dir = root_dir + "ver/current/asm/nonmatchings/world/" +if len(sys.argv) <= 1 or not (sys.argv[1] == "y" or sys.argv[1] == "-y"): + print(f"Warning! This script is destructive, pass -y if you really want to run it") + exit() + for root, dirs, files in os.walk(src_dir): for dir_name in dirs: dir_path = os.path.join(root, dir_name) diff --git a/tools/star_rod_idx_to_c.py b/tools/star_rod_idx_to_c.py index b1d561a246..f8ff73d814 100755 --- a/tools/star_rod_idx_to_c.py +++ b/tools/star_rod_idx_to_c.py @@ -4,39 +4,71 @@ import sys import os import yaml import json -from struct import unpack +from struct import unpack, unpack_from import argparse import disasm_script DIR = os.path.dirname(__file__) +INCLUDED = {} +INCLUDED["functions"] = set() +INCLUDES_NEEDED = {} +INCLUDES_NEEDED["include"] = [] +INCLUDES_NEEDED["forward"] = [] +INCLUDES_NEEDED["npcs"] = set() + def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0): + global INCLUDES_NEEDED, INCLUDED out = "" entry_list_name = None main_script_name = None + INDENT = f" " + while len(midx) > 0: struct = midx.pop(0) + name = struct["name"] + INCLUDED["functions"].add(name) + if comments: out += f"// {romstart+struct['start']:X}-{romstart+struct['end']:X} (VRAM: {struct['vaddr']:X})\n" # format struct if struct["type"].startswith("Script"): if struct["type"] == "Script_Main": + name = "N(main)" main_script_name = name pos = bytes.tell() + try_replace = False try: - out += disasm_script.ScriptDSLDisassembler(bytes, name, symbol_map).disassemble() + script_text = disasm_script.ScriptDSLDisassembler(bytes, name, symbol_map, romstart, INCLUDES_NEEDED, INCLUDED).disassemble() + try_replace = True except disasm_script.UnsupportedScript as e: - out += f"// Unable to use DSL: {e}\n" + script_text = f"// Unable to use DSL: {e}\n" bytes.seek(pos) - out += disasm_script.ScriptDisassembler(bytes, name, symbol_map).disassemble() + script_text = disasm_script.ScriptDisassembler(bytes, name, symbol_map, romstart, INCLUDES_NEEDED, INCLUDED).disassemble() + + if try_replace and "exitWalk" in name: + script_text = script_text.splitlines() + walkDistance = exitIdx = map_ = entryIdx = "" + if "UseExitHeading" in script_text[2]: + walkDistance, exitIdx = script_text[2].split("(",1)[1].split(")",1)[0].split(",") + if "GotoMap" in script_text[4]: + map_, entryIdx = script_text[4].split("(",1)[1].split(")",1)[0].split(",") + if walkDistance and exitIdx and map_ and entryIdx: + out += f"Script {name} = EXIT_WALK_SCRIPT({walkDistance}, {exitIdx}, {map_}, {entryIdx});\n" + else: + print(f"Unable to macro replace exit script {name}") + out += "\n".join(script_text) + "\n" + else: + out += script_text + elif struct["type"] == "EntryList": entry_list_name = name out += f"EntryList {name} = {{" @@ -44,13 +76,286 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0): x,y,z,yaw = unpack(">ffff", bytes.read(4 * 4)) out += f"\n {{ {x}f, {y}f, {z}f, {yaw}f }}," out += f"\n}};\n" + elif struct["type"] == "NpcSettings": + tmp_out = f"NpcSettings {name} = {{\n" + npcSettings = bytes.read(struct["length"]) + + i = 0 + while i < struct["length"]: + if i == 0x0 or i == 0x24: + var_names = ["unk_00", "unk_24"] + data = unpack_from(">4B", npcSettings, i) + if not sum(data) == 0: + tmp_out += INDENT + f".{var_names[0] if i == 0 else var_names[1]} = {{ " + ", ".join(f"{x:02X}" for x in unk_00) + f" }},\n" + elif i == 0x4 or i == 0x28: + var_names = ["height", "radius", "level", "unk_2A"] + for x,var in enumerate(unpack_from(">2h", npcSettings, i)): + var_name = var_names[x if i == 0x4 else x+2] + if not var == 0: + tmp_out += INDENT + f".{var_name} = {var},\n" + elif i == 0x8: + var_names = ["otherAI", "onInteract", "ai", "onHit", "aux", "onDefeat", "flags"] + for x,var in enumerate(unpack_from(f">7I", npcSettings, i)): + var_name = var_names[x] + if not var == 0: + if var == 0x80077F70: + tmp_out += INDENT + f".{var_name} = EnemyNpcHit,\n" + elif var == 0x8007809C: + tmp_out += INDENT + f".{var_name} = EnemyNpcDefeat,\n" + elif var_name != "flags" and var in symbol_map: + tmp_out += INDENT + f".{var_name} = &{symbol_map[var][0][1]},\n" + if symbol_map[var][0][1] not in INCLUDED["functions"]: + INCLUDES_NEEDED["forward"].append(symbol_map[var][0][1]) + else: + tmp_out += INDENT + f".{var_name} = 0x{var:08X},\n" + i += 1 + + tmp_out += "};\n" + out += tmp_out + elif struct["type"] == "AISettings": + tmp_out = f"NpcAISettings {name} = {{\n" + npcAISettings = bytes.read(struct["length"]) + + i = x = 0 + var_names = ["moveSpeed", "moveTime", "waitTime", "alertRadius", "unk_10", "unk_14", + "chaseSpeed", "unk_1C", "unk_20", "chaseRadius", "unk_28", "unk_2C"] + while i < struct["length"]: + var_f, var_i1, var_i2 = unpack_from(f">fii", npcAISettings, i) + if not var_f == 0: + tmp_out += INDENT + f".{var_names[x]} = {var_f:.01f}f,\n" + if not var_i1 == 0: + # account for X32 + if var_names[x + 1] == "unk_10" or var_names[x + 1] == "unk_28": + ftest = float(unpack_from(">f", npcAISettings, i+4)[0]) + if ftest >= -1000.0 and ftest <= 1000: + tmp_out += INDENT + f".{var_names[x + 1]} = {{ .f = {ftest:.01f}f }},\n" + else: + tmp_out += INDENT + f".{var_names[x + 1]} = {{ .s = {var_i1} }},\n" + else: + tmp_out += INDENT + f".{var_names[x + 1]} = {var_i1},\n" + if not var_i2 == 0: + tmp_out += INDENT + f".{var_names[x + 2]} = {var_i2},\n" + i += 12 + x += 3 + + tmp_out += "};\n" + out += tmp_out + elif struct["type"] == "NpcGroup": + staticNpc = bytes.read(struct["length"]) + curr_base = 0 + numNpcs = struct['length'] // 0x1F0 + tmp_out = f"StaticNpc {name}" + ("[]" if numNpcs > 1 else "") + f" = {{\n" + + for z in range(struct['length'] // 0x1F0): + i = 0 + var_names = ["id", "settings", "pos", "flags", + "init", "unk_1C", "yaw", "dropFlags", + "itemDropChance", "itemDrops", "heartDrops", "flowerDrops", + "minCoinBonus", "maxCoinBonus", "movement", "animations", + "unk_1E0", "extraAnimations", "tattle"] + + if numNpcs > 1: + tmp_out += INDENT + f"{{\n" + INDENT = INDENT*2 + + while i < 0x1F0: + if i == 0x0 or i == 0x24: + var_name = var_names[0] if i == 0x0 else var_names[6] + var = unpack_from(f">i", staticNpc, curr_base+i)[0] + tmp_out += INDENT + f".{var_name} = {var},\n" + elif i == 0x4 or i == 0x14 or i == 0x18 or i == 0x1E8: + var_name = var_names[1] if i == 0x4 else var_names[3] if i == 0x14 else var_names[4] if i == 0x18 else var_names[17] + addr = unpack_from(f">I", staticNpc, curr_base+i)[0] + if not addr == 0: + if var_name != "flags" and addr in symbol_map: + tmp_out += INDENT + f".{var_name} = &{symbol_map[addr][0][1]},\n" + if symbol_map[addr][0][1] not in INCLUDED["functions"]: + INCLUDES_NEEDED["forward"].append(symbol_map[addr][0][1]) + else: + enabled = [] + for x in range(32): + val = addr & (1 << x) + if val: + if val in disasm_script.CONSTANTS["NpcFlags"]: + enabled.append(disasm_script.CONSTANTS["NpcFlags"][val]) + else: + print(f"NpcFlag 0x{val:08X} missing from NpcFlag enums!") + enabled.append(f"0x{val:08X}") + if not enabled: + enabled.append(0) + tmp_out += INDENT + f".{var_name} = " + " | ".join(enabled) + f",\n" + elif i == 0x8: + pos = unpack_from(f">fff", staticNpc, curr_base+i) + if not sum(pos) == 0: + tmp_out += INDENT + f".pos = {{ {pos[0]:.01f}f, {pos[1]:.01f}f, {pos[2]:.01f}f }},\n" + elif i == 0x1C or i == 0x1E0: + var_name = var_names[5] if i == 0x1C else var_names[16] + data = unpack_from(f">8B", staticNpc, curr_base+i) + if not sum(data) == 0: + tmp_out += INDENT + f".{var_name} = {{ " + ", ".join(f"{x:02X}" for x in data) + f"}},\n" + elif i == 0x28 or i == 0x29: + var_name = var_names[7] if i == 0x28 else var_names[8] + var = unpack_from(f">b", staticNpc, curr_base+i)[0] + if not var == 0: + if var_name == "dropFlags": + tmp_out += INDENT + f".{var_name} = 0x{abs(var):02X},\n" + else: + tmp_out += INDENT + f".{var_name} = {var},\n" + elif i == 0x2A: + var_name = var_names[9] + tmp_tmp = "" + for x in range(8): + item, weight, unk_08 = unpack_from(f">3h", staticNpc, curr_base+i) + if not (item == 0 and weight == 0 and unk_08 == 0): + item = disasm_script.CONSTANTS["ItemIDs"][item] if item in disasm_script.CONSTANTS["ItemIDs"] else f"{item}" + tmp_tmp += INDENT*2 + f"{{ {item}, {weight}, {unk_08} }},\n" + i += 0x6 + + if tmp_tmp: + tmp_out += INDENT + f".{var_name} = {{\n" + tmp_out += tmp_tmp + tmp_out += INDENT + f"}},\n" + + i -= 1 + elif i == 0x5A or i == 0x9A: + var_name = var_names[10] if i == 0x5A else var_names[11] + drops = [] + for x in range(8): + cutoff, generalChance, attempts, chancePerAttempt = unpack_from(f">4h", staticNpc, curr_base+i) + if not (cutoff == 0 and generalChance == 0 and attempts == 0 and chancePerAttempt == 0): + drops.append([cutoff, generalChance, attempts, chancePerAttempt]) + i += 0x8 + i -= 1 + if drops: + tmp_out += INDENT + f".{var_name} = " + if var_name == "heartDrops": + if round(drops[0][1] / 327.67, 2) == 70 and round(drops[0][3] / 327.67, 2) == 50: + tmp_out += f"STANDARD_HEART_DROPS({drops[0][2]})" + elif round(drops[0][1] / 327.67, 2) == 80 and round(drops[0][3] / 327.67, 2) == 50: + tmp_out += f"GENEROUS_HEART_DROPS({drops[0][2]})" + elif round(drops[0][1] / 327.67, 2) == 80 and round(drops[0][3] / 327.67, 2) == 60: + tmp_out += f"GENEROUS_WHEN_LOW_HEART_DROPS({drops[0][2]})" + elif round(drops[0][0] / 327.67, 2) == 100 and round(drops[0][1] / 327.67, 2) == 0 and round(drops[0][2] / 327.67, 2) == 0: + tmp_out += f"NO_DROPS" + else: + print(f"Unknown heart drop macro, values were {round(drops[0][1] / 327.67, 2)} and {round(drops[0][3] / 327.67, 2)}") + exit() + else: + if round(drops[0][1] / 327.67, 2) == 50 and round(drops[0][3] / 327.67, 2) == 40: + tmp_out += f"STANDARD_FLOWER_DROPS({drops[0][2]})" + elif round(drops[0][1] / 327.67, 2) == 70 and round(drops[0][3] / 327.67, 2) == 50: + tmp_out += f"GENEROUS_WHEN_LOW_FLOWER_DROPS({drops[0][2]})" + elif round(drops[0][1] / 327.67, 2) == 40 and round(drops[0][3] / 327.67, 2) == 40: + tmp_out += f"REDUCED_FLOWER_DROPS({drops[0][2]})" + elif round(drops[0][0] / 327.67, 2) == 100 and round(drops[0][1] / 327.67, 2) == 0 and round(drops[0][2] / 327.67, 2) == 0: + tmp_out += f"NO_DROPS" + else: + print(f"Unknown flower drop macro, values were {round(drops[0][1] / 327.67, 2)} and {round(drops[0][3] / 327.67, 2)}") + exit() + + tmp_out += f",\n" + elif i == 0xDA or i == 0xDC: + var_name = var_names[12] if i == 0xDA else var_names[13] + var = unpack_from(">h", staticNpc, curr_base+i)[0] + if not var == 0: + tmp_out += INDENT + f".{var_name} = {var},\n" + elif i == 0xE0: + data = unpack_from(">48i", staticNpc, curr_base+i) + if not sum(data) == 0: + end_pos = len(data) + for x,datum in enumerate(data): + if not datum == 0: + end_pos = x + tmp_out += INDENT + f".movement = {{ " + ", ".join(f"{x}" for x in data[:end_pos+1]) + f" }},\n" + elif i == 0x1A0: + tmp_out += INDENT + f".{var_names[15]} = {{\n" + for x in range(16): + anim = unpack_from(">I", staticNpc, curr_base+i)[0] + if not anim == 0: + sprite_id = (anim & 0x00FF0000) >> 16 + palette_id = (anim & 0x0000FF00) >> 8 + anim_id = (anim & 0x000000FF) >> 0 + sprite = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["name"] + palette = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["palettes"][palette_id] + anim = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["anims"][anim_id] + if numNpcs > 1: + tmp_out += INDENT + " " + f"NPC_ANIM({sprite}, {palette}, {anim}),\n" + else: + tmp_out += INDENT*2 + f"NPC_ANIM({sprite}, {palette}, {anim}),\n" + INCLUDES_NEEDED["npcs"].add(sprite) + i += 4 + tmp_out += INDENT + f"}},\n" + i -= 1 + elif i == 0x1EC: + var = unpack_from(">I", staticNpc, curr_base+i)[0] + if not var == 0: + tmp_out += INDENT + f".{var_names[18]} = MESSAGE_ID(0x{(var & 0xFF0000) >> 16:02X}, 0x{var & 0xFFFF:04X}),\n" + + i += 1 + + if numNpcs > 1: + INDENT = INDENT[:len(INDENT)//2] + tmp_out += INDENT + f"}},\n" + if z+1 == numNpcs: + tmp_out += "};\n" + + curr_base += 0x1F0 + out += tmp_out + elif struct["type"] == "ExtraAnimationList": + tmp_out = f"NpcAnimID {name}[] = {{\n" + extraAnimations = bytes.read(struct["length"]) + + i = 0 + while i < struct["length"]: + anim = unpack_from(">I", extraAnimations, i)[0] + if anim == 0xFFFFFFFF: + tmp_out += INDENT + f"ANIM_END,\n" + elif not anim == 0: + sprite_id = (anim & 0x00FF0000) >> 16 + palette_id = (anim & 0x0000FF00) >> 8 + anim_id = (anim & 0x000000FF) >> 0 + sprite = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["name"] + palette = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["palettes"][palette_id] + anim = disasm_script.CONSTANTS["NPC_SPRITE"][sprite_id]["anims"][anim_id] + tmp_out += INDENT + f"NPC_ANIM({sprite}, {palette}, {anim}),\n" + INCLUDES_NEEDED["npcs"].add(sprite) + i += 4 + tmp_out += f"}};\n" + out += tmp_out + elif struct["type"] == "NpcGroupList": + tmp_out = f"NpcGroupList {name} = {{\n" + npcGroupList = bytes.read(struct["length"]) + + i = 0 + while i < struct["length"]: + npcCount, npcs, battle = unpack_from(">3I", npcGroupList, i) + if not (npcCount == 0 and npcs == 0 and battle == 0): + battle_a = (battle & 0xFF000000) >> 24 + battle_b = (battle & 0x00FF0000) >> 16 + battle_c = (battle & 0x0000FF00) >> 8 + battle_d = (battle & 0x000000FF) >> 0 + tmp_out += INDENT + f"NPC_GROUP({symbol_map[npcs][0][1]}, BATTLE_ID({battle_a}, {battle_b}, {battle_c}, {battle_d})),\n" + if symbol_map[npcs][0][1] not in INCLUDED["functions"]: + INCLUDES_NEEDED["forward"].append(symbol_map[npcs][0][1]) + i += 0xC + tmp_out += INDENT + f"{{}},\n" + tmp_out += f"}};\n" + out += tmp_out + elif struct["type"] == "ItemList": + out += f"s32 {name}[] = {{\n" + + items = unpack(f">{struct['length']//4}I", bytes.read(struct["length"])) + for item in items: + out += f" {disasm_script.CONSTANTS['ItemIDs'][item]},\n" + out += f"}};\n" + elif struct["type"] == "Header": - out += f"MapConfig {name} = {{\n" + out += f"MapConfig N(config) = {{\n" bytes.read(0x10) main,entry_list,entry_count = unpack(">IIi", bytes.read(4 * 3)) - out += f" .main = {main_script_name},\n" + out += f" .main = N(main),\n" out += f" .entryList = {entry_list_name},\n" out += f" .entryCount = ENTRY_COUNT({entry_list_name}),\n" @@ -64,30 +369,52 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0): out += f" .tattle = 0x{tattle:X},\n" out += f"}};\n" - elif struct["type"] == "ASCII": - string_data = bytes.read(struct["length"]).decode("ascii") - - # strip null terminator(s) - while string_data[-1] == "\0": - string_data = string_data[:-1] - - string_literal = json.dumps(string_data) - out += f"const char {struct['name']}[] = {string_literal};\n" + elif struct["type"] == "ASCII" or struct["type"] == "SJIS": + # rodata string hopefully inlined elsewhere + bytes.read(struct["length"]) + out += f"// rodata: {struct['name']}\n" elif struct["type"].startswith("Function"): bytes.read(struct["length"]) - out += f"// function: {name}\n" + out += f"s32 {name}();\n" elif struct["type"] == "FloatTable": + vram = int(name.split("_",1)[1][:-1], 16) + name = f"N(D_{vram:X}_{(vram - 0x80240000) + romstart:X})" + struct["name"] = name out += f"f32 {name}[] = {{" for i in range(0, struct["length"], 4): - if (i % 0x20) == 0: - out += f"\n " + if (i % (4 * 4)) == 0: + out += f"\n " word = unpack(">f", bytes.read(4))[0] - out += " %ff," % word + out += f" {word:.01f}f," out += f"\n}};\n" + elif struct["type"] == "Formation": + out += f"Formation {struct['name']} = {{\n" + + num_bytes_remaining = struct["length"] + while num_bytes_remaining > 0: + num_read, s = disasm_struct.output_single_line(bytes.read(0x1C), 0, "FormationRow") + num_bytes_remaining -= num_read + + s = s.replace(", .var0 = 0, .var1 = 0, .var2 = 0, .var3 = 0", "") + + out += f" {s},\n" + + out += f"}};\n" else: # unknown type of struct - out += f"s32 {name}[] = {{" + if struct["name"].startswith("N(unk_802"): + vram = int(name.split("_",1)[1][:-1], 16) + name = f"N(D_{vram:X}_{(vram - 0x80240000) + romstart:X})" + struct["name"] = name + + if struct["type"] == "Padding": + out += "static " + if struct["length"] // 4 > 1: + out += f"s32 {name}[] = {{" + else: + out += f"s32 {name} = {{" + for i in range(0, struct["length"], 4): if (i % 0x20) == 0: out += f"\n " @@ -95,7 +422,7 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0): word = int.from_bytes(bytes.read(4), byteorder="big") if word in symbol_map: - out += f" {symbol_map[word]}," + out += f" {symbol_map[word][0][1]}," else: out += f" 0x{word:08X}," @@ -106,7 +433,7 @@ def disassemble(bytes, midx, symbol_map={}, comments=True, romstart=0): # end of data return out -def parse_midx(file, prefix = ""): +def parse_midx(file, prefix="", vram=0x80240000): structs = [] for line in file.readlines(): @@ -116,7 +443,7 @@ def parse_midx(file, prefix = ""): if s[0] == "$End": continue structs.append({ - "name": prefix + name_struct(s[0]), + "name": "N(" + prefix + name_struct(s[0]) + ")", "type": s[1], "start": int(s[2], 16), "vaddr": int(s[3], 16), @@ -126,7 +453,7 @@ def parse_midx(file, prefix = ""): elif "Missing" in s: start = int(s[1], 16) end = int(s[2], 16) - vaddr = start + 0x80240000 + vaddr = start + vram structs.append({ "name": f"{prefix}unk_missing_{vaddr:X}", "type": "Missing", @@ -138,7 +465,7 @@ def parse_midx(file, prefix = ""): elif "Padding" in s: start = int(s[1], 16) end = int(s[2], 16) - vaddr = start + 0x80240000 + vaddr = start + vram structs.append({ "name": f"{prefix}pad_{start:X}", "type": "Padding", @@ -154,6 +481,8 @@ def parse_midx(file, prefix = ""): def name_struct(s): s = s[1:].replace("???", "unk") + s = s.replace("Function", "func") + """ # use ThisCase for scripts if s.startswith("Script_"): @@ -180,19 +509,101 @@ def name_struct(s): if __name__ == "__main__": parser = argparse.ArgumentParser(description="Converts split data to C using a Star Rod idx file") parser.add_argument("idxfile", help="Input .*idx file from Star Rod dump") - parser.add_argument("offset", help="Starting ROM offset") parser.add_argument("--comments", action="store_true", help="Write offset/vaddr comments") args = parser.parse_args() - with open(args.idxfile, "r") as f: - midx = parse_midx(f) + base, ext = os.path.splitext(os.path.basename(args.idxfile)) + if ext == ".midx": + map_name = base + area_name, _ = map_name.split("_") + segment_name = f"world/area_{area_name}/{map_name}/" + else: + battle_area = "_".join(base.lower().split(" ")[1:]) + segment_name = f"battle/{battle_area}/" symbol_map = {} - for struct in midx: - symbol_map[struct["vaddr"]] = struct["name"] - with open(os.path.join(DIR, "../baserom.z64"), "rb") as romfile: - romfile.seek(eval(args.offset)) - disasm = disassemble(romfile, midx, symbol_map, args.comments, eval(args.offset)) + disasm_script.get_constants() + + with open(os.path.join(DIR, "../ver/current/splat.yaml")) as f: + splat_config = yaml.safe_load(f.read()) + + rom_offset = -1 + for segment in splat_config["segments"]: + if isinstance(segment, dict) and segment.get("name") == segment_name: + rom_offset = segment["start"] + vram = segment["vram"] + break + + if rom_offset == -1: + print(f"can't find segment with name '{segment_name}' in splat.yaml") + exit(1) + + with open(args.idxfile, "r") as f: + midx = parse_midx(f, vram=vram) + + with open(os.path.join(DIR, "../ver/current/baserom.z64"), "rb") as romfile: + name_fixes = { "script_NpcAI": "npcAI", + "aISettings": "npcAISettings", + "script_ExitWalk": "exitWalk", + "script_MakeEntities": "makeEntities", + } + + for struct in midx: + romfile.seek(struct["start"] + rom_offset) + + name = struct["name"] + if name.startswith("N("): + name = name[2:-1] + if name.split("_",1)[0] in name_fixes: + name = name_fixes[name.split("_",1)[0]] + "_" + name.rsplit("_",1)[1] + elif name.startswith("script_"): + name = name.split("script_",1)[1] + elif "_Main_" in name: + name = "main" + elif "ASCII" in name: + name = name.replace("ASCII", "ascii") + name = name[0].lower() + name[1:] + name = "N(" + name + ")" + struct["name"] = name + + # decode rodata stuff so it can be written inline instead of by pointer (which wouldn't match) + if struct["type"] == "ASCII": + string_data = romfile.read(struct["length"]).decode("ascii") + + # strip null terminator(s) + while string_data[-1] == "\0": + string_data = string_data[:-1] + + string_literal = json.dumps(string_data) + symbol_map[struct["vaddr"]] = [[struct["vaddr"], string_literal]] + elif struct["type"] == "SJIS": + string_data = sjis.decode(romfile.read(struct["length"])) + + string_literal = '"' + string_data + '"' + symbol_map[struct["vaddr"]] = [[struct["vaddr"], string_literal]] + else: + symbol_map[struct["vaddr"]] = [[struct["vaddr"], struct["name"]]] + + romfile.seek(rom_offset) + disasm = disassemble(romfile, midx, symbol_map, args.comments, rom_offset) + + if INCLUDES_NEEDED["forward"]: + print() + print("========== Forward declares: ==========\n") + for forward in INCLUDES_NEEDED["forward"]: + print(forward) + print() + + if INCLUDES_NEEDED["npcs"]: + print("========== Includes needed: ===========\n") + print(f"#include \"map.h\"") + for npc in INCLUDES_NEEDED["npcs"]: + print(f"#include \"sprite/npc/{npc}.h\"") + print() + + print("=======================================\n") print(disasm.rstrip()) + + diff --git a/ver/us/asm/data/code_EB1920.data.s b/ver/us/asm/data/code_EB1920.data.s index 7e1ba49dd5..b0fdb3751a 100644 --- a/ver/us/asm/data/code_EB1920.data.s +++ b/ver/us/asm/data/code_EB1920.data.s @@ -12,4 +12,4 @@ glabel D_802417E4_EB2644 .word 0x00000000 glabel D_802417E8_EB2648 -.word 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, 0x802E3A70, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802E3EA8, 0xFE363C81, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_80240484_EB12E4, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, 0x802E4310, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000043, 0x00000002, 0x802E461C, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_EB1508, 0xFE363C8A, 0x00000043, 0x00000001, 0x802E3FA4, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802406E0_EB1540, 0xFE363C80, 0x0000004E, 0x00000006, 0x802417EC, 0x00000010, 0x00000000, D_802442D0_BE7A80, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_EB14B4, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_8024086C_EB16CC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802E4720, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, 0x802E3A70, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802E3EA8, 0xFE363C81, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_8024086C_EB16CC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, 0x802E4310, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x80241980, 0xFE363C8A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFC, 0x00040002, 0x00000043, 0x00000004, 0x802E1D58, 0xFE363C89, 0xFFFFFFFC, 0xFE363C8B, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802DC654, 0xFE363C89, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFC, 0x00000100, 0x00000001, 0x0000000E, 0x00000002, 0xFE363C8B, 0x000000B4, 0x00000027, 0x00000002, 0xFE363C86, 0x00000014, 0x00000012, 0x00000000, 0x00000027, 0x00000002, 0xFE363C86, 0xFFFFFFEC, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C87, 0x0000000A, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFC, 0xF24A7A80, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000014, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000043, 0x00000002, 0x802E461C, 0xFE363C80, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, 0x802DBF70, 0xFFFFFFFC, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8A, 0x000000B4, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000014, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFC, 0x00040001, 0x00000043, 0x00000004, 0x802DC3E0, 0xFFFFFFFC, 0xFE363C89, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFC, 0x00000100, 0x00000000, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000008, 0x00000001, 0x00000005, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_EB1508, 0xFE363C8A, 0x00000043, 0x00000001, 0x802E3FA4, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000002, func_802406E0_EB1540, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241A00, 0x00000010, 0x00000000, D_802442D0_BE7A80, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_EB14B4, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFBA, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_802409F8_EB1858, 0x00000043, 0x00000002, 0x802DD1D4, 0xFE363C80, 0x00000043, 0x00000003, 0x802E4064, 0xFE363C85, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000004, 0x0000000B, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000043, 0x00000003, 0x802DF124, 0xFE363C82, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0xFE363C82, 0xFE363C8D, 0xFE363C80, 0xFE363C8E, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C8E, 0xFE363C8F, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFC, 0xF24A7A80, 0x00000027, 0x00000002, 0xFE363C80, 0x0000000A, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C80, 0xFE363C8F, 0x0000000A, 0x00000043, 0x00000007, 0x802DD864, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000000, 0xFE363C82, 0xFE363C87, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000046, 0x00000001, 0x80241D24, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C88, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C89, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000000, 0xFE363C8A, 0x00000013, 0x00000000, 0x00000043, 0x00000001, 0x802DCA8C, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C86, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, 0x802E3F18, 0xFE363C86, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000023, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_80240A3C_EB189C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000054, 0x00000000, 0x00000043, 0x0000000B, func_8024077C_EB15DC, 0x00000000, 0x00B60008, 0x00B60001, 0x00000054, 0x00000000, 0x001000E4, 0x001000E5, 0x001000E6, 0x001000E7, 0x8024208C, 0x00000046, 0x00000001, 0x80241D94, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000024, 0x00000002, 0xFE363C80, 0x0000015C, 0x00000024, 0x00000002, 0xFE363C81, 0x00000003, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, 0x802E4940, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000B, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000064, 0xFE363C80, 0x00000028, 0x00000002, 0xFE363C80, 0x00000064, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000064, 0xFE363C80, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000A, 0x0000000F, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000044, 0x00000001, 0x80242148, 0x00000012, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000002, 0xF24A7C80, 0x0000000B, 0x00000002, 0xF971888B, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000044, 0x00000001, 0x80242148, 0x00000043, 0x00000005, 0x802E1C00, 0x00000014, 0x000000FA, 0x00000005, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, 0x802E1C7C, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000003, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, 0x802E1C00, 0x000000FA, 0x0000001E, 0x0000003C, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, 0x802E1C7C, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000005, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000005, 0xF24A7C80, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000002, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000001, 0xFFFFFFA1, 0x000000A5, 0x0000000F, 0x00000001, 0xFFFFFF92, 0x00000078, 0x00000023, 0xFFFFFFFF, 0x00000001, 0xFFFFFFE7, 0x000000C3, 0x00000014, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000001, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000002, 0xFFFFFF88, 0x0000008C, 0x0000000F, 0xFFFFFFFF, 0x0000004D, 0x00000001, 0x000000EF, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000001, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000030, 0x00000001, 0x80242434, 0x00000012, 0x00000000, 0x00000030, 0x00000001, 0x80242478, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000033, 0x00000003, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x0000000A, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, 0x802DB57C, 0x00000000, 0xFE363C81, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60004, 0x00000043, 0x00000005, 0x802DB78C, 0x00000000, 0xFE363C82, 0xFE363C83, 0x00000000, 0x00000031, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60001, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, 0x802E1D00, 0x00000002, 0xFE363C84, 0x00000027, 0x00000002, 0xFE363C84, 0x00000001, 0x00000005, 0x00000001, 0xFE363C84, 0x00000043, 0x00000003, 0x802DBF70, 0x00000000, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C85, 0x000000B4, 0x0000000D, 0x00000002, 0xFE363C85, 0x00000168, 0x00000028, 0x00000002, 0xFE363C85, 0x00000168, 0x00000013, 0x00000000, 0x00000043, 0x00000004, 0x802DC064, 0x00000000, 0xFE363C85, 0x00000001, 0x00000008, 0x00000001, 0x00000014, 0x00000006, 0x00000000, 0x00000008, 0x00000001, 0xFE363C82, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C80, 0xFE363C83, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C83, 0x0000001E, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x0001002A, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x802424BC, 0xFE363C89, 0x00000003, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000049, 0x00000001, 0xFE363C89, 0x00000008, 0x00000001, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000001, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x0000000A, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000028, 0x00000023, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x0010010A, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000014, 0x00000016, 0x00000001, 0x00000019, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFE2, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24E6280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000014, 0x00000000, 0x00000000, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7E80, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFDD, 0x0000007D, 0xFFFFFFEC, 0x0000000C, 0x00000043, 0x00000003, 0x802DF124, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A7E80, 0x00000003, 0x00000001, 0x00000019, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0xFFFFFFF1, 0xFFFFFFEC, 0x00000000, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0xFFFFFFD8, 0xFFFFFFEC, 0x00000000, 0x0000000A, 0x00000002, 0xF971888A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000019, 0x00000013, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010B, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, 0x802E4EF0, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8080, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000008, 0x00000043, 0x00000003, 0x802DC228, 0xFFFFFFFF, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010C, 0x00000024, 0x00000002, 0xF971888B, 0x00000001, 0x00000043, 0x00000005, 0x802E339C, 0x00000000, 0x0000002A, 0x00000000, 0x00000008, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x0001002B, 0x00000008, 0x00000001, 0x0000003C, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000057, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60002, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x0010010D, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFF1, 0x0000004B, 0x00000050, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000023, 0x00000032, 0x00000078, 0x0000000A, 0x00000016, 0x00000001, 0x00000023, 0x00000043, 0x00000001, func_80240A68_EB18C8, 0x00000044, 0x00000001, 0x802426A4, 0x00000056, 0x00000000, 0x00000043, 0x00000003, 0x802DF124, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000004, 0x802DDE0C, 0x0010010F, 0x000000A0, 0x00000028, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFF6, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000027, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000001, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B6000D, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7DB4, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x000000E8, 0x00000000, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000003C, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF2518280, 0x00000043, 0x00000004, 0x802D903C, 0x00000000, 0xF24AB680, 0xF24A5E80, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, 0x802D9848, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60007, 0x00B60007, 0x00000000, 0x00100110, 0x00000043, 0x00000003, 0x802D9DE4, 0x00000000, 0xF24BE280, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000028, 0x00000016, 0x00000001, 0x0000002D, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x00000008, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000032, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x0000004B, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000000, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0x00000064, 0x00000043, 0x00000003, 0x80048DA0, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x00100108, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000043, 0x00000003, 0x80048DA0, 0xFFFFFFFF, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x00100113, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000043, 0x00000003, 0x80048C5C, 0xFFFFFFFF, 0x802427B4, 0x00000043, 0x00000003, 0x80049154, 0xFFFFFFFF, 0x802432D4, 0x00000012, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xC2F00000, 0x428C0000, 0x42340000, 0xC2960000, 0x42A00000, 0x42B40000, 0xC1200000, 0x42E60000, 0x42B40000, 0x41200000, 0x43340000, 0x428C0000, 0x42480000, 0x43520000, 0x41F00000, 0x42C80000, 0x43200000, 0x00000000, 0x43110000, 0x43430000, 0xC1200000, 0x42C80000, 0x433E0000, 0xC2B40000, 0x42A00000, 0x43340000, 0xC2700000, 0x42E60000, 0x432F0000, 0xC2200000, 0x43250000, 0x432A0000, 0xC1200000, 0x43660000, 0x432A0000, 0xC1A00000, 0x43870000, 0x432F0000, 0xC1F00000, 0x0000000A, 0x00000002, 0xF9718889, 0x00000000, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFF88, 0x00000046, 0x0000002D, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xF9718889, 0x00000001, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, func_802E2A80, 0x0000003C, 0x80243420, 0x00000006, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802E2B74, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80240A8C_EB18EC, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000013, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000001, 0x00000008, 0x00000001, 0x0000000A, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, 0x802DE644, 0xF24A8280, 0x00000043, 0x00000004, 0x802DE754, 0x0000003C, 0x00000000, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000024, 0x00000002, 0xF971888B, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x00000014, 0x00000024, 0x00000002, 0xF971888A, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000019, 0x00000057, 0x00000000, 0x00000024, 0x00000002, 0xF971888A, 0x00000001, 0x00000016, 0x00000001, 0x0000001E, 0x00000056, 0x00000000, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, 0x802D9848, 0x00000000, 0xF24A7E80, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001F, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000005, 0x0010010E, 0x00000003, 0x00000001, 0x0000001E, 0x0000000A, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000001E, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000023, 0x00000016, 0x00000001, 0x00000028, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100111, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000002D, 0x00000016, 0x00000001, 0x00000032, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000091, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, 0x802E4EF0, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x000000AA, 0x000000AA, 0x00000032, 0x00000014, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0xFFFFFFC4, 0x00000000, 0x00000043, 0x00000003, 0x802DBFE4, 0xFFFFFFFF, 0x0000010E, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000091, 0x000000AA, 0xFFFFFFF6, 0x0000000F, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFF, 0x00000091, 0x000000A0, 0xFFFFFFF6, 0x00000005, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100112, 0x00000043, 0x00000003, 0x802DC228, 0xFFFFFFFF, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000000, 0x00000003, 0x00000001, 0x0000005A, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000005A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000001, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, AddCoin, 0x00000000, 0x0000001A, 0x7FFFFE00, 0x00000056, 0x00000000, 0x00000043, 0x00000004, 0x802DC5C0, 0x00000000, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60007, 0x00000043, 0x00000003, 0x802DB57C, 0x00000000, 0xF24A8E80, 0x00000043, 0x00000005, 0x802DB78C, 0x00000000, 0x00000131, 0x00000000, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7C80, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000091, 0x000000C3, 0xFFFFFFF6, 0x00000005, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160005, 0x00160008, 0x00000000, 0x00100115, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, func_802E2A80, 0x0000001E, 0x80243468, 0x00000007, 0x00000000, 0x00000003, 0x00000001, 0x0000005B, 0x00000043, 0x00000001, func_802E2B74, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000004, 0x00000001, 0x0000005B, 0x00000013, 0x00000000, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100114, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE0180, 0x00000024, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000003, 0x80048C5C, 0xFFFFFFFF, 0x802434BC, 0x00000043, 0x00000003, 0x80049154, 0xFFFFFFFF, 0x80243E08, 0x00000012, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x802416D0, 0xC2820000, 0x00000000, 0x433E0000, 0x00510509, 0x802433B8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00B60001, 0x00B60004, 0x00B60006, 0x00B60006, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00000000, 0x00000000, 0x00000000, 0x001A0000, 0x00000001, 0x802416FC, 0x42C80000, 0x43200000, 0x00000000, 0x00400001, 0x80243E38, 0x00000000, 0x00000000, 0x0000010E, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00000000, 0x00000000, 0x00000000, 0x001A000B, 0x00000001, 0x80243EB4, 0x00000000, 0x00000001, 0x802440A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6B7A6E5F, 0x31390000, 0x6B7A6E5F, 0x32320000 +.word 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, 0x802E3A70, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802E3EA8, 0xFE363C81, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_80240484_EB12E4, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, 0x802E4310, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000043, 0x00000002, 0x802E461C, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_EB1508, 0xFE363C8A, 0x00000043, 0x00000001, 0x802E3FA4, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802406E0_EB1540, 0xFE363C80, 0x0000004E, 0x00000006, 0x802417EC, 0x00000010, 0x00000000, 0x802442D0, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_EB14B4, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_8024086C_EB16CC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802E4720, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, 0x802E3A70, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802E3EA8, 0xFE363C81, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, func_8024086C_EB16CC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, 0x802E4310, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x80241980, 0xFE363C8A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFC, 0x00040002, 0x00000043, 0x00000004, 0x802E1D58, 0xFE363C89, 0xFFFFFFFC, 0xFE363C8B, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802DC654, 0xFE363C89, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFC, 0x00000100, 0x00000001, 0x0000000E, 0x00000002, 0xFE363C8B, 0x000000B4, 0x00000027, 0x00000002, 0xFE363C86, 0x00000014, 0x00000012, 0x00000000, 0x00000027, 0x00000002, 0xFE363C86, 0xFFFFFFEC, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C87, 0x0000000A, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFC, 0xF24A7A80, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000014, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000043, 0x00000002, 0x802E461C, 0xFE363C80, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, 0x802DBF70, 0xFFFFFFFC, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8A, 0x000000B4, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000014, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFC, 0x00040001, 0x00000043, 0x00000004, 0x802DC3E0, 0xFFFFFFFC, 0xFE363C89, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFC, 0x00000100, 0x00000000, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000008, 0x00000001, 0x00000005, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_EB1508, 0xFE363C8A, 0x00000043, 0x00000001, 0x802E3FA4, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000002, func_802406E0_EB1540, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241A00, 0x00000010, 0x00000000, 0x802442D0, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_EB14B4, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFBA, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_802409F8_EB1858, 0x00000043, 0x00000002, 0x802DD1D4, 0xFE363C80, 0x00000043, 0x00000003, 0x802E4064, 0xFE363C85, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000004, 0x0000000B, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000043, 0x00000003, 0x802DF124, 0xFE363C82, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0xFE363C82, 0xFE363C8D, 0xFE363C80, 0xFE363C8E, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C8E, 0xFE363C8F, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFC, 0xF24A7A80, 0x00000027, 0x00000002, 0xFE363C80, 0x0000000A, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C80, 0xFE363C8F, 0x0000000A, 0x00000043, 0x00000007, 0x802DD864, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000000, 0xFE363C82, 0xFE363C87, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000046, 0x00000001, 0x80241D24, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C88, 0x00000043, 0x00000001, 0x802DCA8C, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, 0x802DCA48, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C89, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000000, 0xFE363C8A, 0x00000013, 0x00000000, 0x00000043, 0x00000001, 0x802DCA8C, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C86, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, 0x802E3F18, 0xFE363C86, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000023, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_80240A3C_EB189C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000054, 0x00000000, 0x00000043, 0x0000000B, func_8024077C_EB15DC, 0x00000000, 0x00B60008, 0x00B60001, 0x00000054, 0x00000000, 0x001000E4, 0x001000E5, 0x001000E6, 0x001000E7, 0x8024208C, 0x00000046, 0x00000001, 0x80241D94, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000024, 0x00000002, 0xFE363C80, 0x0000015C, 0x00000024, 0x00000002, 0xFE363C81, 0x00000003, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, 0x802E4940, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000B, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000064, 0xFE363C80, 0x00000028, 0x00000002, 0xFE363C80, 0x00000064, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000064, 0xFE363C80, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000A, 0x0000000F, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000044, 0x00000001, 0x80242148, 0x00000012, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000002, 0xF24A7C80, 0x0000000B, 0x00000002, 0xF971888B, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000044, 0x00000001, 0x80242148, 0x00000043, 0x00000005, 0x802E1C00, 0x00000014, 0x000000FA, 0x00000005, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, 0x802E1C7C, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000003, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, 0x802E1C00, 0x000000FA, 0x0000001E, 0x0000003C, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, 0x802E1C7C, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000005, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802D8758, 0x00000000, 0x00000000, 0x00000005, 0xF24A7C80, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000002, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000001, 0xFFFFFFA1, 0x000000A5, 0x0000000F, 0x00000001, 0xFFFFFF92, 0x00000078, 0x00000023, 0xFFFFFFFF, 0x00000001, 0xFFFFFFE7, 0x000000C3, 0x00000014, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000001, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000002, 0xFFFFFF88, 0x0000008C, 0x0000000F, 0xFFFFFFFF, 0x0000004D, 0x00000001, 0x000000EF, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000003, 0x802E1D00, 0x00000001, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000030, 0x00000001, 0x80242434, 0x00000012, 0x00000000, 0x00000030, 0x00000001, 0x80242478, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000033, 0x00000003, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x0000000A, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, 0x802DB57C, 0x00000000, 0xFE363C81, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60004, 0x00000043, 0x00000005, 0x802DB78C, 0x00000000, 0xFE363C82, 0xFE363C83, 0x00000000, 0x00000031, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60001, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, 0x802E1D00, 0x00000002, 0xFE363C84, 0x00000027, 0x00000002, 0xFE363C84, 0x00000001, 0x00000005, 0x00000001, 0xFE363C84, 0x00000043, 0x00000003, 0x802DBF70, 0x00000000, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C85, 0x000000B4, 0x0000000D, 0x00000002, 0xFE363C85, 0x00000168, 0x00000028, 0x00000002, 0xFE363C85, 0x00000168, 0x00000013, 0x00000000, 0x00000043, 0x00000004, 0x802DC064, 0x00000000, 0xFE363C85, 0x00000001, 0x00000008, 0x00000001, 0x00000014, 0x00000006, 0x00000000, 0x00000008, 0x00000001, 0xFE363C82, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C80, 0xFE363C83, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C83, 0x0000001E, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x0001002A, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x802424BC, 0xFE363C89, 0x00000003, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000049, 0x00000001, 0xFE363C89, 0x00000008, 0x00000001, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000001, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x0000000A, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000028, 0x00000023, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x0010010A, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000014, 0x00000016, 0x00000001, 0x00000019, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFE2, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24E6280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000014, 0x00000000, 0x00000000, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7E80, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFDD, 0x0000007D, 0xFFFFFFEC, 0x0000000C, 0x00000043, 0x00000003, 0x802DF124, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A7E80, 0x00000003, 0x00000001, 0x00000019, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0xFFFFFFF1, 0xFFFFFFEC, 0x00000000, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0xFFFFFFD8, 0xFFFFFFEC, 0x00000000, 0x0000000A, 0x00000002, 0xF971888A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000019, 0x00000013, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010B, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, 0x802E4EF0, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8080, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000008, 0x00000043, 0x00000003, 0x802DC228, 0xFFFFFFFF, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010C, 0x00000024, 0x00000002, 0xF971888B, 0x00000001, 0x00000043, 0x00000005, 0x802E339C, 0x00000000, 0x0000002A, 0x00000000, 0x00000008, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000002, 0x802DE6A4, 0x0001002B, 0x00000008, 0x00000001, 0x0000003C, 0x00000043, 0x00000002, 0x802DE6A4, 0x00010002, 0x00000057, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60002, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x0010010D, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFF1, 0x0000004B, 0x00000050, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000023, 0x00000032, 0x00000078, 0x0000000A, 0x00000016, 0x00000001, 0x00000023, 0x00000043, 0x00000001, func_80240A68_EB18C8, 0x00000044, 0x00000001, 0x802426A4, 0x00000056, 0x00000000, 0x00000043, 0x00000003, 0x802DF124, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000004, 0x802DDE0C, 0x0010010F, 0x000000A0, 0x00000028, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFF6, 0x00000043, 0x0000000F, 0x802E58EC, 0x00000027, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000001, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B6000D, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7DB4, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x000000E8, 0x00000000, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000003C, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60007, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF2518280, 0x00000043, 0x00000004, 0x802D903C, 0x00000000, 0xF24AB680, 0xF24A5E80, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, 0x802D9848, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60007, 0x00B60007, 0x00000000, 0x00100110, 0x00000043, 0x00000003, 0x802D9DE4, 0x00000000, 0xF24BE280, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000028, 0x00000016, 0x00000001, 0x0000002D, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x00000008, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000032, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x0000004B, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000000, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0x00000064, 0x00000043, 0x00000003, 0x80048DA0, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x00100108, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000043, 0x00000003, 0x80048DA0, 0xFFFFFFFF, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x00100113, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000043, 0x00000003, 0x80048C5C, 0xFFFFFFFF, 0x802427B4, 0x00000043, 0x00000003, 0x80049154, 0xFFFFFFFF, 0x802432D4, 0x00000012, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xC2F00000, 0x428C0000, 0x42340000, 0xC2960000, 0x42A00000, 0x42B40000, 0xC1200000, 0x42E60000, 0x42B40000, 0x41200000, 0x43340000, 0x428C0000, 0x42480000, 0x43520000, 0x41F00000, 0x42C80000, 0x43200000, 0x00000000, 0x43110000, 0x43430000, 0xC1200000, 0x42C80000, 0x433E0000, 0xC2B40000, 0x42A00000, 0x43340000, 0xC2700000, 0x42E60000, 0x432F0000, 0xC2200000, 0x43250000, 0x432A0000, 0xC1200000, 0x43660000, 0x432A0000, 0xC1A00000, 0x43870000, 0x432F0000, 0xC1F00000, 0x0000000A, 0x00000002, 0xF9718889, 0x00000000, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFFFFFF88, 0x00000046, 0x0000002D, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xF9718889, 0x00000001, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, func_802E2A80, 0x0000003C, 0x80243420, 0x00000006, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, func_802E2B74, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80240A8C_EB18EC, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000013, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000001, 0x00000008, 0x00000001, 0x0000000A, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, 0x802DE644, 0xF24A8280, 0x00000043, 0x00000004, 0x802DE754, 0x0000003C, 0x00000000, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, 0x802DC654, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000024, 0x00000002, 0xF971888B, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x00000014, 0x00000024, 0x00000002, 0xF971888A, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000019, 0x00000057, 0x00000000, 0x00000024, 0x00000002, 0xF971888A, 0x00000001, 0x00000016, 0x00000001, 0x0000001E, 0x00000056, 0x00000000, 0x00000043, 0x00000004, 0x802DF41C, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D8D40, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, 0x802D9320, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, 0x802D90D8, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, 0x802D93E4, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000004, 0x802D8C7C, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, 0x802D9848, 0x00000000, 0xF24A7E80, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001F, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000005, 0x0010010E, 0x00000003, 0x00000001, 0x0000001E, 0x0000000A, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000001E, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000023, 0x00000016, 0x00000001, 0x00000028, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100111, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000002D, 0x00000016, 0x00000001, 0x00000032, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, 0x802DB57C, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, 0x802DB78C, 0xFFFFFFFF, 0x00000091, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000004, 0x802DD70C, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, 0x802E4EF0, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160007, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x000000AA, 0x000000AA, 0x00000032, 0x00000014, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0xFFFFFFC4, 0x00000000, 0x00000043, 0x00000003, 0x802DBFE4, 0xFFFFFFFF, 0x0000010E, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000091, 0x000000AA, 0xFFFFFFF6, 0x0000000F, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000005, 0x802DB310, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000006, 0x802DBC40, 0xFFFFFFFF, 0x00000091, 0x000000A0, 0xFFFFFFF6, 0x00000005, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100112, 0x00000043, 0x00000003, 0x802DC228, 0xFFFFFFFF, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000000, 0x00000003, 0x00000001, 0x0000005A, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000005A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000001, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, AddCoin, 0x00000000, 0x0000001A, 0x7FFFFE00, 0x00000056, 0x00000000, 0x00000043, 0x00000004, 0x802DC5C0, 0x00000000, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB654, 0x00000000, 0x00B60007, 0x00000043, 0x00000003, 0x802DB57C, 0x00000000, 0xF24A8E80, 0x00000043, 0x00000005, 0x802DB78C, 0x00000000, 0x00000131, 0x00000000, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000004, 0x802DC5C0, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, 0x802DB5E8, 0xFFFFFFFF, 0xF24A7C80, 0x00000043, 0x00000006, 0x802DBC24, 0xFFFFFFFF, 0x00000091, 0x000000C3, 0xFFFFFFF6, 0x00000005, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160005, 0x00160008, 0x00000000, 0x00100115, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, 0x802DC064, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, func_802E2A80, 0x0000001E, 0x80243468, 0x00000007, 0x00000000, 0x00000003, 0x00000001, 0x0000005B, 0x00000043, 0x00000001, func_802E2B74, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000004, 0x00000001, 0x0000005B, 0x00000013, 0x00000000, 0x00000043, 0x00000005, 0x802DB210, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000002, 0x802DE448, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, 0x802DD810, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100114, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE0180, 0x00000024, 0x00000043, 0x00000003, 0x802DB654, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000003, 0x80048C5C, 0xFFFFFFFF, 0x802434BC, 0x00000043, 0x00000003, 0x80049154, 0xFFFFFFFF, 0x80243E08, 0x00000012, 0x00000000, 0x00000043, 0x00000002, 0x800483E0, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x802416D0, 0xC2820000, 0x00000000, 0x433E0000, 0x00510509, 0x802433B8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00B60001, 0x00B60004, 0x00B60006, 0x00B60006, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00000000, 0x00000000, 0x00000000, 0x001A0000, 0x00000001, 0x802416FC, 0x42C80000, 0x43200000, 0x00000000, 0x00400001, 0x80243E38, 0x00000000, 0x00000000, 0x0000010E, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00000000, 0x00000000, 0x00000000, 0x001A000B, 0x00000001, 0x80243EB4, 0x00000000, 0x00000001, 0x802440A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6B7A6E5F, 0x31390000, 0x6B7A6E5F, 0x32320000 diff --git a/ver/us/asm/data/world/area_arn/arn_03/BE0950.data.s b/ver/us/asm/data/world/area_arn/arn_03/BE0950.data.s index 031ef0f69a..e78a786399 100644 --- a/ver/us/asm/data/world/area_arn/arn_03/BE0950.data.s +++ b/ver/us/asm/data/world/area_arn/arn_03/BE0950.data.s @@ -5,11 +5,12 @@ glabel D_80241BC0_BE0950 .word 0x3F800000, 0x00000019, 0x0000001E, 0x42480000, 0x42480000, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x42C80000, 0x42A00000, 0x00000001, 0x00000043, 0x00000002, func_8024113C_BDFECC, D_80241BC0_BE0950, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00180018, 0x00000000, 0x00000000, 0x80241BF0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00630000, 0x00000000, 0x00180018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00630000 -glabel D_80241C68_BE09F8 -.word 0x00000000, 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000001, 0x00000010, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 +glabel D_80241C68_BE09FC +.word 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, ShowGotItem, 0xFE363C80, 0x00000001, 0x00000010, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000 -glabel D_80241CCC_BE0A5C -.word 0x00000000 +glabel D_80241CD0_BE0A64 +.word 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, arn_03_SomeXYZFuncTodoRename, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_80241648_BE03D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80241680_BE0410, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241CD4, 0x00000010, 0x00000000, D_80244A20, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_802415F4_BE0384, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080007, 0x00000008, 0x00000001, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718882, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0073, 0x00000024, 0x00000002, 0xF9718882, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0074, 0x00000024, 0x00000002, 0xF9718882, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0075, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0076, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0077, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0078, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080007, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, EndSpeech, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x00000019, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000032, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0x00000145, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C86, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000009, 0x00000043, 0x00000002, BringPartnerOut, 0x00000009, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C86, 0x00000004, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFC, 0xFFFFFFAF, 0x000000B0, 0x000000AB, 0x00000014, 0x00000012, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFC, 0xFFFFFFAF, 0x000000BA, 0x000000AB, 0x00000014, 0x00000013, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFF8, 0x000000BA, 0x0000009F, 0x0000003C, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E006E, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00050004, 0x00050001, 0x00000005, 0x000E006F, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E0070, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00050004, 0x00050001, 0x00000005, 0x000E0071, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E0072, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C86, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000009, 0x00000043, 0x00000001, PutPartnerAway, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x0000001E, 0x0000007D, 0x0000001E, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000002, func_802CF56C, 0x00000002, 0x00000008, 0x00000001, 0x0000000F, 0x00000024, 0x00000002, 0xF5DE0180, 0xFFFFFFDE, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0x00000003, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFDE, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x000000AF, 0x000000F0, 0x00000091, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80242064, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80241EB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F80, 0x00000000, 0x0000000F, 0x00000002, 0xFD050F80, 0xFD050F81, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0081, 0x00000024, 0x00000002, 0xFE363C80, 0x00000076, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241C6C, 0x00000043, 0x00000002, AddKeyItem, 0x00000076, 0x00000024, 0x00000002, 0xFD050F80, 0x00000000, 0x00000024, 0x00000002, 0xF8405F77, 0x00000001, 0x00000024, 0x00000002, 0xF8405F7C, 0x00000000, 0x00000002, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0080, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718883, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0079, 0x00000024, 0x00000002, 0xF9718883, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007A, 0x00000024, 0x00000002, 0xF9718883, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007B, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007C, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007D, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007E, 0x00000023, 0x00000000, 0x0000000A, 0x00000002, 0xF8405F77, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE02DC, 0x00000012, 0x00000046, 0x00000001, 0x80241E68, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007F, 0x00000043, 0x00000005, EndSpeech, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x00000024, 0x00000002, 0xFD050F80, 0x00000000, 0x00000024, 0x00000002, 0xFD050F81, 0x000001C2, 0x00000024, 0x00000002, 0xF8405F7C, 0x00000001, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000027, 0x00000002, 0xFD050F80, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x0000000F, 0x00000002, 0xFD050F80, 0xFD050F81, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x8024254C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000043, 0x00000003, SetNpcYaw, 0x00000004, 0x0000005A, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000043, 0x00000003, SetNpcYaw, 0x00000004, 0x0000010E, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C81, 0x00000014, 0x00000043, 0x00000005, SetNpcPos, 0x00000004, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000001E, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000001E, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000FF, 0x00000028, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0xFE363C80, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0x00000004, 0xFE363C80, 0xFE363C82, 0x00000028, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000FF, 0x00000000, 0x00000028, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0xFE363C80, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0x00000004, 0xFE363C80, 0xFE363C82, 0x00000028, 0x00000043, 0x00000005, SetNpcPos, 0x00000004, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000046, 0x00000001, 0x802429D4, 0x00000024, 0x00000002, 0xFD050F82, 0x00000000, 0x00000024, 0x00000002, 0xFD050F83, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000019, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080017, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00950109, 0x00000005, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F82, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00950101, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000004, 0x00950108, 0x00000043, 0x00000005, EndSpeech, 0x00000004, 0x00950108, 0x00950108, 0x00000005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000004, 0x00950101, 0x00000008, 0x00000001, 0x0000000A, 0x00000046, 0x00000001, 0x80242B0C, 0x00000024, 0x00000002, 0xFD050F82, 0x00000001, 0x00000008, 0x00000001, 0x0000000F, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718884, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0082, 0x00000024, 0x00000002, 0xF9718884, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0083, 0x00000024, 0x00000002, 0xF9718884, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0084, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0085, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFEC, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFC, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFC, 0xFE363C80, 0xFE363C82, 0x00000000, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0086, 0x00000046, 0x00000001, 0x802428CC, 0x00000043, 0x00000003, PlayerFaceNpc, 0x00000004, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0x00000004, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000004, 0x00950104, 0x00950101, 0x00000005, 0x000E0087, 0x00000046, 0x00000001, 0x80242C60, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0088, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFEC, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFC, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFC, 0xFE363C80, 0xFE363C82, 0x00000000, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0089, 0x00000046, 0x00000001, 0x802428CC, 0x00000043, 0x00000003, PlayerFaceNpc, 0x00000004, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0x00000004, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000004, 0x00950104, 0x00950101, 0x00000005, 0x000E008A, 0x00000046, 0x00000001, 0x80242C60, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008B, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80242DC4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718885, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008C, 0x00000024, 0x00000002, 0xF9718885, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008D, 0x00000024, 0x00000002, 0xF9718885, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008E, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008F, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0090, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0091, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x802431C8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x80241C10, 0x42100000, 0x43390000, 0x430C0000, 0x00000505, 0x802424E0, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000024, 0x0000000A, 0x000000B9, 0x00000038, 0x0000000A, 0x000000B9, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x000001DF, 0x000000D7, 0x000000C6, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AA, 0x00000001, 0x80241C3C, 0x43510000, 0x43390000, 0x43590000, 0x00000505, 0x802428A8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AB, 0x00000002, 0x80241C10, 0x43BD8000, 0x433A0000, 0x433A0000, 0x00000505, 0x802431A4, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x0000017B, 0x0000000A, 0x000000BA, 0x0000018F, 0x0000000A, 0x000000BA, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x000001DF, 0x000000D7, 0x000000C6, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AC, 0x00000003, 0x80241C3C, 0x44080000, 0x436B0000, 0x43000000, 0x00000505, 0x80243328, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AD, 0x00000004, 0x80241C3C, 0x00000000, 0xC47A0000, 0x00000000, 0x00000505, 0x8024334C, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000024, 0x00000002, 0xFE363C83, 0xFE363C80, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFC4, 0x00000024, 0x00000002, 0xFE363C84, 0xFE363C80, 0x00000027, 0x00000002, 0xFE363C84, 0x0000003C, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000005, 0xFE363C85, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C85, 0x0000002E, 0x00000002, 0xFE363C86, 0xF24A7AE7, 0x0000002C, 0x00000002, 0xFE363C86, 0xF24A7DB4, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xFE363C86, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFE363C83, 0xFE363C82, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000005, 0xFE363C85, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C85, 0x0000002E, 0x00000002, 0xFE363C86, 0xF24A7AE7, 0x0000002C, 0x00000002, 0xFE363C86, 0xF24A7DB4, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xFE363C86, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFE363C84, 0xFE363C82, 0x00000000, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x80241C3C, 0x42100000, 0x438A8000, 0x430C0000, 0x00402705, 0x80243E90, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x80241C3C, 0x43340000, 0x438E8000, 0x43360000, 0x00402705, 0x80243ECC, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x80241C3C, 0x43AE8000, 0x438F0000, 0x43180000, 0x00402705, 0x80243F08, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x80241C3C, 0x43F50000, 0x43A20000, 0x43000000, 0x00402705, 0x80243F44, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, -glabel D_80241CD0_BE0A60 -.word 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, arn_03_SomeXYZFuncTodoRename, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_80241648_BE03D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80241680_BE0410, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241CD4, 0x00000010, 0x00000000, D_80244A20, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_802415F4_BE0384, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080007, 0x00000008, 0x00000001, 0x00000014, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718882, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0073, 0x00000024, 0x00000002, 0xF9718882, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0074, 0x00000024, 0x00000002, 0xF9718882, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0075, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0076, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0077, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0078, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080007, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, EndSpeech, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x00000019, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000032, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0x00000145, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C86, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000009, 0x00000043, 0x00000002, BringPartnerOut, 0x00000009, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C86, 0x00000004, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFC, 0xFFFFFFAF, 0x000000B0, 0x000000AB, 0x00000014, 0x00000012, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFC, 0xFFFFFFAF, 0x000000BA, 0x000000AB, 0x00000014, 0x00000013, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFF8, 0x000000BA, 0x0000009F, 0x0000003C, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0xFFFFFFFC, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E006E, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00050004, 0x00050001, 0x00000005, 0x000E006F, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E0070, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00050004, 0x00050001, 0x00000005, 0x000E0071, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000005, 0x000E0072, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C86, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000009, 0x00000043, 0x00000001, PutPartnerAway, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x0000001E, 0x0000007D, 0x0000001E, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000002, func_802CF56C, 0x00000002, 0x00000008, 0x00000001, 0x0000000F, 0x00000024, 0x00000002, 0xF5DE0180, 0xFFFFFFDE, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0x00000003, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFDE, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x000000AF, 0x000000F0, 0x00000091, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80242064, 0x00000013, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80241EB0, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F80, 0x00000000, 0x0000000F, 0x00000002, 0xFD050F80, 0xFD050F81, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0081, 0x00000024, 0x00000002, 0xFE363C80, 0x00000076, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241C6C, 0x00000043, 0x00000002, AddKeyItem, 0x00000076, 0x00000024, 0x00000002, 0xFD050F80, 0x00000000, 0x00000024, 0x00000002, 0xF8405F77, 0x00000001, 0x00000024, 0x00000002, 0xF8405F7C, 0x00000000, 0x00000002, 0x00000000, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0080, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718883, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0079, 0x00000024, 0x00000002, 0xF9718883, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007A, 0x00000024, 0x00000002, 0xF9718883, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007B, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007C, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007D, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007E, 0x00000023, 0x00000000, 0x0000000A, 0x00000002, 0xF8405F77, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE02DC, 0x00000012, 0x00000046, 0x00000001, 0x80241E68, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E007F, 0x00000043, 0x00000005, EndSpeech, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x00000024, 0x00000002, 0xFD050F80, 0x00000000, 0x00000024, 0x00000002, 0xFD050F81, 0x000001C2, 0x00000024, 0x00000002, 0xF8405F7C, 0x00000001, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000027, 0x00000002, 0xFD050F80, 0x00000001, 0x00000008, 0x00000001, 0x00000001, 0x0000000F, 0x00000002, 0xFD050F80, 0xFD050F81, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x8024254C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000043, 0x00000003, SetNpcYaw, 0x00000004, 0x0000005A, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000043, 0x00000003, SetNpcYaw, 0x00000004, 0x0000010E, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C81, 0x00000014, 0x00000043, 0x00000005, SetNpcPos, 0x00000004, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000001E, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000001E, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x00000000, 0x000000FF, 0x00000028, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0xFE363C80, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0x00000004, 0xFE363C80, 0xFE363C82, 0x00000028, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x0000000D, 0x00000002, 0xFE363C80, 0xFE363C83, 0x00000027, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000012, 0x00000000, 0x00000028, 0x00000002, 0xFE363C80, 0x0000003C, 0x00000013, 0x00000000, 0x00000056, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000FF, 0x00000000, 0x00000028, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000043, 0x00000001, UpdateLerp, 0x00000043, 0x00000007, func_802CFD30, 0x00000004, 0x00000007, 0xFE363C80, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0x00000004, 0xFE363C80, 0xFE363C82, 0x00000028, 0x00000043, 0x00000005, SetNpcPos, 0x00000004, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000046, 0x00000001, 0x802429D4, 0x00000024, 0x00000002, 0xFD050F82, 0x00000000, 0x00000024, 0x00000002, 0xFD050F83, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000019, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00080017, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00950109, 0x00000005, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F82, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00950101, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000004, 0x00950108, 0x00000043, 0x00000005, EndSpeech, 0x00000004, 0x00950108, 0x00950108, 0x00000005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000004, 0x00950101, 0x00000008, 0x00000001, 0x0000000A, 0x00000046, 0x00000001, 0x80242B0C, 0x00000024, 0x00000002, 0xFD050F82, 0x00000001, 0x00000008, 0x00000001, 0x0000000F, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718884, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0082, 0x00000024, 0x00000002, 0xF9718884, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0083, 0x00000024, 0x00000002, 0xF9718884, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0084, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0085, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFEC, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFC, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFC, 0xFE363C80, 0xFE363C82, 0x00000000, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0086, 0x00000046, 0x00000001, 0x802428CC, 0x00000043, 0x00000003, PlayerFaceNpc, 0x00000004, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0x00000004, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000004, 0x00950104, 0x00950101, 0x00000005, 0x000E0087, 0x00000046, 0x00000001, 0x80242C60, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0088, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000001, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFEC, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFC, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFC, 0xFE363C80, 0xFE363C82, 0x00000000, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFFFFFFFF, 0x00000001, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0089, 0x00000046, 0x00000001, 0x802428CC, 0x00000043, 0x00000003, PlayerFaceNpc, 0x00000004, 0x00000001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0x00000004, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0x00000004, 0x00950104, 0x00950101, 0x00000005, 0x000E008A, 0x00000046, 0x00000001, 0x80242C60, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008B, 0x00000043, 0x00000002, DisablePlayerPhysics, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80242DC4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000014, 0x00000001, 0xF5DE0180, 0x00000018, 0x00000001, 0xFFFFFFE6, 0x0000000A, 0x00000002, 0xF9718885, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008C, 0x00000024, 0x00000002, 0xF9718885, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008D, 0x00000024, 0x00000002, 0xF9718885, 0x00000000, 0x00000013, 0x00000000, 0x00000018, 0x00000001, 0xFFFFFFF0, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008E, 0x00000018, 0x00000001, 0xFFFFFFF2, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E008F, 0x00000018, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0090, 0x0000001B, 0x00000001, 0x00000027, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00950104, 0x00950101, 0x00000000, 0x000E0091, 0x00000023, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x802431C8, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x80241C10, 0x42100000, 0x43390000, 0x430C0000, 0x00000505, 0x802424E0, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000024, 0x0000000A, 0x000000B9, 0x00000038, 0x0000000A, 0x000000B9, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x000001DF, 0x000000D7, 0x000000C6, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AA, 0x00000001, 0x80241C3C, 0x43510000, 0x43390000, 0x43590000, 0x00000505, 0x802428A8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AB, 0x00000002, 0x80241C10, 0x43BD8000, 0x433A0000, 0x433A0000, 0x00000505, 0x802431A4, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x0000017B, 0x0000000A, 0x000000BA, 0x0000018F, 0x0000000A, 0x000000BA, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFF8001, 0x000001DF, 0x000000D7, 0x000000C6, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AC, 0x00000003, 0x80241C3C, 0x44080000, 0x436B0000, 0x43000000, 0x00000505, 0x80243328, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x001A00AD, 0x00000004, 0x80241C3C, 0x00000000, 0xC47A0000, 0x00000000, 0x00000505, 0x8024334C, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000024, 0x00000002, 0xFE363C83, 0xFE363C80, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFC4, 0x00000024, 0x00000002, 0xFE363C84, 0xFE363C80, 0x00000027, 0x00000002, 0xFE363C84, 0x0000003C, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000005, 0xFE363C85, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C85, 0x0000002E, 0x00000002, 0xFE363C86, 0xF24A7AE7, 0x0000002C, 0x00000002, 0xFE363C86, 0xF24A7DB4, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xFE363C86, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFE363C83, 0xFE363C82, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000005, 0xFE363C85, 0x00000026, 0x00000002, 0xFE363C86, 0xFE363C85, 0x0000002E, 0x00000002, 0xFE363C86, 0xF24A7AE7, 0x0000002C, 0x00000002, 0xFE363C86, 0xF24A7DB4, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xFE363C86, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFE363C84, 0xFE363C82, 0x00000000, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x80243D28, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000010, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x80241C3C, 0x42100000, 0x438A8000, 0x430C0000, 0x00402705, 0x80243E90, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x80241C3C, 0x43340000, 0x438E8000, 0x43360000, 0x00402705, 0x80243ECC, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x80241C3C, 0x43AE8000, 0x438F0000, 0x43180000, 0x00402705, 0x80243F08, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x80241C3C, 0x43F50000, 0x43A20000, 0x43000000, 0x00402705, 0x80243F44, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00950101, 0x00950102, 0x00950103, 0x00950103, 0x00950101, 0x00950101, 0x00950100, 0x00950100, 0x0095010A, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00950103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x80243378, 0x00000000, 0x00000001, 0x80243568, 0x00000000, 0x00000001, 0x80243758, 0x00000000, 0x00000001, 0x80243948, 0x00000000, 0x00000001, 0x80243B38, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x80243378, 0x00000000, 0x00000001, 0x80243568, 0x00000000, 0x00000001, 0x80243758, 0x00000000, 0x00000001, 0x80243948, 0x00000000, 0x00000001, 0x80243B38, 0x00000000, 0x00000004, 0x80243F80, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 + + +0x00000001, 0x80243378, 0x00000000, 0x00000001, 0x80243568, 0x00000000, 0x00000001, 0x80243758, 0x00000000, 0x00000001, 0x80243948, 0x00000000, 0x00000001, 0x80243B38, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x80243378, 0x00000000, 0x00000001, 0x80243568, 0x00000000, 0x00000001, 0x80243758, 0x00000000, 0x00000001, 0x80243948, 0x00000000, 0x00000001, 0x80243B38, 0x00000000, 0x00000004, 0x80243F80, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_arn/arn_04/BE6E10.data.s b/ver/us/asm/data/world/area_arn/arn_04/BE6E10.data.s index e53ad964ff..bb5757c131 100644 --- a/ver/us/asm/data/world/area_arn/arn_04/BE6E10.data.s +++ b/ver/us/asm/data/world/area_arn/arn_04/BE6E10.data.s @@ -6,4 +6,7 @@ glabel D_80243660_BE6E10 .word 0x3FC00000, 0x0000001E, 0x0000001E, 0x43020000, 0x00000000, 0x00000001, 0x40200000, 0x000000B4, 0x00000003, 0x43160000, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240B94_BE4344, D_80243660_BE6E10, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00140017, 0x00000000, 0x00000000, 0x80243690, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000C0000 glabel D_802436DC_BE6E8C -.word 0x40900000, 0x40600000, 0x40266666, 0x40000000, 0x3FC00000, 0x41A00000, 0x3FE66666, 0x0000003C, 0x0000000F, 0x42F00000, 0x00000000, 0x00000003, 0x40800000, 0x00000005, 0x00000001, 0x43160000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000005, 0xFFFFFCAE, 0x00000043, 0x00000003, SetSelfVar, 0x00000006, 0x0000003C, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x000002BC, 0x00000043, 0x00000002, func_8024219C_BE594C, 0x802436F4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00120014, 0x00000000, 0x00000000, 0x80243724, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000C0001, 0x3F800000, 0x0000001E, 0x0000001E, 0x42F00000, 0x00000000, 0x00000003, 0x41080000, 0x0000003C, 0x00000003, 0x42C80000, 0x42700000, 0x00000001, 0x00000043, 0x00000003, func_80243018_BE67C8, 0x802437C0, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00180018, 0x00000000, 0x00000000, 0x802437F0, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000, 0x00000000, 0x80243794, 0xC3AF0000, 0x43340000, 0x43160000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x8014008D, 0x000A0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFEA2, 0x000000B4, 0x00000096, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFEA2, 0x000000B4, 0x00000096, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280201, 0x00280203, 0x00280204, 0x00280204, 0x00280201, 0x00280201, 0x00280206, 0x00280206, 0x00280205, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x802436B0, 0x43B40000, 0x43500000, 0x42C80000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x8014008D, 0x000A0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x00000168, 0x000000D0, 0x00000064, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000168, 0x000000D0, 0x00000064, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00260201, 0x00260202, 0x00260203, 0x00260203, 0x00260201, 0x00260201, 0x00260205, 0x00260205, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x80243814, 0x43160000, 0x43310000, 0x43200000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980003, 0x3FFF2666, 0x4CCC0003, 0x3FFF3FFF, 0x3FFF0003, 0x33326665, 0x33320003, 0x33327FFF, 0x26660003, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000096, 0x000000B1, 0x000000A0, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000096, 0x000000B1, 0x000000A0, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300102, 0x00300106, 0x00300107, 0x00300107, 0x00300102, 0x00300102, 0x00300108, 0x00300108, 0x00300114, 0x00300117, 0x00300113, 0x00300115, 0x00300110, 0x00300111, 0x00300116, 0x00300100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x80243814, 0x44098000, 0x43660000, 0x42FA0000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980003, 0x3FFF2666, 0x4CCC0003, 0x3FFF3FFF, 0x3FFF0003, 0x33326665, 0x33320003, 0x33327FFF, 0x26660003, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000226, 0x000000E6, 0x0000007D, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000226, 0x000000E6, 0x0000007D, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300102, 0x00300106, 0x00300107, 0x00300107, 0x00300102, 0x00300102, 0x00300108, 0x00300108, 0x00300114, 0x00300117, 0x00300113, 0x00300115, 0x00300110, 0x00300111, 0x00300116, 0x00300100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x80243840, 0x0E090001, 0x00000001, 0x80243A30, 0x0E030001, 0x00000001, 0x80243C20, 0x0E0C0001, 0x00000001, 0x80243E10, 0x0E0E0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 +.word 0x3FE66666, 0x0000003C, 0x0000000F, 0x42F00000, 0x00000000, 0x00000003, 0x40800000, 0x00000005, 0x00000001, 0x43160000, 0x00000000, 0x00000001, + +glabel D_BE6EA4 +0x00000043, 0x00000003, SetSelfVar, 0x00000000, 0x00000001, 0x00000043, 0x00000003, SetSelfVar, 0x00000005, 0xFFFFFCAE, 0x00000043, 0x00000003, SetSelfVar, 0x00000006, 0x0000003C, 0x00000043, 0x00000003, SetSelfVar, 0x00000001, 0x000002BC, 0x00000043, 0x00000002, func_8024219C_BE594C, 0x802436F4, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00120014, 0x00000000, 0x00000000, 0x80243724, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000C0001, 0x3F800000, 0x0000001E, 0x0000001E, 0x42F00000, 0x00000000, 0x00000003, 0x41080000, 0x0000003C, 0x00000003, 0x42C80000, 0x42700000, 0x00000001, 0x00000043, 0x00000003, func_80243018_BE67C8, 0x802437C0, 0x00000008, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00180018, 0x00000000, 0x00000000, 0x802437F0, EnemyNpcHit, 0x00000000, EnemyNpcDefeat, 0x00000000, 0x00000000, 0x000F0000, 0x00000000, 0x80243794, 0xC3AF0000, 0x43340000, 0x43160000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x8014008D, 0x000A0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0xFFFFFEA2, 0x000000B4, 0x00000096, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0xFFFFFEA2, 0x000000B4, 0x00000096, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280201, 0x00280203, 0x00280204, 0x00280204, 0x00280201, 0x00280201, 0x00280206, 0x00280206, 0x00280205, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00280204, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x802436B0, 0x43B40000, 0x43500000, 0x42C80000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, 0x8014008D, 0x000A0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980002, 0x3FFF2666, 0x4CCC0002, 0x3FFF3FFF, 0x3FFF0002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x00000168, 0x000000D0, 0x00000064, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000168, 0x000000D0, 0x00000064, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00260201, 0x00260202, 0x00260203, 0x00260203, 0x00260201, 0x00260201, 0x00260205, 0x00260205, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00260203, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x80243814, 0x43160000, 0x43310000, 0x43200000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980003, 0x3FFF2666, 0x4CCC0003, 0x3FFF3FFF, 0x3FFF0003, 0x33326665, 0x33320003, 0x33327FFF, 0x26660003, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000096, 0x000000B1, 0x000000A0, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000096, 0x000000B1, 0x000000A0, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300102, 0x00300106, 0x00300107, 0x00300107, 0x00300102, 0x00300102, 0x00300108, 0x00300108, 0x00300114, 0x00300117, 0x00300113, 0x00300115, 0x00300110, 0x00300111, 0x00300116, 0x00300100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x80243814, 0x44098000, 0x43660000, 0x42FA0000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x59980003, 0x3FFF2666, 0x4CCC0003, 0x3FFF3FFF, 0x3FFF0003, 0x33326665, 0x33320003, 0x33327FFF, 0x26660003, 0x26660000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001999, 0x3FFF0002, 0x33322666, 0x33320002, 0x33323FFF, 0x33320002, 0x33326665, 0x33320002, 0x33327FFF, 0x26660002, 0x33320000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00030000, 0x00000226, 0x000000E6, 0x0000007D, 0x0000001E, 0x00000000, 0xFFFF8001, 0x00000000, 0x00000226, 0x000000E6, 0x0000007D, 0x00000096, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300102, 0x00300106, 0x00300107, 0x00300107, 0x00300102, 0x00300102, 0x00300108, 0x00300108, 0x00300114, 0x00300117, 0x00300113, 0x00300115, 0x00300110, 0x00300111, 0x00300116, 0x00300100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x80243840, 0x0E090001, 0x00000001, 0x80243A30, 0x0E030001, 0x00000001, 0x80243C20, 0x0E0C0001, 0x00000001, 0x80243E10, 0x0E0E0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/data/world/area_arn/arn_04/BE78D0.rodata.s b/ver/us/asm/data/world/area_arn/arn_04/BE78D0.rodata.s index bb8a10c95b..cde7ff07ba 100644 --- a/ver/us/asm/data/world/area_arn/arn_04/BE78D0.rodata.s +++ b/ver/us/asm/data/world/area_arn/arn_04/BE78D0.rodata.s @@ -17,11 +17,5 @@ glabel jtbl_80244140_BE78F0 glabel D_802442D0_BE7A80 .double 32767.0 -glabel D_802442D8_BE7A88 -.double 0.09 - -glabel D_802442E0_BE7A90 -.double 0.09 - glabel jtbl_802442E8_BE7A98 .word L802422A8_BE5A58, L802422B8_BE5A68, L802422D0_BE5A80, L802422E0_BE5A90, L80242360_BE5B10, L80242360_BE5B10, L80242360_BE5B10, L80242360_BE5B10, L80242360_BE5B10, L80242360_BE5B10, L802422F8_BE5AA8, L80242308_BE5AB8, L80242320_BE5AD0, L80242338_BE5AE8, L80242350_BE5B00, 0 diff --git a/ver/us/asm/data/world/area_arn/arn_04/BE7AD8.rodata.s b/ver/us/asm/data/world/area_arn/arn_04/BE7AD8.rodata.s index dda49e4931..7a2bf4663c 100644 --- a/ver/us/asm/data/world/area_arn/arn_04/BE7AD8.rodata.s +++ b/ver/us/asm/data/world/area_arn/arn_04/BE7AD8.rodata.s @@ -2,11 +2,7 @@ .section .rodata -glabel D_80244328_BE7AD8 -.double 180.0 -glabel D_80244330_BE7AE0 -.double 75.0 glabel D_80244338_BE7AE8 .double 0.85 diff --git a/ver/us/asm/data/world/area_arn/arn_07/BF46F0.rodata.s b/ver/us/asm/data/world/area_arn/arn_07/BF46F0.rodata.s index 74f51af335..bd35c63f2e 100644 --- a/ver/us/asm/data/world/area_arn/arn_07/BF46F0.rodata.s +++ b/ver/us/asm/data/world/area_arn/arn_07/BF46F0.rodata.s @@ -3,4 +3,10 @@ .section .rodata glabel jtbl_80247900_BF46F0 -.word L802401EC_BECFDC, L802402AC_BED09C, L802402F4_BED0E4, L80240394_BED184, L802403FC_BED1EC, 0x6B6D725F, 0x32330000, 0x61726E5F, 0x30380000, 0x61726E5F, 0x30330000, 0x6D696D5F, 0x31320000, 0, 0, 0 +.word L802401EC_BECFDC, +L802402AC_BED09C, +L802402F4_BED0E4, +L80240394_BED184, +L802403FC_BED1EC, + +0x6B6D725F, 0x32330000, 0x61726E5F, 0x30380000, 0x61726E5F, 0x30330000, 0x6D696D5F, 0x31320000, 0, 0, 0 diff --git a/ver/us/asm/data/world/area_arn/arn_07/BF4740.rodata.s b/ver/us/asm/data/world/area_arn/arn_07/BF4740.rodata.s index d05dc5168b..a359d87762 100644 --- a/ver/us/asm/data/world/area_arn/arn_07/BF4740.rodata.s +++ b/ver/us/asm/data/world/area_arn/arn_07/BF4740.rodata.s @@ -1,15 +1,3 @@ .include "macro.inc" -.section .rodata -glabel D_80247950_BF4740 -.double 32767.0 - -glabel D_80247958_BF4748 -.double 0.09 - -glabel D_80247960_BF4750 -.double 0.09 - -glabel jtbl_80247968_BF4758 -.word L80241D68_BEEB58, L80241D78_BEEB68, L80241D90_BEEB80, L80241DA0_BEEB90, L80241E20_BEEC10, L80241E20_BEEC10, L80241E20_BEEC10, L80241E20_BEEC10, L80241E20_BEEC10, L80241E20_BEEC10, L80241DB8_BEEBA8, L80241DC8_BEEBB8, L80241DE0_BEEBD0, L80241DF8_BEEBE8, L80241E10_BEEC00, 0, 0, 0 diff --git a/ver/us/asm/data/world/area_kzn/kzn_20/C97600.data.s b/ver/us/asm/data/world/area_kzn/kzn_20/C97600.data.s index 2225eee813..a05c4ae407 100644 --- a/ver/us/asm/data/world/area_kzn/kzn_20/C97600.data.s +++ b/ver/us/asm/data/world/area_kzn/kzn_20/C97600.data.s @@ -12,4 +12,4 @@ glabel D_802417E4_C97714 .word 0x00000000 glabel D_802417E8_C97718 -.word 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_SomeXYZFuncTodoRename, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_C965D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802406E0_C96610, 0xFE363C80, 0x0000004E, 0x00000006, 0x802417EC, 0x00000010, 0x00000000, D_802442D0_BE7A80, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_C96584, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_UnkYawFunc, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, SetItemPos, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_UnkYawFunc, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x80241980, 0xFE363C8A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFC, 0x00040002, 0x00000043, 0x00000004, GetAngleBetweenNPCs, 0xFE363C89, 0xFFFFFFFC, 0xFE363C8B, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, GetNpcPos, 0xFE363C89, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFC, 0x00000100, 0x00000001, 0x0000000E, 0x00000002, 0xFE363C8B, 0x000000B4, 0x00000027, 0x00000002, 0xFE363C86, 0x00000014, 0x00000012, 0x00000000, 0x00000027, 0x00000002, 0xFE363C86, 0xFFFFFFEC, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C87, 0x0000000A, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0xF24A7A80, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000014, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, GetNpcYaw, 0xFFFFFFFC, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8A, 0x000000B4, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000014, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFC, 0x00040001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFE363C89, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFC, 0x00000100, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000008, 0x00000001, 0x00000005, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_C965D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000002, func_802406E0_C96610, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241A00, 0x00000010, 0x00000000, D_802442D0_BE7A80, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_C96584, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFBA, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_802409F8_C96928, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C80, 0x00000043, 0x00000003, FindKeyItem, 0xFE363C85, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000004, 0x0000000B, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFE363C82, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0xFE363C82, 0xFE363C8D, 0xFE363C80, 0xFE363C8E, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C8E, 0xFE363C8F, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0xF24A7A80, 0x00000027, 0x00000002, 0xFE363C80, 0x0000000A, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C80, 0xFE363C8F, 0x0000000A, 0x00000043, 0x00000007, SpeakToNpc, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000000, 0xFE363C82, 0xFE363C87, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000046, 0x00000001, 0x80241D24, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C88, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C89, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000000, 0xFE363C8A, 0x00000013, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C86, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, AddKeyItem, 0xFE363C86, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000023, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_80240A3C_C9696C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000054, 0x00000000, 0x00000043, 0x0000000B, kzn_20_SetManyVars, 0x00000000, 0x00B60008, 0x00B60001, 0x00000054, 0x00000000, 0x001000E4, 0x001000E5, 0x001000E6, 0x001000E7, 0x8024208C, 0x00000046, 0x00000001, 0x80241D94, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000024, 0x00000002, 0xFE363C80, 0x0000015C, 0x00000024, 0x00000002, 0xFE363C81, 0x00000003, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, AddStarPieces, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000B, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000064, 0xFE363C80, 0x00000028, 0x00000002, 0xFE363C80, 0x00000064, 0x00000043, 0x0000000F, PlayEffect, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000064, 0xFE363C80, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x0000000F, PlayEffect, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000A, 0x0000000F, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000044, 0x00000001, 0x80242148, 0x00000012, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000002, 0xF24A7C80, 0x0000000B, 0x00000002, 0xF971888B, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000044, 0x00000001, 0x80242148, 0x00000043, 0x00000005, MakeLerp, 0x00000014, 0x000000FA, 0x00000005, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000003, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000FA, 0x0000001E, 0x0000003C, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000005, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000005, 0xF24A7C80, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000002, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000001, 0xFFFFFFA1, 0x000000A5, 0x0000000F, 0x00000001, 0xFFFFFF92, 0x00000078, 0x00000023, 0xFFFFFFFF, 0x00000001, 0xFFFFFFE7, 0x000000C3, 0x00000014, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000001, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000002, 0xFFFFFF88, 0x0000008C, 0x0000000F, 0xFFFFFFFF, 0x0000004D, 0x00000001, 0x000000EF, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000001, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000030, 0x00000001, 0x80242434, 0x00000012, 0x00000000, 0x00000030, 0x00000001, 0x80242478, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000033, 0x00000003, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x0000000A, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, SetNpcSpeed, 0x00000000, 0xFE363C81, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60004, 0x00000043, 0x00000005, NpcMoveTo, 0x00000000, 0xFE363C82, 0xFE363C83, 0x00000000, 0x00000031, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60001, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, RandInt, 0x00000002, 0xFE363C84, 0x00000027, 0x00000002, 0xFE363C84, 0x00000001, 0x00000005, 0x00000001, 0xFE363C84, 0x00000043, 0x00000003, GetNpcYaw, 0x00000000, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C85, 0x000000B4, 0x0000000D, 0x00000002, 0xFE363C85, 0x00000168, 0x00000028, 0x00000002, 0xFE363C85, 0x00000168, 0x00000013, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0x00000000, 0xFE363C85, 0x00000001, 0x00000008, 0x00000001, 0x00000014, 0x00000006, 0x00000000, 0x00000008, 0x00000001, 0xFE363C82, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C83, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C83, 0x0000001E, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x0001002A, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x802424BC, 0xFE363C89, 0x00000003, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000049, 0x00000001, 0xFE363C89, 0x00000008, 0x00000001, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000001, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x0000000A, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000028, 0x00000023, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x0010010A, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000014, 0x00000016, 0x00000001, 0x00000019, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFE2, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24E6280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000014, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7E80, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFDD, 0x0000007D, 0xFFFFFFEC, 0x0000000C, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A7E80, 0x00000003, 0x00000001, 0x00000019, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFF1, 0xFFFFFFEC, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFD8, 0xFFFFFFEC, 0x00000000, 0x0000000A, 0x00000002, 0xF971888A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000019, 0x00000013, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010B, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8080, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000008, 0x00000043, 0x00000003, NpcFacePlayer, 0xFFFFFFFF, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010C, 0x00000024, 0x00000002, 0xF971888B, 0x00000001, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000002A, 0x00000000, 0x00000008, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x0001002B, 0x00000008, 0x00000001, 0x0000003C, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60002, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x0010010D, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFF1, 0x0000004B, 0x00000050, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000023, 0x00000032, 0x00000078, 0x0000000A, 0x00000016, 0x00000001, 0x00000023, 0x00000043, 0x00000001, func_80240A68_C96998, 0x00000044, 0x00000001, 0x802426A4, 0x00000056, 0x00000000, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000004, ShowMessageAtScreenPos, 0x0010010F, 0x000000A0, 0x00000028, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFF6, 0x00000043, 0x0000000F, PlayEffect, 0x00000027, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000001, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B6000D, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7DB4, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x000000E8, 0x00000000, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000003C, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF2518280, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB680, 0xF24A5E80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60007, 0x00B60007, 0x00000000, 0x00100110, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24BE280, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000028, 0x00000016, 0x00000001, 0x0000002D, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x00000008, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000032, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x0000004B, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000000, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0x00000064, 0x00000043, 0x00000003, EnableNpcAI, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x00100108, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000043, 0x00000003, EnableNpcAI, 0xFFFFFFFF, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x00100113, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x802427B4, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x802432D4, 0x00000012, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xC2F00000, 0x428C0000, 0x42340000, 0xC2960000, 0x42A00000, 0x42B40000, 0xC1200000, 0x42E60000, 0x42B40000, 0x41200000, 0x43340000, 0x428C0000, 0x42480000, 0x43520000, 0x41F00000, 0x42C80000, 0x43200000, 0x00000000, 0x43110000, 0x43430000, 0xC1200000, 0x42C80000, 0x433E0000, 0xC2B40000, 0x42A00000, 0x43340000, 0xC2700000, 0x42E60000, 0x432F0000, 0xC2200000, 0x43250000, 0x432A0000, 0xC1200000, 0x43660000, 0x432A0000, 0xC1A00000, 0x43870000, 0x432F0000, 0xC1F00000, 0x0000000A, 0x00000002, 0xF9718889, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFF88, 0x00000046, 0x0000002D, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xF9718889, 0x00000001, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x0000003C, 0x80243420, 0x00000006, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80240A8C_C969BC, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000013, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x0000000A, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, SetPlayerSpeed, 0xF24A8280, 0x00000043, 0x00000004, PlayerMoveTo, 0x0000003C, 0x00000000, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000024, 0x00000002, 0xF971888B, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x00000014, 0x00000024, 0x00000002, 0xF971888A, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000019, 0x00000057, 0x00000000, 0x00000024, 0x00000002, 0xF971888A, 0x00000001, 0x00000016, 0x00000001, 0x0000001E, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001F, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000005, 0x0010010E, 0x00000003, 0x00000001, 0x0000001E, 0x0000000A, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000001E, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000023, 0x00000016, 0x00000001, 0x00000028, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100111, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000002D, 0x00000016, 0x00000001, 0x00000032, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000091, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x000000AA, 0x000000AA, 0x00000032, 0x00000014, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFFFFFFC4, 0x00000000, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000091, 0x000000AA, 0xFFFFFFF6, 0x0000000F, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFF, 0x00000091, 0x000000A0, 0xFFFFFFF6, 0x00000005, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100112, 0x00000043, 0x00000003, NpcFacePlayer, 0xFFFFFFFF, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000003, 0x00000001, 0x0000005A, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000005A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x0000001A, 0x7FFFFE00, 0x00000056, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000000, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60007, 0x00000043, 0x00000003, SetNpcSpeed, 0x00000000, 0xF24A8E80, 0x00000043, 0x00000005, NpcMoveTo, 0x00000000, 0x00000131, 0x00000000, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7C80, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000091, 0x000000C3, 0xFFFFFFF6, 0x00000005, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160005, 0x00160008, 0x00000000, 0x00100115, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x0000001E, 0x80243468, 0x00000007, 0x00000000, 0x00000003, 0x00000001, 0x0000005B, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000004, 0x00000001, 0x0000005B, 0x00000013, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100114, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE0180, 0x00000024, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x802434BC, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80243E08, 0x00000012, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, D_802416D0_C97600, 0xC2820000, 0x00000000, 0x433E0000, 0x00510509, 0x802433B8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00B60001, 0x00B60004, 0x00B60006, 0x00B60006, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00000000, 0x00000000, 0x00000000, 0x001A0000, 0x00000001, 0x802416FC, 0x42C80000, 0x43200000, 0x00000000, 0x00400001, 0x80243E38, 0x00000000, 0x00000000, 0x0000010E, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00000000, 0x00000000, 0x00000000, 0x001A000B, 0x00000001, 0x80243EB4, 0x00000000, 0x00000001, 0x802440A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 +.word 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_SomeXYZFuncTodoRename, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00060005, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_C965D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_802406E0_C96610, 0xFE363C80, 0x0000004E, 0x00000006, 0x802417EC, 0x00000010, 0x00000000, 0x802442D0, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_C96584, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_UnkYawFunc, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, SetItemPos, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000001, 0x00000001, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C89, 0xFE363C81, 0x00000043, 0x00000001, func_802D6420, 0x00000024, 0x00000002, 0xFE363C8A, 0xFE363C80, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0x00000000, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, RemoveKeyItemAt, 0xFE363C81, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000004, kzn_20_UnkYawFunc, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000042, 0x00000002, 0xFE363C80, 0x00050000, 0x00000043, 0x00000007, MakeItemEntity, 0xFE363C80, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x80241980, 0xFE363C8A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFC, 0x00040002, 0x00000043, 0x00000004, GetAngleBetweenNPCs, 0xFE363C89, 0xFFFFFFFC, 0xFE363C8B, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, GetNpcPos, 0xFE363C89, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFC, 0x00000100, 0x00000001, 0x0000000E, 0x00000002, 0xFE363C8B, 0x000000B4, 0x00000027, 0x00000002, 0xFE363C86, 0x00000014, 0x00000012, 0x00000000, 0x00000027, 0x00000002, 0xFE363C86, 0xFFFFFFEC, 0x00000013, 0x00000000, 0x00000027, 0x00000002, 0xFE363C87, 0x0000000A, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0xF24A7A80, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C86, 0xFE363C87, 0xFE363C88, 0x00000014, 0x00000049, 0x00000001, 0xFE363C8A, 0x00000043, 0x00000002, RemoveItemEntity, 0xFE363C80, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000003, GetNpcYaw, 0xFFFFFFFC, 0xFE363C8A, 0x00000027, 0x00000002, 0xFE363C8A, 0x000000B4, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFC, 0xFE363C8A, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000014, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFC, 0x00040001, 0x00000043, 0x00000004, NpcFaceNpc, 0xFFFFFFFC, 0xFE363C89, 0x00000000, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFC, 0x00000100, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000008, 0x00000001, 0x00000005, 0x00000023, 0x00000000, 0x00000043, 0x00000002, func_802406A8_C965D8, 0xFE363C8A, 0x00000043, 0x00000001, func_802D6954, 0x00000048, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C8B, 0x00000024, 0x00000002, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000002, func_802406E0_C96610, 0xFE363C80, 0x0000004E, 0x00000006, 0x80241A00, 0x00000010, 0x00000000, 0x802442D0, 0x00000000, 0x00000001, 0x00000043, 0x00000002, func_80240654_C96584, 0xFE363C80, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0xFFFFFFBA, 0x00000002, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_802409F8_C96928, 0x00000043, 0x00000002, GetCurrentPartnerID, 0xFE363C80, 0x00000043, 0x00000003, FindKeyItem, 0xFE363C85, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000004, 0x0000000B, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFE363C82, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0xFE363C82, 0xFE363C8D, 0xFE363C80, 0xFE363C8E, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C8E, 0xFE363C8F, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFC, 0xF24A7A80, 0x00000027, 0x00000002, 0xFE363C80, 0x0000000A, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFC, 0xFE363C8D, 0xFE363C80, 0xFE363C8F, 0x0000000A, 0x00000043, 0x00000007, SpeakToNpc, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000000, 0xFE363C82, 0xFE363C87, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000046, 0x00000001, 0x80241D24, 0x00000014, 0x00000001, 0xFE363C80, 0x00000016, 0x00000001, 0xFFFFFFFF, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C88, 0x00000043, 0x00000001, EnablePartnerAI, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000001, 0x0000001C, 0x00000000, 0x00000043, 0x00000002, DisablePartnerAI, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFC, 0x00040006, 0x00040001, 0x00000005, 0xFE363C89, 0x0000000B, 0x00000002, 0xFE363C8A, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFE363C82, 0xFE363C83, 0xFE363C84, 0x00000000, 0xFE363C8A, 0x00000013, 0x00000000, 0x00000043, 0x00000001, EnablePartnerAI, 0x0000000B, 0x00000002, 0xFE363C86, 0x00000000, 0x00000024, 0x00000002, 0xFE363C80, 0xFE363C86, 0x00000024, 0x00000002, 0xFE363C81, 0x00000001, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, AddKeyItem, 0xFE363C86, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000023, 0x00000000, 0x00000013, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000001, func_80240A3C_C9696C, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000054, 0x00000000, 0x00000043, 0x0000000B, kzn_20_SetManyVars, 0x00000000, 0x00B60008, 0x00B60001, 0x00000054, 0x00000000, 0x001000E4, 0x001000E5, 0x001000E6, 0x001000E7, 0x8024208C, 0x00000046, 0x00000001, 0x80241D94, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xFE363C8C, 0x00000002, 0x00000024, 0x00000002, 0xFE363C80, 0x0000015C, 0x00000024, 0x00000002, 0xFE363C81, 0x00000003, 0x00000046, 0x00000001, 0x80241784, 0x00000043, 0x00000002, AddStarPieces, 0x00000001, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000B, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000064, 0xFE363C80, 0x00000028, 0x00000002, 0xFE363C80, 0x00000064, 0x00000043, 0x0000000F, PlayEffect, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000064, 0xFE363C80, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x0000000F, PlayEffect, 0x00000015, 0x00000001, 0xFE363C80, 0x0000015E, 0x00000000, 0x0000003C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000004D, 0x00000001, 0x0000000A, 0x0000000F, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000044, 0x00000001, 0x80242148, 0x00000012, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000002, 0xF24A7C80, 0x0000000B, 0x00000002, 0xF971888B, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000044, 0x00000001, 0x80242148, 0x00000043, 0x00000005, MakeLerp, 0x00000014, 0x000000FA, 0x00000005, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000003, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000005, MakeLerp, 0x000000FA, 0x0000001E, 0x0000003C, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, UpdateLerp, 0x0000002F, 0x00000002, 0xFE363C80, 0xF24C0A80, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000005, 0xFE363C80, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000013, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000005, ShakeCam, 0x00000000, 0x00000000, 0x00000005, 0xF24A7C80, 0x00000006, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000002, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000001, 0xFFFFFFA1, 0x000000A5, 0x0000000F, 0x00000001, 0xFFFFFF92, 0x00000078, 0x00000023, 0xFFFFFFFF, 0x00000001, 0xFFFFFFE7, 0x000000C3, 0x00000014, 0x00000002, 0xFFFFFFB5, 0x000000C3, 0x00000023, 0x00000001, 0xFFFFFFC4, 0x000000AF, 0x00000019, 0x00000002, 0xFFFFFF88, 0x0000008C, 0x0000000F, 0xFFFFFFFF, 0x0000004D, 0x00000001, 0x000000EF, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000003, RandInt, 0x00000001, 0xFE363C81, 0x0000000A, 0x00000002, 0xFE363C81, 0x00000000, 0x00000030, 0x00000001, 0x80242434, 0x00000012, 0x00000000, 0x00000030, 0x00000001, 0x80242478, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x0000000A, 0x00000033, 0x00000003, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x0000000A, 0x00000002, 0xFE363C81, 0xFFFFFFFF, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000003, SetNpcSpeed, 0x00000000, 0xFE363C81, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60004, 0x00000043, 0x00000005, NpcMoveTo, 0x00000000, 0xFE363C82, 0xFE363C83, 0x00000000, 0x00000031, 0x00000001, 0xFE363C82, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60001, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000003, RandInt, 0x00000002, 0xFE363C84, 0x00000027, 0x00000002, 0xFE363C84, 0x00000001, 0x00000005, 0x00000001, 0xFE363C84, 0x00000043, 0x00000003, GetNpcYaw, 0x00000000, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C85, 0x000000B4, 0x0000000D, 0x00000002, 0xFE363C85, 0x00000168, 0x00000028, 0x00000002, 0xFE363C85, 0x00000168, 0x00000013, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0x00000000, 0xFE363C85, 0x00000001, 0x00000008, 0x00000001, 0x00000014, 0x00000006, 0x00000000, 0x00000008, 0x00000001, 0xFE363C82, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C83, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C83, 0x0000001E, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000D, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x0001002A, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0xFE363C83, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000045, 0x00000002, 0x802424BC, 0xFE363C89, 0x00000003, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000049, 0x00000001, 0xFE363C89, 0x00000008, 0x00000001, 0x0000000A, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000001, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x0000000A, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000028, 0x00000023, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x0010010A, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000014, 0x00000016, 0x00000001, 0x00000019, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000027, 0x00000002, 0xFE363C83, 0xFFFFFFE2, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24E6280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000004, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000014, 0x00000000, 0x00000000, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7E80, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFDD, 0x0000007D, 0xFFFFFFEC, 0x0000000C, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A7E80, 0x00000003, 0x00000001, 0x00000019, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFF1, 0xFFFFFFEC, 0x00000000, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0xFFFFFFD8, 0xFFFFFFEC, 0x00000000, 0x0000000A, 0x00000002, 0xF971888A, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000019, 0x00000013, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010B, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8080, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFE363C83, 0xFE363C84, 0xFE363C85, 0x00000008, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x00000008, 0x00000043, 0x00000003, NpcFacePlayer, 0xFFFFFFFF, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000005, 0x0010010C, 0x00000024, 0x00000002, 0xF971888B, 0x00000001, 0x00000043, 0x00000005, SetMusicTrack, 0x00000000, 0x0000002A, 0x00000000, 0x00000008, 0x00000008, 0x00000001, 0x00000014, 0x00000056, 0x00000000, 0x00000043, 0x00000002, SetPlayerAnimation, 0x0001002B, 0x00000008, 0x00000001, 0x0000003C, 0x00000043, 0x00000002, SetPlayerAnimation, 0x00010002, 0x00000057, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60002, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x0010010D, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFF1, 0x0000004B, 0x00000050, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000023, 0x00000032, 0x00000078, 0x0000000A, 0x00000016, 0x00000001, 0x00000023, 0x00000043, 0x00000001, func_80240A68_C96998, 0x00000044, 0x00000001, 0x802426A4, 0x00000056, 0x00000000, 0x00000043, 0x00000003, PlayerFaceNpc, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000004, ShowMessageAtScreenPos, 0x0010010F, 0x000000A0, 0x00000028, 0x00000057, 0x00000000, 0x00000056, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000027, 0x00000002, 0xFE363C82, 0xFFFFFFF6, 0x00000043, 0x0000000F, PlayEffect, 0x00000027, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000001, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000A, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B6000D, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7DB4, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x000000E8, 0x00000000, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000003C, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60007, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000024, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0x00000064, 0x00000019, 0x00000064, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF2518280, 0x00000043, 0x00000004, SetCamPitch, 0x00000000, 0xF24AB680, 0xF24A5E80, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60007, 0x00B60007, 0x00000000, 0x00100110, 0x00000043, 0x00000003, ResetCam, 0x00000000, 0xF24BE280, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000028, 0x00000016, 0x00000001, 0x0000002D, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60004, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFFE2, 0x00000064, 0x00000028, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A8280, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0xFFFFFFE7, 0x0000007D, 0xFFFFFFEC, 0x0000000A, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x0000032C, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000014, 0x00000096, 0x00000005, 0x00000008, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000032, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x0000004B, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00B60001, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000000, 0x00000023, 0x00000000, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x0000000C, 0x00000002, 0xFE363C81, 0x00000064, 0x00000043, 0x00000003, EnableNpcAI, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60008, 0x00B60001, 0x00000000, 0x00100108, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000043, 0x00000003, EnableNpcAI, 0xFFFFFFFF, 0x00000001, 0x00000012, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00B60009, 0x00B60002, 0x00000000, 0x00100113, 0x00000046, 0x00000001, 0x80242094, 0x00000046, 0x00000001, 0x802420E4, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x802427B4, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x802432D4, 0x00000012, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xC2F00000, 0x428C0000, 0x42340000, 0xC2960000, 0x42A00000, 0x42B40000, 0xC1200000, 0x42E60000, 0x42B40000, 0x41200000, 0x43340000, 0x428C0000, 0x42480000, 0x43520000, 0x41F00000, 0x42C80000, 0x43200000, 0x00000000, 0x43110000, 0x43430000, 0xC1200000, 0x42C80000, 0x433E0000, 0xC2B40000, 0x42A00000, 0x43340000, 0xC2700000, 0x42E60000, 0x432F0000, 0xC2200000, 0x43250000, 0x432A0000, 0xC1200000, 0x43660000, 0x432A0000, 0xC1A00000, 0x43870000, 0x432F0000, 0xC1F00000, 0x0000000A, 0x00000002, 0xF9718889, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFFFFFF88, 0x00000046, 0x0000002D, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xF9718889, 0x00000001, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x0000003C, 0x80243420, 0x00000006, 0x00000000, 0x00000005, 0x00000001, 0x00000000, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000001, 0x00000007, 0x00000000, 0x00000013, 0x00000000, 0x00000006, 0x00000000, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000013, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000043, 0x00000002, func_80240A8C_C969BC, 0xFE363C80, 0x0000000B, 0x00000002, 0xFE363C80, 0x00000013, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x00000000, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x0000000A, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000002, SetPlayerSpeed, 0xF24A8280, 0x00000043, 0x00000004, PlayerMoveTo, 0x0000003C, 0x00000000, 0x00000000, 0x00000057, 0x00000000, 0x00000043, 0x00000005, GetNpcPos, 0xFFFFFFFF, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8680, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000024, 0x00000002, 0xF971888B, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000000F, 0x00000003, 0x00000001, 0x0000000A, 0x00000014, 0x00000001, 0xFD050F8D, 0x00000016, 0x00000001, 0x00000014, 0x00000024, 0x00000002, 0xF971888A, 0x00000000, 0x00000056, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000019, 0x00000057, 0x00000000, 0x00000024, 0x00000002, 0xF971888A, 0x00000001, 0x00000016, 0x00000001, 0x0000001E, 0x00000056, 0x00000000, 0x00000043, 0x00000004, GetPlayerPos, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, UseSettingsFrom, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000005, SetPanTarget, 0x00000000, 0xFE363C80, 0xFE363C81, 0xFE363C82, 0x00000043, 0x00000003, SetCamDistance, 0x00000000, 0xF24FF280, 0x00000043, 0x00000003, SetCamSpeed, 0x00000000, 0xF24A8A80, 0x00000043, 0x00000004, PanToTarget, 0x00000000, 0x00000000, 0x00000001, 0x00000043, 0x00000003, WaitForCam, 0x00000000, 0xF24A7E80, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000001F, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000005, 0x0010010E, 0x00000003, 0x00000001, 0x0000001E, 0x0000000A, 0x00000002, 0xFD050F8D, 0x0000001E, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000001E, 0x00000013, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0x00000023, 0x00000016, 0x00000001, 0x00000028, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100111, 0x00000024, 0x00000002, 0xFD050F8D, 0x0000002D, 0x00000016, 0x00000001, 0x00000032, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000008, 0x00000001, 0x0000000F, 0x00000043, 0x00000003, SetNpcSpeed, 0xFFFFFFFF, 0xF24A8680, 0x00000043, 0x00000005, NpcMoveTo, 0xFFFFFFFF, 0x00000091, 0xFFFFFFF6, 0x00000000, 0x00000043, 0x00000004, PlaySoundAtNpc, 0xFFFFFFFF, 0x00000262, 0x00000000, 0x00000043, 0x0000000A, ShowEmote, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x0000000F, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000001, 0x00000014, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFFFFFFE2, 0x00000000, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160007, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0x00000000, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x000000AA, 0x000000AA, 0x00000032, 0x00000014, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0xFFFFFFC4, 0x00000000, 0x00000043, 0x00000003, SetNpcYaw, 0xFFFFFFFF, 0x0000010E, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000091, 0x000000AA, 0xFFFFFFF6, 0x0000000F, 0x00000008, 0x00000001, 0x0000000A, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000005, SetNpcRotation, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0x00000006, NpcJump1, 0xFFFFFFFF, 0x00000091, 0x000000A0, 0xFFFFFFF6, 0x00000005, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100112, 0x00000043, 0x00000003, NpcFacePlayer, 0xFFFFFFFF, 0x00000000, 0x00000024, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000023, 0x00000000, 0x0000000B, 0x00000002, 0xFD050F8D, 0xFFFFFFFF, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000000A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000003, 0x00000001, 0x0000005A, 0x0000000C, 0x00000002, 0xF5DE0180, 0x00000025, 0x00000008, 0x00000001, 0x00000001, 0x00000004, 0x00000001, 0x0000005A, 0x00000013, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000001, 0x00000008, 0x00000001, 0x00000028, 0x00000043, 0x00000004, ModifyColliderFlags, 0x00000000, 0x0000001A, 0x7FFFFE00, 0x00000056, 0x00000000, 0x00000043, 0x00000004, SetNpcFlagBits, 0x00000000, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcAnimation, 0x00000000, 0x00B60007, 0x00000043, 0x00000003, SetNpcSpeed, 0x00000000, 0xF24A8E80, 0x00000043, 0x00000005, NpcMoveTo, 0x00000000, 0x00000131, 0x00000000, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0x00000000, 0x00000057, 0x00000000, 0x00000008, 0x00000001, 0x0000001E, 0x00000043, 0x00000004, SetNpcFlagBits, 0xFFFFFFFF, 0x00000100, 0x00000001, 0x00000043, 0x00000003, SetNpcJumpscale, 0xFFFFFFFF, 0xF24A7C80, 0x00000043, 0x00000006, NpcJump0, 0xFFFFFFFF, 0x00000091, 0x000000C3, 0xFFFFFFF6, 0x00000005, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160005, 0x00160008, 0x00000000, 0x00100115, 0x00000008, 0x00000001, 0x00000005, 0x00000043, 0x00000004, InterpNpcYaw, 0xFFFFFFFF, 0x0000005A, 0x00000000, 0x00000043, 0x00000005, LoadPath, 0x0000001E, 0x80243468, 0x00000007, 0x00000000, 0x00000003, 0x00000001, 0x0000005B, 0x00000043, 0x00000001, GetNextPathPos, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0xFE363C81, 0xFE363C82, 0xFE363C83, 0x00000008, 0x00000001, 0x00000001, 0x0000000A, 0x00000002, 0xFE363C80, 0x00000001, 0x00000004, 0x00000001, 0x0000005B, 0x00000013, 0x00000000, 0x00000043, 0x00000005, SetNpcPos, 0xFFFFFFFF, 0x00000000, 0xFFFFFC18, 0x00000000, 0x00000043, 0x00000002, DisablePlayerInput, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000043, 0x00000006, SpeakToPlayer, 0xFFFFFFFF, 0x00160009, 0x00160008, 0x00000000, 0x00100114, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x0000000A, 0x00000002, 0xF5DE0180, 0x00000024, 0x00000043, 0x00000003, SetNpcAnimation, 0xFFFFFFFF, 0x00160008, 0x00000043, 0x00000003, BindNpcIdle, 0xFFFFFFFF, 0x802434BC, 0x00000043, 0x00000003, BindNpcInteract, 0xFFFFFFFF, 0x80243E08, 0x00000012, 0x00000000, 0x00000043, 0x00000002, RemoveNpc, 0xFFFFFFFF, 0x00000013, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, D_802416D0_C97600, 0xC2820000, 0x00000000, 0x433E0000, 0x00510509, 0x802433B8, 0x00000000, 0x00000000, 0x0000005A, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00B60001, 0x00B60004, 0x00B60006, 0x00B60006, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00B60001, 0x00000000, 0x00000000, 0x00000000, 0x001A0000, 0x00000001, 0x802416FC, 0x42C80000, 0x43200000, 0x00000000, 0x00400001, 0x80243E38, 0x00000000, 0x00000000, 0x0000010E, D_80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00007FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160000, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00160001, 0x00000000, 0x00000000, 0x00000000, 0x001A000B, 0x00000001, 0x80243EB4, 0x00000000, 0x00000001, 0x802440A4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/ver/us/asm/nonmatchings/code_EB1170/func_802406E0_EB1540.s b/ver/us/asm/nonmatchings/code_EB1170/func_802406E0_EB1540.s index 191eb021f2..104c18042a 100644 --- a/ver/us/asm/nonmatchings/code_EB1170/func_802406E0_EB1540.s +++ b/ver/us/asm/nonmatchings/code_EB1170/func_802406E0_EB1540.s @@ -13,8 +13,8 @@ glabel func_802406E0_EB1540 /* EB1560 80240700 8C620000 */ lw $v0, ($v1) /* EB1564 80240704 5040000A */ beql $v0, $zero, .L80240730 /* EB1568 80240708 00041080 */ sll $v0, $a0, 2 -/* EB156C 8024070C 3C058024 */ lui $a1, %hi(D_802442D0_BE7A80) -/* EB1570 80240710 24A542D0 */ addiu $a1, $a1, %lo(D_802442D0_BE7A80) +/* EB156C 8024070C 3C058024 */ lui $a1, %hi(code_eb1170_bss) +/* EB1570 80240710 24A542D0 */ addiu $a1, $a1, %lo(code_eb1170_bss) .L80240714: /* EB1574 80240714 24630004 */ addiu $v1, $v1, 4 /* EB1578 80240718 24840001 */ addiu $a0, $a0, 1 @@ -24,14 +24,14 @@ glabel func_802406E0_EB1540 /* EB1588 80240728 24A50004 */ addiu $a1, $a1, 4 /* EB158C 8024072C 00041080 */ sll $v0, $a0, 2 .L80240730: -/* EB1590 80240730 3C018024 */ lui $at, %hi(D_802442D0_BE7A80) +/* EB1590 80240730 3C018024 */ lui $at, %hi(code_eb1170_bss) /* EB1594 80240734 00220821 */ addu $at, $at, $v0 -/* EB1598 80240738 AC2042D0 */ sw $zero, %lo(D_802442D0_BE7A80)($at) +/* EB1598 80240738 AC2042D0 */ sw $zero, %lo(code_eb1170_bss)($at) /* EB159C 8024073C 080901DB */ j .L8024076C /* EB15A0 80240740 00000000 */ nop .L80240744: -/* EB15A4 80240744 3C038024 */ lui $v1, %hi(D_802442D0_BE7A80) -/* EB15A8 80240748 246342D0 */ addiu $v1, $v1, %lo(D_802442D0_BE7A80) +/* EB15A4 80240744 3C038024 */ lui $v1, %hi(code_eb1170_bss) +/* EB15A8 80240748 246342D0 */ addiu $v1, $v1, %lo(code_eb1170_bss) /* EB15AC 8024074C 0060282D */ daddu $a1, $v1, $zero .L80240750: /* EB15B0 80240750 24820010 */ addiu $v0, $a0, 0x10 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_02/BDD1B0/func_80240000_BDD1B0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_02/BDD1B0/arn_02_func_80240000_BDD1B0.s similarity index 100% rename from ver/us/asm/nonmatchings/world/area_arn/arn_02/BDD1B0/func_80240000_BDD1B0.s rename to ver/us/asm/nonmatchings/world/area_arn/arn_02/BDD1B0/arn_02_func_80240000_BDD1B0.s diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241680_BE0410.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/arn_03_func_80241680_BE0410.s similarity index 100% rename from ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241680_BE0410.s rename to ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/arn_03_func_80241680_BE0410.s diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240000_BDED90.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240000_BDED90.s deleted file mode 100644 index 80da0bb29e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240000_BDED90.s +++ /dev/null @@ -1,95 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BDED90 -/* BDED90 80240000 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BDED94 80240004 AFB50024 */ sw $s5, 0x24($sp) -/* BDED98 80240008 0080A82D */ daddu $s5, $a0, $zero -/* BDED9C 8024000C AFBF002C */ sw $ra, 0x2c($sp) -/* BDEDA0 80240010 AFB60028 */ sw $s6, 0x28($sp) -/* BDEDA4 80240014 AFB40020 */ sw $s4, 0x20($sp) -/* BDEDA8 80240018 AFB3001C */ sw $s3, 0x1c($sp) -/* BDEDAC 8024001C AFB20018 */ sw $s2, 0x18($sp) -/* BDEDB0 80240020 AFB10014 */ sw $s1, 0x14($sp) -/* BDEDB4 80240024 AFB00010 */ sw $s0, 0x10($sp) -/* BDEDB8 80240028 F7B80040 */ sdc1 $f24, 0x40($sp) -/* BDEDBC 8024002C F7B60038 */ sdc1 $f22, 0x38($sp) -/* BDEDC0 80240030 F7B40030 */ sdc1 $f20, 0x30($sp) -/* BDEDC4 80240034 8EB30148 */ lw $s3, 0x148($s5) -/* BDEDC8 80240038 86640008 */ lh $a0, 8($s3) -/* BDEDCC 8024003C 0C00EABB */ jal get_npc_unsafe -/* BDEDD0 80240040 00A0B02D */ daddu $s6, $a1, $zero -/* BDEDD4 80240044 0040A02D */ daddu $s4, $v0, $zero -/* BDEDD8 80240048 AEA00074 */ sw $zero, 0x74($s5) -/* BDEDDC 8024004C C6980038 */ lwc1 $f24, 0x38($s4) -/* BDEDE0 80240050 C6960040 */ lwc1 $f22, 0x40($s4) -/* BDEDE4 80240054 0000902D */ daddu $s2, $zero, $zero -/* BDEDE8 80240058 AEA00078 */ sw $zero, 0x78($s5) -/* BDEDEC 8024005C 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDEDF0 80240060 8C620000 */ lw $v0, ($v1) -/* BDEDF4 80240064 3C0146FF */ lui $at, 0x46ff -/* BDEDF8 80240068 3421FE00 */ ori $at, $at, 0xfe00 -/* BDEDFC 8024006C 4481A000 */ mtc1 $at, $f20 -/* BDEE00 80240070 18400018 */ blez $v0, .L802400D4 -/* BDEE04 80240074 0240802D */ daddu $s0, $s2, $zero -/* BDEE08 80240078 0240882D */ daddu $s1, $s2, $zero -.L8024007C: -/* BDEE0C 8024007C 02231021 */ addu $v0, $s1, $v1 -/* BDEE10 80240080 4600C306 */ mov.s $f12, $f24 -/* BDEE14 80240084 C4440004 */ lwc1 $f4, 4($v0) -/* BDEE18 80240088 46802120 */ cvt.s.w $f4, $f4 -/* BDEE1C 8024008C 44062000 */ mfc1 $a2, $f4 -/* BDEE20 80240090 C444000C */ lwc1 $f4, 0xc($v0) -/* BDEE24 80240094 46802120 */ cvt.s.w $f4, $f4 -/* BDEE28 80240098 44072000 */ mfc1 $a3, $f4 -/* BDEE2C 8024009C 0C00A7B5 */ jal dist2D -/* BDEE30 802400A0 4600B386 */ mov.s $f14, $f22 -/* BDEE34 802400A4 4614003C */ c.lt.s $f0, $f20 -/* BDEE38 802400A8 00000000 */ nop -/* BDEE3C 802400AC 45000003 */ bc1f .L802400BC -/* BDEE40 802400B0 2631000C */ addiu $s1, $s1, 0xc -/* BDEE44 802400B4 46000506 */ mov.s $f20, $f0 -/* BDEE48 802400B8 AEB20078 */ sw $s2, 0x78($s5) -.L802400BC: -/* BDEE4C 802400BC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDEE50 802400C0 26100001 */ addiu $s0, $s0, 1 -/* BDEE54 802400C4 8C620000 */ lw $v0, ($v1) -/* BDEE58 802400C8 0202102A */ slt $v0, $s0, $v0 -/* BDEE5C 802400CC 1440FFEB */ bnez $v0, .L8024007C -/* BDEE60 802400D0 26520001 */ addiu $s2, $s2, 1 -.L802400D4: -/* BDEE64 802400D4 8E6200CC */ lw $v0, 0xcc($s3) -/* BDEE68 802400D8 8C420004 */ lw $v0, 4($v0) -/* BDEE6C 802400DC AE820028 */ sw $v0, 0x28($s4) -/* BDEE70 802400E0 8E6200D0 */ lw $v0, 0xd0($s3) -/* BDEE74 802400E4 8C42007C */ lw $v0, 0x7c($v0) -/* BDEE78 802400E8 04410004 */ bgez $v0, .L802400FC -/* BDEE7C 802400EC 00000000 */ nop -/* BDEE80 802400F0 C6C00000 */ lwc1 $f0, ($s6) -/* BDEE84 802400F4 08090047 */ j .L8024011C -/* BDEE88 802400F8 E6800018 */ swc1 $f0, 0x18($s4) -.L802400FC: -/* BDEE8C 802400FC 3C018024 */ lui $at, %hi(D_80244860_BE35F0) -/* BDEE90 80240100 D4224860 */ ldc1 $f2, %lo(D_80244860_BE35F0)($at) -/* BDEE94 80240104 44820000 */ mtc1 $v0, $f0 -/* BDEE98 80240108 00000000 */ nop -/* BDEE9C 8024010C 46800021 */ cvt.d.w $f0, $f0 -/* BDEEA0 80240110 46220003 */ div.d $f0, $f0, $f2 -/* BDEEA4 80240114 46200020 */ cvt.s.d $f0, $f0 -/* BDEEA8 80240118 E6800018 */ swc1 $f0, 0x18($s4) -.L8024011C: -/* BDEEAC 8024011C 24020001 */ addiu $v0, $zero, 1 -/* BDEEB0 80240120 AEA20070 */ sw $v0, 0x70($s5) -/* BDEEB4 80240124 8FBF002C */ lw $ra, 0x2c($sp) -/* BDEEB8 80240128 8FB60028 */ lw $s6, 0x28($sp) -/* BDEEBC 8024012C 8FB50024 */ lw $s5, 0x24($sp) -/* BDEEC0 80240130 8FB40020 */ lw $s4, 0x20($sp) -/* BDEEC4 80240134 8FB3001C */ lw $s3, 0x1c($sp) -/* BDEEC8 80240138 8FB20018 */ lw $s2, 0x18($sp) -/* BDEECC 8024013C 8FB10014 */ lw $s1, 0x14($sp) -/* BDEED0 80240140 8FB00010 */ lw $s0, 0x10($sp) -/* BDEED4 80240144 D7B80040 */ ldc1 $f24, 0x40($sp) -/* BDEED8 80240148 D7B60038 */ ldc1 $f22, 0x38($sp) -/* BDEEDC 8024014C D7B40030 */ ldc1 $f20, 0x30($sp) -/* BDEEE0 80240150 03E00008 */ jr $ra -/* BDEEE4 80240154 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240158_BDEEE8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240158_BDEEE8.s deleted file mode 100644 index a2d2c1691b..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240158_BDEEE8.s +++ /dev/null @@ -1,183 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240158_BDEEE8 -/* BDEEE8 80240158 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* BDEEEC 8024015C AFB20038 */ sw $s2, 0x38($sp) -/* BDEEF0 80240160 0080902D */ daddu $s2, $a0, $zero -/* BDEEF4 80240164 AFBF0044 */ sw $ra, 0x44($sp) -/* BDEEF8 80240168 AFB40040 */ sw $s4, 0x40($sp) -/* BDEEFC 8024016C AFB3003C */ sw $s3, 0x3c($sp) -/* BDEF00 80240170 AFB10034 */ sw $s1, 0x34($sp) -/* BDEF04 80240174 AFB00030 */ sw $s0, 0x30($sp) -/* BDEF08 80240178 F7B60050 */ sdc1 $f22, 0x50($sp) -/* BDEF0C 8024017C F7B40048 */ sdc1 $f20, 0x48($sp) -/* BDEF10 80240180 8E510148 */ lw $s1, 0x148($s2) -/* BDEF14 80240184 00A0982D */ daddu $s3, $a1, $zero -/* BDEF18 80240188 86240008 */ lh $a0, 8($s1) -/* BDEF1C 8024018C 0C00EABB */ jal get_npc_unsafe -/* BDEF20 80240190 00C0A02D */ daddu $s4, $a2, $zero -/* BDEF24 80240194 8E630014 */ lw $v1, 0x14($s3) -/* BDEF28 80240198 04600030 */ bltz $v1, .L8024025C -/* BDEF2C 8024019C 0040802D */ daddu $s0, $v0, $zero -/* BDEF30 802401A0 8E420074 */ lw $v0, 0x74($s2) -/* BDEF34 802401A4 1C40002C */ bgtz $v0, .L80240258 -/* BDEF38 802401A8 2442FFFF */ addiu $v0, $v0, -1 -/* BDEF3C 802401AC 0280202D */ daddu $a0, $s4, $zero -/* BDEF40 802401B0 AE430074 */ sw $v1, 0x74($s2) -/* BDEF44 802401B4 AFA00010 */ sw $zero, 0x10($sp) -/* BDEF48 802401B8 8E66000C */ lw $a2, 0xc($s3) -/* BDEF4C 802401BC 8E670010 */ lw $a3, 0x10($s3) -/* BDEF50 802401C0 0C01242D */ jal func_800490B4 -/* BDEF54 802401C4 0220282D */ daddu $a1, $s1, $zero -/* BDEF58 802401C8 10400021 */ beqz $v0, .L80240250 -/* BDEF5C 802401CC 0000202D */ daddu $a0, $zero, $zero -/* BDEF60 802401D0 0200282D */ daddu $a1, $s0, $zero -/* BDEF64 802401D4 0000302D */ daddu $a2, $zero, $zero -/* BDEF68 802401D8 860300A8 */ lh $v1, 0xa8($s0) -/* BDEF6C 802401DC 3C013F80 */ lui $at, 0x3f80 -/* BDEF70 802401E0 44810000 */ mtc1 $at, $f0 -/* BDEF74 802401E4 3C014000 */ lui $at, 0x4000 -/* BDEF78 802401E8 44811000 */ mtc1 $at, $f2 -/* BDEF7C 802401EC 3C01C1A0 */ lui $at, 0xc1a0 -/* BDEF80 802401F0 44812000 */ mtc1 $at, $f4 -/* BDEF84 802401F4 2402000F */ addiu $v0, $zero, 0xf -/* BDEF88 802401F8 AFA2001C */ sw $v0, 0x1c($sp) -/* BDEF8C 802401FC 44833000 */ mtc1 $v1, $f6 -/* BDEF90 80240200 00000000 */ nop -/* BDEF94 80240204 468031A0 */ cvt.s.w $f6, $f6 -/* BDEF98 80240208 44073000 */ mfc1 $a3, $f6 -/* BDEF9C 8024020C 27A20028 */ addiu $v0, $sp, 0x28 -/* BDEFA0 80240210 AFA20020 */ sw $v0, 0x20($sp) -/* BDEFA4 80240214 E7A00010 */ swc1 $f0, 0x10($sp) -/* BDEFA8 80240218 E7A20014 */ swc1 $f2, 0x14($sp) -/* BDEFAC 8024021C 0C01BFA4 */ jal fx_emote -/* BDEFB0 80240220 E7A40018 */ swc1 $f4, 0x18($sp) -/* BDEFB4 80240224 0200202D */ daddu $a0, $s0, $zero -/* BDEFB8 80240228 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BDEFBC 8024022C 0C012530 */ jal func_800494C0 -/* BDEFC0 80240230 3C060020 */ lui $a2, 0x20 -/* BDEFC4 80240234 8E220018 */ lw $v0, 0x18($s1) -/* BDEFC8 80240238 9442002A */ lhu $v0, 0x2a($v0) -/* BDEFCC 8024023C 30420001 */ andi $v0, $v0, 1 -/* BDEFD0 80240240 14400064 */ bnez $v0, .L802403D4 -/* BDEFD4 80240244 2402000A */ addiu $v0, $zero, 0xa -/* BDEFD8 80240248 080900F5 */ j .L802403D4 -/* BDEFDC 8024024C 2402000C */ addiu $v0, $zero, 0xc -.L80240250: -/* BDEFE0 80240250 8E420074 */ lw $v0, 0x74($s2) -/* BDEFE4 80240254 2442FFFF */ addiu $v0, $v0, -1 -.L80240258: -/* BDEFE8 80240258 AE420074 */ sw $v0, 0x74($s2) -.L8024025C: -/* BDEFEC 8024025C 8602008C */ lh $v0, 0x8c($s0) -/* BDEFF0 80240260 1440005D */ bnez $v0, .L802403D8 -/* BDEFF4 80240264 00000000 */ nop -/* BDEFF8 80240268 C6000018 */ lwc1 $f0, 0x18($s0) -/* BDEFFC 8024026C 3C014010 */ lui $at, 0x4010 -/* BDF000 80240270 44811800 */ mtc1 $at, $f3 -/* BDF004 80240274 44801000 */ mtc1 $zero, $f2 -/* BDF008 80240278 46000021 */ cvt.d.s $f0, $f0 -/* BDF00C 8024027C 4622003C */ c.lt.d $f0, $f2 -/* BDF010 80240280 00000000 */ nop -/* BDF014 80240284 45000003 */ bc1f .L80240294 -/* BDF018 80240288 0200202D */ daddu $a0, $s0, $zero -/* BDF01C 8024028C 080900A6 */ j .L80240298 -/* BDF020 80240290 0000282D */ daddu $a1, $zero, $zero -.L80240294: -/* BDF024 80240294 24050001 */ addiu $a1, $zero, 1 -.L80240298: -/* BDF028 80240298 0C00F598 */ jal func_8003D660 -/* BDF02C 8024029C 00000000 */ nop -/* BDF030 802402A0 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BDF034 802402A4 8E430078 */ lw $v1, 0x78($s2) -/* BDF038 802402A8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BDF03C 802402AC 00031040 */ sll $v0, $v1, 1 -/* BDF040 802402B0 00431021 */ addu $v0, $v0, $v1 -/* BDF044 802402B4 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF048 802402B8 00021080 */ sll $v0, $v0, 2 -/* BDF04C 802402BC 00431021 */ addu $v0, $v0, $v1 -/* BDF050 802402C0 C4560004 */ lwc1 $f22, 4($v0) -/* BDF054 802402C4 4680B5A0 */ cvt.s.w $f22, $f22 -/* BDF058 802402C8 C454000C */ lwc1 $f20, 0xc($v0) -/* BDF05C 802402CC 4680A520 */ cvt.s.w $f20, $f20 -/* BDF060 802402D0 4406B000 */ mfc1 $a2, $f22 -/* BDF064 802402D4 4407A000 */ mfc1 $a3, $f20 -/* BDF068 802402D8 0C00A720 */ jal atan2 -/* BDF06C 802402DC 00000000 */ nop -/* BDF070 802402E0 8E050018 */ lw $a1, 0x18($s0) -/* BDF074 802402E4 44060000 */ mfc1 $a2, $f0 -/* BDF078 802402E8 0200202D */ daddu $a0, $s0, $zero -/* BDF07C 802402EC 0C00EA95 */ jal npc_move_heading -/* BDF080 802402F0 AE06000C */ sw $a2, 0xc($s0) -/* BDF084 802402F4 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BDF088 802402F8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BDF08C 802402FC 4406B000 */ mfc1 $a2, $f22 -/* BDF090 80240300 4407A000 */ mfc1 $a3, $f20 -/* BDF094 80240304 0C00A7B5 */ jal dist2D -/* BDF098 80240308 00000000 */ nop -/* BDF09C 8024030C C6020018 */ lwc1 $f2, 0x18($s0) -/* BDF0A0 80240310 4602003E */ c.le.s $f0, $f2 -/* BDF0A4 80240314 00000000 */ nop -/* BDF0A8 80240318 4500002F */ bc1f .L802403D8 -/* BDF0AC 8024031C 240403E8 */ addiu $a0, $zero, 0x3e8 -/* BDF0B0 80240320 24020002 */ addiu $v0, $zero, 2 -/* BDF0B4 80240324 0C00A67F */ jal rand_int -/* BDF0B8 80240328 AE420070 */ sw $v0, 0x70($s2) -/* BDF0BC 8024032C 3C035555 */ lui $v1, 0x5555 -/* BDF0C0 80240330 34635556 */ ori $v1, $v1, 0x5556 -/* BDF0C4 80240334 00430018 */ mult $v0, $v1 -/* BDF0C8 80240338 000227C3 */ sra $a0, $v0, 0x1f -/* BDF0CC 8024033C 00004010 */ mfhi $t0 -/* BDF0D0 80240340 01042023 */ subu $a0, $t0, $a0 -/* BDF0D4 80240344 00041840 */ sll $v1, $a0, 1 -/* BDF0D8 80240348 00641821 */ addu $v1, $v1, $a0 -/* BDF0DC 8024034C 00431023 */ subu $v0, $v0, $v1 -/* BDF0E0 80240350 24430002 */ addiu $v1, $v0, 2 -/* BDF0E4 80240354 AE430074 */ sw $v1, 0x74($s2) -/* BDF0E8 80240358 8E62002C */ lw $v0, 0x2c($s3) -/* BDF0EC 8024035C 18400009 */ blez $v0, .L80240384 -/* BDF0F0 80240360 24020004 */ addiu $v0, $zero, 4 -/* BDF0F4 80240364 8E620004 */ lw $v0, 4($s3) -/* BDF0F8 80240368 18400006 */ blez $v0, .L80240384 -/* BDF0FC 8024036C 24020004 */ addiu $v0, $zero, 4 -/* BDF100 80240370 8E620008 */ lw $v0, 8($s3) -/* BDF104 80240374 18400003 */ blez $v0, .L80240384 -/* BDF108 80240378 24020004 */ addiu $v0, $zero, 4 -/* BDF10C 8024037C 14600002 */ bnez $v1, .L80240388 -/* BDF110 80240380 00000000 */ nop -.L80240384: -/* BDF114 80240384 AE420070 */ sw $v0, 0x70($s2) -.L80240388: -/* BDF118 80240388 0C00A67F */ jal rand_int -/* BDF11C 8024038C 24042710 */ addiu $a0, $zero, 0x2710 -/* BDF120 80240390 3C0351EB */ lui $v1, 0x51eb -/* BDF124 80240394 3463851F */ ori $v1, $v1, 0x851f -/* BDF128 80240398 00430018 */ mult $v0, $v1 -/* BDF12C 8024039C 00021FC3 */ sra $v1, $v0, 0x1f -/* BDF130 802403A0 00004010 */ mfhi $t0 -/* BDF134 802403A4 00082143 */ sra $a0, $t0, 5 -/* BDF138 802403A8 00832023 */ subu $a0, $a0, $v1 -/* BDF13C 802403AC 00041840 */ sll $v1, $a0, 1 -/* BDF140 802403B0 00641821 */ addu $v1, $v1, $a0 -/* BDF144 802403B4 000318C0 */ sll $v1, $v1, 3 -/* BDF148 802403B8 00641821 */ addu $v1, $v1, $a0 -/* BDF14C 802403BC 00031880 */ sll $v1, $v1, 2 -/* BDF150 802403C0 8E640004 */ lw $a0, 4($s3) -/* BDF154 802403C4 00431023 */ subu $v0, $v0, $v1 -/* BDF158 802403C8 0044102A */ slt $v0, $v0, $a0 -/* BDF15C 802403CC 10400002 */ beqz $v0, .L802403D8 -/* BDF160 802403D0 24020004 */ addiu $v0, $zero, 4 -.L802403D4: -/* BDF164 802403D4 AE420070 */ sw $v0, 0x70($s2) -.L802403D8: -/* BDF168 802403D8 8FBF0044 */ lw $ra, 0x44($sp) -/* BDF16C 802403DC 8FB40040 */ lw $s4, 0x40($sp) -/* BDF170 802403E0 8FB3003C */ lw $s3, 0x3c($sp) -/* BDF174 802403E4 8FB20038 */ lw $s2, 0x38($sp) -/* BDF178 802403E8 8FB10034 */ lw $s1, 0x34($sp) -/* BDF17C 802403EC 8FB00030 */ lw $s0, 0x30($sp) -/* BDF180 802403F0 D7B60050 */ ldc1 $f22, 0x50($sp) -/* BDF184 802403F4 D7B40048 */ ldc1 $f20, 0x48($sp) -/* BDF188 802403F8 03E00008 */ jr $ra -/* BDF18C 802403FC 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802404C0_BDF250.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802404C0_BDF250.s deleted file mode 100644 index 16ae96753f..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802404C0_BDF250.s +++ /dev/null @@ -1,120 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802404C0_BDF250 -/* BDF250 802404C0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BDF254 802404C4 AFB40040 */ sw $s4, 0x40($sp) -/* BDF258 802404C8 0080A02D */ daddu $s4, $a0, $zero -/* BDF25C 802404CC AFBF0044 */ sw $ra, 0x44($sp) -/* BDF260 802404D0 AFB3003C */ sw $s3, 0x3c($sp) -/* BDF264 802404D4 AFB20038 */ sw $s2, 0x38($sp) -/* BDF268 802404D8 AFB10034 */ sw $s1, 0x34($sp) -/* BDF26C 802404DC AFB00030 */ sw $s0, 0x30($sp) -/* BDF270 802404E0 8E910148 */ lw $s1, 0x148($s4) -/* BDF274 802404E4 00A0902D */ daddu $s2, $a1, $zero -/* BDF278 802404E8 86240008 */ lh $a0, 8($s1) -/* BDF27C 802404EC 0C00EABB */ jal get_npc_unsafe -/* BDF280 802404F0 00C0982D */ daddu $s3, $a2, $zero -/* BDF284 802404F4 8E430014 */ lw $v1, 0x14($s2) -/* BDF288 802404F8 04600031 */ bltz $v1, .L802405C0 -/* BDF28C 802404FC 0040802D */ daddu $s0, $v0, $zero -/* BDF290 80240500 0260202D */ daddu $a0, $s3, $zero -/* BDF294 80240504 AFA00010 */ sw $zero, 0x10($sp) -/* BDF298 80240508 8E460024 */ lw $a2, 0x24($s2) -/* BDF29C 8024050C 8E470028 */ lw $a3, 0x28($s2) -/* BDF2A0 80240510 0C01242D */ jal func_800490B4 -/* BDF2A4 80240514 0220282D */ daddu $a1, $s1, $zero -/* BDF2A8 80240518 10400029 */ beqz $v0, .L802405C0 -/* BDF2AC 8024051C 0000202D */ daddu $a0, $zero, $zero -/* BDF2B0 80240520 0200282D */ daddu $a1, $s0, $zero -/* BDF2B4 80240524 0000302D */ daddu $a2, $zero, $zero -/* BDF2B8 80240528 860300A8 */ lh $v1, 0xa8($s0) -/* BDF2BC 8024052C 3C013F80 */ lui $at, 0x3f80 -/* BDF2C0 80240530 44810000 */ mtc1 $at, $f0 -/* BDF2C4 80240534 3C014000 */ lui $at, 0x4000 -/* BDF2C8 80240538 44811000 */ mtc1 $at, $f2 -/* BDF2CC 8024053C 3C01C1A0 */ lui $at, 0xc1a0 -/* BDF2D0 80240540 44812000 */ mtc1 $at, $f4 -/* BDF2D4 80240544 2402000F */ addiu $v0, $zero, 0xf -/* BDF2D8 80240548 AFA2001C */ sw $v0, 0x1c($sp) -/* BDF2DC 8024054C 44833000 */ mtc1 $v1, $f6 -/* BDF2E0 80240550 00000000 */ nop -/* BDF2E4 80240554 468031A0 */ cvt.s.w $f6, $f6 -/* BDF2E8 80240558 44073000 */ mfc1 $a3, $f6 -/* BDF2EC 8024055C 27A20028 */ addiu $v0, $sp, 0x28 -/* BDF2F0 80240560 AFA20020 */ sw $v0, 0x20($sp) -/* BDF2F4 80240564 E7A00010 */ swc1 $f0, 0x10($sp) -/* BDF2F8 80240568 E7A20014 */ swc1 $f2, 0x14($sp) -/* BDF2FC 8024056C 0C01BFA4 */ jal fx_emote -/* BDF300 80240570 E7A40018 */ swc1 $f4, 0x18($sp) -/* BDF304 80240574 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BDF308 80240578 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BDF30C 8024057C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BDF310 80240580 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BDF314 80240584 8C460028 */ lw $a2, 0x28($v0) -/* BDF318 80240588 0C00A720 */ jal atan2 -/* BDF31C 8024058C 8C470030 */ lw $a3, 0x30($v0) -/* BDF320 80240590 0200202D */ daddu $a0, $s0, $zero -/* BDF324 80240594 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BDF328 80240598 3C060020 */ lui $a2, 0x20 -/* BDF32C 8024059C 0C012530 */ jal func_800494C0 -/* BDF330 802405A0 E480000C */ swc1 $f0, 0xc($a0) -/* BDF334 802405A4 8E220018 */ lw $v0, 0x18($s1) -/* BDF338 802405A8 9442002A */ lhu $v0, 0x2a($v0) -/* BDF33C 802405AC 30420001 */ andi $v0, $v0, 1 -/* BDF340 802405B0 14400029 */ bnez $v0, .L80240658 -/* BDF344 802405B4 2402000A */ addiu $v0, $zero, 0xa -/* BDF348 802405B8 08090196 */ j .L80240658 -/* BDF34C 802405BC 2402000C */ addiu $v0, $zero, 0xc -.L802405C0: -/* BDF350 802405C0 8602008C */ lh $v0, 0x8c($s0) -/* BDF354 802405C4 14400025 */ bnez $v0, .L8024065C -/* BDF358 802405C8 00000000 */ nop -/* BDF35C 802405CC 9602008E */ lhu $v0, 0x8e($s0) -/* BDF360 802405D0 2442FFFF */ addiu $v0, $v0, -1 -/* BDF364 802405D4 A602008E */ sh $v0, 0x8e($s0) -/* BDF368 802405D8 00021400 */ sll $v0, $v0, 0x10 -/* BDF36C 802405DC 1440001F */ bnez $v0, .L8024065C -/* BDF370 802405E0 00000000 */ nop -/* BDF374 802405E4 8E820074 */ lw $v0, 0x74($s4) -/* BDF378 802405E8 2442FFFF */ addiu $v0, $v0, -1 -/* BDF37C 802405EC 10400019 */ beqz $v0, .L80240654 -/* BDF380 802405F0 AE820074 */ sw $v0, 0x74($s4) -/* BDF384 802405F4 8E220018 */ lw $v0, 0x18($s1) -/* BDF388 802405F8 9442002A */ lhu $v0, 0x2a($v0) -/* BDF38C 802405FC 30420010 */ andi $v0, $v0, 0x10 -/* BDF390 80240600 14400007 */ bnez $v0, .L80240620 -/* BDF394 80240604 00000000 */ nop -/* BDF398 80240608 C600000C */ lwc1 $f0, 0xc($s0) -/* BDF39C 8024060C 3C014334 */ lui $at, 0x4334 -/* BDF3A0 80240610 44816000 */ mtc1 $at, $f12 -/* BDF3A4 80240614 0C00A6C9 */ jal clamp_angle -/* BDF3A8 80240618 460C0300 */ add.s $f12, $f0, $f12 -/* BDF3AC 8024061C E600000C */ swc1 $f0, 0xc($s0) -.L80240620: -/* BDF3B0 80240620 8E440008 */ lw $a0, 8($s2) -/* BDF3B4 80240624 000417C2 */ srl $v0, $a0, 0x1f -/* BDF3B8 80240628 00822021 */ addu $a0, $a0, $v0 -/* BDF3BC 8024062C 00042043 */ sra $a0, $a0, 1 -/* BDF3C0 80240630 0C00A67F */ jal rand_int -/* BDF3C4 80240634 24840001 */ addiu $a0, $a0, 1 -/* BDF3C8 80240638 8E430008 */ lw $v1, 8($s2) -/* BDF3CC 8024063C 000327C2 */ srl $a0, $v1, 0x1f -/* BDF3D0 80240640 00641821 */ addu $v1, $v1, $a0 -/* BDF3D4 80240644 00031843 */ sra $v1, $v1, 1 -/* BDF3D8 80240648 00621821 */ addu $v1, $v1, $v0 -/* BDF3DC 8024064C 08090197 */ j .L8024065C -/* BDF3E0 80240650 A603008E */ sh $v1, 0x8e($s0) -.L80240654: -/* BDF3E4 80240654 24020004 */ addiu $v0, $zero, 4 -.L80240658: -/* BDF3E8 80240658 AE820070 */ sw $v0, 0x70($s4) -.L8024065C: -/* BDF3EC 8024065C 8FBF0044 */ lw $ra, 0x44($sp) -/* BDF3F0 80240660 8FB40040 */ lw $s4, 0x40($sp) -/* BDF3F4 80240664 8FB3003C */ lw $s3, 0x3c($sp) -/* BDF3F8 80240668 8FB20038 */ lw $s2, 0x38($sp) -/* BDF3FC 8024066C 8FB10034 */ lw $s1, 0x34($sp) -/* BDF400 80240670 8FB00030 */ lw $s0, 0x30($sp) -/* BDF404 80240674 03E00008 */ jr $ra -/* BDF408 80240678 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024067C_BDF40C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024067C_BDF40C.s deleted file mode 100644 index c91601f84b..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024067C_BDF40C.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024067C_BDF40C -/* BDF40C 8024067C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BDF410 80240680 AFB10014 */ sw $s1, 0x14($sp) -/* BDF414 80240684 0080882D */ daddu $s1, $a0, $zero -/* BDF418 80240688 AFBF001C */ sw $ra, 0x1c($sp) -/* BDF41C 8024068C AFB20018 */ sw $s2, 0x18($sp) -/* BDF420 80240690 AFB00010 */ sw $s0, 0x10($sp) -/* BDF424 80240694 8E300148 */ lw $s0, 0x148($s1) -/* BDF428 80240698 86040008 */ lh $a0, 8($s0) -/* BDF42C 8024069C 0C00EABB */ jal get_npc_unsafe -/* BDF430 802406A0 00A0902D */ daddu $s2, $a1, $zero -/* BDF434 802406A4 8E230078 */ lw $v1, 0x78($s1) -/* BDF438 802406A8 24630001 */ addiu $v1, $v1, 1 -/* BDF43C 802406AC AE230078 */ sw $v1, 0x78($s1) -/* BDF440 802406B0 8E0400D0 */ lw $a0, 0xd0($s0) -/* BDF444 802406B4 8C840000 */ lw $a0, ($a0) -/* BDF448 802406B8 0064182A */ slt $v1, $v1, $a0 -/* BDF44C 802406BC 14600002 */ bnez $v1, .L802406C8 -/* BDF450 802406C0 0040282D */ daddu $a1, $v0, $zero -/* BDF454 802406C4 AE200078 */ sw $zero, 0x78($s1) -.L802406C8: -/* BDF458 802406C8 8E0200CC */ lw $v0, 0xcc($s0) -/* BDF45C 802406CC 8C420004 */ lw $v0, 4($v0) -/* BDF460 802406D0 ACA20028 */ sw $v0, 0x28($a1) -/* BDF464 802406D4 8E0200D0 */ lw $v0, 0xd0($s0) -/* BDF468 802406D8 8C42007C */ lw $v0, 0x7c($v0) -/* BDF46C 802406DC 04410004 */ bgez $v0, .L802406F0 -/* BDF470 802406E0 00000000 */ nop -/* BDF474 802406E4 C6400000 */ lwc1 $f0, ($s2) -/* BDF478 802406E8 080901C4 */ j .L80240710 -/* BDF47C 802406EC E4A00018 */ swc1 $f0, 0x18($a1) -.L802406F0: -/* BDF480 802406F0 3C018024 */ lui $at, %hi(D_80244868_BE35F8) -/* BDF484 802406F4 D4224868 */ ldc1 $f2, %lo(D_80244868_BE35F8)($at) -/* BDF488 802406F8 44820000 */ mtc1 $v0, $f0 -/* BDF48C 802406FC 00000000 */ nop -/* BDF490 80240700 46800021 */ cvt.d.w $f0, $f0 -/* BDF494 80240704 46220003 */ div.d $f0, $f0, $f2 -/* BDF498 80240708 46200020 */ cvt.s.d $f0, $f0 -/* BDF49C 8024070C E4A00018 */ swc1 $f0, 0x18($a1) -.L80240710: -/* BDF4A0 80240710 24020001 */ addiu $v0, $zero, 1 -/* BDF4A4 80240714 AE220070 */ sw $v0, 0x70($s1) -/* BDF4A8 80240718 8FBF001C */ lw $ra, 0x1c($sp) -/* BDF4AC 8024071C 8FB20018 */ lw $s2, 0x18($sp) -/* BDF4B0 80240720 8FB10014 */ lw $s1, 0x14($sp) -/* BDF4B4 80240724 8FB00010 */ lw $s0, 0x10($sp) -/* BDF4B8 80240728 03E00008 */ jr $ra -/* BDF4BC 8024072C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024094C_BDF6DC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024094C_BDF6DC.s deleted file mode 100644 index 3676ccf880..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024094C_BDF6DC.s +++ /dev/null @@ -1,80 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024094C_BDF6DC -/* BDF6DC 8024094C 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BDF6E0 80240950 AFB3003C */ sw $s3, 0x3c($sp) -/* BDF6E4 80240954 0080982D */ daddu $s3, $a0, $zero -/* BDF6E8 80240958 AFBF0040 */ sw $ra, 0x40($sp) -/* BDF6EC 8024095C AFB20038 */ sw $s2, 0x38($sp) -/* BDF6F0 80240960 AFB10034 */ sw $s1, 0x34($sp) -/* BDF6F4 80240964 AFB00030 */ sw $s0, 0x30($sp) -/* BDF6F8 80240968 8E720148 */ lw $s2, 0x148($s3) -/* BDF6FC 8024096C 00A0882D */ daddu $s1, $a1, $zero -/* BDF700 80240970 86440008 */ lh $a0, 8($s2) -/* BDF704 80240974 0C00EABB */ jal get_npc_unsafe -/* BDF708 80240978 00C0802D */ daddu $s0, $a2, $zero -/* BDF70C 8024097C 0200202D */ daddu $a0, $s0, $zero -/* BDF710 80240980 0240282D */ daddu $a1, $s2, $zero -/* BDF714 80240984 24030001 */ addiu $v1, $zero, 1 -/* BDF718 80240988 AFA30010 */ sw $v1, 0x10($sp) -/* BDF71C 8024098C 8E260024 */ lw $a2, 0x24($s1) -/* BDF720 80240990 8E270028 */ lw $a3, 0x28($s1) -/* BDF724 80240994 0C01242D */ jal func_800490B4 -/* BDF728 80240998 0040802D */ daddu $s0, $v0, $zero -/* BDF72C 8024099C 1440001E */ bnez $v0, .L80240A18 -/* BDF730 802409A0 0200202D */ daddu $a0, $s0, $zero -/* BDF734 802409A4 24040002 */ addiu $a0, $zero, 2 -/* BDF738 802409A8 0200282D */ daddu $a1, $s0, $zero -/* BDF73C 802409AC 0000302D */ daddu $a2, $zero, $zero -/* BDF740 802409B0 860300A8 */ lh $v1, 0xa8($s0) -/* BDF744 802409B4 3C013F80 */ lui $at, 0x3f80 -/* BDF748 802409B8 44810000 */ mtc1 $at, $f0 -/* BDF74C 802409BC 3C014000 */ lui $at, 0x4000 -/* BDF750 802409C0 44811000 */ mtc1 $at, $f2 -/* BDF754 802409C4 3C01C1A0 */ lui $at, 0xc1a0 -/* BDF758 802409C8 44812000 */ mtc1 $at, $f4 -/* BDF75C 802409CC 2402000F */ addiu $v0, $zero, 0xf -/* BDF760 802409D0 AFA2001C */ sw $v0, 0x1c($sp) -/* BDF764 802409D4 44833000 */ mtc1 $v1, $f6 -/* BDF768 802409D8 00000000 */ nop -/* BDF76C 802409DC 468031A0 */ cvt.s.w $f6, $f6 -/* BDF770 802409E0 44073000 */ mfc1 $a3, $f6 -/* BDF774 802409E4 27A20028 */ addiu $v0, $sp, 0x28 -/* BDF778 802409E8 AFA20020 */ sw $v0, 0x20($sp) -/* BDF77C 802409EC E7A00010 */ swc1 $f0, 0x10($sp) -/* BDF780 802409F0 E7A20014 */ swc1 $f2, 0x14($sp) -/* BDF784 802409F4 0C01BFA4 */ jal fx_emote -/* BDF788 802409F8 E7A40018 */ swc1 $f4, 0x18($sp) -/* BDF78C 802409FC 8E4200CC */ lw $v0, 0xcc($s2) -/* BDF790 80240A00 8C430000 */ lw $v1, ($v0) -/* BDF794 80240A04 24020019 */ addiu $v0, $zero, 0x19 -/* BDF798 80240A08 A602008E */ sh $v0, 0x8e($s0) -/* BDF79C 80240A0C 2402000E */ addiu $v0, $zero, 0xe -/* BDF7A0 80240A10 08090293 */ j .L80240A4C -/* BDF7A4 80240A14 AE030028 */ sw $v1, 0x28($s0) -.L80240A18: -/* BDF7A8 80240A18 0C00F598 */ jal func_8003D660 -/* BDF7AC 80240A1C 24050001 */ addiu $a1, $zero, 1 -/* BDF7B0 80240A20 8E050018 */ lw $a1, 0x18($s0) -/* BDF7B4 80240A24 8E06000C */ lw $a2, 0xc($s0) -/* BDF7B8 80240A28 0C00EA95 */ jal npc_move_heading -/* BDF7BC 80240A2C 0200202D */ daddu $a0, $s0, $zero -/* BDF7C0 80240A30 8602008E */ lh $v0, 0x8e($s0) -/* BDF7C4 80240A34 9603008E */ lhu $v1, 0x8e($s0) -/* BDF7C8 80240A38 18400003 */ blez $v0, .L80240A48 -/* BDF7CC 80240A3C 2462FFFF */ addiu $v0, $v1, -1 -/* BDF7D0 80240A40 08090294 */ j .L80240A50 -/* BDF7D4 80240A44 A602008E */ sh $v0, 0x8e($s0) -.L80240A48: -/* BDF7D8 80240A48 2402000C */ addiu $v0, $zero, 0xc -.L80240A4C: -/* BDF7DC 80240A4C AE620070 */ sw $v0, 0x70($s3) -.L80240A50: -/* BDF7E0 80240A50 8FBF0040 */ lw $ra, 0x40($sp) -/* BDF7E4 80240A54 8FB3003C */ lw $s3, 0x3c($sp) -/* BDF7E8 80240A58 8FB20038 */ lw $s2, 0x38($sp) -/* BDF7EC 80240A5C 8FB10034 */ lw $s1, 0x34($sp) -/* BDF7F0 80240A60 8FB00030 */ lw $s0, 0x30($sp) -/* BDF7F4 80240A64 03E00008 */ jr $ra -/* BDF7F8 80240A68 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240AD4_BDF864.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240AD4_BDF864.s deleted file mode 100644 index d7884891dc..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240AD4_BDF864.s +++ /dev/null @@ -1,55 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240AD4_BDF864 -/* BDF864 80240AD4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BDF868 80240AD8 AFB10014 */ sw $s1, 0x14($sp) -/* BDF86C 80240ADC 0080882D */ daddu $s1, $a0, $zero -/* BDF870 80240AE0 AFBF001C */ sw $ra, 0x1c($sp) -/* BDF874 80240AE4 AFB20018 */ sw $s2, 0x18($sp) -/* BDF878 80240AE8 AFB00010 */ sw $s0, 0x10($sp) -/* BDF87C 80240AEC 8E300148 */ lw $s0, 0x148($s1) -/* BDF880 80240AF0 86040008 */ lh $a0, 8($s0) -/* BDF884 80240AF4 0C00EABB */ jal get_npc_unsafe -/* BDF888 80240AF8 00A0902D */ daddu $s2, $a1, $zero -/* BDF88C 80240AFC 8E0300D0 */ lw $v1, 0xd0($s0) -/* BDF890 80240B00 8E240078 */ lw $a0, 0x78($s1) -/* BDF894 80240B04 8C630000 */ lw $v1, ($v1) -/* BDF898 80240B08 0083182A */ slt $v1, $a0, $v1 -/* BDF89C 80240B0C 10600013 */ beqz $v1, .L80240B5C -/* BDF8A0 80240B10 0040302D */ daddu $a2, $v0, $zero -/* BDF8A4 80240B14 00041040 */ sll $v0, $a0, 1 -/* BDF8A8 80240B18 00441021 */ addu $v0, $v0, $a0 -/* BDF8AC 80240B1C 00022880 */ sll $a1, $v0, 2 -.L80240B20: -/* BDF8B0 80240B20 8E0300D0 */ lw $v1, 0xd0($s0) -/* BDF8B4 80240B24 C4C2003C */ lwc1 $f2, 0x3c($a2) -/* BDF8B8 80240B28 00A31021 */ addu $v0, $a1, $v1 -/* BDF8BC 80240B2C C4400008 */ lwc1 $f0, 8($v0) -/* BDF8C0 80240B30 46800020 */ cvt.s.w $f0, $f0 -/* BDF8C4 80240B34 4602003E */ c.le.s $f0, $f2 -/* BDF8C8 80240B38 00000000 */ nop -/* BDF8CC 80240B3C 45020003 */ bc1fl .L80240B4C -/* BDF8D0 80240B40 24840001 */ addiu $a0, $a0, 1 -/* BDF8D4 80240B44 080902D7 */ j .L80240B5C -/* BDF8D8 80240B48 AE240078 */ sw $a0, 0x78($s1) -.L80240B4C: -/* BDF8DC 80240B4C 8C620000 */ lw $v0, ($v1) -/* BDF8E0 80240B50 0082102A */ slt $v0, $a0, $v0 -/* BDF8E4 80240B54 1440FFF2 */ bnez $v0, .L80240B20 -/* BDF8E8 80240B58 24A5000C */ addiu $a1, $a1, 0xc -.L80240B5C: -/* BDF8EC 80240B5C C6400000 */ lwc1 $f0, ($s2) -/* BDF8F0 80240B60 E4C00018 */ swc1 $f0, 0x18($a2) -/* BDF8F4 80240B64 8E0200CC */ lw $v0, 0xcc($s0) -/* BDF8F8 80240B68 8C420004 */ lw $v0, 4($v0) -/* BDF8FC 80240B6C ACC20028 */ sw $v0, 0x28($a2) -/* BDF900 80240B70 24020001 */ addiu $v0, $zero, 1 -/* BDF904 80240B74 AE200074 */ sw $zero, 0x74($s1) -/* BDF908 80240B78 AE220070 */ sw $v0, 0x70($s1) -/* BDF90C 80240B7C 8FBF001C */ lw $ra, 0x1c($sp) -/* BDF910 80240B80 8FB20018 */ lw $s2, 0x18($sp) -/* BDF914 80240B84 8FB10014 */ lw $s1, 0x14($sp) -/* BDF918 80240B88 8FB00010 */ lw $s0, 0x10($sp) -/* BDF91C 80240B8C 03E00008 */ jr $ra -/* BDF920 80240B90 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240B94_BDF924.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240B94_BDF924.s deleted file mode 100644 index c6b28b76d4..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240B94_BDF924.s +++ /dev/null @@ -1,214 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240B94_BDF924 -/* BDF924 80240B94 27BDFF98 */ addiu $sp, $sp, -0x68 -/* BDF928 80240B98 AFB40058 */ sw $s4, 0x58($sp) -/* BDF92C 80240B9C 0080A02D */ daddu $s4, $a0, $zero -/* BDF930 80240BA0 AFBF0060 */ sw $ra, 0x60($sp) -/* BDF934 80240BA4 AFB5005C */ sw $s5, 0x5c($sp) -/* BDF938 80240BA8 AFB30054 */ sw $s3, 0x54($sp) -/* BDF93C 80240BAC AFB20050 */ sw $s2, 0x50($sp) -/* BDF940 80240BB0 AFB1004C */ sw $s1, 0x4c($sp) -/* BDF944 80240BB4 AFB00048 */ sw $s0, 0x48($sp) -/* BDF948 80240BB8 8E910148 */ lw $s1, 0x148($s4) -/* BDF94C 80240BBC 86240008 */ lh $a0, 8($s1) -/* BDF950 80240BC0 0C00EABB */ jal get_npc_unsafe -/* BDF954 80240BC4 00A0802D */ daddu $s0, $a1, $zero -/* BDF958 80240BC8 8E83000C */ lw $v1, 0xc($s4) -/* BDF95C 80240BCC 0280202D */ daddu $a0, $s4, $zero -/* BDF960 80240BD0 8C650000 */ lw $a1, ($v1) -/* BDF964 80240BD4 0C0B1EAF */ jal get_variable -/* BDF968 80240BD8 0040902D */ daddu $s2, $v0, $zero -/* BDF96C 80240BDC AFA00018 */ sw $zero, 0x18($sp) -/* BDF970 80240BE0 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF974 80240BE4 8C630094 */ lw $v1, 0x94($v1) -/* BDF978 80240BE8 AFA3001C */ sw $v1, 0x1c($sp) -/* BDF97C 80240BEC 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF980 80240BF0 8C630080 */ lw $v1, 0x80($v1) -/* BDF984 80240BF4 AFA30020 */ sw $v1, 0x20($sp) -/* BDF988 80240BF8 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF98C 80240BFC 8C630088 */ lw $v1, 0x88($v1) -/* BDF990 80240C00 AFA30024 */ sw $v1, 0x24($sp) -/* BDF994 80240C04 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF998 80240C08 8C63008C */ lw $v1, 0x8c($v1) -/* BDF99C 80240C0C 27B50018 */ addiu $s5, $sp, 0x18 -/* BDF9A0 80240C10 AFA30028 */ sw $v1, 0x28($sp) -/* BDF9A4 80240C14 8E2300D0 */ lw $v1, 0xd0($s1) -/* BDF9A8 80240C18 3C014282 */ lui $at, 0x4282 -/* BDF9AC 80240C1C 44810000 */ mtc1 $at, $f0 -/* BDF9B0 80240C20 8C630090 */ lw $v1, 0x90($v1) -/* BDF9B4 80240C24 0040982D */ daddu $s3, $v0, $zero -/* BDF9B8 80240C28 E7A00030 */ swc1 $f0, 0x30($sp) -/* BDF9BC 80240C2C A7A00034 */ sh $zero, 0x34($sp) -/* BDF9C0 80240C30 16000005 */ bnez $s0, .L80240C48 -/* BDF9C4 80240C34 AFA3002C */ sw $v1, 0x2c($sp) -/* BDF9C8 80240C38 8E2200B0 */ lw $v0, 0xb0($s1) -/* BDF9CC 80240C3C 30420004 */ andi $v0, $v0, 4 -/* BDF9D0 80240C40 10400044 */ beqz $v0, .L80240D54 -/* BDF9D4 80240C44 00000000 */ nop -.L80240C48: -/* BDF9D8 80240C48 2404F7FF */ addiu $a0, $zero, -0x801 -/* BDF9DC 80240C4C AE800070 */ sw $zero, 0x70($s4) -/* BDF9E0 80240C50 A640008E */ sh $zero, 0x8e($s2) -/* BDF9E4 80240C54 8E2200CC */ lw $v0, 0xcc($s1) -/* BDF9E8 80240C58 8E430000 */ lw $v1, ($s2) -/* BDF9EC 80240C5C 8C420000 */ lw $v0, ($v0) -/* BDF9F0 80240C60 00641824 */ and $v1, $v1, $a0 -/* BDF9F4 80240C64 AE430000 */ sw $v1, ($s2) -/* BDF9F8 80240C68 AE420028 */ sw $v0, 0x28($s2) -/* BDF9FC 80240C6C 8E2200D0 */ lw $v0, 0xd0($s1) -/* BDFA00 80240C70 8C420098 */ lw $v0, 0x98($v0) -/* BDFA04 80240C74 54400005 */ bnel $v0, $zero, .L80240C8C -/* BDFA08 80240C78 2402FDFF */ addiu $v0, $zero, -0x201 -/* BDFA0C 80240C7C 34620200 */ ori $v0, $v1, 0x200 -/* BDFA10 80240C80 2403FFF7 */ addiu $v1, $zero, -9 -/* BDFA14 80240C84 08090325 */ j .L80240C94 -/* BDFA18 80240C88 00431024 */ and $v0, $v0, $v1 -.L80240C8C: -/* BDFA1C 80240C8C 00621024 */ and $v0, $v1, $v0 -/* BDFA20 80240C90 34420008 */ ori $v0, $v0, 8 -.L80240C94: -/* BDFA24 80240C94 AE420000 */ sw $v0, ($s2) -/* BDFA28 80240C98 8E2200B0 */ lw $v0, 0xb0($s1) -/* BDFA2C 80240C9C 30420004 */ andi $v0, $v0, 4 -/* BDFA30 80240CA0 10400008 */ beqz $v0, .L80240CC4 -/* BDFA34 80240CA4 24020063 */ addiu $v0, $zero, 0x63 -/* BDFA38 80240CA8 AE820070 */ sw $v0, 0x70($s4) -/* BDFA3C 80240CAC AE800074 */ sw $zero, 0x74($s4) -/* BDFA40 80240CB0 8E2200B0 */ lw $v0, 0xb0($s1) -/* BDFA44 80240CB4 2403FFFB */ addiu $v1, $zero, -5 -/* BDFA48 80240CB8 00431024 */ and $v0, $v0, $v1 -/* BDFA4C 80240CBC 0809033C */ j .L80240CF0 -/* BDFA50 80240CC0 AE2200B0 */ sw $v0, 0xb0($s1) -.L80240CC4: -/* BDFA54 80240CC4 8E220000 */ lw $v0, ($s1) -/* BDFA58 80240CC8 3C034000 */ lui $v1, 0x4000 -/* BDFA5C 80240CCC 00431024 */ and $v0, $v0, $v1 -/* BDFA60 80240CD0 10400007 */ beqz $v0, .L80240CF0 -/* BDFA64 80240CD4 3C03BFFF */ lui $v1, 0xbfff -/* BDFA68 80240CD8 2402000C */ addiu $v0, $zero, 0xc -/* BDFA6C 80240CDC AE820070 */ sw $v0, 0x70($s4) -/* BDFA70 80240CE0 8E220000 */ lw $v0, ($s1) -/* BDFA74 80240CE4 3463FFFF */ ori $v1, $v1, 0xffff -/* BDFA78 80240CE8 00431024 */ and $v0, $v0, $v1 -/* BDFA7C 80240CEC AE220000 */ sw $v0, ($s1) -.L80240CF0: -/* BDFA80 80240CF0 27A50038 */ addiu $a1, $sp, 0x38 -/* BDFA84 80240CF4 27A6003C */ addiu $a2, $sp, 0x3c -/* BDFA88 80240CF8 C6400038 */ lwc1 $f0, 0x38($s2) -/* BDFA8C 80240CFC 864200A8 */ lh $v0, 0xa8($s2) -/* BDFA90 80240D00 3C0142C8 */ lui $at, 0x42c8 -/* BDFA94 80240D04 44812000 */ mtc1 $at, $f4 -/* BDFA98 80240D08 44823000 */ mtc1 $v0, $f6 -/* BDFA9C 80240D0C 00000000 */ nop -/* BDFAA0 80240D10 468031A0 */ cvt.s.w $f6, $f6 -/* BDFAA4 80240D14 27A20044 */ addiu $v0, $sp, 0x44 -/* BDFAA8 80240D18 E7A00038 */ swc1 $f0, 0x38($sp) -/* BDFAAC 80240D1C C640003C */ lwc1 $f0, 0x3c($s2) -/* BDFAB0 80240D20 C6420040 */ lwc1 $f2, 0x40($s2) -/* BDFAB4 80240D24 46060000 */ add.s $f0, $f0, $f6 -/* BDFAB8 80240D28 E7A40044 */ swc1 $f4, 0x44($sp) -/* BDFABC 80240D2C E7A20040 */ swc1 $f2, 0x40($sp) -/* BDFAC0 80240D30 E7A0003C */ swc1 $f0, 0x3c($sp) -/* BDFAC4 80240D34 AFA20010 */ sw $v0, 0x10($sp) -/* BDFAC8 80240D38 8E440080 */ lw $a0, 0x80($s2) -/* BDFACC 80240D3C 0C0372DF */ jal func_800DCB7C -/* BDFAD0 80240D40 27A70040 */ addiu $a3, $sp, 0x40 -/* BDFAD4 80240D44 10400003 */ beqz $v0, .L80240D54 -/* BDFAD8 80240D48 00000000 */ nop -/* BDFADC 80240D4C C7A0003C */ lwc1 $f0, 0x3c($sp) -/* BDFAE0 80240D50 E640003C */ swc1 $f0, 0x3c($s2) -.L80240D54: -/* BDFAE4 80240D54 8E830070 */ lw $v1, 0x70($s4) -/* BDFAE8 80240D58 2C620064 */ sltiu $v0, $v1, 0x64 -/* BDFAEC 80240D5C 10400042 */ beqz $v0, L80240E68_BDFBF8 -/* BDFAF0 80240D60 00031080 */ sll $v0, $v1, 2 -/* BDFAF4 80240D64 3C018024 */ lui $at, %hi(jtbl_80244870_BE3600) -/* BDFAF8 80240D68 00220821 */ addu $at, $at, $v0 -/* BDFAFC 80240D6C 8C224870 */ lw $v0, %lo(jtbl_80244870_BE3600)($at) -/* BDFB00 80240D70 00400008 */ jr $v0 -/* BDFB04 80240D74 00000000 */ nop -glabel L80240D78_BDFB08 -/* BDFB08 80240D78 0280202D */ daddu $a0, $s4, $zero -/* BDFB0C 80240D7C 0260282D */ daddu $a1, $s3, $zero -/* BDFB10 80240D80 0C090000 */ jal func_80240000_BDED90 -/* BDFB14 80240D84 02A0302D */ daddu $a2, $s5, $zero -glabel L80240D88_BDFB18 -/* BDFB18 80240D88 0280202D */ daddu $a0, $s4, $zero -/* BDFB1C 80240D8C 0260282D */ daddu $a1, $s3, $zero -/* BDFB20 80240D90 0C090056 */ jal func_80240158_BDEEE8 -/* BDFB24 80240D94 02A0302D */ daddu $a2, $s5, $zero -/* BDFB28 80240D98 0809039A */ j L80240E68_BDFBF8 -/* BDFB2C 80240D9C 00000000 */ nop -glabel L80240DA0_BDFB30 -/* BDFB30 80240DA0 0280202D */ daddu $a0, $s4, $zero -/* BDFB34 80240DA4 0260282D */ daddu $a1, $s3, $zero -/* BDFB38 80240DA8 0C090100 */ jal arn_03_UnkNpcAIFunc1 -/* BDFB3C 80240DAC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DB0_BDFB40 -/* BDFB40 80240DB0 0280202D */ daddu $a0, $s4, $zero -/* BDFB44 80240DB4 0260282D */ daddu $a1, $s3, $zero -/* BDFB48 80240DB8 0C090130 */ jal func_802404C0_BDF250 -/* BDFB4C 80240DBC 02A0302D */ daddu $a2, $s5, $zero -/* BDFB50 80240DC0 0809039A */ j L80240E68_BDFBF8 -/* BDFB54 80240DC4 00000000 */ nop -glabel L80240DC8_BDFB58 -/* BDFB58 80240DC8 0280202D */ daddu $a0, $s4, $zero -/* BDFB5C 80240DCC 0260282D */ daddu $a1, $s3, $zero -/* BDFB60 80240DD0 0C09019F */ jal func_8024067C_BDF40C -/* BDFB64 80240DD4 02A0302D */ daddu $a2, $s5, $zero -/* BDFB68 80240DD8 0809039A */ j L80240E68_BDFBF8 -/* BDFB6C 80240DDC 00000000 */ nop -glabel L80240DE0_BDFB70 -/* BDFB70 80240DE0 0280202D */ daddu $a0, $s4, $zero -/* BDFB74 80240DE4 0260282D */ daddu $a1, $s3, $zero -/* BDFB78 80240DE8 0C0901CC */ jal arn_03_NpcJumpFunc2 -/* BDFB7C 80240DEC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DF0_BDFB80 -/* BDFB80 80240DF0 0280202D */ daddu $a0, $s4, $zero -/* BDFB84 80240DF4 0260282D */ daddu $a1, $s3, $zero -/* BDFB88 80240DF8 0C0901E9 */ jal arn_03_NpcJumpFunc -/* BDFB8C 80240DFC 02A0302D */ daddu $a2, $s5, $zero -/* BDFB90 80240E00 0809039A */ j L80240E68_BDFBF8 -/* BDFB94 80240E04 00000000 */ nop -glabel L80240E08_BDFB98 -/* BDFB98 80240E08 0280202D */ daddu $a0, $s4, $zero -/* BDFB9C 80240E0C 0260282D */ daddu $a1, $s3, $zero -/* BDFBA0 80240E10 0C090207 */ jal arn_03_UnkNpcAIFunc13 -/* BDFBA4 80240E14 02A0302D */ daddu $a2, $s5, $zero -glabel L80240E18_BDFBA8 -/* BDFBA8 80240E18 0280202D */ daddu $a0, $s4, $zero -/* BDFBAC 80240E1C 0260282D */ daddu $a1, $s3, $zero -/* BDFBB0 80240E20 0C090253 */ jal func_8024094C_BDF6DC -/* BDFBB4 80240E24 02A0302D */ daddu $a2, $s5, $zero -/* BDFBB8 80240E28 0809039A */ j L80240E68_BDFBF8 -/* BDFBBC 80240E2C 00000000 */ nop -glabel L80240E30_BDFBC0 -/* BDFBC0 80240E30 0280202D */ daddu $a0, $s4, $zero -/* BDFBC4 80240E34 0260282D */ daddu $a1, $s3, $zero -/* BDFBC8 80240E38 0C09029B */ jal arn_03_UnkNpcDurationFlagFunc -/* BDFBCC 80240E3C 02A0302D */ daddu $a2, $s5, $zero -/* BDFBD0 80240E40 0809039A */ j L80240E68_BDFBF8 -/* BDFBD4 80240E44 00000000 */ nop -glabel L80240E48_BDFBD8 -/* BDFBD8 80240E48 0280202D */ daddu $a0, $s4, $zero -/* BDFBDC 80240E4C 0260282D */ daddu $a1, $s3, $zero -/* BDFBE0 80240E50 0C0902B5 */ jal func_80240AD4_BDF864 -/* BDFBE4 80240E54 02A0302D */ daddu $a2, $s5, $zero -/* BDFBE8 80240E58 0809039A */ j L80240E68_BDFBF8 -/* BDFBEC 80240E5C 00000000 */ nop -glabel L80240E60_BDFBF0 -/* BDFBF0 80240E60 0C0129CF */ jal func_8004A73C -/* BDFBF4 80240E64 0280202D */ daddu $a0, $s4, $zero -glabel L80240E68_BDFBF8 -/* BDFBF8 80240E68 8FBF0060 */ lw $ra, 0x60($sp) -/* BDFBFC 80240E6C 8FB5005C */ lw $s5, 0x5c($sp) -/* BDFC00 80240E70 8FB40058 */ lw $s4, 0x58($sp) -/* BDFC04 80240E74 8FB30054 */ lw $s3, 0x54($sp) -/* BDFC08 80240E78 8FB20050 */ lw $s2, 0x50($sp) -/* BDFC0C 80240E7C 8FB1004C */ lw $s1, 0x4c($sp) -/* BDFC10 80240E80 8FB00048 */ lw $s0, 0x48($sp) -/* BDFC14 80240E84 0000102D */ daddu $v0, $zero, $zero -/* BDFC18 80240E88 03E00008 */ jr $ra -/* BDFC1C 80240E8C 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240E90_BDFC20.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240E90_BDFC20.s deleted file mode 100644 index ffbc44c1da..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80240E90_BDFC20.s +++ /dev/null @@ -1,126 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240E90_BDFC20 -/* BDFC20 80240E90 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BDFC24 80240E94 AFB20030 */ sw $s2, 0x30($sp) -/* BDFC28 80240E98 0080902D */ daddu $s2, $a0, $zero -/* BDFC2C 80240E9C AFBF0034 */ sw $ra, 0x34($sp) -/* BDFC30 80240EA0 AFB1002C */ sw $s1, 0x2c($sp) -/* BDFC34 80240EA4 AFB00028 */ sw $s0, 0x28($sp) -/* BDFC38 80240EA8 F7B60040 */ sdc1 $f22, 0x40($sp) -/* BDFC3C 80240EAC F7B40038 */ sdc1 $f20, 0x38($sp) -/* BDFC40 80240EB0 8E500148 */ lw $s0, 0x148($s2) -/* BDFC44 80240EB4 0C00EABB */ jal get_npc_unsafe -/* BDFC48 80240EB8 86040008 */ lh $a0, 8($s0) -/* BDFC4C 80240EBC 0040882D */ daddu $s1, $v0, $zero -/* BDFC50 80240EC0 C62C0038 */ lwc1 $f12, 0x38($s1) -/* BDFC54 80240EC4 8E430078 */ lw $v1, 0x78($s2) -/* BDFC58 80240EC8 C62E0040 */ lwc1 $f14, 0x40($s1) -/* BDFC5C 80240ECC 00031040 */ sll $v0, $v1, 1 -/* BDFC60 80240ED0 00431021 */ addu $v0, $v0, $v1 -/* BDFC64 80240ED4 8E0300D0 */ lw $v1, 0xd0($s0) -/* BDFC68 80240ED8 00021080 */ sll $v0, $v0, 2 -/* BDFC6C 80240EDC 00431021 */ addu $v0, $v0, $v1 -/* BDFC70 80240EE0 C4560004 */ lwc1 $f22, 4($v0) -/* BDFC74 80240EE4 4680B5A0 */ cvt.s.w $f22, $f22 -/* BDFC78 80240EE8 C454000C */ lwc1 $f20, 0xc($v0) -/* BDFC7C 80240EEC 4680A520 */ cvt.s.w $f20, $f20 -/* BDFC80 80240EF0 4406B000 */ mfc1 $a2, $f22 -/* BDFC84 80240EF4 4407A000 */ mfc1 $a3, $f20 -/* BDFC88 80240EF8 E7AC0018 */ swc1 $f12, 0x18($sp) -/* BDFC8C 80240EFC 0C00A720 */ jal atan2 -/* BDFC90 80240F00 E7AE0020 */ swc1 $f14, 0x20($sp) -/* BDFC94 80240F04 8E250018 */ lw $a1, 0x18($s1) -/* BDFC98 80240F08 44060000 */ mfc1 $a2, $f0 -/* BDFC9C 80240F0C 0220202D */ daddu $a0, $s1, $zero -/* BDFCA0 80240F10 0C00EA95 */ jal npc_move_heading -/* BDFCA4 80240F14 AE26000C */ sw $a2, 0xc($s1) -/* BDFCA8 80240F18 27A50018 */ addiu $a1, $sp, 0x18 -/* BDFCAC 80240F1C 27A6001C */ addiu $a2, $sp, 0x1c -/* BDFCB0 80240F20 C6200038 */ lwc1 $f0, 0x38($s1) -/* BDFCB4 80240F24 8E430078 */ lw $v1, 0x78($s2) -/* BDFCB8 80240F28 3C01447A */ lui $at, 0x447a -/* BDFCBC 80240F2C 44812000 */ mtc1 $at, $f4 -/* BDFCC0 80240F30 00031040 */ sll $v0, $v1, 1 -/* BDFCC4 80240F34 00431021 */ addu $v0, $v0, $v1 -/* BDFCC8 80240F38 00021080 */ sll $v0, $v0, 2 -/* BDFCCC 80240F3C E7A00018 */ swc1 $f0, 0x18($sp) -/* BDFCD0 80240F40 8E0300D0 */ lw $v1, 0xd0($s0) -/* BDFCD4 80240F44 C620003C */ lwc1 $f0, 0x3c($s1) -/* BDFCD8 80240F48 C6220040 */ lwc1 $f2, 0x40($s1) -/* BDFCDC 80240F4C 00431021 */ addu $v0, $v0, $v1 -/* BDFCE0 80240F50 C4460008 */ lwc1 $f6, 8($v0) -/* BDFCE4 80240F54 468031A0 */ cvt.s.w $f6, $f6 -/* BDFCE8 80240F58 27A20024 */ addiu $v0, $sp, 0x24 -/* BDFCEC 80240F5C 46060000 */ add.s $f0, $f0, $f6 -/* BDFCF0 80240F60 E7A20020 */ swc1 $f2, 0x20($sp) -/* BDFCF4 80240F64 E7A40024 */ swc1 $f4, 0x24($sp) -/* BDFCF8 80240F68 E7A0001C */ swc1 $f0, 0x1c($sp) -/* BDFCFC 80240F6C AFA20010 */ sw $v0, 0x10($sp) -/* BDFD00 80240F70 8E240080 */ lw $a0, 0x80($s1) -/* BDFD04 80240F74 0C0372DF */ jal func_800DCB7C -/* BDFD08 80240F78 27A70020 */ addiu $a3, $sp, 0x20 -/* BDFD0C 80240F7C 8E430078 */ lw $v1, 0x78($s2) -/* BDFD10 80240F80 C7A2001C */ lwc1 $f2, 0x1c($sp) -/* BDFD14 80240F84 00031040 */ sll $v0, $v1, 1 -/* BDFD18 80240F88 00431021 */ addu $v0, $v0, $v1 -/* BDFD1C 80240F8C 8E0300D0 */ lw $v1, 0xd0($s0) -/* BDFD20 80240F90 00021080 */ sll $v0, $v0, 2 -/* BDFD24 80240F94 00431021 */ addu $v0, $v0, $v1 -/* BDFD28 80240F98 C4400008 */ lwc1 $f0, 8($v0) -/* BDFD2C 80240F9C 46800020 */ cvt.s.w $f0, $f0 -/* BDFD30 80240FA0 46001080 */ add.s $f2, $f2, $f0 -/* BDFD34 80240FA4 C620003C */ lwc1 $f0, 0x3c($s1) -/* BDFD38 80240FA8 3C014000 */ lui $at, 0x4000 -/* BDFD3C 80240FAC 44813800 */ mtc1 $at, $f7 -/* BDFD40 80240FB0 44803000 */ mtc1 $zero, $f6 -/* BDFD44 80240FB4 46001001 */ sub.s $f0, $f2, $f0 -/* BDFD48 80240FB8 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BDFD4C 80240FBC 46000121 */ cvt.d.s $f4, $f0 -/* BDFD50 80240FC0 4624303C */ c.lt.d $f6, $f4 -/* BDFD54 80240FC4 00000000 */ nop -/* BDFD58 80240FC8 45000005 */ bc1f .L80240FE0 -/* BDFD5C 80240FCC E7A00024 */ swc1 $f0, 0x24($sp) -/* BDFD60 80240FD0 C620003C */ lwc1 $f0, 0x3c($s1) -/* BDFD64 80240FD4 46000021 */ cvt.d.s $f0, $f0 -/* BDFD68 80240FD8 08090403 */ j .L8024100C -/* BDFD6C 80240FDC 46260000 */ add.d $f0, $f0, $f6 -.L80240FE0: -/* BDFD70 80240FE0 3C01C000 */ lui $at, 0xc000 -/* BDFD74 80240FE4 44810800 */ mtc1 $at, $f1 -/* BDFD78 80240FE8 44800000 */ mtc1 $zero, $f0 -/* BDFD7C 80240FEC 00000000 */ nop -/* BDFD80 80240FF0 4620203C */ c.lt.d $f4, $f0 -/* BDFD84 80240FF4 00000000 */ nop -/* BDFD88 80240FF8 45020006 */ bc1fl .L80241014 -/* BDFD8C 80240FFC E622003C */ swc1 $f2, 0x3c($s1) -/* BDFD90 80241000 C620003C */ lwc1 $f0, 0x3c($s1) -/* BDFD94 80241004 46000021 */ cvt.d.s $f0, $f0 -/* BDFD98 80241008 46260001 */ sub.d $f0, $f0, $f6 -.L8024100C: -/* BDFD9C 8024100C 46200020 */ cvt.s.d $f0, $f0 -/* BDFDA0 80241010 E620003C */ swc1 $f0, 0x3c($s1) -.L80241014: -/* BDFDA4 80241014 C62C0038 */ lwc1 $f12, 0x38($s1) -/* BDFDA8 80241018 C62E0040 */ lwc1 $f14, 0x40($s1) -/* BDFDAC 8024101C 4406B000 */ mfc1 $a2, $f22 -/* BDFDB0 80241020 4407A000 */ mfc1 $a3, $f20 -/* BDFDB4 80241024 0C00A7B5 */ jal dist2D -/* BDFDB8 80241028 00000000 */ nop -/* BDFDBC 8024102C C6220018 */ lwc1 $f2, 0x18($s1) -/* BDFDC0 80241030 4600103C */ c.lt.s $f2, $f0 -/* BDFDC4 80241034 00000000 */ nop -/* BDFDC8 80241038 45010003 */ bc1t .L80241048 -/* BDFDCC 8024103C E7A00024 */ swc1 $f0, 0x24($sp) -/* BDFDD0 80241040 24020002 */ addiu $v0, $zero, 2 -/* BDFDD4 80241044 AE420070 */ sw $v0, 0x70($s2) -.L80241048: -/* BDFDD8 80241048 8FBF0034 */ lw $ra, 0x34($sp) -/* BDFDDC 8024104C 8FB20030 */ lw $s2, 0x30($sp) -/* BDFDE0 80241050 8FB1002C */ lw $s1, 0x2c($sp) -/* BDFDE4 80241054 8FB00028 */ lw $s0, 0x28($sp) -/* BDFDE8 80241058 D7B60040 */ ldc1 $f22, 0x40($sp) -/* BDFDEC 8024105C D7B40038 */ ldc1 $f20, 0x38($sp) -/* BDFDF0 80241060 03E00008 */ jr $ra -/* BDFDF4 80241064 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241068_BDFDF8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241068_BDFDF8.s deleted file mode 100644 index 1618895979..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241068_BDFDF8.s +++ /dev/null @@ -1,59 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241068_BDFDF8 -/* BDFDF8 80241068 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BDFDFC 8024106C AFB10014 */ sw $s1, 0x14($sp) -/* BDFE00 80241070 0080882D */ daddu $s1, $a0, $zero -/* BDFE04 80241074 AFBF0020 */ sw $ra, 0x20($sp) -/* BDFE08 80241078 AFB3001C */ sw $s3, 0x1c($sp) -/* BDFE0C 8024107C AFB20018 */ sw $s2, 0x18($sp) -/* BDFE10 80241080 AFB00010 */ sw $s0, 0x10($sp) -/* BDFE14 80241084 8E320148 */ lw $s2, 0x148($s1) -/* BDFE18 80241088 86440008 */ lh $a0, 8($s2) -/* BDFE1C 8024108C 0C00EABB */ jal get_npc_unsafe -/* BDFE20 80241090 00A0982D */ daddu $s3, $a1, $zero -/* BDFE24 80241094 0040802D */ daddu $s0, $v0, $zero -/* BDFE28 80241098 9602008E */ lhu $v0, 0x8e($s0) -/* BDFE2C 8024109C 2442FFFF */ addiu $v0, $v0, -1 -/* BDFE30 802410A0 A602008E */ sh $v0, 0x8e($s0) -/* BDFE34 802410A4 00021400 */ sll $v0, $v0, 0x10 -/* BDFE38 802410A8 0441001D */ bgez $v0, .L80241120 -/* BDFE3C 802410AC 00000000 */ nop -/* BDFE40 802410B0 8E220074 */ lw $v0, 0x74($s1) -/* BDFE44 802410B4 2442FFFF */ addiu $v0, $v0, -1 -/* BDFE48 802410B8 04400014 */ bltz $v0, .L8024110C -/* BDFE4C 802410BC AE220074 */ sw $v0, 0x74($s1) -/* BDFE50 802410C0 C600000C */ lwc1 $f0, 0xc($s0) -/* BDFE54 802410C4 3C014334 */ lui $at, 0x4334 -/* BDFE58 802410C8 44816000 */ mtc1 $at, $f12 -/* BDFE5C 802410CC 0C00A6C9 */ jal clamp_angle -/* BDFE60 802410D0 460C0300 */ add.s $f12, $f0, $f12 -/* BDFE64 802410D4 E600000C */ swc1 $f0, 0xc($s0) -/* BDFE68 802410D8 8E640008 */ lw $a0, 8($s3) -/* BDFE6C 802410DC 000417C2 */ srl $v0, $a0, 0x1f -/* BDFE70 802410E0 00822021 */ addu $a0, $a0, $v0 -/* BDFE74 802410E4 00042043 */ sra $a0, $a0, 1 -/* BDFE78 802410E8 0C00A67F */ jal rand_int -/* BDFE7C 802410EC 24840001 */ addiu $a0, $a0, 1 -/* BDFE80 802410F0 8E630008 */ lw $v1, 8($s3) -/* BDFE84 802410F4 000327C2 */ srl $a0, $v1, 0x1f -/* BDFE88 802410F8 00641821 */ addu $v1, $v1, $a0 -/* BDFE8C 802410FC 00031843 */ sra $v1, $v1, 1 -/* BDFE90 80241100 00621821 */ addu $v1, $v1, $v0 -/* BDFE94 80241104 08090448 */ j .L80241120 -/* BDFE98 80241108 A603008E */ sh $v1, 0x8e($s0) -.L8024110C: -/* BDFE9C 8024110C 24020004 */ addiu $v0, $zero, 4 -/* BDFEA0 80241110 AE220070 */ sw $v0, 0x70($s1) -/* BDFEA4 80241114 8E4200CC */ lw $v0, 0xcc($s2) -/* BDFEA8 80241118 8C420000 */ lw $v0, ($v0) -/* BDFEAC 8024111C AE020028 */ sw $v0, 0x28($s0) -.L80241120: -/* BDFEB0 80241120 8FBF0020 */ lw $ra, 0x20($sp) -/* BDFEB4 80241124 8FB3001C */ lw $s3, 0x1c($sp) -/* BDFEB8 80241128 8FB20018 */ lw $s2, 0x18($sp) -/* BDFEBC 8024112C 8FB10014 */ lw $s1, 0x14($sp) -/* BDFEC0 80241130 8FB00010 */ lw $s0, 0x10($sp) -/* BDFEC4 80241134 03E00008 */ jr $ra -/* BDFEC8 80241138 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024113C_BDFECC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024113C_BDFECC.s deleted file mode 100644 index 5af27b5f44..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_8024113C_BDFECC.s +++ /dev/null @@ -1,104 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024113C_BDFECC -/* BDFECC 8024113C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BDFED0 80241140 AFB40040 */ sw $s4, 0x40($sp) -/* BDFED4 80241144 0080A02D */ daddu $s4, $a0, $zero -/* BDFED8 80241148 AFBF0048 */ sw $ra, 0x48($sp) -/* BDFEDC 8024114C AFB50044 */ sw $s5, 0x44($sp) -/* BDFEE0 80241150 AFB3003C */ sw $s3, 0x3c($sp) -/* BDFEE4 80241154 AFB20038 */ sw $s2, 0x38($sp) -/* BDFEE8 80241158 AFB10034 */ sw $s1, 0x34($sp) -/* BDFEEC 8024115C AFB00030 */ sw $s0, 0x30($sp) -/* BDFEF0 80241160 8E930148 */ lw $s3, 0x148($s4) -/* BDFEF4 80241164 86640008 */ lh $a0, 8($s3) -/* BDFEF8 80241168 8E90000C */ lw $s0, 0xc($s4) -/* BDFEFC 8024116C 0C00EABB */ jal get_npc_unsafe -/* BDFF00 80241170 00A0882D */ daddu $s1, $a1, $zero -/* BDFF04 80241174 0280202D */ daddu $a0, $s4, $zero -/* BDFF08 80241178 8E050000 */ lw $a1, ($s0) -/* BDFF0C 8024117C 0C0B1EAF */ jal get_variable -/* BDFF10 80241180 0040A82D */ daddu $s5, $v0, $zero -/* BDFF14 80241184 AFA00010 */ sw $zero, 0x10($sp) -/* BDFF18 80241188 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDFF1C 8024118C 8C630094 */ lw $v1, 0x94($v1) -/* BDFF20 80241190 AFA30014 */ sw $v1, 0x14($sp) -/* BDFF24 80241194 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDFF28 80241198 8C630080 */ lw $v1, 0x80($v1) -/* BDFF2C 8024119C AFA30018 */ sw $v1, 0x18($sp) -/* BDFF30 802411A0 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDFF34 802411A4 8C630088 */ lw $v1, 0x88($v1) -/* BDFF38 802411A8 AFA3001C */ sw $v1, 0x1c($sp) -/* BDFF3C 802411AC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDFF40 802411B0 8C63008C */ lw $v1, 0x8c($v1) -/* BDFF44 802411B4 27B20010 */ addiu $s2, $sp, 0x10 -/* BDFF48 802411B8 AFA30020 */ sw $v1, 0x20($sp) -/* BDFF4C 802411BC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BDFF50 802411C0 3C0142C8 */ lui $at, 0x42c8 -/* BDFF54 802411C4 44810000 */ mtc1 $at, $f0 -/* BDFF58 802411C8 8C630090 */ lw $v1, 0x90($v1) -/* BDFF5C 802411CC 0040802D */ daddu $s0, $v0, $zero -/* BDFF60 802411D0 E7A00028 */ swc1 $f0, 0x28($sp) -/* BDFF64 802411D4 A7A0002C */ sh $zero, 0x2c($sp) -/* BDFF68 802411D8 12200007 */ beqz $s1, .L802411F8 -/* BDFF6C 802411DC AFA30024 */ sw $v1, 0x24($sp) -/* BDFF70 802411E0 AE800070 */ sw $zero, 0x70($s4) -/* BDFF74 802411E4 8EA20000 */ lw $v0, ($s5) -/* BDFF78 802411E8 2403F7FF */ addiu $v1, $zero, -0x801 -/* BDFF7C 802411EC A6A0008E */ sh $zero, 0x8e($s5) -/* BDFF80 802411F0 00431024 */ and $v0, $v0, $v1 -/* BDFF84 802411F4 AEA20000 */ sw $v0, ($s5) -.L802411F8: -/* BDFF88 802411F8 8E830070 */ lw $v1, 0x70($s4) -/* BDFF8C 802411FC 2C620005 */ sltiu $v0, $v1, 5 -/* BDFF90 80241200 1040001E */ beqz $v0, .L8024127C -/* BDFF94 80241204 00031080 */ sll $v0, $v1, 2 -/* BDFF98 80241208 3C018024 */ lui $at, %hi(jtbl_80244A00_BE3790) -/* BDFF9C 8024120C 00220821 */ addu $at, $at, $v0 -/* BDFFA0 80241210 8C224A00 */ lw $v0, %lo(jtbl_80244A00_BE3790)($at) -/* BDFFA4 80241214 00400008 */ jr $v0 -/* BDFFA8 80241218 00000000 */ nop -glabel L8024121C_BDFFAC -/* BDFFAC 8024121C 0280202D */ daddu $a0, $s4, $zero -/* BDFFB0 80241220 0200282D */ daddu $a1, $s0, $zero -/* BDFFB4 80241224 0C090000 */ jal func_80240000_BDED90 -/* BDFFB8 80241228 0240302D */ daddu $a2, $s2, $zero -glabel L8024122C_BDFFBC -/* BDFFBC 8024122C 0280202D */ daddu $a0, $s4, $zero -/* BDFFC0 80241230 0200282D */ daddu $a1, $s0, $zero -/* BDFFC4 80241234 0C0903A4 */ jal func_80240E90_BDFC20 -/* BDFFC8 80241238 0240302D */ daddu $a2, $s2, $zero -/* BDFFCC 8024123C 0809049F */ j .L8024127C -/* BDFFD0 80241240 00000000 */ nop -glabel L80241244_BDFFD4 -/* BDFFD4 80241244 0280202D */ daddu $a0, $s4, $zero -/* BDFFD8 80241248 0200282D */ daddu $a1, $s0, $zero -/* BDFFDC 8024124C 0C090100 */ jal arn_03_UnkNpcAIFunc1 -/* BDFFE0 80241250 0240302D */ daddu $a2, $s2, $zero -glabel L80241254_BDFFE4 -/* BDFFE4 80241254 0280202D */ daddu $a0, $s4, $zero -/* BDFFE8 80241258 0200282D */ daddu $a1, $s0, $zero -/* BDFFEC 8024125C 0C09041A */ jal func_80241068_BDFDF8 -/* BDFFF0 80241260 0240302D */ daddu $a2, $s2, $zero -/* BDFFF4 80241264 0809049F */ j .L8024127C -/* BDFFF8 80241268 00000000 */ nop -glabel L8024126C_BDFFFC -/* BDFFFC 8024126C 0280202D */ daddu $a0, $s4, $zero -/* BE0000 80241270 0200282D */ daddu $a1, $s0, $zero -/* BE0004 80241274 0C09019F */ jal func_8024067C_BDF40C -/* BE0008 80241278 0240302D */ daddu $a2, $s2, $zero -.L8024127C: -/* BE000C 8024127C C6A0003C */ lwc1 $f0, 0x3c($s5) -/* BE0010 80241280 4600008D */ trunc.w.s $f2, $f0 -/* BE0014 80241284 E662006C */ swc1 $f2, 0x6c($s3) -/* BE0018 80241288 8FBF0048 */ lw $ra, 0x48($sp) -/* BE001C 8024128C 8FB50044 */ lw $s5, 0x44($sp) -/* BE0020 80241290 8FB40040 */ lw $s4, 0x40($sp) -/* BE0024 80241294 8FB3003C */ lw $s3, 0x3c($sp) -/* BE0028 80241298 8FB20038 */ lw $s2, 0x38($sp) -/* BE002C 8024129C 8FB10034 */ lw $s1, 0x34($sp) -/* BE0030 802412A0 8FB00030 */ lw $s0, 0x30($sp) -/* BE0034 802412A4 0000102D */ daddu $v0, $zero, $zero -/* BE0038 802412A8 03E00008 */ jr $ra -/* BE003C 802412AC 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802412B0_BE0040.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802412B0_BE0040.s deleted file mode 100644 index d0b0ec4334..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802412B0_BE0040.s +++ /dev/null @@ -1,53 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802412B0_BE0040 -/* BE0040 802412B0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE0044 802412B4 AFB00010 */ sw $s0, 0x10($sp) -/* BE0048 802412B8 3C108024 */ lui $s0, %hi(D_80241C68_BE09F8) -/* BE004C 802412BC 26101C68 */ addiu $s0, $s0, %lo(D_80241C68_BE09F8) -/* BE0050 802412C0 AFBF0018 */ sw $ra, 0x18($sp) -/* BE0054 802412C4 AFB10014 */ sw $s1, 0x14($sp) -/* BE0058 802412C8 8E020000 */ lw $v0, ($s0) -/* BE005C 802412CC 14400010 */ bnez $v0, .L80241310 -/* BE0060 802412D0 0080882D */ daddu $s1, $a0, $zero -/* BE0064 802412D4 0C00AB39 */ jal heap_malloc -/* BE0068 802412D8 24040040 */ addiu $a0, $zero, 0x40 -/* BE006C 802412DC AE020000 */ sw $v0, ($s0) -/* BE0070 802412E0 0000182D */ daddu $v1, $zero, $zero -/* BE0074 802412E4 0040282D */ daddu $a1, $v0, $zero -/* BE0078 802412E8 0220202D */ daddu $a0, $s1, $zero -.L802412EC: -/* BE007C 802412EC 8C820084 */ lw $v0, 0x84($a0) -/* BE0080 802412F0 24840004 */ addiu $a0, $a0, 4 -/* BE0084 802412F4 24630001 */ addiu $v1, $v1, 1 -/* BE0088 802412F8 ACA20000 */ sw $v0, ($a1) -/* BE008C 802412FC 28620010 */ slti $v0, $v1, 0x10 -/* BE0090 80241300 1440FFFA */ bnez $v0, .L802412EC -/* BE0094 80241304 24A50004 */ addiu $a1, $a1, 4 -/* BE0098 80241308 080904D3 */ j .L8024134C -/* BE009C 8024130C 00000000 */ nop -.L80241310: -/* BE00A0 80241310 0000182D */ daddu $v1, $zero, $zero -/* BE00A4 80241314 0040282D */ daddu $a1, $v0, $zero -/* BE00A8 80241318 0220202D */ daddu $a0, $s1, $zero -.L8024131C: -/* BE00AC 8024131C 8CA20000 */ lw $v0, ($a1) -/* BE00B0 80241320 24A50004 */ addiu $a1, $a1, 4 -/* BE00B4 80241324 24630001 */ addiu $v1, $v1, 1 -/* BE00B8 80241328 AC820084 */ sw $v0, 0x84($a0) -/* BE00BC 8024132C 28620010 */ slti $v0, $v1, 0x10 -/* BE00C0 80241330 1440FFFA */ bnez $v0, .L8024131C -/* BE00C4 80241334 24840004 */ addiu $a0, $a0, 4 -/* BE00C8 80241338 3C108024 */ lui $s0, %hi(D_80241C68_BE09F8) -/* BE00CC 8024133C 26101C68 */ addiu $s0, $s0, %lo(D_80241C68_BE09F8) -/* BE00D0 80241340 0C00AB4B */ jal heap_free -/* BE00D4 80241344 8E040000 */ lw $a0, ($s0) -/* BE00D8 80241348 AE000000 */ sw $zero, ($s0) -.L8024134C: -/* BE00DC 8024134C 8FBF0018 */ lw $ra, 0x18($sp) -/* BE00E0 80241350 8FB10014 */ lw $s1, 0x14($sp) -/* BE00E4 80241354 8FB00010 */ lw $s0, 0x10($sp) -/* BE00E8 80241358 24020002 */ addiu $v0, $zero, 2 -/* BE00EC 8024135C 03E00008 */ jr $ra -/* BE00F0 80241360 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802415F4_BE0384.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802415F4_BE0384.s deleted file mode 100644 index 127c046453..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_802415F4_BE0384.s +++ /dev/null @@ -1,28 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802415F4_BE0384 -/* BE0384 802415F4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BE0388 802415F8 AFBF0010 */ sw $ra, 0x10($sp) -/* BE038C 802415FC 10A00003 */ beqz $a1, .L8024160C -/* BE0390 80241600 8C86000C */ lw $a2, 0xc($a0) -/* BE0394 80241604 3C018024 */ lui $at, %hi(D_80241CCC_BE0A5C) -/* BE0398 80241608 AC201CCC */ sw $zero, %lo(D_80241CCC_BE0A5C)($at) -.L8024160C: -/* BE039C 8024160C 3C038024 */ lui $v1, %hi(D_80241CCC_BE0A5C) -/* BE03A0 80241610 24631CCC */ addiu $v1, $v1, %lo(D_80241CCC_BE0A5C) -/* BE03A4 80241614 8C620000 */ lw $v0, ($v1) -/* BE03A8 80241618 54400003 */ bnel $v0, $zero, .L80241628 -/* BE03AC 8024161C AC600000 */ sw $zero, ($v1) -/* BE03B0 80241620 0809058F */ j .L8024163C -/* BE03B4 80241624 0000102D */ daddu $v0, $zero, $zero -.L80241628: -/* BE03B8 80241628 8CC50000 */ lw $a1, ($a2) -/* BE03BC 8024162C 3C068024 */ lui $a2, %hi(D_80241CD0_BE0A60) -/* BE03C0 80241630 0C0B2026 */ jal set_variable -/* BE03C4 80241634 8CC61CD0 */ lw $a2, %lo(D_80241CD0_BE0A60)($a2) -/* BE03C8 80241638 24020002 */ addiu $v0, $zero, 2 -.L8024163C: -/* BE03CC 8024163C 8FBF0010 */ lw $ra, 0x10($sp) -/* BE03D0 80241640 03E00008 */ jr $ra -/* BE03D4 80241644 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241648_BE03D8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241648_BE03D8.s deleted file mode 100644 index 620384ac73..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_03/BDED90/func_80241648_BE03D8.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241648_BE03D8 -/* BE03D8 80241648 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BE03DC 8024164C AFBF0010 */ sw $ra, 0x10($sp) -/* BE03E0 80241650 8C82000C */ lw $v0, 0xc($a0) -/* BE03E4 80241654 0C0B1EAF */ jal get_variable -/* BE03E8 80241658 8C450000 */ lw $a1, ($v0) -/* BE03EC 8024165C 3C018024 */ lui $at, %hi(D_80241CD0_BE0A60) -/* BE03F0 80241660 AC221CD0 */ sw $v0, %lo(D_80241CD0_BE0A60)($at) -/* BE03F4 80241664 24020002 */ addiu $v0, $zero, 2 -/* BE03F8 80241668 8FBF0010 */ lw $ra, 0x10($sp) -/* BE03FC 8024166C 24030001 */ addiu $v1, $zero, 1 -/* BE0400 80241670 3C018024 */ lui $at, %hi(D_80241CCC_BE0A5C) -/* BE0404 80241674 AC231CCC */ sw $v1, %lo(D_80241CCC_BE0A5C)($at) -/* BE0408 80241678 03E00008 */ jr $ra -/* BE040C 8024167C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241040_BE47F0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80241040_BE47F0.s similarity index 99% rename from ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241040_BE47F0.s rename to ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80241040_BE47F0.s index f876267253..b0f1c9dec4 100644 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241040_BE47F0.s +++ b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80241040_BE47F0.s @@ -1,6 +1,14 @@ .set noat # allow manual use of $at .set noreorder # don't insert nops after branches +.section .rodata +glabel D_802442D8_BE7A88 +.double 0.09 +glabel D_802442E0_BE7A90 +.double 0.09 + +.section .text + glabel func_80241040_BE47F0 /* BE47F0 80241040 27BDFF80 */ addiu $sp, $sp, -0x80 /* BE47F4 80241044 AFB3004C */ sw $s3, 0x4c($sp) diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242388_BE5B38.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80242388_BE5B38.s similarity index 97% rename from ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242388_BE5B38.s rename to ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80242388_BE5B38.s index 11b29cd149..2a5d933082 100644 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242388_BE5B38.s +++ b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/arn_04_func_80242388_BE5B38.s @@ -1,6 +1,13 @@ .set noat # allow manual use of $at .set noreorder # don't insert nops after branches +.section .rodata +glabel D_80244328_BE7AD8 +.double 180.0 +glabel D_80244330_BE7AE0 +.double 75.0 + +.section .text glabel func_80242388_BE5B38 /* BE5B38 80242388 27BDFFD8 */ addiu $sp, $sp, -0x28 /* BE5B3C 8024238C AFBF001C */ sw $ra, 0x1c($sp) diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240000_BE37B0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240000_BE37B0.s deleted file mode 100644 index 8f7e1e186f..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240000_BE37B0.s +++ /dev/null @@ -1,95 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BE37B0 -/* BE37B0 80240000 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE37B4 80240004 AFB50024 */ sw $s5, 0x24($sp) -/* BE37B8 80240008 0080A82D */ daddu $s5, $a0, $zero -/* BE37BC 8024000C AFBF002C */ sw $ra, 0x2c($sp) -/* BE37C0 80240010 AFB60028 */ sw $s6, 0x28($sp) -/* BE37C4 80240014 AFB40020 */ sw $s4, 0x20($sp) -/* BE37C8 80240018 AFB3001C */ sw $s3, 0x1c($sp) -/* BE37CC 8024001C AFB20018 */ sw $s2, 0x18($sp) -/* BE37D0 80240020 AFB10014 */ sw $s1, 0x14($sp) -/* BE37D4 80240024 AFB00010 */ sw $s0, 0x10($sp) -/* BE37D8 80240028 F7B80040 */ sdc1 $f24, 0x40($sp) -/* BE37DC 8024002C F7B60038 */ sdc1 $f22, 0x38($sp) -/* BE37E0 80240030 F7B40030 */ sdc1 $f20, 0x30($sp) -/* BE37E4 80240034 8EB30148 */ lw $s3, 0x148($s5) -/* BE37E8 80240038 86640008 */ lh $a0, 8($s3) -/* BE37EC 8024003C 0C00EABB */ jal get_npc_unsafe -/* BE37F0 80240040 00A0B02D */ daddu $s6, $a1, $zero -/* BE37F4 80240044 0040A02D */ daddu $s4, $v0, $zero -/* BE37F8 80240048 AEA00074 */ sw $zero, 0x74($s5) -/* BE37FC 8024004C C6980038 */ lwc1 $f24, 0x38($s4) -/* BE3800 80240050 C6960040 */ lwc1 $f22, 0x40($s4) -/* BE3804 80240054 0000902D */ daddu $s2, $zero, $zero -/* BE3808 80240058 AEA00078 */ sw $zero, 0x78($s5) -/* BE380C 8024005C 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE3810 80240060 8C620000 */ lw $v0, ($v1) -/* BE3814 80240064 3C0146FF */ lui $at, 0x46ff -/* BE3818 80240068 3421FE00 */ ori $at, $at, 0xfe00 -/* BE381C 8024006C 4481A000 */ mtc1 $at, $f20 -/* BE3820 80240070 18400018 */ blez $v0, .L802400D4 -/* BE3824 80240074 0240802D */ daddu $s0, $s2, $zero -/* BE3828 80240078 0240882D */ daddu $s1, $s2, $zero -.L8024007C: -/* BE382C 8024007C 02231021 */ addu $v0, $s1, $v1 -/* BE3830 80240080 4600C306 */ mov.s $f12, $f24 -/* BE3834 80240084 C4440004 */ lwc1 $f4, 4($v0) -/* BE3838 80240088 46802120 */ cvt.s.w $f4, $f4 -/* BE383C 8024008C 44062000 */ mfc1 $a2, $f4 -/* BE3840 80240090 C444000C */ lwc1 $f4, 0xc($v0) -/* BE3844 80240094 46802120 */ cvt.s.w $f4, $f4 -/* BE3848 80240098 44072000 */ mfc1 $a3, $f4 -/* BE384C 8024009C 0C00A7B5 */ jal dist2D -/* BE3850 802400A0 4600B386 */ mov.s $f14, $f22 -/* BE3854 802400A4 4614003C */ c.lt.s $f0, $f20 -/* BE3858 802400A8 00000000 */ nop -/* BE385C 802400AC 45000003 */ bc1f .L802400BC -/* BE3860 802400B0 2631000C */ addiu $s1, $s1, 0xc -/* BE3864 802400B4 46000506 */ mov.s $f20, $f0 -/* BE3868 802400B8 AEB20078 */ sw $s2, 0x78($s5) -.L802400BC: -/* BE386C 802400BC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE3870 802400C0 26100001 */ addiu $s0, $s0, 1 -/* BE3874 802400C4 8C620000 */ lw $v0, ($v1) -/* BE3878 802400C8 0202102A */ slt $v0, $s0, $v0 -/* BE387C 802400CC 1440FFEB */ bnez $v0, .L8024007C -/* BE3880 802400D0 26520001 */ addiu $s2, $s2, 1 -.L802400D4: -/* BE3884 802400D4 8E6200CC */ lw $v0, 0xcc($s3) -/* BE3888 802400D8 8C420004 */ lw $v0, 4($v0) -/* BE388C 802400DC AE820028 */ sw $v0, 0x28($s4) -/* BE3890 802400E0 8E6200D0 */ lw $v0, 0xd0($s3) -/* BE3894 802400E4 8C42007C */ lw $v0, 0x7c($v0) -/* BE3898 802400E8 04410004 */ bgez $v0, .L802400FC -/* BE389C 802400EC 00000000 */ nop -/* BE38A0 802400F0 C6C00000 */ lwc1 $f0, ($s6) -/* BE38A4 802400F4 08090047 */ j .L8024011C -/* BE38A8 802400F8 E6800018 */ swc1 $f0, 0x18($s4) -.L802400FC: -/* BE38AC 802400FC 3C018024 */ lui $at, %hi(D_80244130_BE78E0) -/* BE38B0 80240100 D4224130 */ ldc1 $f2, %lo(D_80244130_BE78E0)($at) -/* BE38B4 80240104 44820000 */ mtc1 $v0, $f0 -/* BE38B8 80240108 00000000 */ nop -/* BE38BC 8024010C 46800021 */ cvt.d.w $f0, $f0 -/* BE38C0 80240110 46220003 */ div.d $f0, $f0, $f2 -/* BE38C4 80240114 46200020 */ cvt.s.d $f0, $f0 -/* BE38C8 80240118 E6800018 */ swc1 $f0, 0x18($s4) -.L8024011C: -/* BE38CC 8024011C 24020001 */ addiu $v0, $zero, 1 -/* BE38D0 80240120 AEA20070 */ sw $v0, 0x70($s5) -/* BE38D4 80240124 8FBF002C */ lw $ra, 0x2c($sp) -/* BE38D8 80240128 8FB60028 */ lw $s6, 0x28($sp) -/* BE38DC 8024012C 8FB50024 */ lw $s5, 0x24($sp) -/* BE38E0 80240130 8FB40020 */ lw $s4, 0x20($sp) -/* BE38E4 80240134 8FB3001C */ lw $s3, 0x1c($sp) -/* BE38E8 80240138 8FB20018 */ lw $s2, 0x18($sp) -/* BE38EC 8024013C 8FB10014 */ lw $s1, 0x14($sp) -/* BE38F0 80240140 8FB00010 */ lw $s0, 0x10($sp) -/* BE38F4 80240144 D7B80040 */ ldc1 $f24, 0x40($sp) -/* BE38F8 80240148 D7B60038 */ ldc1 $f22, 0x38($sp) -/* BE38FC 8024014C D7B40030 */ ldc1 $f20, 0x30($sp) -/* BE3900 80240150 03E00008 */ jr $ra -/* BE3904 80240154 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240158_BE3908.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240158_BE3908.s deleted file mode 100644 index 727f335eda..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240158_BE3908.s +++ /dev/null @@ -1,183 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240158_BE3908 -/* BE3908 80240158 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* BE390C 8024015C AFB20038 */ sw $s2, 0x38($sp) -/* BE3910 80240160 0080902D */ daddu $s2, $a0, $zero -/* BE3914 80240164 AFBF0044 */ sw $ra, 0x44($sp) -/* BE3918 80240168 AFB40040 */ sw $s4, 0x40($sp) -/* BE391C 8024016C AFB3003C */ sw $s3, 0x3c($sp) -/* BE3920 80240170 AFB10034 */ sw $s1, 0x34($sp) -/* BE3924 80240174 AFB00030 */ sw $s0, 0x30($sp) -/* BE3928 80240178 F7B60050 */ sdc1 $f22, 0x50($sp) -/* BE392C 8024017C F7B40048 */ sdc1 $f20, 0x48($sp) -/* BE3930 80240180 8E510148 */ lw $s1, 0x148($s2) -/* BE3934 80240184 00A0982D */ daddu $s3, $a1, $zero -/* BE3938 80240188 86240008 */ lh $a0, 8($s1) -/* BE393C 8024018C 0C00EABB */ jal get_npc_unsafe -/* BE3940 80240190 00C0A02D */ daddu $s4, $a2, $zero -/* BE3944 80240194 8E630014 */ lw $v1, 0x14($s3) -/* BE3948 80240198 04600030 */ bltz $v1, .L8024025C -/* BE394C 8024019C 0040802D */ daddu $s0, $v0, $zero -/* BE3950 802401A0 8E420074 */ lw $v0, 0x74($s2) -/* BE3954 802401A4 1C40002C */ bgtz $v0, .L80240258 -/* BE3958 802401A8 2442FFFF */ addiu $v0, $v0, -1 -/* BE395C 802401AC 0280202D */ daddu $a0, $s4, $zero -/* BE3960 802401B0 AE430074 */ sw $v1, 0x74($s2) -/* BE3964 802401B4 AFA00010 */ sw $zero, 0x10($sp) -/* BE3968 802401B8 8E66000C */ lw $a2, 0xc($s3) -/* BE396C 802401BC 8E670010 */ lw $a3, 0x10($s3) -/* BE3970 802401C0 0C01242D */ jal func_800490B4 -/* BE3974 802401C4 0220282D */ daddu $a1, $s1, $zero -/* BE3978 802401C8 10400021 */ beqz $v0, .L80240250 -/* BE397C 802401CC 0000202D */ daddu $a0, $zero, $zero -/* BE3980 802401D0 0200282D */ daddu $a1, $s0, $zero -/* BE3984 802401D4 0000302D */ daddu $a2, $zero, $zero -/* BE3988 802401D8 860300A8 */ lh $v1, 0xa8($s0) -/* BE398C 802401DC 3C013F80 */ lui $at, 0x3f80 -/* BE3990 802401E0 44810000 */ mtc1 $at, $f0 -/* BE3994 802401E4 3C014000 */ lui $at, 0x4000 -/* BE3998 802401E8 44811000 */ mtc1 $at, $f2 -/* BE399C 802401EC 3C01C1A0 */ lui $at, 0xc1a0 -/* BE39A0 802401F0 44812000 */ mtc1 $at, $f4 -/* BE39A4 802401F4 2402000F */ addiu $v0, $zero, 0xf -/* BE39A8 802401F8 AFA2001C */ sw $v0, 0x1c($sp) -/* BE39AC 802401FC 44833000 */ mtc1 $v1, $f6 -/* BE39B0 80240200 00000000 */ nop -/* BE39B4 80240204 468031A0 */ cvt.s.w $f6, $f6 -/* BE39B8 80240208 44073000 */ mfc1 $a3, $f6 -/* BE39BC 8024020C 27A20028 */ addiu $v0, $sp, 0x28 -/* BE39C0 80240210 AFA20020 */ sw $v0, 0x20($sp) -/* BE39C4 80240214 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE39C8 80240218 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE39CC 8024021C 0C01BFA4 */ jal fx_emote -/* BE39D0 80240220 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE39D4 80240224 0200202D */ daddu $a0, $s0, $zero -/* BE39D8 80240228 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE39DC 8024022C 0C012530 */ jal func_800494C0 -/* BE39E0 80240230 3C060020 */ lui $a2, 0x20 -/* BE39E4 80240234 8E220018 */ lw $v0, 0x18($s1) -/* BE39E8 80240238 9442002A */ lhu $v0, 0x2a($v0) -/* BE39EC 8024023C 30420001 */ andi $v0, $v0, 1 -/* BE39F0 80240240 14400064 */ bnez $v0, .L802403D4 -/* BE39F4 80240244 2402000A */ addiu $v0, $zero, 0xa -/* BE39F8 80240248 080900F5 */ j .L802403D4 -/* BE39FC 8024024C 2402000C */ addiu $v0, $zero, 0xc -.L80240250: -/* BE3A00 80240250 8E420074 */ lw $v0, 0x74($s2) -/* BE3A04 80240254 2442FFFF */ addiu $v0, $v0, -1 -.L80240258: -/* BE3A08 80240258 AE420074 */ sw $v0, 0x74($s2) -.L8024025C: -/* BE3A0C 8024025C 8602008C */ lh $v0, 0x8c($s0) -/* BE3A10 80240260 1440005D */ bnez $v0, .L802403D8 -/* BE3A14 80240264 00000000 */ nop -/* BE3A18 80240268 C6000018 */ lwc1 $f0, 0x18($s0) -/* BE3A1C 8024026C 3C014010 */ lui $at, 0x4010 -/* BE3A20 80240270 44811800 */ mtc1 $at, $f3 -/* BE3A24 80240274 44801000 */ mtc1 $zero, $f2 -/* BE3A28 80240278 46000021 */ cvt.d.s $f0, $f0 -/* BE3A2C 8024027C 4622003C */ c.lt.d $f0, $f2 -/* BE3A30 80240280 00000000 */ nop -/* BE3A34 80240284 45000003 */ bc1f .L80240294 -/* BE3A38 80240288 0200202D */ daddu $a0, $s0, $zero -/* BE3A3C 8024028C 080900A6 */ j .L80240298 -/* BE3A40 80240290 0000282D */ daddu $a1, $zero, $zero -.L80240294: -/* BE3A44 80240294 24050001 */ addiu $a1, $zero, 1 -.L80240298: -/* BE3A48 80240298 0C00F598 */ jal func_8003D660 -/* BE3A4C 8024029C 00000000 */ nop -/* BE3A50 802402A0 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE3A54 802402A4 8E430078 */ lw $v1, 0x78($s2) -/* BE3A58 802402A8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE3A5C 802402AC 00031040 */ sll $v0, $v1, 1 -/* BE3A60 802402B0 00431021 */ addu $v0, $v0, $v1 -/* BE3A64 802402B4 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE3A68 802402B8 00021080 */ sll $v0, $v0, 2 -/* BE3A6C 802402BC 00431021 */ addu $v0, $v0, $v1 -/* BE3A70 802402C0 C4560004 */ lwc1 $f22, 4($v0) -/* BE3A74 802402C4 4680B5A0 */ cvt.s.w $f22, $f22 -/* BE3A78 802402C8 C454000C */ lwc1 $f20, 0xc($v0) -/* BE3A7C 802402CC 4680A520 */ cvt.s.w $f20, $f20 -/* BE3A80 802402D0 4406B000 */ mfc1 $a2, $f22 -/* BE3A84 802402D4 4407A000 */ mfc1 $a3, $f20 -/* BE3A88 802402D8 0C00A720 */ jal atan2 -/* BE3A8C 802402DC 00000000 */ nop -/* BE3A90 802402E0 8E050018 */ lw $a1, 0x18($s0) -/* BE3A94 802402E4 44060000 */ mfc1 $a2, $f0 -/* BE3A98 802402E8 0200202D */ daddu $a0, $s0, $zero -/* BE3A9C 802402EC 0C00EA95 */ jal npc_move_heading -/* BE3AA0 802402F0 AE06000C */ sw $a2, 0xc($s0) -/* BE3AA4 802402F4 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE3AA8 802402F8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE3AAC 802402FC 4406B000 */ mfc1 $a2, $f22 -/* BE3AB0 80240300 4407A000 */ mfc1 $a3, $f20 -/* BE3AB4 80240304 0C00A7B5 */ jal dist2D -/* BE3AB8 80240308 00000000 */ nop -/* BE3ABC 8024030C C6020018 */ lwc1 $f2, 0x18($s0) -/* BE3AC0 80240310 4602003E */ c.le.s $f0, $f2 -/* BE3AC4 80240314 00000000 */ nop -/* BE3AC8 80240318 4500002F */ bc1f .L802403D8 -/* BE3ACC 8024031C 240403E8 */ addiu $a0, $zero, 0x3e8 -/* BE3AD0 80240320 24020002 */ addiu $v0, $zero, 2 -/* BE3AD4 80240324 0C00A67F */ jal rand_int -/* BE3AD8 80240328 AE420070 */ sw $v0, 0x70($s2) -/* BE3ADC 8024032C 3C035555 */ lui $v1, 0x5555 -/* BE3AE0 80240330 34635556 */ ori $v1, $v1, 0x5556 -/* BE3AE4 80240334 00430018 */ mult $v0, $v1 -/* BE3AE8 80240338 000227C3 */ sra $a0, $v0, 0x1f -/* BE3AEC 8024033C 00004010 */ mfhi $t0 -/* BE3AF0 80240340 01042023 */ subu $a0, $t0, $a0 -/* BE3AF4 80240344 00041840 */ sll $v1, $a0, 1 -/* BE3AF8 80240348 00641821 */ addu $v1, $v1, $a0 -/* BE3AFC 8024034C 00431023 */ subu $v0, $v0, $v1 -/* BE3B00 80240350 24430002 */ addiu $v1, $v0, 2 -/* BE3B04 80240354 AE430074 */ sw $v1, 0x74($s2) -/* BE3B08 80240358 8E62002C */ lw $v0, 0x2c($s3) -/* BE3B0C 8024035C 18400009 */ blez $v0, .L80240384 -/* BE3B10 80240360 24020004 */ addiu $v0, $zero, 4 -/* BE3B14 80240364 8E620004 */ lw $v0, 4($s3) -/* BE3B18 80240368 18400006 */ blez $v0, .L80240384 -/* BE3B1C 8024036C 24020004 */ addiu $v0, $zero, 4 -/* BE3B20 80240370 8E620008 */ lw $v0, 8($s3) -/* BE3B24 80240374 18400003 */ blez $v0, .L80240384 -/* BE3B28 80240378 24020004 */ addiu $v0, $zero, 4 -/* BE3B2C 8024037C 14600002 */ bnez $v1, .L80240388 -/* BE3B30 80240380 00000000 */ nop -.L80240384: -/* BE3B34 80240384 AE420070 */ sw $v0, 0x70($s2) -.L80240388: -/* BE3B38 80240388 0C00A67F */ jal rand_int -/* BE3B3C 8024038C 24042710 */ addiu $a0, $zero, 0x2710 -/* BE3B40 80240390 3C0351EB */ lui $v1, 0x51eb -/* BE3B44 80240394 3463851F */ ori $v1, $v1, 0x851f -/* BE3B48 80240398 00430018 */ mult $v0, $v1 -/* BE3B4C 8024039C 00021FC3 */ sra $v1, $v0, 0x1f -/* BE3B50 802403A0 00004010 */ mfhi $t0 -/* BE3B54 802403A4 00082143 */ sra $a0, $t0, 5 -/* BE3B58 802403A8 00832023 */ subu $a0, $a0, $v1 -/* BE3B5C 802403AC 00041840 */ sll $v1, $a0, 1 -/* BE3B60 802403B0 00641821 */ addu $v1, $v1, $a0 -/* BE3B64 802403B4 000318C0 */ sll $v1, $v1, 3 -/* BE3B68 802403B8 00641821 */ addu $v1, $v1, $a0 -/* BE3B6C 802403BC 00031880 */ sll $v1, $v1, 2 -/* BE3B70 802403C0 8E640004 */ lw $a0, 4($s3) -/* BE3B74 802403C4 00431023 */ subu $v0, $v0, $v1 -/* BE3B78 802403C8 0044102A */ slt $v0, $v0, $a0 -/* BE3B7C 802403CC 10400002 */ beqz $v0, .L802403D8 -/* BE3B80 802403D0 24020004 */ addiu $v0, $zero, 4 -.L802403D4: -/* BE3B84 802403D4 AE420070 */ sw $v0, 0x70($s2) -.L802403D8: -/* BE3B88 802403D8 8FBF0044 */ lw $ra, 0x44($sp) -/* BE3B8C 802403DC 8FB40040 */ lw $s4, 0x40($sp) -/* BE3B90 802403E0 8FB3003C */ lw $s3, 0x3c($sp) -/* BE3B94 802403E4 8FB20038 */ lw $s2, 0x38($sp) -/* BE3B98 802403E8 8FB10034 */ lw $s1, 0x34($sp) -/* BE3B9C 802403EC 8FB00030 */ lw $s0, 0x30($sp) -/* BE3BA0 802403F0 D7B60050 */ ldc1 $f22, 0x50($sp) -/* BE3BA4 802403F4 D7B40048 */ ldc1 $f20, 0x48($sp) -/* BE3BA8 802403F8 03E00008 */ jr $ra -/* BE3BAC 802403FC 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_802404C0_BE3C70.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_802404C0_BE3C70.s deleted file mode 100644 index 08d822f07a..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_802404C0_BE3C70.s +++ /dev/null @@ -1,120 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802404C0_BE3C70 -/* BE3C70 802404C0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE3C74 802404C4 AFB40040 */ sw $s4, 0x40($sp) -/* BE3C78 802404C8 0080A02D */ daddu $s4, $a0, $zero -/* BE3C7C 802404CC AFBF0044 */ sw $ra, 0x44($sp) -/* BE3C80 802404D0 AFB3003C */ sw $s3, 0x3c($sp) -/* BE3C84 802404D4 AFB20038 */ sw $s2, 0x38($sp) -/* BE3C88 802404D8 AFB10034 */ sw $s1, 0x34($sp) -/* BE3C8C 802404DC AFB00030 */ sw $s0, 0x30($sp) -/* BE3C90 802404E0 8E910148 */ lw $s1, 0x148($s4) -/* BE3C94 802404E4 00A0902D */ daddu $s2, $a1, $zero -/* BE3C98 802404E8 86240008 */ lh $a0, 8($s1) -/* BE3C9C 802404EC 0C00EABB */ jal get_npc_unsafe -/* BE3CA0 802404F0 00C0982D */ daddu $s3, $a2, $zero -/* BE3CA4 802404F4 8E430014 */ lw $v1, 0x14($s2) -/* BE3CA8 802404F8 04600031 */ bltz $v1, .L802405C0 -/* BE3CAC 802404FC 0040802D */ daddu $s0, $v0, $zero -/* BE3CB0 80240500 0260202D */ daddu $a0, $s3, $zero -/* BE3CB4 80240504 AFA00010 */ sw $zero, 0x10($sp) -/* BE3CB8 80240508 8E460024 */ lw $a2, 0x24($s2) -/* BE3CBC 8024050C 8E470028 */ lw $a3, 0x28($s2) -/* BE3CC0 80240510 0C01242D */ jal func_800490B4 -/* BE3CC4 80240514 0220282D */ daddu $a1, $s1, $zero -/* BE3CC8 80240518 10400029 */ beqz $v0, .L802405C0 -/* BE3CCC 8024051C 0000202D */ daddu $a0, $zero, $zero -/* BE3CD0 80240520 0200282D */ daddu $a1, $s0, $zero -/* BE3CD4 80240524 0000302D */ daddu $a2, $zero, $zero -/* BE3CD8 80240528 860300A8 */ lh $v1, 0xa8($s0) -/* BE3CDC 8024052C 3C013F80 */ lui $at, 0x3f80 -/* BE3CE0 80240530 44810000 */ mtc1 $at, $f0 -/* BE3CE4 80240534 3C014000 */ lui $at, 0x4000 -/* BE3CE8 80240538 44811000 */ mtc1 $at, $f2 -/* BE3CEC 8024053C 3C01C1A0 */ lui $at, 0xc1a0 -/* BE3CF0 80240540 44812000 */ mtc1 $at, $f4 -/* BE3CF4 80240544 2402000F */ addiu $v0, $zero, 0xf -/* BE3CF8 80240548 AFA2001C */ sw $v0, 0x1c($sp) -/* BE3CFC 8024054C 44833000 */ mtc1 $v1, $f6 -/* BE3D00 80240550 00000000 */ nop -/* BE3D04 80240554 468031A0 */ cvt.s.w $f6, $f6 -/* BE3D08 80240558 44073000 */ mfc1 $a3, $f6 -/* BE3D0C 8024055C 27A20028 */ addiu $v0, $sp, 0x28 -/* BE3D10 80240560 AFA20020 */ sw $v0, 0x20($sp) -/* BE3D14 80240564 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE3D18 80240568 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE3D1C 8024056C 0C01BFA4 */ jal fx_emote -/* BE3D20 80240570 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE3D24 80240574 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE3D28 80240578 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE3D2C 8024057C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE3D30 80240580 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE3D34 80240584 8C460028 */ lw $a2, 0x28($v0) -/* BE3D38 80240588 0C00A720 */ jal atan2 -/* BE3D3C 8024058C 8C470030 */ lw $a3, 0x30($v0) -/* BE3D40 80240590 0200202D */ daddu $a0, $s0, $zero -/* BE3D44 80240594 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE3D48 80240598 3C060020 */ lui $a2, 0x20 -/* BE3D4C 8024059C 0C012530 */ jal func_800494C0 -/* BE3D50 802405A0 E480000C */ swc1 $f0, 0xc($a0) -/* BE3D54 802405A4 8E220018 */ lw $v0, 0x18($s1) -/* BE3D58 802405A8 9442002A */ lhu $v0, 0x2a($v0) -/* BE3D5C 802405AC 30420001 */ andi $v0, $v0, 1 -/* BE3D60 802405B0 14400029 */ bnez $v0, .L80240658 -/* BE3D64 802405B4 2402000A */ addiu $v0, $zero, 0xa -/* BE3D68 802405B8 08090196 */ j .L80240658 -/* BE3D6C 802405BC 2402000C */ addiu $v0, $zero, 0xc -.L802405C0: -/* BE3D70 802405C0 8602008C */ lh $v0, 0x8c($s0) -/* BE3D74 802405C4 14400025 */ bnez $v0, .L8024065C -/* BE3D78 802405C8 00000000 */ nop -/* BE3D7C 802405CC 9602008E */ lhu $v0, 0x8e($s0) -/* BE3D80 802405D0 2442FFFF */ addiu $v0, $v0, -1 -/* BE3D84 802405D4 A602008E */ sh $v0, 0x8e($s0) -/* BE3D88 802405D8 00021400 */ sll $v0, $v0, 0x10 -/* BE3D8C 802405DC 1440001F */ bnez $v0, .L8024065C -/* BE3D90 802405E0 00000000 */ nop -/* BE3D94 802405E4 8E820074 */ lw $v0, 0x74($s4) -/* BE3D98 802405E8 2442FFFF */ addiu $v0, $v0, -1 -/* BE3D9C 802405EC 10400019 */ beqz $v0, .L80240654 -/* BE3DA0 802405F0 AE820074 */ sw $v0, 0x74($s4) -/* BE3DA4 802405F4 8E220018 */ lw $v0, 0x18($s1) -/* BE3DA8 802405F8 9442002A */ lhu $v0, 0x2a($v0) -/* BE3DAC 802405FC 30420010 */ andi $v0, $v0, 0x10 -/* BE3DB0 80240600 14400007 */ bnez $v0, .L80240620 -/* BE3DB4 80240604 00000000 */ nop -/* BE3DB8 80240608 C600000C */ lwc1 $f0, 0xc($s0) -/* BE3DBC 8024060C 3C014334 */ lui $at, 0x4334 -/* BE3DC0 80240610 44816000 */ mtc1 $at, $f12 -/* BE3DC4 80240614 0C00A6C9 */ jal clamp_angle -/* BE3DC8 80240618 460C0300 */ add.s $f12, $f0, $f12 -/* BE3DCC 8024061C E600000C */ swc1 $f0, 0xc($s0) -.L80240620: -/* BE3DD0 80240620 8E440008 */ lw $a0, 8($s2) -/* BE3DD4 80240624 000417C2 */ srl $v0, $a0, 0x1f -/* BE3DD8 80240628 00822021 */ addu $a0, $a0, $v0 -/* BE3DDC 8024062C 00042043 */ sra $a0, $a0, 1 -/* BE3DE0 80240630 0C00A67F */ jal rand_int -/* BE3DE4 80240634 24840001 */ addiu $a0, $a0, 1 -/* BE3DE8 80240638 8E430008 */ lw $v1, 8($s2) -/* BE3DEC 8024063C 000327C2 */ srl $a0, $v1, 0x1f -/* BE3DF0 80240640 00641821 */ addu $v1, $v1, $a0 -/* BE3DF4 80240644 00031843 */ sra $v1, $v1, 1 -/* BE3DF8 80240648 00621821 */ addu $v1, $v1, $v0 -/* BE3DFC 8024064C 08090197 */ j .L8024065C -/* BE3E00 80240650 A603008E */ sh $v1, 0x8e($s0) -.L80240654: -/* BE3E04 80240654 24020004 */ addiu $v0, $zero, 4 -.L80240658: -/* BE3E08 80240658 AE820070 */ sw $v0, 0x70($s4) -.L8024065C: -/* BE3E0C 8024065C 8FBF0044 */ lw $ra, 0x44($sp) -/* BE3E10 80240660 8FB40040 */ lw $s4, 0x40($sp) -/* BE3E14 80240664 8FB3003C */ lw $s3, 0x3c($sp) -/* BE3E18 80240668 8FB20038 */ lw $s2, 0x38($sp) -/* BE3E1C 8024066C 8FB10034 */ lw $s1, 0x34($sp) -/* BE3E20 80240670 8FB00030 */ lw $s0, 0x30($sp) -/* BE3E24 80240674 03E00008 */ jr $ra -/* BE3E28 80240678 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024067C_BE3E2C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024067C_BE3E2C.s deleted file mode 100644 index d21fb835da..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024067C_BE3E2C.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024067C_BE3E2C -/* BE3E2C 8024067C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE3E30 80240680 AFB10014 */ sw $s1, 0x14($sp) -/* BE3E34 80240684 0080882D */ daddu $s1, $a0, $zero -/* BE3E38 80240688 AFBF001C */ sw $ra, 0x1c($sp) -/* BE3E3C 8024068C AFB20018 */ sw $s2, 0x18($sp) -/* BE3E40 80240690 AFB00010 */ sw $s0, 0x10($sp) -/* BE3E44 80240694 8E300148 */ lw $s0, 0x148($s1) -/* BE3E48 80240698 86040008 */ lh $a0, 8($s0) -/* BE3E4C 8024069C 0C00EABB */ jal get_npc_unsafe -/* BE3E50 802406A0 00A0902D */ daddu $s2, $a1, $zero -/* BE3E54 802406A4 8E230078 */ lw $v1, 0x78($s1) -/* BE3E58 802406A8 24630001 */ addiu $v1, $v1, 1 -/* BE3E5C 802406AC AE230078 */ sw $v1, 0x78($s1) -/* BE3E60 802406B0 8E0400D0 */ lw $a0, 0xd0($s0) -/* BE3E64 802406B4 8C840000 */ lw $a0, ($a0) -/* BE3E68 802406B8 0064182A */ slt $v1, $v1, $a0 -/* BE3E6C 802406BC 14600002 */ bnez $v1, .L802406C8 -/* BE3E70 802406C0 0040282D */ daddu $a1, $v0, $zero -/* BE3E74 802406C4 AE200078 */ sw $zero, 0x78($s1) -.L802406C8: -/* BE3E78 802406C8 8E0200CC */ lw $v0, 0xcc($s0) -/* BE3E7C 802406CC 8C420004 */ lw $v0, 4($v0) -/* BE3E80 802406D0 ACA20028 */ sw $v0, 0x28($a1) -/* BE3E84 802406D4 8E0200D0 */ lw $v0, 0xd0($s0) -/* BE3E88 802406D8 8C42007C */ lw $v0, 0x7c($v0) -/* BE3E8C 802406DC 04410004 */ bgez $v0, .L802406F0 -/* BE3E90 802406E0 00000000 */ nop -/* BE3E94 802406E4 C6400000 */ lwc1 $f0, ($s2) -/* BE3E98 802406E8 080901C4 */ j .L80240710 -/* BE3E9C 802406EC E4A00018 */ swc1 $f0, 0x18($a1) -.L802406F0: -/* BE3EA0 802406F0 3C018024 */ lui $at, %hi(D_80244138_BE78E8) -/* BE3EA4 802406F4 D4224138 */ ldc1 $f2, %lo(D_80244138_BE78E8)($at) -/* BE3EA8 802406F8 44820000 */ mtc1 $v0, $f0 -/* BE3EAC 802406FC 00000000 */ nop -/* BE3EB0 80240700 46800021 */ cvt.d.w $f0, $f0 -/* BE3EB4 80240704 46220003 */ div.d $f0, $f0, $f2 -/* BE3EB8 80240708 46200020 */ cvt.s.d $f0, $f0 -/* BE3EBC 8024070C E4A00018 */ swc1 $f0, 0x18($a1) -.L80240710: -/* BE3EC0 80240710 24020001 */ addiu $v0, $zero, 1 -/* BE3EC4 80240714 AE220070 */ sw $v0, 0x70($s1) -/* BE3EC8 80240718 8FBF001C */ lw $ra, 0x1c($sp) -/* BE3ECC 8024071C 8FB20018 */ lw $s2, 0x18($sp) -/* BE3ED0 80240720 8FB10014 */ lw $s1, 0x14($sp) -/* BE3ED4 80240724 8FB00010 */ lw $s0, 0x10($sp) -/* BE3ED8 80240728 03E00008 */ jr $ra -/* BE3EDC 8024072C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024094C_BE40FC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024094C_BE40FC.s deleted file mode 100644 index 44c49a0e32..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024094C_BE40FC.s +++ /dev/null @@ -1,80 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024094C_BE40FC -/* BE40FC 8024094C 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE4100 80240950 AFB3003C */ sw $s3, 0x3c($sp) -/* BE4104 80240954 0080982D */ daddu $s3, $a0, $zero -/* BE4108 80240958 AFBF0040 */ sw $ra, 0x40($sp) -/* BE410C 8024095C AFB20038 */ sw $s2, 0x38($sp) -/* BE4110 80240960 AFB10034 */ sw $s1, 0x34($sp) -/* BE4114 80240964 AFB00030 */ sw $s0, 0x30($sp) -/* BE4118 80240968 8E720148 */ lw $s2, 0x148($s3) -/* BE411C 8024096C 00A0882D */ daddu $s1, $a1, $zero -/* BE4120 80240970 86440008 */ lh $a0, 8($s2) -/* BE4124 80240974 0C00EABB */ jal get_npc_unsafe -/* BE4128 80240978 00C0802D */ daddu $s0, $a2, $zero -/* BE412C 8024097C 0200202D */ daddu $a0, $s0, $zero -/* BE4130 80240980 0240282D */ daddu $a1, $s2, $zero -/* BE4134 80240984 24030001 */ addiu $v1, $zero, 1 -/* BE4138 80240988 AFA30010 */ sw $v1, 0x10($sp) -/* BE413C 8024098C 8E260024 */ lw $a2, 0x24($s1) -/* BE4140 80240990 8E270028 */ lw $a3, 0x28($s1) -/* BE4144 80240994 0C01242D */ jal func_800490B4 -/* BE4148 80240998 0040802D */ daddu $s0, $v0, $zero -/* BE414C 8024099C 1440001E */ bnez $v0, .L80240A18 -/* BE4150 802409A0 0200202D */ daddu $a0, $s0, $zero -/* BE4154 802409A4 24040002 */ addiu $a0, $zero, 2 -/* BE4158 802409A8 0200282D */ daddu $a1, $s0, $zero -/* BE415C 802409AC 0000302D */ daddu $a2, $zero, $zero -/* BE4160 802409B0 860300A8 */ lh $v1, 0xa8($s0) -/* BE4164 802409B4 3C013F80 */ lui $at, 0x3f80 -/* BE4168 802409B8 44810000 */ mtc1 $at, $f0 -/* BE416C 802409BC 3C014000 */ lui $at, 0x4000 -/* BE4170 802409C0 44811000 */ mtc1 $at, $f2 -/* BE4174 802409C4 3C01C1A0 */ lui $at, 0xc1a0 -/* BE4178 802409C8 44812000 */ mtc1 $at, $f4 -/* BE417C 802409CC 2402000F */ addiu $v0, $zero, 0xf -/* BE4180 802409D0 AFA2001C */ sw $v0, 0x1c($sp) -/* BE4184 802409D4 44833000 */ mtc1 $v1, $f6 -/* BE4188 802409D8 00000000 */ nop -/* BE418C 802409DC 468031A0 */ cvt.s.w $f6, $f6 -/* BE4190 802409E0 44073000 */ mfc1 $a3, $f6 -/* BE4194 802409E4 27A20028 */ addiu $v0, $sp, 0x28 -/* BE4198 802409E8 AFA20020 */ sw $v0, 0x20($sp) -/* BE419C 802409EC E7A00010 */ swc1 $f0, 0x10($sp) -/* BE41A0 802409F0 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE41A4 802409F4 0C01BFA4 */ jal fx_emote -/* BE41A8 802409F8 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE41AC 802409FC 8E4200CC */ lw $v0, 0xcc($s2) -/* BE41B0 80240A00 8C430000 */ lw $v1, ($v0) -/* BE41B4 80240A04 24020019 */ addiu $v0, $zero, 0x19 -/* BE41B8 80240A08 A602008E */ sh $v0, 0x8e($s0) -/* BE41BC 80240A0C 2402000E */ addiu $v0, $zero, 0xe -/* BE41C0 80240A10 08090293 */ j .L80240A4C -/* BE41C4 80240A14 AE030028 */ sw $v1, 0x28($s0) -.L80240A18: -/* BE41C8 80240A18 0C00F598 */ jal func_8003D660 -/* BE41CC 80240A1C 24050001 */ addiu $a1, $zero, 1 -/* BE41D0 80240A20 8E050018 */ lw $a1, 0x18($s0) -/* BE41D4 80240A24 8E06000C */ lw $a2, 0xc($s0) -/* BE41D8 80240A28 0C00EA95 */ jal npc_move_heading -/* BE41DC 80240A2C 0200202D */ daddu $a0, $s0, $zero -/* BE41E0 80240A30 8602008E */ lh $v0, 0x8e($s0) -/* BE41E4 80240A34 9603008E */ lhu $v1, 0x8e($s0) -/* BE41E8 80240A38 18400003 */ blez $v0, .L80240A48 -/* BE41EC 80240A3C 2462FFFF */ addiu $v0, $v1, -1 -/* BE41F0 80240A40 08090294 */ j .L80240A50 -/* BE41F4 80240A44 A602008E */ sh $v0, 0x8e($s0) -.L80240A48: -/* BE41F8 80240A48 2402000C */ addiu $v0, $zero, 0xc -.L80240A4C: -/* BE41FC 80240A4C AE620070 */ sw $v0, 0x70($s3) -.L80240A50: -/* BE4200 80240A50 8FBF0040 */ lw $ra, 0x40($sp) -/* BE4204 80240A54 8FB3003C */ lw $s3, 0x3c($sp) -/* BE4208 80240A58 8FB20038 */ lw $s2, 0x38($sp) -/* BE420C 80240A5C 8FB10034 */ lw $s1, 0x34($sp) -/* BE4210 80240A60 8FB00030 */ lw $s0, 0x30($sp) -/* BE4214 80240A64 03E00008 */ jr $ra -/* BE4218 80240A68 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240AD4_BE4284.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240AD4_BE4284.s deleted file mode 100644 index 11b1781a9e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240AD4_BE4284.s +++ /dev/null @@ -1,55 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240AD4_BE4284 -/* BE4284 80240AD4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE4288 80240AD8 AFB10014 */ sw $s1, 0x14($sp) -/* BE428C 80240ADC 0080882D */ daddu $s1, $a0, $zero -/* BE4290 80240AE0 AFBF001C */ sw $ra, 0x1c($sp) -/* BE4294 80240AE4 AFB20018 */ sw $s2, 0x18($sp) -/* BE4298 80240AE8 AFB00010 */ sw $s0, 0x10($sp) -/* BE429C 80240AEC 8E300148 */ lw $s0, 0x148($s1) -/* BE42A0 80240AF0 86040008 */ lh $a0, 8($s0) -/* BE42A4 80240AF4 0C00EABB */ jal get_npc_unsafe -/* BE42A8 80240AF8 00A0902D */ daddu $s2, $a1, $zero -/* BE42AC 80240AFC 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE42B0 80240B00 8E240078 */ lw $a0, 0x78($s1) -/* BE42B4 80240B04 8C630000 */ lw $v1, ($v1) -/* BE42B8 80240B08 0083182A */ slt $v1, $a0, $v1 -/* BE42BC 80240B0C 10600013 */ beqz $v1, .L80240B5C -/* BE42C0 80240B10 0040302D */ daddu $a2, $v0, $zero -/* BE42C4 80240B14 00041040 */ sll $v0, $a0, 1 -/* BE42C8 80240B18 00441021 */ addu $v0, $v0, $a0 -/* BE42CC 80240B1C 00022880 */ sll $a1, $v0, 2 -.L80240B20: -/* BE42D0 80240B20 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE42D4 80240B24 C4C2003C */ lwc1 $f2, 0x3c($a2) -/* BE42D8 80240B28 00A31021 */ addu $v0, $a1, $v1 -/* BE42DC 80240B2C C4400008 */ lwc1 $f0, 8($v0) -/* BE42E0 80240B30 46800020 */ cvt.s.w $f0, $f0 -/* BE42E4 80240B34 4602003E */ c.le.s $f0, $f2 -/* BE42E8 80240B38 00000000 */ nop -/* BE42EC 80240B3C 45020003 */ bc1fl .L80240B4C -/* BE42F0 80240B40 24840001 */ addiu $a0, $a0, 1 -/* BE42F4 80240B44 080902D7 */ j .L80240B5C -/* BE42F8 80240B48 AE240078 */ sw $a0, 0x78($s1) -.L80240B4C: -/* BE42FC 80240B4C 8C620000 */ lw $v0, ($v1) -/* BE4300 80240B50 0082102A */ slt $v0, $a0, $v0 -/* BE4304 80240B54 1440FFF2 */ bnez $v0, .L80240B20 -/* BE4308 80240B58 24A5000C */ addiu $a1, $a1, 0xc -.L80240B5C: -/* BE430C 80240B5C C6400000 */ lwc1 $f0, ($s2) -/* BE4310 80240B60 E4C00018 */ swc1 $f0, 0x18($a2) -/* BE4314 80240B64 8E0200CC */ lw $v0, 0xcc($s0) -/* BE4318 80240B68 8C420004 */ lw $v0, 4($v0) -/* BE431C 80240B6C ACC20028 */ sw $v0, 0x28($a2) -/* BE4320 80240B70 24020001 */ addiu $v0, $zero, 1 -/* BE4324 80240B74 AE200074 */ sw $zero, 0x74($s1) -/* BE4328 80240B78 AE220070 */ sw $v0, 0x70($s1) -/* BE432C 80240B7C 8FBF001C */ lw $ra, 0x1c($sp) -/* BE4330 80240B80 8FB20018 */ lw $s2, 0x18($sp) -/* BE4334 80240B84 8FB10014 */ lw $s1, 0x14($sp) -/* BE4338 80240B88 8FB00010 */ lw $s0, 0x10($sp) -/* BE433C 80240B8C 03E00008 */ jr $ra -/* BE4340 80240B90 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240B94_BE4344.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240B94_BE4344.s deleted file mode 100644 index e38d5117a3..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240B94_BE4344.s +++ /dev/null @@ -1,214 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240B94_BE4344 -/* BE4344 80240B94 27BDFF98 */ addiu $sp, $sp, -0x68 -/* BE4348 80240B98 AFB40058 */ sw $s4, 0x58($sp) -/* BE434C 80240B9C 0080A02D */ daddu $s4, $a0, $zero -/* BE4350 80240BA0 AFBF0060 */ sw $ra, 0x60($sp) -/* BE4354 80240BA4 AFB5005C */ sw $s5, 0x5c($sp) -/* BE4358 80240BA8 AFB30054 */ sw $s3, 0x54($sp) -/* BE435C 80240BAC AFB20050 */ sw $s2, 0x50($sp) -/* BE4360 80240BB0 AFB1004C */ sw $s1, 0x4c($sp) -/* BE4364 80240BB4 AFB00048 */ sw $s0, 0x48($sp) -/* BE4368 80240BB8 8E910148 */ lw $s1, 0x148($s4) -/* BE436C 80240BBC 86240008 */ lh $a0, 8($s1) -/* BE4370 80240BC0 0C00EABB */ jal get_npc_unsafe -/* BE4374 80240BC4 00A0802D */ daddu $s0, $a1, $zero -/* BE4378 80240BC8 8E83000C */ lw $v1, 0xc($s4) -/* BE437C 80240BCC 0280202D */ daddu $a0, $s4, $zero -/* BE4380 80240BD0 8C650000 */ lw $a1, ($v1) -/* BE4384 80240BD4 0C0B1EAF */ jal get_variable -/* BE4388 80240BD8 0040902D */ daddu $s2, $v0, $zero -/* BE438C 80240BDC AFA00018 */ sw $zero, 0x18($sp) -/* BE4390 80240BE0 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE4394 80240BE4 8C630094 */ lw $v1, 0x94($v1) -/* BE4398 80240BE8 AFA3001C */ sw $v1, 0x1c($sp) -/* BE439C 80240BEC 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE43A0 80240BF0 8C630080 */ lw $v1, 0x80($v1) -/* BE43A4 80240BF4 AFA30020 */ sw $v1, 0x20($sp) -/* BE43A8 80240BF8 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE43AC 80240BFC 8C630088 */ lw $v1, 0x88($v1) -/* BE43B0 80240C00 AFA30024 */ sw $v1, 0x24($sp) -/* BE43B4 80240C04 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE43B8 80240C08 8C63008C */ lw $v1, 0x8c($v1) -/* BE43BC 80240C0C 27B50018 */ addiu $s5, $sp, 0x18 -/* BE43C0 80240C10 AFA30028 */ sw $v1, 0x28($sp) -/* BE43C4 80240C14 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE43C8 80240C18 3C014282 */ lui $at, 0x4282 -/* BE43CC 80240C1C 44810000 */ mtc1 $at, $f0 -/* BE43D0 80240C20 8C630090 */ lw $v1, 0x90($v1) -/* BE43D4 80240C24 0040982D */ daddu $s3, $v0, $zero -/* BE43D8 80240C28 E7A00030 */ swc1 $f0, 0x30($sp) -/* BE43DC 80240C2C A7A00034 */ sh $zero, 0x34($sp) -/* BE43E0 80240C30 16000005 */ bnez $s0, .L80240C48 -/* BE43E4 80240C34 AFA3002C */ sw $v1, 0x2c($sp) -/* BE43E8 80240C38 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE43EC 80240C3C 30420004 */ andi $v0, $v0, 4 -/* BE43F0 80240C40 10400044 */ beqz $v0, .L80240D54 -/* BE43F4 80240C44 00000000 */ nop -.L80240C48: -/* BE43F8 80240C48 2404F7FF */ addiu $a0, $zero, -0x801 -/* BE43FC 80240C4C AE800070 */ sw $zero, 0x70($s4) -/* BE4400 80240C50 A640008E */ sh $zero, 0x8e($s2) -/* BE4404 80240C54 8E2200CC */ lw $v0, 0xcc($s1) -/* BE4408 80240C58 8E430000 */ lw $v1, ($s2) -/* BE440C 80240C5C 8C420000 */ lw $v0, ($v0) -/* BE4410 80240C60 00641824 */ and $v1, $v1, $a0 -/* BE4414 80240C64 AE430000 */ sw $v1, ($s2) -/* BE4418 80240C68 AE420028 */ sw $v0, 0x28($s2) -/* BE441C 80240C6C 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE4420 80240C70 8C420098 */ lw $v0, 0x98($v0) -/* BE4424 80240C74 54400005 */ bnel $v0, $zero, .L80240C8C -/* BE4428 80240C78 2402FDFF */ addiu $v0, $zero, -0x201 -/* BE442C 80240C7C 34620200 */ ori $v0, $v1, 0x200 -/* BE4430 80240C80 2403FFF7 */ addiu $v1, $zero, -9 -/* BE4434 80240C84 08090325 */ j .L80240C94 -/* BE4438 80240C88 00431024 */ and $v0, $v0, $v1 -.L80240C8C: -/* BE443C 80240C8C 00621024 */ and $v0, $v1, $v0 -/* BE4440 80240C90 34420008 */ ori $v0, $v0, 8 -.L80240C94: -/* BE4444 80240C94 AE420000 */ sw $v0, ($s2) -/* BE4448 80240C98 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE444C 80240C9C 30420004 */ andi $v0, $v0, 4 -/* BE4450 80240CA0 10400008 */ beqz $v0, .L80240CC4 -/* BE4454 80240CA4 24020063 */ addiu $v0, $zero, 0x63 -/* BE4458 80240CA8 AE820070 */ sw $v0, 0x70($s4) -/* BE445C 80240CAC AE800074 */ sw $zero, 0x74($s4) -/* BE4460 80240CB0 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE4464 80240CB4 2403FFFB */ addiu $v1, $zero, -5 -/* BE4468 80240CB8 00431024 */ and $v0, $v0, $v1 -/* BE446C 80240CBC 0809033C */ j .L80240CF0 -/* BE4470 80240CC0 AE2200B0 */ sw $v0, 0xb0($s1) -.L80240CC4: -/* BE4474 80240CC4 8E220000 */ lw $v0, ($s1) -/* BE4478 80240CC8 3C034000 */ lui $v1, 0x4000 -/* BE447C 80240CCC 00431024 */ and $v0, $v0, $v1 -/* BE4480 80240CD0 10400007 */ beqz $v0, .L80240CF0 -/* BE4484 80240CD4 3C03BFFF */ lui $v1, 0xbfff -/* BE4488 80240CD8 2402000C */ addiu $v0, $zero, 0xc -/* BE448C 80240CDC AE820070 */ sw $v0, 0x70($s4) -/* BE4490 80240CE0 8E220000 */ lw $v0, ($s1) -/* BE4494 80240CE4 3463FFFF */ ori $v1, $v1, 0xffff -/* BE4498 80240CE8 00431024 */ and $v0, $v0, $v1 -/* BE449C 80240CEC AE220000 */ sw $v0, ($s1) -.L80240CF0: -/* BE44A0 80240CF0 27A50038 */ addiu $a1, $sp, 0x38 -/* BE44A4 80240CF4 27A6003C */ addiu $a2, $sp, 0x3c -/* BE44A8 80240CF8 C6400038 */ lwc1 $f0, 0x38($s2) -/* BE44AC 80240CFC 864200A8 */ lh $v0, 0xa8($s2) -/* BE44B0 80240D00 3C0142C8 */ lui $at, 0x42c8 -/* BE44B4 80240D04 44812000 */ mtc1 $at, $f4 -/* BE44B8 80240D08 44823000 */ mtc1 $v0, $f6 -/* BE44BC 80240D0C 00000000 */ nop -/* BE44C0 80240D10 468031A0 */ cvt.s.w $f6, $f6 -/* BE44C4 80240D14 27A20044 */ addiu $v0, $sp, 0x44 -/* BE44C8 80240D18 E7A00038 */ swc1 $f0, 0x38($sp) -/* BE44CC 80240D1C C640003C */ lwc1 $f0, 0x3c($s2) -/* BE44D0 80240D20 C6420040 */ lwc1 $f2, 0x40($s2) -/* BE44D4 80240D24 46060000 */ add.s $f0, $f0, $f6 -/* BE44D8 80240D28 E7A40044 */ swc1 $f4, 0x44($sp) -/* BE44DC 80240D2C E7A20040 */ swc1 $f2, 0x40($sp) -/* BE44E0 80240D30 E7A0003C */ swc1 $f0, 0x3c($sp) -/* BE44E4 80240D34 AFA20010 */ sw $v0, 0x10($sp) -/* BE44E8 80240D38 8E440080 */ lw $a0, 0x80($s2) -/* BE44EC 80240D3C 0C0372DF */ jal func_800DCB7C -/* BE44F0 80240D40 27A70040 */ addiu $a3, $sp, 0x40 -/* BE44F4 80240D44 10400003 */ beqz $v0, .L80240D54 -/* BE44F8 80240D48 00000000 */ nop -/* BE44FC 80240D4C C7A0003C */ lwc1 $f0, 0x3c($sp) -/* BE4500 80240D50 E640003C */ swc1 $f0, 0x3c($s2) -.L80240D54: -/* BE4504 80240D54 8E830070 */ lw $v1, 0x70($s4) -/* BE4508 80240D58 2C620064 */ sltiu $v0, $v1, 0x64 -/* BE450C 80240D5C 10400042 */ beqz $v0, L80240E68_BE4618 -/* BE4510 80240D60 00031080 */ sll $v0, $v1, 2 -/* BE4514 80240D64 3C018024 */ lui $at, %hi(jtbl_80244140_BE78F0) -/* BE4518 80240D68 00220821 */ addu $at, $at, $v0 -/* BE451C 80240D6C 8C224140 */ lw $v0, %lo(jtbl_80244140_BE78F0)($at) -/* BE4520 80240D70 00400008 */ jr $v0 -/* BE4524 80240D74 00000000 */ nop -glabel L80240D78_BE4528 -/* BE4528 80240D78 0280202D */ daddu $a0, $s4, $zero -/* BE452C 80240D7C 0260282D */ daddu $a1, $s3, $zero -/* BE4530 80240D80 0C090000 */ jal func_80240000_BE37B0 -/* BE4534 80240D84 02A0302D */ daddu $a2, $s5, $zero -glabel L80240D88_BE4538 -/* BE4538 80240D88 0280202D */ daddu $a0, $s4, $zero -/* BE453C 80240D8C 0260282D */ daddu $a1, $s3, $zero -/* BE4540 80240D90 0C090056 */ jal func_80240158_BE3908 -/* BE4544 80240D94 02A0302D */ daddu $a2, $s5, $zero -/* BE4548 80240D98 0809039A */ j L80240E68_BE4618 -/* BE454C 80240D9C 00000000 */ nop -glabel L80240DA0_BE4550 -/* BE4550 80240DA0 0280202D */ daddu $a0, $s4, $zero -/* BE4554 80240DA4 0260282D */ daddu $a1, $s3, $zero -/* BE4558 80240DA8 0C090100 */ jal arn_04_UnkNpcAIFunc1 -/* BE455C 80240DAC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DB0_BE4560 -/* BE4560 80240DB0 0280202D */ daddu $a0, $s4, $zero -/* BE4564 80240DB4 0260282D */ daddu $a1, $s3, $zero -/* BE4568 80240DB8 0C090130 */ jal func_802404C0_BE3C70 -/* BE456C 80240DBC 02A0302D */ daddu $a2, $s5, $zero -/* BE4570 80240DC0 0809039A */ j L80240E68_BE4618 -/* BE4574 80240DC4 00000000 */ nop -glabel L80240DC8_BE4578 -/* BE4578 80240DC8 0280202D */ daddu $a0, $s4, $zero -/* BE457C 80240DCC 0260282D */ daddu $a1, $s3, $zero -/* BE4580 80240DD0 0C09019F */ jal func_8024067C_BE3E2C -/* BE4584 80240DD4 02A0302D */ daddu $a2, $s5, $zero -/* BE4588 80240DD8 0809039A */ j L80240E68_BE4618 -/* BE458C 80240DDC 00000000 */ nop -glabel L80240DE0_BE4590 -/* BE4590 80240DE0 0280202D */ daddu $a0, $s4, $zero -/* BE4594 80240DE4 0260282D */ daddu $a1, $s3, $zero -/* BE4598 80240DE8 0C0901CC */ jal arn_04_NpcJumpFunc2 -/* BE459C 80240DEC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DF0_BE45A0 -/* BE45A0 80240DF0 0280202D */ daddu $a0, $s4, $zero -/* BE45A4 80240DF4 0260282D */ daddu $a1, $s3, $zero -/* BE45A8 80240DF8 0C0901E9 */ jal arn_04_NpcJumpFunc -/* BE45AC 80240DFC 02A0302D */ daddu $a2, $s5, $zero -/* BE45B0 80240E00 0809039A */ j L80240E68_BE4618 -/* BE45B4 80240E04 00000000 */ nop -glabel L80240E08_BE45B8 -/* BE45B8 80240E08 0280202D */ daddu $a0, $s4, $zero -/* BE45BC 80240E0C 0260282D */ daddu $a1, $s3, $zero -/* BE45C0 80240E10 0C090207 */ jal arn_04_UnkNpcAIFunc13 -/* BE45C4 80240E14 02A0302D */ daddu $a2, $s5, $zero -glabel L80240E18_BE45C8 -/* BE45C8 80240E18 0280202D */ daddu $a0, $s4, $zero -/* BE45CC 80240E1C 0260282D */ daddu $a1, $s3, $zero -/* BE45D0 80240E20 0C090253 */ jal func_8024094C_BE40FC -/* BE45D4 80240E24 02A0302D */ daddu $a2, $s5, $zero -/* BE45D8 80240E28 0809039A */ j L80240E68_BE4618 -/* BE45DC 80240E2C 00000000 */ nop -glabel L80240E30_BE45E0 -/* BE45E0 80240E30 0280202D */ daddu $a0, $s4, $zero -/* BE45E4 80240E34 0260282D */ daddu $a1, $s3, $zero -/* BE45E8 80240E38 0C09029B */ jal arn_04_UnkNpcDurationFlagFunc -/* BE45EC 80240E3C 02A0302D */ daddu $a2, $s5, $zero -/* BE45F0 80240E40 0809039A */ j L80240E68_BE4618 -/* BE45F4 80240E44 00000000 */ nop -glabel L80240E48_BE45F8 -/* BE45F8 80240E48 0280202D */ daddu $a0, $s4, $zero -/* BE45FC 80240E4C 0260282D */ daddu $a1, $s3, $zero -/* BE4600 80240E50 0C0902B5 */ jal func_80240AD4_BE4284 -/* BE4604 80240E54 02A0302D */ daddu $a2, $s5, $zero -/* BE4608 80240E58 0809039A */ j L80240E68_BE4618 -/* BE460C 80240E5C 00000000 */ nop -glabel L80240E60_BE4610 -/* BE4610 80240E60 0C0129CF */ jal func_8004A73C -/* BE4614 80240E64 0280202D */ daddu $a0, $s4, $zero -glabel L80240E68_BE4618 -/* BE4618 80240E68 8FBF0060 */ lw $ra, 0x60($sp) -/* BE461C 80240E6C 8FB5005C */ lw $s5, 0x5c($sp) -/* BE4620 80240E70 8FB40058 */ lw $s4, 0x58($sp) -/* BE4624 80240E74 8FB30054 */ lw $s3, 0x54($sp) -/* BE4628 80240E78 8FB20050 */ lw $s2, 0x50($sp) -/* BE462C 80240E7C 8FB1004C */ lw $s1, 0x4c($sp) -/* BE4630 80240E80 8FB00048 */ lw $s0, 0x48($sp) -/* BE4634 80240E84 0000102D */ daddu $v0, $zero, $zero -/* BE4638 80240E88 03E00008 */ jr $ra -/* BE463C 80240E8C 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240E90_BE4640.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240E90_BE4640.s deleted file mode 100644 index dcfc721aa8..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80240E90_BE4640.s +++ /dev/null @@ -1,116 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240E90_BE4640 -/* BE4640 80240E90 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* BE4644 80240E94 AFB3002C */ sw $s3, 0x2c($sp) -/* BE4648 80240E98 0080982D */ daddu $s3, $a0, $zero -/* BE464C 80240E9C AFBF0030 */ sw $ra, 0x30($sp) -/* BE4650 80240EA0 AFB20028 */ sw $s2, 0x28($sp) -/* BE4654 80240EA4 AFB10024 */ sw $s1, 0x24($sp) -/* BE4658 80240EA8 AFB00020 */ sw $s0, 0x20($sp) -/* BE465C 80240EAC 8E710148 */ lw $s1, 0x148($s3) -/* BE4660 80240EB0 86240008 */ lh $a0, 8($s1) -/* BE4664 80240EB4 0C00EABB */ jal get_npc_unsafe -/* BE4668 80240EB8 00A0902D */ daddu $s2, $a1, $zero -/* BE466C 80240EBC 8E440004 */ lw $a0, 4($s2) -/* BE4670 80240EC0 0040802D */ daddu $s0, $v0, $zero -/* BE4674 80240EC4 00041FC2 */ srl $v1, $a0, 0x1f -/* BE4678 80240EC8 00832021 */ addu $a0, $a0, $v1 -/* BE467C 80240ECC 00042043 */ sra $a0, $a0, 1 -/* BE4680 80240ED0 0C00A67F */ jal rand_int -/* BE4684 80240ED4 24840001 */ addiu $a0, $a0, 1 -/* BE4688 80240ED8 8E430004 */ lw $v1, 4($s2) -/* BE468C 80240EDC 000327C2 */ srl $a0, $v1, 0x1f -/* BE4690 80240EE0 00641821 */ addu $v1, $v1, $a0 -/* BE4694 80240EE4 00031843 */ sra $v1, $v1, 1 -/* BE4698 80240EE8 00621821 */ addu $v1, $v1, $v0 -/* BE469C 80240EEC A603008E */ sh $v1, 0x8e($s0) -/* BE46A0 80240EF0 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE46A4 80240EF4 C6000040 */ lwc1 $f0, 0x40($s0) -/* BE46A8 80240EF8 C4640000 */ lwc1 $f4, ($v1) -/* BE46AC 80240EFC 46802120 */ cvt.s.w $f4, $f4 -/* BE46B0 80240F00 C4620008 */ lwc1 $f2, 8($v1) -/* BE46B4 80240F04 468010A0 */ cvt.s.w $f2, $f2 -/* BE46B8 80240F08 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE46BC 80240F0C 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE46C0 80240F10 44061000 */ mfc1 $a2, $f2 -/* BE46C4 80240F14 C440000C */ lwc1 $f0, 0xc($v0) -/* BE46C8 80240F18 46800020 */ cvt.s.w $f0, $f0 -/* BE46CC 80240F1C E7A00014 */ swc1 $f0, 0x14($sp) -/* BE46D0 80240F20 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE46D4 80240F24 44052000 */ mfc1 $a1, $f4 -/* BE46D8 80240F28 C4400010 */ lwc1 $f0, 0x10($v0) -/* BE46DC 80240F2C 46800020 */ cvt.s.w $f0, $f0 -/* BE46E0 80240F30 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE46E4 80240F34 8C640018 */ lw $a0, 0x18($v1) -/* BE46E8 80240F38 0C0123F5 */ jal is_point_within_region -/* BE46EC 80240F3C 8E070038 */ lw $a3, 0x38($s0) -/* BE46F0 80240F40 1040000E */ beqz $v0, .L80240F7C -/* BE46F4 80240F44 00000000 */ nop -/* BE46F8 80240F48 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE46FC 80240F4C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE4700 80240F50 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE4704 80240F54 C4460000 */ lwc1 $f6, ($v0) -/* BE4708 80240F58 468031A0 */ cvt.s.w $f6, $f6 -/* BE470C 80240F5C 44063000 */ mfc1 $a2, $f6 -/* BE4710 80240F60 C4460008 */ lwc1 $f6, 8($v0) -/* BE4714 80240F64 468031A0 */ cvt.s.w $f6, $f6 -/* BE4718 80240F68 44073000 */ mfc1 $a3, $f6 -/* BE471C 80240F6C 0C00A720 */ jal atan2 -/* BE4720 80240F70 00000000 */ nop -/* BE4724 80240F74 080903EB */ j .L80240FAC -/* BE4728 80240F78 E600000C */ swc1 $f0, 0xc($s0) -.L80240F7C: -/* BE472C 80240F7C 0C00A67F */ jal rand_int -/* BE4730 80240F80 2404003C */ addiu $a0, $zero, 0x3c -/* BE4734 80240F84 C60C000C */ lwc1 $f12, 0xc($s0) -/* BE4738 80240F88 44820000 */ mtc1 $v0, $f0 -/* BE473C 80240F8C 00000000 */ nop -/* BE4740 80240F90 46800020 */ cvt.s.w $f0, $f0 -/* BE4744 80240F94 46006300 */ add.s $f12, $f12, $f0 -/* BE4748 80240F98 3C0141F0 */ lui $at, 0x41f0 -/* BE474C 80240F9C 44810000 */ mtc1 $at, $f0 -/* BE4750 80240FA0 0C00A6C9 */ jal clamp_angle -/* BE4754 80240FA4 46006301 */ sub.s $f12, $f12, $f0 -/* BE4758 80240FA8 E600000C */ swc1 $f0, 0xc($s0) -.L80240FAC: -/* BE475C 80240FAC 8E2200CC */ lw $v0, 0xcc($s1) -/* BE4760 80240FB0 8C420004 */ lw $v0, 4($v0) -/* BE4764 80240FB4 AE020028 */ sw $v0, 0x28($s0) -/* BE4768 80240FB8 AE600074 */ sw $zero, 0x74($s3) -/* BE476C 80240FBC 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE4770 80240FC0 8C420014 */ lw $v0, 0x14($v0) -/* BE4774 80240FC4 04410004 */ bgez $v0, .L80240FD8 -/* BE4778 80240FC8 00000000 */ nop -/* BE477C 80240FCC C6400000 */ lwc1 $f0, ($s2) -/* BE4780 80240FD0 080903FE */ j .L80240FF8 -/* BE4784 80240FD4 E6000018 */ swc1 $f0, 0x18($s0) -.L80240FD8: -/* BE4788 80240FD8 3C018024 */ lui $at, %hi(D_802442D0_BE7A80) -/* BE478C 80240FDC D42242D0 */ ldc1 $f2, %lo(D_802442D0_BE7A80)($at) -/* BE4790 80240FE0 44820000 */ mtc1 $v0, $f0 -/* BE4794 80240FE4 00000000 */ nop -/* BE4798 80240FE8 46800021 */ cvt.d.w $f0, $f0 -/* BE479C 80240FEC 46220003 */ div.d $f0, $f0, $f2 -/* BE47A0 80240FF0 46200020 */ cvt.s.d $f0, $f0 -/* BE47A4 80240FF4 E6000018 */ swc1 $f0, 0x18($s0) -.L80240FF8: -/* BE47A8 80240FF8 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE47AC 80240FFC 3C014059 */ lui $at, 0x4059 -/* BE47B0 80241000 44811800 */ mtc1 $at, $f3 -/* BE47B4 80241004 44801000 */ mtc1 $zero, $f2 -/* BE47B8 80241008 46000021 */ cvt.d.s $f0, $f0 -/* BE47BC 8024100C 46220002 */ mul.d $f0, $f0, $f2 -/* BE47C0 80241010 00000000 */ nop -/* BE47C4 80241014 24020001 */ addiu $v0, $zero, 1 -/* BE47C8 80241018 4620018D */ trunc.w.d $f6, $f0 -/* BE47CC 8024101C E626007C */ swc1 $f6, 0x7c($s1) -/* BE47D0 80241020 AE620070 */ sw $v0, 0x70($s3) -/* BE47D4 80241024 8FBF0030 */ lw $ra, 0x30($sp) -/* BE47D8 80241028 8FB3002C */ lw $s3, 0x2c($sp) -/* BE47DC 8024102C 8FB20028 */ lw $s2, 0x28($sp) -/* BE47E0 80241030 8FB10024 */ lw $s1, 0x24($sp) -/* BE47E4 80241034 8FB00020 */ lw $s0, 0x20($sp) -/* BE47E8 80241038 03E00008 */ jr $ra -/* BE47EC 8024103C 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241728_BE4ED8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241728_BE4ED8.s deleted file mode 100644 index 6af2776ff2..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241728_BE4ED8.s +++ /dev/null @@ -1,225 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241728_BE4ED8 -/* BE4ED8 80241728 27BDFF88 */ addiu $sp, $sp, -0x78 -/* BE4EDC 8024172C AFB3004C */ sw $s3, 0x4c($sp) -/* BE4EE0 80241730 0080982D */ daddu $s3, $a0, $zero -/* BE4EE4 80241734 AFBF0054 */ sw $ra, 0x54($sp) -/* BE4EE8 80241738 AFB40050 */ sw $s4, 0x50($sp) -/* BE4EEC 8024173C AFB20048 */ sw $s2, 0x48($sp) -/* BE4EF0 80241740 AFB10044 */ sw $s1, 0x44($sp) -/* BE4EF4 80241744 AFB00040 */ sw $s0, 0x40($sp) -/* BE4EF8 80241748 F7BA0070 */ sdc1 $f26, 0x70($sp) -/* BE4EFC 8024174C F7B80068 */ sdc1 $f24, 0x68($sp) -/* BE4F00 80241750 F7B60060 */ sdc1 $f22, 0x60($sp) -/* BE4F04 80241754 F7B40058 */ sdc1 $f20, 0x58($sp) -/* BE4F08 80241758 8E710148 */ lw $s1, 0x148($s3) -/* BE4F0C 8024175C 00A0902D */ daddu $s2, $a1, $zero -/* BE4F10 80241760 86240008 */ lh $a0, 8($s1) -/* BE4F14 80241764 0C00EABB */ jal get_npc_unsafe -/* BE4F18 80241768 00C0A02D */ daddu $s4, $a2, $zero -/* BE4F1C 8024176C 0040802D */ daddu $s0, $v0, $zero -/* BE4F20 80241770 C6200078 */ lwc1 $f0, 0x78($s1) -/* BE4F24 80241774 46800020 */ cvt.s.w $f0, $f0 -/* BE4F28 80241778 46000021 */ cvt.d.s $f0, $f0 -/* BE4F2C 8024177C 3C014059 */ lui $at, 0x4059 -/* BE4F30 80241780 44811800 */ mtc1 $at, $f3 -/* BE4F34 80241784 44801000 */ mtc1 $zero, $f2 -/* BE4F38 80241788 8602008E */ lh $v0, 0x8e($s0) -/* BE4F3C 8024178C 9603008E */ lhu $v1, 0x8e($s0) -/* BE4F40 80241790 46220003 */ div.d $f0, $f0, $f2 -/* BE4F44 80241794 46200620 */ cvt.s.d $f24, $f0 -/* BE4F48 80241798 C6200088 */ lwc1 $f0, 0x88($s1) -/* BE4F4C 8024179C 46800020 */ cvt.s.w $f0, $f0 -/* BE4F50 802417A0 46000021 */ cvt.d.s $f0, $f0 -/* BE4F54 802417A4 46220003 */ div.d $f0, $f0, $f2 -/* BE4F58 802417A8 46200020 */ cvt.s.d $f0, $f0 -/* BE4F5C 802417AC 18400003 */ blez $v0, .L802417BC -/* BE4F60 802417B0 4600C680 */ add.s $f26, $f24, $f0 -/* BE4F64 802417B4 2462FFFF */ addiu $v0, $v1, -1 -/* BE4F68 802417B8 A602008E */ sh $v0, 0x8e($s0) -.L802417BC: -/* BE4F6C 802417BC 8E220070 */ lw $v0, 0x70($s1) -/* BE4F70 802417C0 18400034 */ blez $v0, .L80241894 -/* BE4F74 802417C4 00000000 */ nop -/* BE4F78 802417C8 C62C0074 */ lwc1 $f12, 0x74($s1) -/* BE4F7C 802417CC 46806320 */ cvt.s.w $f12, $f12 -/* BE4F80 802417D0 44820000 */ mtc1 $v0, $f0 -/* BE4F84 802417D4 00000000 */ nop -/* BE4F88 802417D8 46800020 */ cvt.s.w $f0, $f0 -/* BE4F8C 802417DC 46000021 */ cvt.d.s $f0, $f0 -/* BE4F90 802417E0 46220003 */ div.d $f0, $f0, $f2 -/* BE4F94 802417E4 0C00A8BB */ jal sin_deg -/* BE4F98 802417E8 462005A0 */ cvt.s.d $f22, $f0 -/* BE4F9C 802417EC 8E020000 */ lw $v0, ($s0) -/* BE4FA0 802417F0 30420008 */ andi $v0, $v0, 8 -/* BE4FA4 802417F4 10400003 */ beqz $v0, .L80241804 -/* BE4FA8 802417F8 46000506 */ mov.s $f20, $f0 -/* BE4FAC 802417FC 08090611 */ j .L80241844 -/* BE4FB0 80241800 0000102D */ daddu $v0, $zero, $zero -.L80241804: -/* BE4FB4 80241804 27A50028 */ addiu $a1, $sp, 0x28 -/* BE4FB8 80241808 27A6002C */ addiu $a2, $sp, 0x2c -/* BE4FBC 8024180C C6000038 */ lwc1 $f0, 0x38($s0) -/* BE4FC0 80241810 C602003C */ lwc1 $f2, 0x3c($s0) -/* BE4FC4 80241814 C6040040 */ lwc1 $f4, 0x40($s0) -/* BE4FC8 80241818 3C01447A */ lui $at, 0x447a -/* BE4FCC 8024181C 44813000 */ mtc1 $at, $f6 -/* BE4FD0 80241820 27A20034 */ addiu $v0, $sp, 0x34 -/* BE4FD4 80241824 E7A00028 */ swc1 $f0, 0x28($sp) -/* BE4FD8 80241828 E7A2002C */ swc1 $f2, 0x2c($sp) -/* BE4FDC 8024182C E7A40030 */ swc1 $f4, 0x30($sp) -/* BE4FE0 80241830 E7A60034 */ swc1 $f6, 0x34($sp) -/* BE4FE4 80241834 AFA20010 */ sw $v0, 0x10($sp) -/* BE4FE8 80241838 8E040080 */ lw $a0, 0x80($s0) -/* BE4FEC 8024183C 0C0372DF */ jal func_800DCB7C -/* BE4FF0 80241840 27A70030 */ addiu $a3, $sp, 0x30 -.L80241844: -/* BE4FF4 80241844 10400007 */ beqz $v0, .L80241864 -/* BE4FF8 80241848 00000000 */ nop -/* BE4FFC 8024184C 4616A082 */ mul.s $f2, $f20, $f22 -/* BE5000 80241850 00000000 */ nop -/* BE5004 80241854 C7A0002C */ lwc1 $f0, 0x2c($sp) -/* BE5008 80241858 46180000 */ add.s $f0, $f0, $f24 -/* BE500C 8024185C 0809061C */ j .L80241870 -/* BE5010 80241860 46020000 */ add.s $f0, $f0, $f2 -.L80241864: -/* BE5014 80241864 4616A002 */ mul.s $f0, $f20, $f22 -/* BE5018 80241868 00000000 */ nop -/* BE501C 8024186C 4600D000 */ add.s $f0, $f26, $f0 -.L80241870: -/* BE5020 80241870 E600003C */ swc1 $f0, 0x3c($s0) -/* BE5024 80241874 8E220074 */ lw $v0, 0x74($s1) -/* BE5028 80241878 2442000A */ addiu $v0, $v0, 0xa -/* BE502C 8024187C 44826000 */ mtc1 $v0, $f12 -/* BE5030 80241880 00000000 */ nop -/* BE5034 80241884 0C00A6C9 */ jal clamp_angle -/* BE5038 80241888 46806320 */ cvt.s.w $f12, $f12 -/* BE503C 8024188C 4600020D */ trunc.w.s $f8, $f0 -/* BE5040 80241890 E6280074 */ swc1 $f8, 0x74($s1) -.L80241894: -/* BE5044 80241894 8E220090 */ lw $v0, 0x90($s1) -/* BE5048 80241898 1C400040 */ bgtz $v0, .L8024199C -/* BE504C 8024189C 2442FFFF */ addiu $v0, $v0, -1 -/* BE5050 802418A0 860200A8 */ lh $v0, 0xa8($s0) -/* BE5054 802418A4 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE5058 802418A8 44821000 */ mtc1 $v0, $f2 -/* BE505C 802418AC 00000000 */ nop -/* BE5060 802418B0 468010A0 */ cvt.s.w $f2, $f2 -/* BE5064 802418B4 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE5068 802418B8 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE506C 802418BC 46020000 */ add.s $f0, $f0, $f2 -/* BE5070 802418C0 3C014024 */ lui $at, 0x4024 -/* BE5074 802418C4 44812800 */ mtc1 $at, $f5 -/* BE5078 802418C8 44802000 */ mtc1 $zero, $f4 -/* BE507C 802418CC C442002C */ lwc1 $f2, 0x2c($v0) -/* BE5080 802418D0 46000021 */ cvt.d.s $f0, $f0 -/* BE5084 802418D4 46240000 */ add.d $f0, $f0, $f4 -/* BE5088 802418D8 460010A1 */ cvt.d.s $f2, $f2 -/* BE508C 802418DC 4620103C */ c.lt.d $f2, $f0 -/* BE5090 802418E0 00000000 */ nop -/* BE5094 802418E4 4500002E */ bc1f .L802419A0 -/* BE5098 802418E8 0280202D */ daddu $a0, $s4, $zero -/* BE509C 802418EC 24020001 */ addiu $v0, $zero, 1 -/* BE50A0 802418F0 AFA20010 */ sw $v0, 0x10($sp) -/* BE50A4 802418F4 8E460024 */ lw $a2, 0x24($s2) -/* BE50A8 802418F8 8E470028 */ lw $a3, 0x28($s2) -/* BE50AC 802418FC 0C01242D */ jal func_800490B4 -/* BE50B0 80241900 0220282D */ daddu $a1, $s1, $zero -/* BE50B4 80241904 10400026 */ beqz $v0, .L802419A0 -/* BE50B8 80241908 0000202D */ daddu $a0, $zero, $zero -/* BE50BC 8024190C 0200282D */ daddu $a1, $s0, $zero -/* BE50C0 80241910 0000302D */ daddu $a2, $zero, $zero -/* BE50C4 80241914 2412000C */ addiu $s2, $zero, 0xc -/* BE50C8 80241918 860300A8 */ lh $v1, 0xa8($s0) -/* BE50CC 8024191C 3C013F80 */ lui $at, 0x3f80 -/* BE50D0 80241920 44810000 */ mtc1 $at, $f0 -/* BE50D4 80241924 3C014000 */ lui $at, 0x4000 -/* BE50D8 80241928 44811000 */ mtc1 $at, $f2 -/* BE50DC 8024192C 3C01C1A0 */ lui $at, 0xc1a0 -/* BE50E0 80241930 44812000 */ mtc1 $at, $f4 -/* BE50E4 80241934 44834000 */ mtc1 $v1, $f8 -/* BE50E8 80241938 00000000 */ nop -/* BE50EC 8024193C 46804220 */ cvt.s.w $f8, $f8 -/* BE50F0 80241940 44074000 */ mfc1 $a3, $f8 -/* BE50F4 80241944 27A20038 */ addiu $v0, $sp, 0x38 -/* BE50F8 80241948 AFB2001C */ sw $s2, 0x1c($sp) -/* BE50FC 8024194C AFA20020 */ sw $v0, 0x20($sp) -/* BE5100 80241950 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE5104 80241954 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE5108 80241958 0C01BFA4 */ jal fx_emote -/* BE510C 8024195C E7A40018 */ swc1 $f4, 0x18($sp) -/* BE5110 80241960 0200202D */ daddu $a0, $s0, $zero -/* BE5114 80241964 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE5118 80241968 C480003C */ lwc1 $f0, 0x3c($a0) -/* BE511C 8024196C 3C060020 */ lui $a2, 0x20 -/* BE5120 80241970 0C012530 */ jal func_800494C0 -/* BE5124 80241974 E4800064 */ swc1 $f0, 0x64($a0) -/* BE5128 80241978 8E220018 */ lw $v0, 0x18($s1) -/* BE512C 8024197C 9442002A */ lhu $v0, 0x2a($v0) -/* BE5130 80241980 30420001 */ andi $v0, $v0, 1 -/* BE5134 80241984 10400003 */ beqz $v0, .L80241994 -/* BE5138 80241988 2402000A */ addiu $v0, $zero, 0xa -/* BE513C 8024198C 0809068F */ j .L80241A3C -/* BE5140 80241990 AE620070 */ sw $v0, 0x70($s3) -.L80241994: -/* BE5144 80241994 0809068F */ j .L80241A3C -/* BE5148 80241998 AE720070 */ sw $s2, 0x70($s3) -.L8024199C: -/* BE514C 8024199C AE220090 */ sw $v0, 0x90($s1) -.L802419A0: -/* BE5150 802419A0 8602008C */ lh $v0, 0x8c($s0) -/* BE5154 802419A4 14400025 */ bnez $v0, .L80241A3C -/* BE5158 802419A8 00000000 */ nop -/* BE515C 802419AC 8602008E */ lh $v0, 0x8e($s0) -/* BE5160 802419B0 1C400022 */ bgtz $v0, .L80241A3C -/* BE5164 802419B4 00000000 */ nop -/* BE5168 802419B8 8E620074 */ lw $v0, 0x74($s3) -/* BE516C 802419BC 2442FFFF */ addiu $v0, $v0, -1 -/* BE5170 802419C0 1840001D */ blez $v0, .L80241A38 -/* BE5174 802419C4 AE620074 */ sw $v0, 0x74($s3) -/* BE5178 802419C8 8E220018 */ lw $v0, 0x18($s1) -/* BE517C 802419CC 9442002A */ lhu $v0, 0x2a($v0) -/* BE5180 802419D0 30420010 */ andi $v0, $v0, 0x10 -/* BE5184 802419D4 14400007 */ bnez $v0, .L802419F4 -/* BE5188 802419D8 00000000 */ nop -/* BE518C 802419DC C600000C */ lwc1 $f0, 0xc($s0) -/* BE5190 802419E0 3C014334 */ lui $at, 0x4334 -/* BE5194 802419E4 44816000 */ mtc1 $at, $f12 -/* BE5198 802419E8 0C00A6C9 */ jal clamp_angle -/* BE519C 802419EC 460C0300 */ add.s $f12, $f0, $f12 -/* BE51A0 802419F0 E600000C */ swc1 $f0, 0xc($s0) -.L802419F4: -/* BE51A4 802419F4 0C00A67F */ jal rand_int -/* BE51A8 802419F8 240403E8 */ addiu $a0, $zero, 0x3e8 -/* BE51AC 802419FC 3C032E8B */ lui $v1, 0x2e8b -/* BE51B0 80241A00 3463A2E9 */ ori $v1, $v1, 0xa2e9 -/* BE51B4 80241A04 00430018 */ mult $v0, $v1 -/* BE51B8 80241A08 00021FC3 */ sra $v1, $v0, 0x1f -/* BE51BC 80241A0C 00004010 */ mfhi $t0 -/* BE51C0 80241A10 00082043 */ sra $a0, $t0, 1 -/* BE51C4 80241A14 00832023 */ subu $a0, $a0, $v1 -/* BE51C8 80241A18 00041840 */ sll $v1, $a0, 1 -/* BE51CC 80241A1C 00641821 */ addu $v1, $v1, $a0 -/* BE51D0 80241A20 00031880 */ sll $v1, $v1, 2 -/* BE51D4 80241A24 00641823 */ subu $v1, $v1, $a0 -/* BE51D8 80241A28 00431023 */ subu $v0, $v0, $v1 -/* BE51DC 80241A2C 24420005 */ addiu $v0, $v0, 5 -/* BE51E0 80241A30 0809068F */ j .L80241A3C -/* BE51E4 80241A34 A602008E */ sh $v0, 0x8e($s0) -.L80241A38: -/* BE51E8 80241A38 AE600070 */ sw $zero, 0x70($s3) -.L80241A3C: -/* BE51EC 80241A3C 8FBF0054 */ lw $ra, 0x54($sp) -/* BE51F0 80241A40 8FB40050 */ lw $s4, 0x50($sp) -/* BE51F4 80241A44 8FB3004C */ lw $s3, 0x4c($sp) -/* BE51F8 80241A48 8FB20048 */ lw $s2, 0x48($sp) -/* BE51FC 80241A4C 8FB10044 */ lw $s1, 0x44($sp) -/* BE5200 80241A50 8FB00040 */ lw $s0, 0x40($sp) -/* BE5204 80241A54 D7BA0070 */ ldc1 $f26, 0x70($sp) -/* BE5208 80241A58 D7B80068 */ ldc1 $f24, 0x68($sp) -/* BE520C 80241A5C D7B60060 */ ldc1 $f22, 0x60($sp) -/* BE5210 80241A60 D7B40058 */ ldc1 $f20, 0x58($sp) -/* BE5214 80241A64 03E00008 */ jr $ra -/* BE5218 80241A68 27BD0078 */ addiu $sp, $sp, 0x78 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241AE4_BE5294.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241AE4_BE5294.s deleted file mode 100644 index 0e9cd84427..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241AE4_BE5294.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241AE4_BE5294 -/* BE5294 80241AE4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BE5298 80241AE8 AFB00010 */ sw $s0, 0x10($sp) -/* BE529C 80241AEC 0080802D */ daddu $s0, $a0, $zero -/* BE52A0 80241AF0 AFBF0014 */ sw $ra, 0x14($sp) -/* BE52A4 80241AF4 8E020148 */ lw $v0, 0x148($s0) -/* BE52A8 80241AF8 0C00EABB */ jal get_npc_unsafe -/* BE52AC 80241AFC 84440008 */ lh $a0, 8($v0) -/* BE52B0 80241B00 9443008E */ lhu $v1, 0x8e($v0) -/* BE52B4 80241B04 C440003C */ lwc1 $f0, 0x3c($v0) -/* BE52B8 80241B08 24640001 */ addiu $a0, $v1, 1 -/* BE52BC 80241B0C 00031C00 */ sll $v1, $v1, 0x10 -/* BE52C0 80241B10 00031B83 */ sra $v1, $v1, 0xe -/* BE52C4 80241B14 A444008E */ sh $a0, 0x8e($v0) -/* BE52C8 80241B18 3C018024 */ lui $at, %hi(D_802436DC_BE6E8C) -/* BE52CC 80241B1C 00230821 */ addu $at, $at, $v1 -/* BE52D0 80241B20 C42236DC */ lwc1 $f2, %lo(D_802436DC_BE6E8C)($at) -/* BE52D4 80241B24 8443008E */ lh $v1, 0x8e($v0) -/* BE52D8 80241B28 46020000 */ add.s $f0, $f0, $f2 -/* BE52DC 80241B2C 28630005 */ slti $v1, $v1, 5 -/* BE52E0 80241B30 14600003 */ bnez $v1, .L80241B40 -/* BE52E4 80241B34 E440003C */ swc1 $f0, 0x3c($v0) -/* BE52E8 80241B38 2402000C */ addiu $v0, $zero, 0xc -/* BE52EC 80241B3C AE020070 */ sw $v0, 0x70($s0) -.L80241B40: -/* BE52F0 80241B40 8FBF0014 */ lw $ra, 0x14($sp) -/* BE52F4 80241B44 8FB00010 */ lw $s0, 0x10($sp) -/* BE52F8 80241B48 03E00008 */ jr $ra -/* BE52FC 80241B4C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241CE8_BE5498.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241CE8_BE5498.s deleted file mode 100644 index 280dd5ee2a..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80241CE8_BE5498.s +++ /dev/null @@ -1,243 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241CE8_BE5498 -/* BE5498 80241CE8 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BE549C 80241CEC AFB20030 */ sw $s2, 0x30($sp) -/* BE54A0 80241CF0 0080902D */ daddu $s2, $a0, $zero -/* BE54A4 80241CF4 AFBF0038 */ sw $ra, 0x38($sp) -/* BE54A8 80241CF8 AFB30034 */ sw $s3, 0x34($sp) -/* BE54AC 80241CFC AFB1002C */ sw $s1, 0x2c($sp) -/* BE54B0 80241D00 AFB00028 */ sw $s0, 0x28($sp) -/* BE54B4 80241D04 F7B60048 */ sdc1 $f22, 0x48($sp) -/* BE54B8 80241D08 F7B40040 */ sdc1 $f20, 0x40($sp) -/* BE54BC 80241D0C 8E510148 */ lw $s1, 0x148($s2) -/* BE54C0 80241D10 86240008 */ lh $a0, 8($s1) -/* BE54C4 80241D14 0C00EABB */ jal get_npc_unsafe -/* BE54C8 80241D18 00A0982D */ daddu $s3, $a1, $zero -/* BE54CC 80241D1C 0040802D */ daddu $s0, $v0, $zero -/* BE54D0 80241D20 0200202D */ daddu $a0, $s0, $zero -/* BE54D4 80241D24 C6220088 */ lwc1 $f2, 0x88($s1) -/* BE54D8 80241D28 468010A0 */ cvt.s.w $f2, $f2 -/* BE54DC 80241D2C 460010A1 */ cvt.d.s $f2, $f2 -/* BE54E0 80241D30 C604001C */ lwc1 $f4, 0x1c($s0) -/* BE54E4 80241D34 C6000014 */ lwc1 $f0, 0x14($s0) -/* BE54E8 80241D38 8E050018 */ lw $a1, 0x18($s0) -/* BE54EC 80241D3C 46002100 */ add.s $f4, $f4, $f0 -/* BE54F0 80241D40 8E06000C */ lw $a2, 0xc($s0) -/* BE54F4 80241D44 C6200078 */ lwc1 $f0, 0x78($s1) -/* BE54F8 80241D48 46800020 */ cvt.s.w $f0, $f0 -/* BE54FC 80241D4C E604001C */ swc1 $f4, 0x1c($s0) -/* BE5500 80241D50 3C014059 */ lui $at, 0x4059 -/* BE5504 80241D54 44812800 */ mtc1 $at, $f5 -/* BE5508 80241D58 44802000 */ mtc1 $zero, $f4 -/* BE550C 80241D5C 46000021 */ cvt.d.s $f0, $f0 -/* BE5510 80241D60 46240003 */ div.d $f0, $f0, $f4 -/* BE5514 80241D64 46200520 */ cvt.s.d $f20, $f0 -/* BE5518 80241D68 46241083 */ div.d $f2, $f2, $f4 -/* BE551C 80241D6C 0C00EA95 */ jal npc_move_heading -/* BE5520 80241D70 462015A0 */ cvt.s.d $f22, $f2 -/* BE5524 80241D74 C604001C */ lwc1 $f4, 0x1c($s0) -/* BE5528 80241D78 44801000 */ mtc1 $zero, $f2 -/* BE552C 80241D7C 44801800 */ mtc1 $zero, $f3 -/* BE5530 80241D80 46002021 */ cvt.d.s $f0, $f4 -/* BE5534 80241D84 4620103E */ c.le.d $f2, $f0 -/* BE5538 80241D88 00000000 */ nop -/* BE553C 80241D8C 45000030 */ bc1f .L80241E50 -/* BE5540 80241D90 00000000 */ nop -/* BE5544 80241D94 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE5548 80241D98 46040000 */ add.s $f0, $f0, $f4 -/* BE554C 80241D9C E600003C */ swc1 $f0, 0x3c($s0) -/* BE5550 80241DA0 8E2200CC */ lw $v0, 0xcc($s1) -/* BE5554 80241DA4 8C420024 */ lw $v0, 0x24($v0) -/* BE5558 80241DA8 AE020028 */ sw $v0, 0x28($s0) -/* BE555C 80241DAC A2200007 */ sb $zero, 7($s1) -/* BE5560 80241DB0 8E020000 */ lw $v0, ($s0) -/* BE5564 80241DB4 30420008 */ andi $v0, $v0, 8 -/* BE5568 80241DB8 14400011 */ bnez $v0, .L80241E00 -/* BE556C 80241DBC 0000102D */ daddu $v0, $zero, $zero -/* BE5570 80241DC0 27A50018 */ addiu $a1, $sp, 0x18 -/* BE5574 80241DC4 27A6001C */ addiu $a2, $sp, 0x1c -/* BE5578 80241DC8 C6000038 */ lwc1 $f0, 0x38($s0) -/* BE557C 80241DCC C602003C */ lwc1 $f2, 0x3c($s0) -/* BE5580 80241DD0 C6040040 */ lwc1 $f4, 0x40($s0) -/* BE5584 80241DD4 3C01447A */ lui $at, 0x447a -/* BE5588 80241DD8 44813000 */ mtc1 $at, $f6 -/* BE558C 80241DDC 27A20024 */ addiu $v0, $sp, 0x24 -/* BE5590 80241DE0 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE5594 80241DE4 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BE5598 80241DE8 E7A40020 */ swc1 $f4, 0x20($sp) -/* BE559C 80241DEC E7A60024 */ swc1 $f6, 0x24($sp) -/* BE55A0 80241DF0 AFA20010 */ sw $v0, 0x10($sp) -/* BE55A4 80241DF4 8E040080 */ lw $a0, 0x80($s0) -/* BE55A8 80241DF8 0C0372DF */ jal func_800DCB7C -/* BE55AC 80241DFC 27A70020 */ addiu $a3, $sp, 0x20 -.L80241E00: -/* BE55B0 80241E00 1040000B */ beqz $v0, .L80241E30 -/* BE55B4 80241E04 00000000 */ nop -/* BE55B8 80241E08 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BE55BC 80241E0C 46140080 */ add.s $f2, $f0, $f20 -/* BE55C0 80241E10 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE55C4 80241E14 4600103E */ c.le.s $f2, $f0 -/* BE55C8 80241E18 00000000 */ nop -/* BE55CC 80241E1C 4500008D */ bc1f .L80242054 -/* BE55D0 80241E20 00000000 */ nop -/* BE55D4 80241E24 E602003C */ swc1 $f2, 0x3c($s0) -/* BE55D8 80241E28 08090815 */ j .L80242054 -/* BE55DC 80241E2C AE400070 */ sw $zero, 0x70($s2) -.L80241E30: -/* BE55E0 80241E30 C602003C */ lwc1 $f2, 0x3c($s0) -/* BE55E4 80241E34 C6000064 */ lwc1 $f0, 0x64($s0) -/* BE55E8 80241E38 4602003E */ c.le.s $f0, $f2 -/* BE55EC 80241E3C 00000000 */ nop -/* BE55F0 80241E40 45030084 */ bc1tl .L80242054 -/* BE55F4 80241E44 AE400070 */ sw $zero, 0x70($s2) -/* BE55F8 80241E48 08090815 */ j .L80242054 -/* BE55FC 80241E4C 00000000 */ nop -.L80241E50: -/* BE5600 80241E50 4622003C */ c.lt.d $f0, $f2 -/* BE5604 80241E54 00000000 */ nop -/* BE5608 80241E58 4500007E */ bc1f .L80242054 -/* BE560C 80241E5C 00000000 */ nop -/* BE5610 80241E60 9602008E */ lhu $v0, 0x8e($s0) -/* BE5614 80241E64 24420001 */ addiu $v0, $v0, 1 -/* BE5618 80241E68 A602008E */ sh $v0, 0x8e($s0) -/* BE561C 80241E6C 00021400 */ sll $v0, $v0, 0x10 -/* BE5620 80241E70 8E630020 */ lw $v1, 0x20($s3) -/* BE5624 80241E74 00021403 */ sra $v0, $v0, 0x10 -/* BE5628 80241E78 0043102A */ slt $v0, $v0, $v1 -/* BE562C 80241E7C 14400026 */ bnez $v0, .L80241F18 -/* BE5630 80241E80 00000000 */ nop -/* BE5634 80241E84 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE5638 80241E88 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE563C 80241E8C 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE5640 80241E90 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE5644 80241E94 A600008E */ sh $zero, 0x8e($s0) -/* BE5648 80241E98 8C460028 */ lw $a2, 0x28($v0) -/* BE564C 80241E9C 0C00A720 */ jal atan2 -/* BE5650 80241EA0 8C470030 */ lw $a3, 0x30($v0) -/* BE5654 80241EA4 46000506 */ mov.s $f20, $f0 -/* BE5658 80241EA8 C60C000C */ lwc1 $f12, 0xc($s0) -/* BE565C 80241EAC 0C00A70A */ jal get_clamped_angle_diff -/* BE5660 80241EB0 4600A386 */ mov.s $f14, $f20 -/* BE5664 80241EB4 46000086 */ mov.s $f2, $f0 -/* BE5668 80241EB8 8E62001C */ lw $v0, 0x1c($s3) -/* BE566C 80241EBC 46001005 */ abs.s $f0, $f2 -/* BE5670 80241EC0 44822000 */ mtc1 $v0, $f4 -/* BE5674 80241EC4 00000000 */ nop -/* BE5678 80241EC8 46802120 */ cvt.s.w $f4, $f4 -/* BE567C 80241ECC 4600203C */ c.lt.s $f4, $f0 -/* BE5680 80241ED0 00000000 */ nop -/* BE5684 80241ED4 4500000D */ bc1f .L80241F0C -/* BE5688 80241ED8 00000000 */ nop -/* BE568C 80241EDC 44800000 */ mtc1 $zero, $f0 -/* BE5690 80241EE0 C614000C */ lwc1 $f20, 0xc($s0) -/* BE5694 80241EE4 4600103C */ c.lt.s $f2, $f0 -/* BE5698 80241EE8 00000000 */ nop -/* BE569C 80241EEC 45000006 */ bc1f .L80241F08 -/* BE56A0 80241EF0 00021023 */ negu $v0, $v0 -/* BE56A4 80241EF4 44820000 */ mtc1 $v0, $f0 -/* BE56A8 80241EF8 00000000 */ nop -/* BE56AC 80241EFC 46800020 */ cvt.s.w $f0, $f0 -/* BE56B0 80241F00 080907C3 */ j .L80241F0C -/* BE56B4 80241F04 4600A500 */ add.s $f20, $f20, $f0 -.L80241F08: -/* BE56B8 80241F08 4604A500 */ add.s $f20, $f20, $f4 -.L80241F0C: -/* BE56BC 80241F0C 0C00A6C9 */ jal clamp_angle -/* BE56C0 80241F10 4600A306 */ mov.s $f12, $f20 -/* BE56C4 80241F14 E600000C */ swc1 $f0, 0xc($s0) -.L80241F18: -/* BE56C8 80241F18 8E020000 */ lw $v0, ($s0) -/* BE56CC 80241F1C 30420008 */ andi $v0, $v0, 8 -/* BE56D0 80241F20 1040000A */ beqz $v0, .L80241F4C -/* BE56D4 80241F24 27A50018 */ addiu $a1, $sp, 0x18 -/* BE56D8 80241F28 C602003C */ lwc1 $f2, 0x3c($s0) -/* BE56DC 80241F2C C600001C */ lwc1 $f0, 0x1c($s0) -/* BE56E0 80241F30 46001080 */ add.s $f2, $f2, $f0 -/* BE56E4 80241F34 4616103C */ c.lt.s $f2, $f22 -/* BE56E8 80241F38 00000000 */ nop -/* BE56EC 80241F3C 45020045 */ bc1fl .L80242054 -/* BE56F0 80241F40 E602003C */ swc1 $f2, 0x3c($s0) -/* BE56F4 80241F44 08090814 */ j .L80242050 -/* BE56F8 80241F48 E616003C */ swc1 $f22, 0x3c($s0) -.L80241F4C: -/* BE56FC 80241F4C C6000038 */ lwc1 $f0, 0x38($s0) -/* BE5700 80241F50 27A6001C */ addiu $a2, $sp, 0x1c -/* BE5704 80241F54 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE5708 80241F58 860200A8 */ lh $v0, 0xa8($s0) -/* BE570C 80241F5C C600001C */ lwc1 $f0, 0x1c($s0) -/* BE5710 80241F60 C604003C */ lwc1 $f4, 0x3c($s0) -/* BE5714 80241F64 44821000 */ mtc1 $v0, $f2 -/* BE5718 80241F68 00000000 */ nop -/* BE571C 80241F6C 468010A0 */ cvt.s.w $f2, $f2 -/* BE5720 80241F70 46000005 */ abs.s $f0, $f0 -/* BE5724 80241F74 46020000 */ add.s $f0, $f0, $f2 -/* BE5728 80241F78 C6060040 */ lwc1 $f6, 0x40($s0) -/* BE572C 80241F7C 27A20024 */ addiu $v0, $sp, 0x24 -/* BE5730 80241F80 46022100 */ add.s $f4, $f4, $f2 -/* BE5734 80241F84 3C014024 */ lui $at, 0x4024 -/* BE5738 80241F88 44811800 */ mtc1 $at, $f3 -/* BE573C 80241F8C 44801000 */ mtc1 $zero, $f2 -/* BE5740 80241F90 46000021 */ cvt.d.s $f0, $f0 -/* BE5744 80241F94 46220000 */ add.d $f0, $f0, $f2 -/* BE5748 80241F98 E7A60020 */ swc1 $f6, 0x20($sp) -/* BE574C 80241F9C E7A4001C */ swc1 $f4, 0x1c($sp) -/* BE5750 80241FA0 46200020 */ cvt.s.d $f0, $f0 -/* BE5754 80241FA4 E7A00024 */ swc1 $f0, 0x24($sp) -/* BE5758 80241FA8 AFA20010 */ sw $v0, 0x10($sp) -/* BE575C 80241FAC 8E040080 */ lw $a0, 0x80($s0) -/* BE5760 80241FB0 0C0372DF */ jal func_800DCB7C -/* BE5764 80241FB4 27A70020 */ addiu $a3, $sp, 0x20 -/* BE5768 80241FB8 10400015 */ beqz $v0, .L80242010 -/* BE576C 80241FBC 00000000 */ nop -/* BE5770 80241FC0 860200A8 */ lh $v0, 0xa8($s0) -/* BE5774 80241FC4 C604001C */ lwc1 $f4, 0x1c($s0) -/* BE5778 80241FC8 44820000 */ mtc1 $v0, $f0 -/* BE577C 80241FCC 00000000 */ nop -/* BE5780 80241FD0 46800020 */ cvt.s.w $f0, $f0 -/* BE5784 80241FD4 46002085 */ abs.s $f2, $f4 -/* BE5788 80241FD8 46020000 */ add.s $f0, $f0, $f2 -/* BE578C 80241FDC C7A20024 */ lwc1 $f2, 0x24($sp) -/* BE5790 80241FE0 4600103E */ c.le.s $f2, $f0 -/* BE5794 80241FE4 00000000 */ nop -/* BE5798 80241FE8 45000005 */ bc1f .L80242000 -/* BE579C 80241FEC 00000000 */ nop -/* BE57A0 80241FF0 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BE57A4 80241FF4 AE00001C */ sw $zero, 0x1c($s0) -/* BE57A8 80241FF8 08090815 */ j .L80242054 -/* BE57AC 80241FFC E600003C */ swc1 $f0, 0x3c($s0) -.L80242000: -/* BE57B0 80242000 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE57B4 80242004 46040000 */ add.s $f0, $f0, $f4 -/* BE57B8 80242008 08090815 */ j .L80242054 -/* BE57BC 8024200C E600003C */ swc1 $f0, 0x3c($s0) -.L80242010: -/* BE57C0 80242010 C606003C */ lwc1 $f6, 0x3c($s0) -/* BE57C4 80242014 860200A8 */ lh $v0, 0xa8($s0) -/* BE57C8 80242018 46163081 */ sub.s $f2, $f6, $f22 -/* BE57CC 8024201C 44820000 */ mtc1 $v0, $f0 -/* BE57D0 80242020 00000000 */ nop -/* BE57D4 80242024 46800020 */ cvt.s.w $f0, $f0 -/* BE57D8 80242028 46001080 */ add.s $f2, $f2, $f0 -/* BE57DC 8024202C C604001C */ lwc1 $f4, 0x1c($s0) -/* BE57E0 80242030 46002005 */ abs.s $f0, $f4 -/* BE57E4 80242034 4602003C */ c.lt.s $f0, $f2 -/* BE57E8 80242038 00000000 */ nop -/* BE57EC 8024203C 45020005 */ bc1fl .L80242054 -/* BE57F0 80242040 AE00001C */ sw $zero, 0x1c($s0) -/* BE57F4 80242044 46043000 */ add.s $f0, $f6, $f4 -/* BE57F8 80242048 08090815 */ j .L80242054 -/* BE57FC 8024204C E600003C */ swc1 $f0, 0x3c($s0) -.L80242050: -/* BE5800 80242050 AE00001C */ sw $zero, 0x1c($s0) -.L80242054: -/* BE5804 80242054 8FBF0038 */ lw $ra, 0x38($sp) -/* BE5808 80242058 8FB30034 */ lw $s3, 0x34($sp) -/* BE580C 8024205C 8FB20030 */ lw $s2, 0x30($sp) -/* BE5810 80242060 8FB1002C */ lw $s1, 0x2c($sp) -/* BE5814 80242064 8FB00028 */ lw $s0, 0x28($sp) -/* BE5818 80242068 D7B60048 */ ldc1 $f22, 0x48($sp) -/* BE581C 8024206C D7B40040 */ ldc1 $f20, 0x40($sp) -/* BE5820 80242070 03E00008 */ jr $ra -/* BE5824 80242074 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242078_BE5828.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242078_BE5828.s deleted file mode 100644 index d2e216a6c9..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242078_BE5828.s +++ /dev/null @@ -1,79 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242078_BE5828 -/* BE5828 80242078 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* BE582C 8024207C AFB00028 */ sw $s0, 0x28($sp) -/* BE5830 80242080 00A0802D */ daddu $s0, $a1, $zero -/* BE5834 80242084 AFB1002C */ sw $s1, 0x2c($sp) -/* BE5838 80242088 00C0882D */ daddu $s1, $a2, $zero -/* BE583C 8024208C AFBF0034 */ sw $ra, 0x34($sp) -/* BE5840 80242090 AFB20030 */ sw $s2, 0x30($sp) -/* BE5844 80242094 AE200070 */ sw $zero, 0x70($s1) -/* BE5848 80242098 8C830000 */ lw $v1, ($a0) -/* BE584C 8024209C 2402FDFF */ addiu $v0, $zero, -0x201 -/* BE5850 802420A0 A480008E */ sh $zero, 0x8e($a0) -/* BE5854 802420A4 00621824 */ and $v1, $v1, $v0 -/* BE5858 802420A8 34650800 */ ori $a1, $v1, 0x800 -/* BE585C 802420AC AC850000 */ sw $a1, ($a0) -/* BE5860 802420B0 8E0200D0 */ lw $v0, 0xd0($s0) -/* BE5864 802420B4 8C420034 */ lw $v0, 0x34($v0) -/* BE5868 802420B8 10400003 */ beqz $v0, .L802420C8 -/* BE586C 802420BC 00E0902D */ daddu $s2, $a3, $zero -/* BE5870 802420C0 08090834 */ j .L802420D0 -/* BE5874 802420C4 34620808 */ ori $v0, $v1, 0x808 -.L802420C8: -/* BE5878 802420C8 2402FFF7 */ addiu $v0, $zero, -9 -/* BE587C 802420CC 00A21024 */ and $v0, $a1, $v0 -.L802420D0: -/* BE5880 802420D0 AC820000 */ sw $v0, ($a0) -/* BE5884 802420D4 27A20024 */ addiu $v0, $sp, 0x24 -/* BE5888 802420D8 27A50018 */ addiu $a1, $sp, 0x18 -/* BE588C 802420DC C4800038 */ lwc1 $f0, 0x38($a0) -/* BE5890 802420E0 C482003C */ lwc1 $f2, 0x3c($a0) -/* BE5894 802420E4 C4840040 */ lwc1 $f4, 0x40($a0) -/* BE5898 802420E8 3C01447A */ lui $at, 0x447a -/* BE589C 802420EC 44813000 */ mtc1 $at, $f6 -/* BE58A0 802420F0 27A6001C */ addiu $a2, $sp, 0x1c -/* BE58A4 802420F4 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE58A8 802420F8 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BE58AC 802420FC E7A40020 */ swc1 $f4, 0x20($sp) -/* BE58B0 80242100 E7A60024 */ swc1 $f6, 0x24($sp) -/* BE58B4 80242104 AFA20010 */ sw $v0, 0x10($sp) -/* BE58B8 80242108 8C840080 */ lw $a0, 0x80($a0) -/* BE58BC 8024210C 0C0372DF */ jal func_800DCB7C -/* BE58C0 80242110 27A70020 */ addiu $a3, $sp, 0x20 -/* BE58C4 80242114 C7A20024 */ lwc1 $f2, 0x24($sp) -/* BE58C8 80242118 3C014059 */ lui $at, 0x4059 -/* BE58CC 8024211C 44812800 */ mtc1 $at, $f5 -/* BE58D0 80242120 44802000 */ mtc1 $zero, $f4 -/* BE58D4 80242124 460010A1 */ cvt.d.s $f2, $f2 -/* BE58D8 80242128 46241082 */ mul.d $f2, $f2, $f4 -/* BE58DC 8024212C 00000000 */ nop -/* BE58E0 80242130 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BE58E4 80242134 46000021 */ cvt.d.s $f0, $f0 -/* BE58E8 80242138 46240002 */ mul.d $f0, $f0, $f4 -/* BE58EC 8024213C 00000000 */ nop -/* BE58F0 80242140 3C013FE0 */ lui $at, 0x3fe0 -/* BE58F4 80242144 44812800 */ mtc1 $at, $f5 -/* BE58F8 80242148 44802000 */ mtc1 $zero, $f4 -/* BE58FC 8024214C 00000000 */ nop -/* BE5900 80242150 46241080 */ add.d $f2, $f2, $f4 -/* BE5904 80242154 AE000074 */ sw $zero, 0x74($s0) -/* BE5908 80242158 46240000 */ add.d $f0, $f0, $f4 -/* BE590C 8024215C AE000090 */ sw $zero, 0x90($s0) -/* BE5910 80242160 4620120D */ trunc.w.d $f8, $f2 -/* BE5914 80242164 E6080078 */ swc1 $f8, 0x78($s0) -/* BE5918 80242168 4620020D */ trunc.w.d $f8, $f0 -/* BE591C 8024216C E6080088 */ swc1 $f8, 0x88($s0) -/* BE5920 80242170 8E420014 */ lw $v0, 0x14($s2) -/* BE5924 80242174 AE220074 */ sw $v0, 0x74($s1) -/* BE5928 80242178 8E0200B0 */ lw $v0, 0xb0($s0) -/* BE592C 8024217C 34420010 */ ori $v0, $v0, 0x10 -/* BE5930 80242180 AE0200B0 */ sw $v0, 0xb0($s0) -/* BE5934 80242184 8FBF0034 */ lw $ra, 0x34($sp) -/* BE5938 80242188 8FB20030 */ lw $s2, 0x30($sp) -/* BE593C 8024218C 8FB1002C */ lw $s1, 0x2c($sp) -/* BE5940 80242190 8FB00028 */ lw $s0, 0x28($sp) -/* BE5944 80242194 03E00008 */ jr $ra -/* BE5948 80242198 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024219C_BE594C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024219C_BE594C.s deleted file mode 100644 index b108c0944e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024219C_BE594C.s +++ /dev/null @@ -1,140 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024219C_BE594C -/* BE594C 8024219C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BE5950 802421A0 AFB40040 */ sw $s4, 0x40($sp) -/* BE5954 802421A4 0080A02D */ daddu $s4, $a0, $zero -/* BE5958 802421A8 AFBF0048 */ sw $ra, 0x48($sp) -/* BE595C 802421AC AFB50044 */ sw $s5, 0x44($sp) -/* BE5960 802421B0 AFB3003C */ sw $s3, 0x3c($sp) -/* BE5964 802421B4 AFB20038 */ sw $s2, 0x38($sp) -/* BE5968 802421B8 AFB10034 */ sw $s1, 0x34($sp) -/* BE596C 802421BC AFB00030 */ sw $s0, 0x30($sp) -/* BE5970 802421C0 8E920148 */ lw $s2, 0x148($s4) -/* BE5974 802421C4 86440008 */ lh $a0, 8($s2) -/* BE5978 802421C8 8E90000C */ lw $s0, 0xc($s4) -/* BE597C 802421CC 0C00EABB */ jal get_npc_unsafe -/* BE5980 802421D0 00A0882D */ daddu $s1, $a1, $zero -/* BE5984 802421D4 0280202D */ daddu $a0, $s4, $zero -/* BE5988 802421D8 8E050000 */ lw $a1, ($s0) -/* BE598C 802421DC 0C0B1EAF */ jal get_variable -/* BE5990 802421E0 0040A82D */ daddu $s5, $v0, $zero -/* BE5994 802421E4 AFA00010 */ sw $zero, 0x10($sp) -/* BE5998 802421E8 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE599C 802421EC 8C630030 */ lw $v1, 0x30($v1) -/* BE59A0 802421F0 AFA30014 */ sw $v1, 0x14($sp) -/* BE59A4 802421F4 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE59A8 802421F8 8C63001C */ lw $v1, 0x1c($v1) -/* BE59AC 802421FC AFA30018 */ sw $v1, 0x18($sp) -/* BE59B0 80242200 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE59B4 80242204 8C630024 */ lw $v1, 0x24($v1) -/* BE59B8 80242208 AFA3001C */ sw $v1, 0x1c($sp) -/* BE59BC 8024220C 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE59C0 80242210 8C630028 */ lw $v1, 0x28($v1) -/* BE59C4 80242214 27B30010 */ addiu $s3, $sp, 0x10 -/* BE59C8 80242218 AFA30020 */ sw $v1, 0x20($sp) -/* BE59CC 8024221C 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE59D0 80242220 3C0142F0 */ lui $at, 0x42f0 -/* BE59D4 80242224 44810000 */ mtc1 $at, $f0 -/* BE59D8 80242228 8C63002C */ lw $v1, 0x2c($v1) -/* BE59DC 8024222C 0040802D */ daddu $s0, $v0, $zero -/* BE59E0 80242230 E7A00028 */ swc1 $f0, 0x28($sp) -/* BE59E4 80242234 A7A0002C */ sh $zero, 0x2c($sp) -/* BE59E8 80242238 12200006 */ beqz $s1, .L80242254 -/* BE59EC 8024223C AFA30024 */ sw $v1, 0x24($sp) -/* BE59F0 80242240 02A0202D */ daddu $a0, $s5, $zero -/* BE59F4 80242244 0240282D */ daddu $a1, $s2, $zero -/* BE59F8 80242248 0280302D */ daddu $a2, $s4, $zero -/* BE59FC 8024224C 0C09081E */ jal func_80242078_BE5828 -/* BE5A00 80242250 0200382D */ daddu $a3, $s0, $zero -.L80242254: -/* BE5A04 80242254 2402FFFE */ addiu $v0, $zero, -2 -/* BE5A08 80242258 A2A200AB */ sb $v0, 0xab($s5) -/* BE5A0C 8024225C 8E4300B0 */ lw $v1, 0xb0($s2) -/* BE5A10 80242260 30620004 */ andi $v0, $v1, 4 -/* BE5A14 80242264 10400007 */ beqz $v0, .L80242284 -/* BE5A18 80242268 00000000 */ nop -/* BE5A1C 8024226C 824200B4 */ lb $v0, 0xb4($s2) -/* BE5A20 80242270 1440003C */ bnez $v0, .L80242364 -/* BE5A24 80242274 0000102D */ daddu $v0, $zero, $zero -/* BE5A28 80242278 2402FFFB */ addiu $v0, $zero, -5 -/* BE5A2C 8024227C 00621024 */ and $v0, $v1, $v0 -/* BE5A30 80242280 AE4200B0 */ sw $v0, 0xb0($s2) -.L80242284: -/* BE5A34 80242284 8E830070 */ lw $v1, 0x70($s4) -/* BE5A38 80242288 2C62000F */ sltiu $v0, $v1, 0xf -/* BE5A3C 8024228C 10400034 */ beqz $v0, L80242360_BE5B10 -/* BE5A40 80242290 00031080 */ sll $v0, $v1, 2 -/* BE5A44 80242294 3C018024 */ lui $at, %hi(jtbl_802442E8_BE7A98) -/* BE5A48 80242298 00220821 */ addu $at, $at, $v0 -/* BE5A4C 8024229C 8C2242E8 */ lw $v0, %lo(jtbl_802442E8_BE7A98)($at) -/* BE5A50 802422A0 00400008 */ jr $v0 -/* BE5A54 802422A4 00000000 */ nop -glabel L802422A8_BE5A58 -/* BE5A58 802422A8 0280202D */ daddu $a0, $s4, $zero -/* BE5A5C 802422AC 0200282D */ daddu $a1, $s0, $zero -/* BE5A60 802422B0 0C0903A4 */ jal func_80240E90_BE4640 -/* BE5A64 802422B4 0260302D */ daddu $a2, $s3, $zero -glabel L802422B8_BE5A68 -/* BE5A68 802422B8 0280202D */ daddu $a0, $s4, $zero -/* BE5A6C 802422BC 0200282D */ daddu $a1, $s0, $zero -/* BE5A70 802422C0 0C090410 */ jal func_80241040_BE47F0 -/* BE5A74 802422C4 0260302D */ daddu $a2, $s3, $zero -/* BE5A78 802422C8 080908D9 */ j .L80242364 -/* BE5A7C 802422CC 0000102D */ daddu $v0, $zero, $zero -glabel L802422D0_BE5A80 -/* BE5A80 802422D0 0280202D */ daddu $a0, $s4, $zero -/* BE5A84 802422D4 0200282D */ daddu $a1, $s0, $zero -/* BE5A88 802422D8 0C09059A */ jal dup_arn_04_UnkNpcAIFunc1 -/* BE5A8C 802422DC 0260302D */ daddu $a2, $s3, $zero -glabel L802422E0_BE5A90 -/* BE5A90 802422E0 0280202D */ daddu $a0, $s4, $zero -/* BE5A94 802422E4 0200282D */ daddu $a1, $s0, $zero -/* BE5A98 802422E8 0C0905CA */ jal func_80241728_BE4ED8 -/* BE5A9C 802422EC 0260302D */ daddu $a2, $s3, $zero -/* BE5AA0 802422F0 080908D9 */ j .L80242364 -/* BE5AA4 802422F4 0000102D */ daddu $v0, $zero, $zero -glabel L802422F8_BE5AA8 -/* BE5AA8 802422F8 0280202D */ daddu $a0, $s4, $zero -/* BE5AAC 802422FC 0200282D */ daddu $a1, $s0, $zero -/* BE5AB0 80242300 0C09069B */ jal arn_04_UnkNpcAIFunc2 -/* BE5AB4 80242304 0260302D */ daddu $a2, $s3, $zero -glabel L80242308_BE5AB8 -/* BE5AB8 80242308 0280202D */ daddu $a0, $s4, $zero -/* BE5ABC 8024230C 0200282D */ daddu $a1, $s0, $zero -/* BE5AC0 80242310 0C0906B9 */ jal func_80241AE4_BE5294 -/* BE5AC4 80242314 0260302D */ daddu $a2, $s3, $zero -/* BE5AC8 80242318 080908D9 */ j .L80242364 -/* BE5ACC 8024231C 0000102D */ daddu $v0, $zero, $zero -glabel L80242320_BE5AD0 -/* BE5AD0 80242320 0280202D */ daddu $a0, $s4, $zero -/* BE5AD4 80242324 0200282D */ daddu $a1, $s0, $zero -/* BE5AD8 80242328 0C0906D4 */ jal arn_04_UnkNpcAIFunc14 -/* BE5ADC 8024232C 0260302D */ daddu $a2, $s3, $zero -/* BE5AE0 80242330 080908D9 */ j .L80242364 -/* BE5AE4 80242334 0000102D */ daddu $v0, $zero, $zero -glabel L80242338_BE5AE8 -/* BE5AE8 80242338 0280202D */ daddu $a0, $s4, $zero -/* BE5AEC 8024233C 0200282D */ daddu $a1, $s0, $zero -/* BE5AF0 80242340 0C090721 */ jal arn_04_UnkNpcAIFunc3 -/* BE5AF4 80242344 0260302D */ daddu $a2, $s3, $zero -/* BE5AF8 80242348 080908D9 */ j .L80242364 -/* BE5AFC 8024234C 0000102D */ daddu $v0, $zero, $zero -glabel L80242350_BE5B00 -/* BE5B00 80242350 0280202D */ daddu $a0, $s4, $zero -/* BE5B04 80242354 0200282D */ daddu $a1, $s0, $zero -/* BE5B08 80242358 0C09073A */ jal func_80241CE8_BE5498 -/* BE5B0C 8024235C 0260302D */ daddu $a2, $s3, $zero -glabel L80242360_BE5B10 -/* BE5B10 80242360 0000102D */ daddu $v0, $zero, $zero -.L80242364: -/* BE5B14 80242364 8FBF0048 */ lw $ra, 0x48($sp) -/* BE5B18 80242368 8FB50044 */ lw $s5, 0x44($sp) -/* BE5B1C 8024236C 8FB40040 */ lw $s4, 0x40($sp) -/* BE5B20 80242370 8FB3003C */ lw $s3, 0x3c($sp) -/* BE5B24 80242374 8FB20038 */ lw $s2, 0x38($sp) -/* BE5B28 80242378 8FB10034 */ lw $s1, 0x34($sp) -/* BE5B2C 8024237C 8FB00030 */ lw $s0, 0x30($sp) -/* BE5B30 80242380 03E00008 */ jr $ra -/* BE5B34 80242384 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024255C_BE5D0C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024255C_BE5D0C.s deleted file mode 100644 index dfe48f9bc2..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_8024255C_BE5D0C.s +++ /dev/null @@ -1,81 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024255C_BE5D0C -/* BE5D0C 8024255C 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE5D10 80242560 AFB3003C */ sw $s3, 0x3c($sp) -/* BE5D14 80242564 0080982D */ daddu $s3, $a0, $zero -/* BE5D18 80242568 AFBF0044 */ sw $ra, 0x44($sp) -/* BE5D1C 8024256C AFB40040 */ sw $s4, 0x40($sp) -/* BE5D20 80242570 AFB20038 */ sw $s2, 0x38($sp) -/* BE5D24 80242574 AFB10034 */ sw $s1, 0x34($sp) -/* BE5D28 80242578 AFB00030 */ sw $s0, 0x30($sp) -/* BE5D2C 8024257C 8E700148 */ lw $s0, 0x148($s3) -/* BE5D30 80242580 00A0902D */ daddu $s2, $a1, $zero -/* BE5D34 80242584 86040008 */ lh $a0, 8($s0) -/* BE5D38 80242588 0C00EABB */ jal get_npc_unsafe -/* BE5D3C 8024258C 00C0A02D */ daddu $s4, $a2, $zero -/* BE5D40 80242590 8E630074 */ lw $v1, 0x74($s3) -/* BE5D44 80242594 1C600032 */ bgtz $v1, .L80242660 -/* BE5D48 80242598 0040882D */ daddu $s1, $v0, $zero -/* BE5D4C 8024259C 8E420014 */ lw $v0, 0x14($s2) -/* BE5D50 802425A0 AE620074 */ sw $v0, 0x74($s3) -/* BE5D54 802425A4 C640000C */ lwc1 $f0, 0xc($s2) -/* BE5D58 802425A8 3C018024 */ lui $at, %hi(D_80244338_BE7AE8) -/* BE5D5C 802425AC D4224338 */ ldc1 $f2, %lo(D_80244338_BE7AE8)($at) -/* BE5D60 802425B0 46000021 */ cvt.d.s $f0, $f0 -/* BE5D64 802425B4 46220002 */ mul.d $f0, $f0, $f2 -/* BE5D68 802425B8 00000000 */ nop -/* BE5D6C 802425BC 0280202D */ daddu $a0, $s4, $zero -/* BE5D70 802425C0 AFA00010 */ sw $zero, 0x10($sp) -/* BE5D74 802425C4 8E470010 */ lw $a3, 0x10($s2) -/* BE5D78 802425C8 46200020 */ cvt.s.d $f0, $f0 -/* BE5D7C 802425CC 44060000 */ mfc1 $a2, $f0 -/* BE5D80 802425D0 0C01242D */ jal func_800490B4 -/* BE5D84 802425D4 0200282D */ daddu $a1, $s0, $zero -/* BE5D88 802425D8 10400021 */ beqz $v0, .L80242660 -/* BE5D8C 802425DC 0000202D */ daddu $a0, $zero, $zero -/* BE5D90 802425E0 0220282D */ daddu $a1, $s1, $zero -/* BE5D94 802425E4 0000302D */ daddu $a2, $zero, $zero -/* BE5D98 802425E8 8E0200CC */ lw $v0, 0xcc($s0) -/* BE5D9C 802425EC 3C013F80 */ lui $at, 0x3f80 -/* BE5DA0 802425F0 44810000 */ mtc1 $at, $f0 -/* BE5DA4 802425F4 3C014000 */ lui $at, 0x4000 -/* BE5DA8 802425F8 44811000 */ mtc1 $at, $f2 -/* BE5DAC 802425FC 8C430024 */ lw $v1, 0x24($v0) -/* BE5DB0 80242600 862200A8 */ lh $v0, 0xa8($s1) -/* BE5DB4 80242604 3C01C1A0 */ lui $at, 0xc1a0 -/* BE5DB8 80242608 44812000 */ mtc1 $at, $f4 -/* BE5DBC 8024260C 44823000 */ mtc1 $v0, $f6 -/* BE5DC0 80242610 00000000 */ nop -/* BE5DC4 80242614 468031A0 */ cvt.s.w $f6, $f6 -/* BE5DC8 80242618 44073000 */ mfc1 $a3, $f6 -/* BE5DCC 8024261C 2402000F */ addiu $v0, $zero, 0xf -/* BE5DD0 80242620 AE230028 */ sw $v1, 0x28($s1) -/* BE5DD4 80242624 AFA2001C */ sw $v0, 0x1c($sp) -/* BE5DD8 80242628 27A20028 */ addiu $v0, $sp, 0x28 -/* BE5DDC 8024262C E7A00010 */ swc1 $f0, 0x10($sp) -/* BE5DE0 80242630 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE5DE4 80242634 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE5DE8 80242638 0C01BFA4 */ jal fx_emote -/* BE5DEC 8024263C AFA20020 */ sw $v0, 0x20($sp) -/* BE5DF0 80242640 0220202D */ daddu $a0, $s1, $zero -/* BE5DF4 80242644 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE5DF8 80242648 0C012530 */ jal func_800494C0 -/* BE5DFC 8024264C 3C060020 */ lui $a2, 0x20 -/* BE5E00 80242650 2402000C */ addiu $v0, $zero, 0xc -/* BE5E04 80242654 A622008E */ sh $v0, 0x8e($s1) -/* BE5E08 80242658 24020002 */ addiu $v0, $zero, 2 -/* BE5E0C 8024265C AE620070 */ sw $v0, 0x70($s3) -.L80242660: -/* BE5E10 80242660 8E620074 */ lw $v0, 0x74($s3) -/* BE5E14 80242664 2442FFFF */ addiu $v0, $v0, -1 -/* BE5E18 80242668 AE620074 */ sw $v0, 0x74($s3) -/* BE5E1C 8024266C 8FBF0044 */ lw $ra, 0x44($sp) -/* BE5E20 80242670 8FB40040 */ lw $s4, 0x40($sp) -/* BE5E24 80242674 8FB3003C */ lw $s3, 0x3c($sp) -/* BE5E28 80242678 8FB20038 */ lw $s2, 0x38($sp) -/* BE5E2C 8024267C 8FB10034 */ lw $s1, 0x34($sp) -/* BE5E30 80242680 8FB00030 */ lw $s0, 0x30($sp) -/* BE5E34 80242684 03E00008 */ jr $ra -/* BE5E38 80242688 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242858_BE6008.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242858_BE6008.s deleted file mode 100644 index 4499d5b5d9..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242858_BE6008.s +++ /dev/null @@ -1,101 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242858_BE6008 -/* BE6008 80242858 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE600C 8024285C AFB3003C */ sw $s3, 0x3c($sp) -/* BE6010 80242860 0080982D */ daddu $s3, $a0, $zero -/* BE6014 80242864 AFBF0040 */ sw $ra, 0x40($sp) -/* BE6018 80242868 AFB20038 */ sw $s2, 0x38($sp) -/* BE601C 8024286C AFB10034 */ sw $s1, 0x34($sp) -/* BE6020 80242870 AFB00030 */ sw $s0, 0x30($sp) -/* BE6024 80242874 8E700148 */ lw $s0, 0x148($s3) -/* BE6028 80242878 00A0902D */ daddu $s2, $a1, $zero -/* BE602C 8024287C 86040008 */ lh $a0, 8($s0) -/* BE6030 80242880 0C00EABB */ jal get_npc_unsafe -/* BE6034 80242884 00C0882D */ daddu $s1, $a2, $zero -/* BE6038 80242888 0220202D */ daddu $a0, $s1, $zero -/* BE603C 8024288C 0200282D */ daddu $a1, $s0, $zero -/* BE6040 80242890 AFA00010 */ sw $zero, 0x10($sp) -/* BE6044 80242894 8E460024 */ lw $a2, 0x24($s2) -/* BE6048 80242898 8E470028 */ lw $a3, 0x28($s2) -/* BE604C 8024289C 0C01242D */ jal func_800490B4 -/* BE6050 802428A0 0040802D */ daddu $s0, $v0, $zero -/* BE6054 802428A4 1040000B */ beqz $v0, .L802428D4 -/* BE6058 802428A8 00000000 */ nop -/* BE605C 802428AC 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE6060 802428B0 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE6064 802428B4 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE6068 802428B8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE606C 802428BC 8C460028 */ lw $a2, 0x28($v0) -/* BE6070 802428C0 0C00A720 */ jal atan2 -/* BE6074 802428C4 8C470030 */ lw $a3, 0x30($v0) -/* BE6078 802428C8 2402000C */ addiu $v0, $zero, 0xc -/* BE607C 802428CC 08090A6B */ j .L802429AC -/* BE6080 802428D0 E600000C */ swc1 $f0, 0xc($s0) -.L802428D4: -/* BE6084 802428D4 9602008E */ lhu $v0, 0x8e($s0) -/* BE6088 802428D8 2442FFFF */ addiu $v0, $v0, -1 -/* BE608C 802428DC A602008E */ sh $v0, 0x8e($s0) -/* BE6090 802428E0 00021400 */ sll $v0, $v0, 0x10 -/* BE6094 802428E4 1C400032 */ bgtz $v0, .L802429B0 -/* BE6098 802428E8 00000000 */ nop -/* BE609C 802428EC 8E620074 */ lw $v0, 0x74($s3) -/* BE60A0 802428F0 2442FFFF */ addiu $v0, $v0, -1 -/* BE60A4 802428F4 18400014 */ blez $v0, .L80242948 -/* BE60A8 802428F8 AE620074 */ sw $v0, 0x74($s3) -/* BE60AC 802428FC C600000C */ lwc1 $f0, 0xc($s0) -/* BE60B0 80242900 3C014334 */ lui $at, 0x4334 -/* BE60B4 80242904 44816000 */ mtc1 $at, $f12 -/* BE60B8 80242908 0C00A6C9 */ jal clamp_angle -/* BE60BC 8024290C 460C0300 */ add.s $f12, $f0, $f12 -/* BE60C0 80242910 E600000C */ swc1 $f0, 0xc($s0) -/* BE60C4 80242914 8E440008 */ lw $a0, 8($s2) -/* BE60C8 80242918 000417C2 */ srl $v0, $a0, 0x1f -/* BE60CC 8024291C 00822021 */ addu $a0, $a0, $v0 -/* BE60D0 80242920 00042043 */ sra $a0, $a0, 1 -/* BE60D4 80242924 0C00A67F */ jal rand_int -/* BE60D8 80242928 24840001 */ addiu $a0, $a0, 1 -/* BE60DC 8024292C 8E430008 */ lw $v1, 8($s2) -/* BE60E0 80242930 000327C2 */ srl $a0, $v1, 0x1f -/* BE60E4 80242934 00641821 */ addu $v1, $v1, $a0 -/* BE60E8 80242938 00031843 */ sra $v1, $v1, 1 -/* BE60EC 8024293C 00621821 */ addu $v1, $v1, $v0 -/* BE60F0 80242940 08090A6C */ j .L802429B0 -/* BE60F4 80242944 A603008E */ sh $v1, 0x8e($s0) -.L80242948: -/* BE60F8 80242948 24040002 */ addiu $a0, $zero, 2 -/* BE60FC 8024294C 0200282D */ daddu $a1, $s0, $zero -/* BE6100 80242950 0000302D */ daddu $a2, $zero, $zero -/* BE6104 80242954 860300A8 */ lh $v1, 0xa8($s0) -/* BE6108 80242958 3C013F80 */ lui $at, 0x3f80 -/* BE610C 8024295C 44810000 */ mtc1 $at, $f0 -/* BE6110 80242960 3C014000 */ lui $at, 0x4000 -/* BE6114 80242964 44811000 */ mtc1 $at, $f2 -/* BE6118 80242968 3C01C1A0 */ lui $at, 0xc1a0 -/* BE611C 8024296C 44812000 */ mtc1 $at, $f4 -/* BE6120 80242970 2402000C */ addiu $v0, $zero, 0xc -/* BE6124 80242974 AFA2001C */ sw $v0, 0x1c($sp) -/* BE6128 80242978 44833000 */ mtc1 $v1, $f6 -/* BE612C 8024297C 00000000 */ nop -/* BE6130 80242980 468031A0 */ cvt.s.w $f6, $f6 -/* BE6134 80242984 44073000 */ mfc1 $a3, $f6 -/* BE6138 80242988 27A20028 */ addiu $v0, $sp, 0x28 -/* BE613C 8024298C AFA20020 */ sw $v0, 0x20($sp) -/* BE6140 80242990 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE6144 80242994 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE6148 80242998 0C01BFA4 */ jal fx_emote -/* BE614C 8024299C E7A40018 */ swc1 $f4, 0x18($sp) -/* BE6150 802429A0 2402000F */ addiu $v0, $zero, 0xf -/* BE6154 802429A4 A602008E */ sh $v0, 0x8e($s0) -/* BE6158 802429A8 24020028 */ addiu $v0, $zero, 0x28 -.L802429AC: -/* BE615C 802429AC AE620070 */ sw $v0, 0x70($s3) -.L802429B0: -/* BE6160 802429B0 8FBF0040 */ lw $ra, 0x40($sp) -/* BE6164 802429B4 8FB3003C */ lw $s3, 0x3c($sp) -/* BE6168 802429B8 8FB20038 */ lw $s2, 0x38($sp) -/* BE616C 802429BC 8FB10034 */ lw $s1, 0x34($sp) -/* BE6170 802429C0 8FB00030 */ lw $s0, 0x30($sp) -/* BE6174 802429C4 03E00008 */ jr $ra -/* BE6178 802429C8 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242A1C_BE61CC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242A1C_BE61CC.s deleted file mode 100644 index c2352234d8..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242A1C_BE61CC.s +++ /dev/null @@ -1,111 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242A1C_BE61CC -/* BE61CC 80242A1C 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* BE61D0 80242A20 AFB30024 */ sw $s3, 0x24($sp) -/* BE61D4 80242A24 0080982D */ daddu $s3, $a0, $zero -/* BE61D8 80242A28 AFBF002C */ sw $ra, 0x2c($sp) -/* BE61DC 80242A2C AFB40028 */ sw $s4, 0x28($sp) -/* BE61E0 80242A30 AFB20020 */ sw $s2, 0x20($sp) -/* BE61E4 80242A34 AFB1001C */ sw $s1, 0x1c($sp) -/* BE61E8 80242A38 AFB00018 */ sw $s0, 0x18($sp) -/* BE61EC 80242A3C 8E710148 */ lw $s1, 0x148($s3) -/* BE61F0 80242A40 86240008 */ lh $a0, 8($s1) -/* BE61F4 80242A44 0C00EABB */ jal get_npc_unsafe -/* BE61F8 80242A48 00A0A02D */ daddu $s4, $a1, $zero -/* BE61FC 80242A4C 0040802D */ daddu $s0, $v0, $zero -/* BE6200 80242A50 3C12800F */ lui $s2, %hi(gPlayerStatusPtr) -/* BE6204 80242A54 26527B30 */ addiu $s2, $s2, %lo(gPlayerStatusPtr) -/* BE6208 80242A58 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE620C 80242A5C 8E420000 */ lw $v0, ($s2) -/* BE6210 80242A60 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE6214 80242A64 8C460028 */ lw $a2, 0x28($v0) -/* BE6218 80242A68 0C00A720 */ jal atan2 -/* BE621C 80242A6C 8C470030 */ lw $a3, 0x30($v0) -/* BE6220 80242A70 3C025555 */ lui $v0, 0x5555 -/* BE6224 80242A74 9603008E */ lhu $v1, 0x8e($s0) -/* BE6228 80242A78 34425556 */ ori $v0, $v0, 0x5556 -/* BE622C 80242A7C 00031C00 */ sll $v1, $v1, 0x10 -/* BE6230 80242A80 00032403 */ sra $a0, $v1, 0x10 -/* BE6234 80242A84 00820018 */ mult $a0, $v0 -/* BE6238 80242A88 00031FC3 */ sra $v1, $v1, 0x1f -/* BE623C 80242A8C 00004010 */ mfhi $t0 -/* BE6240 80242A90 01031823 */ subu $v1, $t0, $v1 -/* BE6244 80242A94 00031040 */ sll $v0, $v1, 1 -/* BE6248 80242A98 00431021 */ addu $v0, $v0, $v1 -/* BE624C 80242A9C 00822023 */ subu $a0, $a0, $v0 -/* BE6250 80242AA0 00042400 */ sll $a0, $a0, 0x10 -/* BE6254 80242AA4 1480000C */ bnez $a0, .L80242AD8 -/* BE6258 80242AA8 E600000C */ swc1 $f0, 0xc($s0) -/* BE625C 80242AAC C6020040 */ lwc1 $f2, 0x40($s0) -/* BE6260 80242AB0 3C014000 */ lui $at, 0x4000 -/* BE6264 80242AB4 44810000 */ mtc1 $at, $f0 -/* BE6268 80242AB8 AFA00010 */ sw $zero, 0x10($sp) -/* BE626C 80242ABC AFA00014 */ sw $zero, 0x14($sp) -/* BE6270 80242AC0 46001080 */ add.s $f2, $f2, $f0 -/* BE6274 80242AC4 8E06003C */ lw $a2, 0x3c($s0) -/* BE6278 80242AC8 8E050038 */ lw $a1, 0x38($s0) -/* BE627C 80242ACC 44071000 */ mfc1 $a3, $f2 -/* BE6280 80242AD0 0C01BECC */ jal fx_walk_normal -/* BE6284 80242AD4 24040002 */ addiu $a0, $zero, 2 -.L80242AD8: -/* BE6288 80242AD8 9602008E */ lhu $v0, 0x8e($s0) -/* BE628C 80242ADC 2442FFFF */ addiu $v0, $v0, -1 -/* BE6290 80242AE0 A602008E */ sh $v0, 0x8e($s0) -/* BE6294 80242AE4 00021400 */ sll $v0, $v0, 0x10 -/* BE6298 80242AE8 1C40002C */ bgtz $v0, .L80242B9C -/* BE629C 80242AEC 00000000 */ nop -/* BE62A0 80242AF0 C6000038 */ lwc1 $f0, 0x38($s0) -/* BE62A4 80242AF4 4600010D */ trunc.w.s $f4, $f0 -/* BE62A8 80242AF8 44022000 */ mfc1 $v0, $f4 -/* BE62AC 80242AFC 00000000 */ nop -/* BE62B0 80242B00 A6220010 */ sh $v0, 0x10($s1) -/* BE62B4 80242B04 C600003C */ lwc1 $f0, 0x3c($s0) -/* BE62B8 80242B08 4600010D */ trunc.w.s $f4, $f0 -/* BE62BC 80242B0C 44022000 */ mfc1 $v0, $f4 -/* BE62C0 80242B10 00000000 */ nop -/* BE62C4 80242B14 A6220012 */ sh $v0, 0x12($s1) -/* BE62C8 80242B18 C6000040 */ lwc1 $f0, 0x40($s0) -/* BE62CC 80242B1C 24020001 */ addiu $v0, $zero, 1 -/* BE62D0 80242B20 A2220007 */ sb $v0, 7($s1) -/* BE62D4 80242B24 4600010D */ trunc.w.s $f4, $f0 -/* BE62D8 80242B28 44022000 */ mfc1 $v0, $f4 -/* BE62DC 80242B2C 00000000 */ nop -/* BE62E0 80242B30 A6220014 */ sh $v0, 0x14($s1) -/* BE62E4 80242B34 C6800018 */ lwc1 $f0, 0x18($s4) -/* BE62E8 80242B38 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE62EC 80242B3C C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE62F0 80242B40 8E420000 */ lw $v0, ($s2) -/* BE62F4 80242B44 E6000018 */ swc1 $f0, 0x18($s0) -/* BE62F8 80242B48 8C460028 */ lw $a2, 0x28($v0) -/* BE62FC 80242B4C 0C00A7B5 */ jal dist2D -/* BE6300 80242B50 8C470030 */ lw $a3, 0x30($v0) -/* BE6304 80242B54 C6020018 */ lwc1 $f2, 0x18($s0) -/* BE6308 80242B58 46020003 */ div.s $f0, $f0, $f2 -/* BE630C 80242B5C 3C018024 */ lui $at, %hi(D_80244340_BE7AF0) -/* BE6310 80242B60 D4224340 */ ldc1 $f2, %lo(D_80244340_BE7AF0)($at) -/* BE6314 80242B64 46000021 */ cvt.d.s $f0, $f0 -/* BE6318 80242B68 46220000 */ add.d $f0, $f0, $f2 -/* BE631C 80242B6C 4620010D */ trunc.w.d $f4, $f0 -/* BE6320 80242B70 44022000 */ mfc1 $v0, $f4 -/* BE6324 80242B74 00000000 */ nop -/* BE6328 80242B78 A602008E */ sh $v0, 0x8e($s0) -/* BE632C 80242B7C 00021400 */ sll $v0, $v0, 0x10 -/* BE6330 80242B80 00021403 */ sra $v0, $v0, 0x10 -/* BE6334 80242B84 2842000F */ slti $v0, $v0, 0xf -/* BE6338 80242B88 10400002 */ beqz $v0, .L80242B94 -/* BE633C 80242B8C 2402000F */ addiu $v0, $zero, 0xf -/* BE6340 80242B90 A602008E */ sh $v0, 0x8e($s0) -.L80242B94: -/* BE6344 80242B94 24020016 */ addiu $v0, $zero, 0x16 -/* BE6348 80242B98 AE620070 */ sw $v0, 0x70($s3) -.L80242B9C: -/* BE634C 80242B9C 8FBF002C */ lw $ra, 0x2c($sp) -/* BE6350 80242BA0 8FB40028 */ lw $s4, 0x28($sp) -/* BE6354 80242BA4 8FB30024 */ lw $s3, 0x24($sp) -/* BE6358 80242BA8 8FB20020 */ lw $s2, 0x20($sp) -/* BE635C 80242BAC 8FB1001C */ lw $s1, 0x1c($sp) -/* BE6360 80242BB0 8FB00018 */ lw $s0, 0x18($sp) -/* BE6364 80242BB4 03E00008 */ jr $ra -/* BE6368 80242BB8 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242BBC_BE636C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242BBC_BE636C.s deleted file mode 100644 index 5bbe31107e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242BBC_BE636C.s +++ /dev/null @@ -1,91 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242BBC_BE636C -/* BE636C 80242BBC 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE6370 80242BC0 AFB3003C */ sw $s3, 0x3c($sp) -/* BE6374 80242BC4 0080982D */ daddu $s3, $a0, $zero -/* BE6378 80242BC8 AFBF0040 */ sw $ra, 0x40($sp) -/* BE637C 80242BCC AFB20038 */ sw $s2, 0x38($sp) -/* BE6380 80242BD0 AFB10034 */ sw $s1, 0x34($sp) -/* BE6384 80242BD4 AFB00030 */ sw $s0, 0x30($sp) -/* BE6388 80242BD8 8E720148 */ lw $s2, 0x148($s3) -/* BE638C 80242BDC 0C00EABB */ jal get_npc_unsafe -/* BE6390 80242BE0 86440008 */ lh $a0, 8($s2) -/* BE6394 80242BE4 0040802D */ daddu $s0, $v0, $zero -/* BE6398 80242BE8 0200202D */ daddu $a0, $s0, $zero -/* BE639C 80242BEC 0C00F598 */ jal func_8003D660 -/* BE63A0 80242BF0 24050001 */ addiu $a1, $zero, 1 -/* BE63A4 80242BF4 8E050018 */ lw $a1, 0x18($s0) -/* BE63A8 80242BF8 8E06000C */ lw $a2, 0xc($s0) -/* BE63AC 80242BFC 0C00EA95 */ jal npc_move_heading -/* BE63B0 80242C00 0200202D */ daddu $a0, $s0, $zero -/* BE63B4 80242C04 8E4300D0 */ lw $v1, 0xd0($s2) -/* BE63B8 80242C08 C6000040 */ lwc1 $f0, 0x40($s0) -/* BE63BC 80242C0C C462001C */ lwc1 $f2, 0x1c($v1) -/* BE63C0 80242C10 468010A0 */ cvt.s.w $f2, $f2 -/* BE63C4 80242C14 C4640024 */ lwc1 $f4, 0x24($v1) -/* BE63C8 80242C18 46802120 */ cvt.s.w $f4, $f4 -/* BE63CC 80242C1C E7A00010 */ swc1 $f0, 0x10($sp) -/* BE63D0 80242C20 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE63D4 80242C24 44051000 */ mfc1 $a1, $f2 -/* BE63D8 80242C28 C4400028 */ lwc1 $f0, 0x28($v0) -/* BE63DC 80242C2C 46800020 */ cvt.s.w $f0, $f0 -/* BE63E0 80242C30 E7A00014 */ swc1 $f0, 0x14($sp) -/* BE63E4 80242C34 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE63E8 80242C38 44062000 */ mfc1 $a2, $f4 -/* BE63EC 80242C3C C440002C */ lwc1 $f0, 0x2c($v0) -/* BE63F0 80242C40 46800020 */ cvt.s.w $f0, $f0 -/* BE63F4 80242C44 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE63F8 80242C48 8C640030 */ lw $a0, 0x30($v1) -/* BE63FC 80242C4C 0C0123F5 */ jal is_point_within_region -/* BE6400 80242C50 8E070038 */ lw $a3, 0x38($s0) -/* BE6404 80242C54 C6000038 */ lwc1 $f0, 0x38($s0) -/* BE6408 80242C58 C602003C */ lwc1 $f2, 0x3c($s0) -/* BE640C 80242C5C C6040040 */ lwc1 $f4, 0x40($s0) -/* BE6410 80242C60 3C013F80 */ lui $at, 0x3f80 -/* BE6414 80242C64 44813000 */ mtc1 $at, $f6 -/* BE6418 80242C68 E7A00020 */ swc1 $f0, 0x20($sp) -/* BE641C 80242C6C E7A20024 */ swc1 $f2, 0x24($sp) -/* BE6420 80242C70 E7A40028 */ swc1 $f4, 0x28($sp) -/* BE6424 80242C74 E7A60010 */ swc1 $f6, 0x10($sp) -/* BE6428 80242C78 C600000C */ lwc1 $f0, 0xc($s0) -/* BE642C 80242C7C 0002882B */ sltu $s1, $zero, $v0 -/* BE6430 80242C80 E7A00014 */ swc1 $f0, 0x14($sp) -/* BE6434 80242C84 860200A8 */ lh $v0, 0xa8($s0) -/* BE6438 80242C88 27A50020 */ addiu $a1, $sp, 0x20 -/* BE643C 80242C8C 44820000 */ mtc1 $v0, $f0 -/* BE6440 80242C90 00000000 */ nop -/* BE6444 80242C94 46800020 */ cvt.s.w $f0, $f0 -/* BE6448 80242C98 E7A00018 */ swc1 $f0, 0x18($sp) -/* BE644C 80242C9C 860200A6 */ lh $v0, 0xa6($s0) -/* BE6450 80242CA0 27A60024 */ addiu $a2, $sp, 0x24 -/* BE6454 80242CA4 44820000 */ mtc1 $v0, $f0 -/* BE6458 80242CA8 00000000 */ nop -/* BE645C 80242CAC 46800020 */ cvt.s.w $f0, $f0 -/* BE6460 80242CB0 E7A0001C */ swc1 $f0, 0x1c($sp) -/* BE6464 80242CB4 8E040080 */ lw $a0, 0x80($s0) -/* BE6468 80242CB8 0C037711 */ jal func_800DDC44 -/* BE646C 80242CBC 27A70028 */ addiu $a3, $sp, 0x28 -/* BE6470 80242CC0 54400001 */ bnel $v0, $zero, .L80242CC8 -/* BE6474 80242CC4 24110001 */ addiu $s1, $zero, 1 -.L80242CC8: -/* BE6478 80242CC8 9602008E */ lhu $v0, 0x8e($s0) -/* BE647C 80242CCC 2442FFFF */ addiu $v0, $v0, -1 -/* BE6480 80242CD0 A602008E */ sh $v0, 0x8e($s0) -/* BE6484 80242CD4 00021400 */ sll $v0, $v0, 0x10 -/* BE6488 80242CD8 58400001 */ blezl $v0, .L80242CE0 -/* BE648C 80242CDC 24110001 */ addiu $s1, $zero, 1 -.L80242CE0: -/* BE6490 80242CE0 12200003 */ beqz $s1, .L80242CF0 -/* BE6494 80242CE4 24020004 */ addiu $v0, $zero, 4 -/* BE6498 80242CE8 AE620070 */ sw $v0, 0x70($s3) -/* BE649C 80242CEC A2400007 */ sb $zero, 7($s2) -.L80242CF0: -/* BE64A0 80242CF0 8FBF0040 */ lw $ra, 0x40($sp) -/* BE64A4 80242CF4 8FB3003C */ lw $s3, 0x3c($sp) -/* BE64A8 80242CF8 8FB20038 */ lw $s2, 0x38($sp) -/* BE64AC 80242CFC 8FB10034 */ lw $s1, 0x34($sp) -/* BE64B0 80242D00 8FB00030 */ lw $s0, 0x30($sp) -/* BE64B4 80242D04 03E00008 */ jr $ra -/* BE64B8 80242D08 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242D0C_BE64BC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242D0C_BE64BC.s deleted file mode 100644 index dcc00359c1..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242D0C_BE64BC.s +++ /dev/null @@ -1,50 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242D0C_BE64BC -/* BE64BC 80242D0C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE64C0 80242D10 AFB20018 */ sw $s2, 0x18($sp) -/* BE64C4 80242D14 0080902D */ daddu $s2, $a0, $zero -/* BE64C8 80242D18 AFBF001C */ sw $ra, 0x1c($sp) -/* BE64CC 80242D1C AFB10014 */ sw $s1, 0x14($sp) -/* BE64D0 80242D20 AFB00010 */ sw $s0, 0x10($sp) -/* BE64D4 80242D24 8E500148 */ lw $s0, 0x148($s2) -/* BE64D8 80242D28 86040008 */ lh $a0, 8($s0) -/* BE64DC 80242D2C 0C00EABB */ jal get_npc_unsafe -/* BE64E0 80242D30 00A0882D */ daddu $s1, $a1, $zero -/* BE64E4 80242D34 0040182D */ daddu $v1, $v0, $zero -/* BE64E8 80242D38 9462008E */ lhu $v0, 0x8e($v1) -/* BE64EC 80242D3C 2442FFFF */ addiu $v0, $v0, -1 -/* BE64F0 80242D40 A462008E */ sh $v0, 0x8e($v1) -/* BE64F4 80242D44 00021400 */ sll $v0, $v0, 0x10 -/* BE64F8 80242D48 1C400015 */ bgtz $v0, .L80242DA0 -/* BE64FC 80242D4C 00000000 */ nop -/* BE6500 80242D50 8E0200CC */ lw $v0, 0xcc($s0) -/* BE6504 80242D54 8C420004 */ lw $v0, 4($v0) -/* BE6508 80242D58 AC620028 */ sw $v0, 0x28($v1) -/* BE650C 80242D5C 8E0200D0 */ lw $v0, 0xd0($s0) -/* BE6510 80242D60 8C420014 */ lw $v0, 0x14($v0) -/* BE6514 80242D64 04410004 */ bgez $v0, .L80242D78 -/* BE6518 80242D68 00000000 */ nop -/* BE651C 80242D6C C6200000 */ lwc1 $f0, ($s1) -/* BE6520 80242D70 08090B66 */ j .L80242D98 -/* BE6524 80242D74 E4600018 */ swc1 $f0, 0x18($v1) -.L80242D78: -/* BE6528 80242D78 3C018024 */ lui $at, %hi(D_80244348_BE7AF8) -/* BE652C 80242D7C D4224348 */ ldc1 $f2, %lo(D_80244348_BE7AF8)($at) -/* BE6530 80242D80 44820000 */ mtc1 $v0, $f0 -/* BE6534 80242D84 00000000 */ nop -/* BE6538 80242D88 46800021 */ cvt.d.w $f0, $f0 -/* BE653C 80242D8C 46220003 */ div.d $f0, $f0, $f2 -/* BE6540 80242D90 46200020 */ cvt.s.d $f0, $f0 -/* BE6544 80242D94 E4600018 */ swc1 $f0, 0x18($v1) -.L80242D98: -/* BE6548 80242D98 24020029 */ addiu $v0, $zero, 0x29 -/* BE654C 80242D9C AE420070 */ sw $v0, 0x70($s2) -.L80242DA0: -/* BE6550 80242DA0 8FBF001C */ lw $ra, 0x1c($sp) -/* BE6554 80242DA4 8FB20018 */ lw $s2, 0x18($sp) -/* BE6558 80242DA8 8FB10014 */ lw $s1, 0x14($sp) -/* BE655C 80242DAC 8FB00010 */ lw $s0, 0x10($sp) -/* BE6560 80242DB0 03E00008 */ jr $ra -/* BE6564 80242DB4 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242DB8_BE6568.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242DB8_BE6568.s deleted file mode 100644 index f0a81a4660..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80242DB8_BE6568.s +++ /dev/null @@ -1,85 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80242DB8_BE6568 -/* BE6568 80242DB8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* BE656C 80242DBC AFB30024 */ sw $s3, 0x24($sp) -/* BE6570 80242DC0 0080982D */ daddu $s3, $a0, $zero -/* BE6574 80242DC4 AFBF0028 */ sw $ra, 0x28($sp) -/* BE6578 80242DC8 AFB20020 */ sw $s2, 0x20($sp) -/* BE657C 80242DCC AFB1001C */ sw $s1, 0x1c($sp) -/* BE6580 80242DD0 AFB00018 */ sw $s0, 0x18($sp) -/* BE6584 80242DD4 8E720148 */ lw $s2, 0x148($s3) -/* BE6588 80242DD8 00A0882D */ daddu $s1, $a1, $zero -/* BE658C 80242DDC 86440008 */ lh $a0, 8($s2) -/* BE6590 80242DE0 0C00EABB */ jal get_npc_unsafe -/* BE6594 80242DE4 00C0802D */ daddu $s0, $a2, $zero -/* BE6598 80242DE8 0200202D */ daddu $a0, $s0, $zero -/* BE659C 80242DEC 0240282D */ daddu $a1, $s2, $zero -/* BE65A0 80242DF0 AFA00010 */ sw $zero, 0x10($sp) -/* BE65A4 80242DF4 8E260024 */ lw $a2, 0x24($s1) -/* BE65A8 80242DF8 8E270028 */ lw $a3, 0x28($s1) -/* BE65AC 80242DFC 0C01242D */ jal func_800490B4 -/* BE65B0 80242E00 0040802D */ daddu $s0, $v0, $zero -/* BE65B4 80242E04 1040000C */ beqz $v0, .L80242E38 -/* BE65B8 80242E08 00000000 */ nop -/* BE65BC 80242E0C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE65C0 80242E10 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE65C4 80242E14 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE65C8 80242E18 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE65CC 80242E1C 8C460028 */ lw $a2, 0x28($v0) -/* BE65D0 80242E20 0C00A720 */ jal atan2 -/* BE65D4 80242E24 8C470030 */ lw $a3, 0x30($v0) -/* BE65D8 80242E28 2402000C */ addiu $v0, $zero, 0xc -/* BE65DC 80242E2C E600000C */ swc1 $f0, 0xc($s0) -/* BE65E0 80242E30 08090BB5 */ j .L80242ED4 -/* BE65E4 80242E34 AE620070 */ sw $v0, 0x70($s3) -.L80242E38: -/* BE65E8 80242E38 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE65EC 80242E3C 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE65F0 80242E40 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE65F4 80242E44 C4440000 */ lwc1 $f4, ($v0) -/* BE65F8 80242E48 46802120 */ cvt.s.w $f4, $f4 -/* BE65FC 80242E4C 44062000 */ mfc1 $a2, $f4 -/* BE6600 80242E50 C4440008 */ lwc1 $f4, 8($v0) -/* BE6604 80242E54 46802120 */ cvt.s.w $f4, $f4 -/* BE6608 80242E58 44072000 */ mfc1 $a3, $f4 -/* BE660C 80242E5C 0C00A7B5 */ jal dist2D -/* BE6610 80242E60 00000000 */ nop -/* BE6614 80242E64 C6020018 */ lwc1 $f2, 0x18($s0) -/* BE6618 80242E68 4602003E */ c.le.s $f0, $f2 -/* BE661C 80242E6C 00000000 */ nop -/* BE6620 80242E70 45000005 */ bc1f .L80242E88 -/* BE6624 80242E74 2402000A */ addiu $v0, $zero, 0xa -/* BE6628 80242E78 A602008E */ sh $v0, 0x8e($s0) -/* BE662C 80242E7C 24020032 */ addiu $v0, $zero, 0x32 -/* BE6630 80242E80 08090BB5 */ j .L80242ED4 -/* BE6634 80242E84 AE620070 */ sw $v0, 0x70($s3) -.L80242E88: -/* BE6638 80242E88 8602008C */ lh $v0, 0x8c($s0) -/* BE663C 80242E8C 14400011 */ bnez $v0, .L80242ED4 -/* BE6640 80242E90 00000000 */ nop -/* BE6644 80242E94 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE6648 80242E98 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE664C 80242E9C C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE6650 80242EA0 C4440000 */ lwc1 $f4, ($v0) -/* BE6654 80242EA4 46802120 */ cvt.s.w $f4, $f4 -/* BE6658 80242EA8 44062000 */ mfc1 $a2, $f4 -/* BE665C 80242EAC C4440008 */ lwc1 $f4, 8($v0) -/* BE6660 80242EB0 46802120 */ cvt.s.w $f4, $f4 -/* BE6664 80242EB4 44072000 */ mfc1 $a3, $f4 -/* BE6668 80242EB8 0C00A720 */ jal atan2 -/* BE666C 80242EBC 00000000 */ nop -/* BE6670 80242EC0 8E050018 */ lw $a1, 0x18($s0) -/* BE6674 80242EC4 44060000 */ mfc1 $a2, $f0 -/* BE6678 80242EC8 0200202D */ daddu $a0, $s0, $zero -/* BE667C 80242ECC 0C00EA95 */ jal npc_move_heading -/* BE6680 80242ED0 AC86000C */ sw $a2, 0xc($a0) -.L80242ED4: -/* BE6684 80242ED4 8FBF0028 */ lw $ra, 0x28($sp) -/* BE6688 80242ED8 8FB30024 */ lw $s3, 0x24($sp) -/* BE668C 80242EDC 8FB20020 */ lw $s2, 0x20($sp) -/* BE6690 80242EE0 8FB1001C */ lw $s1, 0x1c($sp) -/* BE6694 80242EE4 8FB00018 */ lw $s0, 0x18($sp) -/* BE6698 80242EE8 03E00008 */ jr $ra -/* BE669C 80242EEC 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80243018_BE67C8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80243018_BE67C8.s deleted file mode 100644 index c605169321..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_04/BE37B0/func_80243018_BE67C8.s +++ /dev/null @@ -1,242 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80243018_BE67C8 -/* BE67C8 80243018 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BE67CC 8024301C AFB3003C */ sw $s3, 0x3c($sp) -/* BE67D0 80243020 0080982D */ daddu $s3, $a0, $zero -/* BE67D4 80243024 AFBF0048 */ sw $ra, 0x48($sp) -/* BE67D8 80243028 AFB50044 */ sw $s5, 0x44($sp) -/* BE67DC 8024302C AFB40040 */ sw $s4, 0x40($sp) -/* BE67E0 80243030 AFB20038 */ sw $s2, 0x38($sp) -/* BE67E4 80243034 AFB10034 */ sw $s1, 0x34($sp) -/* BE67E8 80243038 AFB00030 */ sw $s0, 0x30($sp) -/* BE67EC 8024303C 8E720148 */ lw $s2, 0x148($s3) -/* BE67F0 80243040 86440008 */ lh $a0, 8($s2) -/* BE67F4 80243044 0C00EABB */ jal get_npc_unsafe -/* BE67F8 80243048 00A0882D */ daddu $s1, $a1, $zero -/* BE67FC 8024304C 0260202D */ daddu $a0, $s3, $zero -/* BE6800 80243050 8E70000C */ lw $s0, 0xc($s3) -/* BE6804 80243054 0040A82D */ daddu $s5, $v0, $zero -/* BE6808 80243058 8E050000 */ lw $a1, ($s0) -/* BE680C 8024305C 0C0B1EAF */ jal get_variable -/* BE6810 80243060 26100004 */ addiu $s0, $s0, 4 -/* BE6814 80243064 0260202D */ daddu $a0, $s3, $zero -/* BE6818 80243068 8E050000 */ lw $a1, ($s0) -/* BE681C 8024306C 0C0B1EAF */ jal get_variable -/* BE6820 80243070 0040A02D */ daddu $s4, $v0, $zero -/* BE6824 80243074 AE420094 */ sw $v0, 0x94($s2) -/* BE6828 80243078 AFA00010 */ sw $zero, 0x10($sp) -/* BE682C 8024307C 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE6830 80243080 8C420030 */ lw $v0, 0x30($v0) -/* BE6834 80243084 AFA20014 */ sw $v0, 0x14($sp) -/* BE6838 80243088 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE683C 8024308C 8C42001C */ lw $v0, 0x1c($v0) -/* BE6840 80243090 AFA20018 */ sw $v0, 0x18($sp) -/* BE6844 80243094 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE6848 80243098 8C420024 */ lw $v0, 0x24($v0) -/* BE684C 8024309C AFA2001C */ sw $v0, 0x1c($sp) -/* BE6850 802430A0 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE6854 802430A4 8C420028 */ lw $v0, 0x28($v0) -/* BE6858 802430A8 AFA20020 */ sw $v0, 0x20($sp) -/* BE685C 802430AC 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE6860 802430B0 3C014220 */ lui $at, 0x4220 -/* BE6864 802430B4 44810000 */ mtc1 $at, $f0 -/* BE6868 802430B8 8C42002C */ lw $v0, 0x2c($v0) -/* BE686C 802430BC 27B00010 */ addiu $s0, $sp, 0x10 -/* BE6870 802430C0 E7A00028 */ swc1 $f0, 0x28($sp) -/* BE6874 802430C4 A7A0002C */ sh $zero, 0x2c($sp) -/* BE6878 802430C8 12200012 */ beqz $s1, .L80243114 -/* BE687C 802430CC AFA20024 */ sw $v0, 0x24($sp) -/* BE6880 802430D0 AE600070 */ sw $zero, 0x70($s3) -/* BE6884 802430D4 8EA30000 */ lw $v1, ($s5) -/* BE6888 802430D8 2402F7FF */ addiu $v0, $zero, -0x801 -/* BE688C 802430DC A6A0008E */ sh $zero, 0x8e($s5) -/* BE6890 802430E0 00621824 */ and $v1, $v1, $v0 -/* BE6894 802430E4 AEA30000 */ sw $v1, ($s5) -/* BE6898 802430E8 8E4200D0 */ lw $v0, 0xd0($s2) -/* BE689C 802430EC 8C420034 */ lw $v0, 0x34($v0) -/* BE68A0 802430F0 54400005 */ bnel $v0, $zero, .L80243108 -/* BE68A4 802430F4 2402FDFF */ addiu $v0, $zero, -0x201 -/* BE68A8 802430F8 34620200 */ ori $v0, $v1, 0x200 -/* BE68AC 802430FC 2403FFF7 */ addiu $v1, $zero, -9 -/* BE68B0 80243100 08090C44 */ j .L80243110 -/* BE68B4 80243104 00431024 */ and $v0, $v0, $v1 -.L80243108: -/* BE68B8 80243108 00621024 */ and $v0, $v1, $v0 -/* BE68BC 8024310C 34420008 */ ori $v0, $v0, 8 -.L80243110: -/* BE68C0 80243110 AEA20000 */ sw $v0, ($s5) -.L80243114: -/* BE68C4 80243114 8E4300B0 */ lw $v1, 0xb0($s2) -/* BE68C8 80243118 30620004 */ andi $v0, $v1, 4 -/* BE68CC 8024311C 10400007 */ beqz $v0, .L8024313C -/* BE68D0 80243120 00000000 */ nop -/* BE68D4 80243124 824200B4 */ lb $v0, 0xb4($s2) -/* BE68D8 80243128 14400086 */ bnez $v0, .L80243344 -/* BE68DC 8024312C 0000102D */ daddu $v0, $zero, $zero -/* BE68E0 80243130 2402FFFB */ addiu $v0, $zero, -5 -/* BE68E4 80243134 00621024 */ and $v0, $v1, $v0 -/* BE68E8 80243138 AE4200B0 */ sw $v0, 0xb0($s2) -.L8024313C: -/* BE68EC 8024313C 8E620070 */ lw $v0, 0x70($s3) -/* BE68F0 80243140 2442FFF4 */ addiu $v0, $v0, -0xc -/* BE68F4 80243144 2C420003 */ sltiu $v0, $v0, 3 -/* BE68F8 80243148 10400007 */ beqz $v0, .L80243168 -/* BE68FC 8024314C 0260202D */ daddu $a0, $s3, $zero -/* BE6900 80243150 0280282D */ daddu $a1, $s4, $zero -/* BE6904 80243154 0C0908E2 */ jal func_80242388_BE5B38 -/* BE6908 80243158 0200302D */ daddu $a2, $s0, $zero -/* BE690C 8024315C 10400002 */ beqz $v0, .L80243168 -/* BE6910 80243160 24020014 */ addiu $v0, $zero, 0x14 -/* BE6914 80243164 AE620070 */ sw $v0, 0x70($s3) -.L80243168: -/* BE6918 80243168 8E630070 */ lw $v1, 0x70($s3) -/* BE691C 8024316C 2C620035 */ sltiu $v0, $v1, 0x35 -/* BE6920 80243170 10400073 */ beqz $v0, L80243340_BE6AF0 -/* BE6924 80243174 00031080 */ sll $v0, $v1, 2 -/* BE6928 80243178 3C018024 */ lui $at, %hi(jtbl_80244350_BE7B00) -/* BE692C 8024317C 00220821 */ addu $at, $at, $v0 -/* BE6930 80243180 8C224350 */ lw $v0, %lo(jtbl_80244350_BE7B00)($at) -/* BE6934 80243184 00400008 */ jr $v0 -/* BE6938 80243188 00000000 */ nop -glabel L8024318C_BE693C -/* BE693C 8024318C 0260202D */ daddu $a0, $s3, $zero -/* BE6940 80243190 0280282D */ daddu $a1, $s4, $zero -/* BE6944 80243194 0C09093A */ jal arn_04_UnkNpcAIFunc18 -/* BE6948 80243198 0200302D */ daddu $a2, $s0, $zero -glabel L8024319C_BE694C -/* BE694C 8024319C 0260202D */ daddu $a0, $s3, $zero -/* BE6950 802431A0 0280282D */ daddu $a1, $s4, $zero -/* BE6954 802431A4 0C090957 */ jal func_8024255C_BE5D0C -/* BE6958 802431A8 0200302D */ daddu $a2, $s0, $zero -/* BE695C 802431AC 8E630070 */ lw $v1, 0x70($s3) -/* BE6960 802431B0 24020002 */ addiu $v0, $zero, 2 -/* BE6964 802431B4 14620063 */ bne $v1, $v0, .L80243344 -/* BE6968 802431B8 0000102D */ daddu $v0, $zero, $zero -glabel L802431BC_BE696C -/* BE696C 802431BC 0260202D */ daddu $a0, $s3, $zero -/* BE6970 802431C0 0280282D */ daddu $a1, $s4, $zero -/* BE6974 802431C4 0C0909A3 */ jal arn_04_UnkNpcAIFunc21 -/* BE6978 802431C8 0200302D */ daddu $a2, $s0, $zero -/* BE697C 802431CC 8E630070 */ lw $v1, 0x70($s3) -/* BE6980 802431D0 24020003 */ addiu $v0, $zero, 3 -/* BE6984 802431D4 1462005B */ bne $v1, $v0, .L80243344 -/* BE6988 802431D8 0000102D */ daddu $v0, $zero, $zero -glabel L802431DC_BE698C -/* BE698C 802431DC 0260202D */ daddu $a0, $s3, $zero -/* BE6990 802431E0 0280282D */ daddu $a1, $s4, $zero -/* BE6994 802431E4 0C0909CA */ jal arn_04_UnkNpcAIFunc20 -/* BE6998 802431E8 0200302D */ daddu $a2, $s0, $zero -/* BE699C 802431EC 8E630070 */ lw $v1, 0x70($s3) -/* BE69A0 802431F0 24020004 */ addiu $v0, $zero, 4 -/* BE69A4 802431F4 14620053 */ bne $v1, $v0, .L80243344 -/* BE69A8 802431F8 0000102D */ daddu $v0, $zero, $zero -glabel L802431FC_BE69AC -/* BE69AC 802431FC 0260202D */ daddu $a0, $s3, $zero -/* BE69B0 80243200 0280282D */ daddu $a1, $s4, $zero -/* BE69B4 80243204 0C0909EC */ jal arn_04_UnkNpcAIFunc22 -/* BE69B8 80243208 0200302D */ daddu $a2, $s0, $zero -glabel L8024320C_BE69BC -/* BE69BC 8024320C 0260202D */ daddu $a0, $s3, $zero -/* BE69C0 80243210 0280282D */ daddu $a1, $s4, $zero -/* BE69C4 80243214 0C090A16 */ jal func_80242858_BE6008 -/* BE69C8 80243218 0200302D */ daddu $a2, $s0, $zero -/* BE69CC 8024321C 08090CD1 */ j .L80243344 -/* BE69D0 80243220 0000102D */ daddu $v0, $zero, $zero -glabel L80243224_BE69D4 -/* BE69D4 80243224 0260202D */ daddu $a0, $s3, $zero -/* BE69D8 80243228 0280282D */ daddu $a1, $s4, $zero -/* BE69DC 8024322C 0C0127DF */ jal func_80049F7C -/* BE69E0 80243230 0200302D */ daddu $a2, $s0, $zero -/* BE69E4 80243234 8E630070 */ lw $v1, 0x70($s3) -/* BE69E8 80243238 2402000D */ addiu $v0, $zero, 0xd -/* BE69EC 8024323C 14620041 */ bne $v1, $v0, .L80243344 -/* BE69F0 80243240 0000102D */ daddu $v0, $zero, $zero -glabel L80243244_BE69F4 -/* BE69F4 80243244 0260202D */ daddu $a0, $s3, $zero -/* BE69F8 80243248 0280282D */ daddu $a1, $s4, $zero -/* BE69FC 8024324C 0C012849 */ jal func_8004A124 -/* BE6A00 80243250 0200302D */ daddu $a2, $s0, $zero -/* BE6A04 80243254 8E630070 */ lw $v1, 0x70($s3) -/* BE6A08 80243258 2402000E */ addiu $v0, $zero, 0xe -/* BE6A0C 8024325C 14620039 */ bne $v1, $v0, .L80243344 -/* BE6A10 80243260 0000102D */ daddu $v0, $zero, $zero -glabel L80243264_BE6A14 -/* BE6A14 80243264 96A2008E */ lhu $v0, 0x8e($s5) -/* BE6A18 80243268 2442FFFF */ addiu $v0, $v0, -1 -/* BE6A1C 8024326C A6A2008E */ sh $v0, 0x8e($s5) -/* BE6A20 80243270 00021400 */ sll $v0, $v0, 0x10 -/* BE6A24 80243274 14400033 */ bnez $v0, .L80243344 -/* BE6A28 80243278 0000102D */ daddu $v0, $zero, $zero -/* BE6A2C 8024327C 24020028 */ addiu $v0, $zero, 0x28 -/* BE6A30 80243280 08090CD0 */ j L80243340_BE6AF0 -/* BE6A34 80243284 AE620070 */ sw $v0, 0x70($s3) -glabel L80243288_BE6A38 -/* BE6A38 80243288 0260202D */ daddu $a0, $s3, $zero -/* BE6A3C 8024328C 0280282D */ daddu $a1, $s4, $zero -/* BE6A40 80243290 0C090A73 */ jal arn_04_UnkNpcAIFunc16 -/* BE6A44 80243294 0200302D */ daddu $a2, $s0, $zero -glabel L80243298_BE6A48 -/* BE6A48 80243298 0260202D */ daddu $a0, $s3, $zero -/* BE6A4C 8024329C 0280282D */ daddu $a1, $s4, $zero -/* BE6A50 802432A0 0C090A87 */ jal func_80242A1C_BE61CC -/* BE6A54 802432A4 0200302D */ daddu $a2, $s0, $zero -/* BE6A58 802432A8 08090CD1 */ j .L80243344 -/* BE6A5C 802432AC 0000102D */ daddu $v0, $zero, $zero -glabel L802432B0_BE6A60 -/* BE6A60 802432B0 0260202D */ daddu $a0, $s3, $zero -/* BE6A64 802432B4 0280282D */ daddu $a1, $s4, $zero -/* BE6A68 802432B8 0C090AEF */ jal func_80242BBC_BE636C -/* BE6A6C 802432BC 0200302D */ daddu $a2, $s0, $zero -/* BE6A70 802432C0 08090CD1 */ j .L80243344 -/* BE6A74 802432C4 0000102D */ daddu $v0, $zero, $zero -glabel L802432C8_BE6A78 -/* BE6A78 802432C8 0260202D */ daddu $a0, $s3, $zero -/* BE6A7C 802432CC 0280282D */ daddu $a1, $s4, $zero -/* BE6A80 802432D0 0C090B43 */ jal func_80242D0C_BE64BC -/* BE6A84 802432D4 0200302D */ daddu $a2, $s0, $zero -/* BE6A88 802432D8 8E630070 */ lw $v1, 0x70($s3) -/* BE6A8C 802432DC 24020029 */ addiu $v0, $zero, 0x29 -/* BE6A90 802432E0 14620018 */ bne $v1, $v0, .L80243344 -/* BE6A94 802432E4 0000102D */ daddu $v0, $zero, $zero -glabel L802432E8_BE6A98 -/* BE6A98 802432E8 0260202D */ daddu $a0, $s3, $zero -/* BE6A9C 802432EC 0280282D */ daddu $a1, $s4, $zero -/* BE6AA0 802432F0 0C090B6E */ jal func_80242DB8_BE6568 -/* BE6AA4 802432F4 0200302D */ daddu $a2, $s0, $zero -/* BE6AA8 802432F8 08090CD1 */ j .L80243344 -/* BE6AAC 802432FC 0000102D */ daddu $v0, $zero, $zero -glabel L80243300_BE6AB0 -/* BE6AB0 80243300 0260202D */ daddu $a0, $s3, $zero -/* BE6AB4 80243304 0280282D */ daddu $a1, $s4, $zero -/* BE6AB8 80243308 0C090BBC */ jal arn_04_UnkNpcAIFunc19 -/* BE6ABC 8024330C 0200302D */ daddu $a2, $s0, $zero -glabel L80243310_BE6AC0 -/* BE6AC0 80243310 0260202D */ daddu $a0, $s3, $zero -/* BE6AC4 80243314 0280282D */ daddu $a1, $s4, $zero -/* BE6AC8 80243318 0C090BDB */ jal arn_04_UnkNpcAIFunc17 -/* BE6ACC 8024331C 0200302D */ daddu $a2, $s0, $zero -/* BE6AD0 80243320 8E630070 */ lw $v1, 0x70($s3) -/* BE6AD4 80243324 24020034 */ addiu $v0, $zero, 0x34 -/* BE6AD8 80243328 14620006 */ bne $v1, $v0, .L80243344 -/* BE6ADC 8024332C 0000102D */ daddu $v0, $zero, $zero -glabel L80243330_BE6AE0 -/* BE6AE0 80243330 0260202D */ daddu $a0, $s3, $zero -/* BE6AE4 80243334 0280282D */ daddu $a1, $s4, $zero -/* BE6AE8 80243338 0C090BF5 */ jal arn_04_UnkDurationCheck -/* BE6AEC 8024333C 0200302D */ daddu $a2, $s0, $zero -glabel L80243340_BE6AF0 -/* BE6AF0 80243340 0000102D */ daddu $v0, $zero, $zero -.L80243344: -/* BE6AF4 80243344 8FBF0048 */ lw $ra, 0x48($sp) -/* BE6AF8 80243348 8FB50044 */ lw $s5, 0x44($sp) -/* BE6AFC 8024334C 8FB40040 */ lw $s4, 0x40($sp) -/* BE6B00 80243350 8FB3003C */ lw $s3, 0x3c($sp) -/* BE6B04 80243354 8FB20038 */ lw $s2, 0x38($sp) -/* BE6B08 80243358 8FB10034 */ lw $s1, 0x34($sp) -/* BE6B0C 8024335C 8FB00030 */ lw $s0, 0x30($sp) -/* BE6B10 80243360 03E00008 */ jr $ra -/* BE6B14 80243364 27BD0050 */ addiu $sp, $sp, 0x50 -/* BE6B18 80243368 00000000 */ nop -/* BE6B1C 8024336C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240000_BE7BE0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240000_BE7BE0.s deleted file mode 100644 index aa2fede209..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240000_BE7BE0.s +++ /dev/null @@ -1,95 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BE7BE0 -/* BE7BE0 80240000 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE7BE4 80240004 AFB50024 */ sw $s5, 0x24($sp) -/* BE7BE8 80240008 0080A82D */ daddu $s5, $a0, $zero -/* BE7BEC 8024000C AFBF002C */ sw $ra, 0x2c($sp) -/* BE7BF0 80240010 AFB60028 */ sw $s6, 0x28($sp) -/* BE7BF4 80240014 AFB40020 */ sw $s4, 0x20($sp) -/* BE7BF8 80240018 AFB3001C */ sw $s3, 0x1c($sp) -/* BE7BFC 8024001C AFB20018 */ sw $s2, 0x18($sp) -/* BE7C00 80240020 AFB10014 */ sw $s1, 0x14($sp) -/* BE7C04 80240024 AFB00010 */ sw $s0, 0x10($sp) -/* BE7C08 80240028 F7B80040 */ sdc1 $f24, 0x40($sp) -/* BE7C0C 8024002C F7B60038 */ sdc1 $f22, 0x38($sp) -/* BE7C10 80240030 F7B40030 */ sdc1 $f20, 0x30($sp) -/* BE7C14 80240034 8EB30148 */ lw $s3, 0x148($s5) -/* BE7C18 80240038 86640008 */ lh $a0, 8($s3) -/* BE7C1C 8024003C 0C00EABB */ jal get_npc_unsafe -/* BE7C20 80240040 00A0B02D */ daddu $s6, $a1, $zero -/* BE7C24 80240044 0040A02D */ daddu $s4, $v0, $zero -/* BE7C28 80240048 AEA00074 */ sw $zero, 0x74($s5) -/* BE7C2C 8024004C C6980038 */ lwc1 $f24, 0x38($s4) -/* BE7C30 80240050 C6960040 */ lwc1 $f22, 0x40($s4) -/* BE7C34 80240054 0000902D */ daddu $s2, $zero, $zero -/* BE7C38 80240058 AEA00078 */ sw $zero, 0x78($s5) -/* BE7C3C 8024005C 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE7C40 80240060 8C620000 */ lw $v0, ($v1) -/* BE7C44 80240064 3C0146FF */ lui $at, 0x46ff -/* BE7C48 80240068 3421FE00 */ ori $at, $at, 0xfe00 -/* BE7C4C 8024006C 4481A000 */ mtc1 $at, $f20 -/* BE7C50 80240070 18400018 */ blez $v0, .L802400D4 -/* BE7C54 80240074 0240802D */ daddu $s0, $s2, $zero -/* BE7C58 80240078 0240882D */ daddu $s1, $s2, $zero -.L8024007C: -/* BE7C5C 8024007C 02231021 */ addu $v0, $s1, $v1 -/* BE7C60 80240080 4600C306 */ mov.s $f12, $f24 -/* BE7C64 80240084 C4440004 */ lwc1 $f4, 4($v0) -/* BE7C68 80240088 46802120 */ cvt.s.w $f4, $f4 -/* BE7C6C 8024008C 44062000 */ mfc1 $a2, $f4 -/* BE7C70 80240090 C444000C */ lwc1 $f4, 0xc($v0) -/* BE7C74 80240094 46802120 */ cvt.s.w $f4, $f4 -/* BE7C78 80240098 44072000 */ mfc1 $a3, $f4 -/* BE7C7C 8024009C 0C00A7B5 */ jal dist2D -/* BE7C80 802400A0 4600B386 */ mov.s $f14, $f22 -/* BE7C84 802400A4 4614003C */ c.lt.s $f0, $f20 -/* BE7C88 802400A8 00000000 */ nop -/* BE7C8C 802400AC 45000003 */ bc1f .L802400BC -/* BE7C90 802400B0 2631000C */ addiu $s1, $s1, 0xc -/* BE7C94 802400B4 46000506 */ mov.s $f20, $f0 -/* BE7C98 802400B8 AEB20078 */ sw $s2, 0x78($s5) -.L802400BC: -/* BE7C9C 802400BC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE7CA0 802400C0 26100001 */ addiu $s0, $s0, 1 -/* BE7CA4 802400C4 8C620000 */ lw $v0, ($v1) -/* BE7CA8 802400C8 0202102A */ slt $v0, $s0, $v0 -/* BE7CAC 802400CC 1440FFEB */ bnez $v0, .L8024007C -/* BE7CB0 802400D0 26520001 */ addiu $s2, $s2, 1 -.L802400D4: -/* BE7CB4 802400D4 8E6200CC */ lw $v0, 0xcc($s3) -/* BE7CB8 802400D8 8C420004 */ lw $v0, 4($v0) -/* BE7CBC 802400DC AE820028 */ sw $v0, 0x28($s4) -/* BE7CC0 802400E0 8E6200D0 */ lw $v0, 0xd0($s3) -/* BE7CC4 802400E4 8C42007C */ lw $v0, 0x7c($v0) -/* BE7CC8 802400E8 04410004 */ bgez $v0, .L802400FC -/* BE7CCC 802400EC 00000000 */ nop -/* BE7CD0 802400F0 C6C00000 */ lwc1 $f0, ($s6) -/* BE7CD4 802400F4 08090047 */ j .L8024011C -/* BE7CD8 802400F8 E6800018 */ swc1 $f0, 0x18($s4) -.L802400FC: -/* BE7CDC 802400FC 3C018024 */ lui $at, %hi(D_80245050_BECC30) -/* BE7CE0 80240100 D4225050 */ ldc1 $f2, %lo(D_80245050_BECC30)($at) -/* BE7CE4 80240104 44820000 */ mtc1 $v0, $f0 -/* BE7CE8 80240108 00000000 */ nop -/* BE7CEC 8024010C 46800021 */ cvt.d.w $f0, $f0 -/* BE7CF0 80240110 46220003 */ div.d $f0, $f0, $f2 -/* BE7CF4 80240114 46200020 */ cvt.s.d $f0, $f0 -/* BE7CF8 80240118 E6800018 */ swc1 $f0, 0x18($s4) -.L8024011C: -/* BE7CFC 8024011C 24020001 */ addiu $v0, $zero, 1 -/* BE7D00 80240120 AEA20070 */ sw $v0, 0x70($s5) -/* BE7D04 80240124 8FBF002C */ lw $ra, 0x2c($sp) -/* BE7D08 80240128 8FB60028 */ lw $s6, 0x28($sp) -/* BE7D0C 8024012C 8FB50024 */ lw $s5, 0x24($sp) -/* BE7D10 80240130 8FB40020 */ lw $s4, 0x20($sp) -/* BE7D14 80240134 8FB3001C */ lw $s3, 0x1c($sp) -/* BE7D18 80240138 8FB20018 */ lw $s2, 0x18($sp) -/* BE7D1C 8024013C 8FB10014 */ lw $s1, 0x14($sp) -/* BE7D20 80240140 8FB00010 */ lw $s0, 0x10($sp) -/* BE7D24 80240144 D7B80040 */ ldc1 $f24, 0x40($sp) -/* BE7D28 80240148 D7B60038 */ ldc1 $f22, 0x38($sp) -/* BE7D2C 8024014C D7B40030 */ ldc1 $f20, 0x30($sp) -/* BE7D30 80240150 03E00008 */ jr $ra -/* BE7D34 80240154 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240158_BE7D38.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240158_BE7D38.s deleted file mode 100644 index 6b808b35c4..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240158_BE7D38.s +++ /dev/null @@ -1,183 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240158_BE7D38 -/* BE7D38 80240158 27BDFFA8 */ addiu $sp, $sp, -0x58 -/* BE7D3C 8024015C AFB20038 */ sw $s2, 0x38($sp) -/* BE7D40 80240160 0080902D */ daddu $s2, $a0, $zero -/* BE7D44 80240164 AFBF0044 */ sw $ra, 0x44($sp) -/* BE7D48 80240168 AFB40040 */ sw $s4, 0x40($sp) -/* BE7D4C 8024016C AFB3003C */ sw $s3, 0x3c($sp) -/* BE7D50 80240170 AFB10034 */ sw $s1, 0x34($sp) -/* BE7D54 80240174 AFB00030 */ sw $s0, 0x30($sp) -/* BE7D58 80240178 F7B60050 */ sdc1 $f22, 0x50($sp) -/* BE7D5C 8024017C F7B40048 */ sdc1 $f20, 0x48($sp) -/* BE7D60 80240180 8E510148 */ lw $s1, 0x148($s2) -/* BE7D64 80240184 00A0982D */ daddu $s3, $a1, $zero -/* BE7D68 80240188 86240008 */ lh $a0, 8($s1) -/* BE7D6C 8024018C 0C00EABB */ jal get_npc_unsafe -/* BE7D70 80240190 00C0A02D */ daddu $s4, $a2, $zero -/* BE7D74 80240194 8E630014 */ lw $v1, 0x14($s3) -/* BE7D78 80240198 04600030 */ bltz $v1, .L8024025C -/* BE7D7C 8024019C 0040802D */ daddu $s0, $v0, $zero -/* BE7D80 802401A0 8E420074 */ lw $v0, 0x74($s2) -/* BE7D84 802401A4 1C40002C */ bgtz $v0, .L80240258 -/* BE7D88 802401A8 2442FFFF */ addiu $v0, $v0, -1 -/* BE7D8C 802401AC 0280202D */ daddu $a0, $s4, $zero -/* BE7D90 802401B0 AE430074 */ sw $v1, 0x74($s2) -/* BE7D94 802401B4 AFA00010 */ sw $zero, 0x10($sp) -/* BE7D98 802401B8 8E66000C */ lw $a2, 0xc($s3) -/* BE7D9C 802401BC 8E670010 */ lw $a3, 0x10($s3) -/* BE7DA0 802401C0 0C01242D */ jal func_800490B4 -/* BE7DA4 802401C4 0220282D */ daddu $a1, $s1, $zero -/* BE7DA8 802401C8 10400021 */ beqz $v0, .L80240250 -/* BE7DAC 802401CC 0000202D */ daddu $a0, $zero, $zero -/* BE7DB0 802401D0 0200282D */ daddu $a1, $s0, $zero -/* BE7DB4 802401D4 0000302D */ daddu $a2, $zero, $zero -/* BE7DB8 802401D8 860300A8 */ lh $v1, 0xa8($s0) -/* BE7DBC 802401DC 3C013F80 */ lui $at, 0x3f80 -/* BE7DC0 802401E0 44810000 */ mtc1 $at, $f0 -/* BE7DC4 802401E4 3C014000 */ lui $at, 0x4000 -/* BE7DC8 802401E8 44811000 */ mtc1 $at, $f2 -/* BE7DCC 802401EC 3C01C1A0 */ lui $at, 0xc1a0 -/* BE7DD0 802401F0 44812000 */ mtc1 $at, $f4 -/* BE7DD4 802401F4 2402000F */ addiu $v0, $zero, 0xf -/* BE7DD8 802401F8 AFA2001C */ sw $v0, 0x1c($sp) -/* BE7DDC 802401FC 44833000 */ mtc1 $v1, $f6 -/* BE7DE0 80240200 00000000 */ nop -/* BE7DE4 80240204 468031A0 */ cvt.s.w $f6, $f6 -/* BE7DE8 80240208 44073000 */ mfc1 $a3, $f6 -/* BE7DEC 8024020C 27A20028 */ addiu $v0, $sp, 0x28 -/* BE7DF0 80240210 AFA20020 */ sw $v0, 0x20($sp) -/* BE7DF4 80240214 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE7DF8 80240218 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE7DFC 8024021C 0C01BFA4 */ jal fx_emote -/* BE7E00 80240220 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE7E04 80240224 0200202D */ daddu $a0, $s0, $zero -/* BE7E08 80240228 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE7E0C 8024022C 0C012530 */ jal func_800494C0 -/* BE7E10 80240230 3C060020 */ lui $a2, 0x20 -/* BE7E14 80240234 8E220018 */ lw $v0, 0x18($s1) -/* BE7E18 80240238 9442002A */ lhu $v0, 0x2a($v0) -/* BE7E1C 8024023C 30420001 */ andi $v0, $v0, 1 -/* BE7E20 80240240 14400064 */ bnez $v0, .L802403D4 -/* BE7E24 80240244 2402000A */ addiu $v0, $zero, 0xa -/* BE7E28 80240248 080900F5 */ j .L802403D4 -/* BE7E2C 8024024C 2402000C */ addiu $v0, $zero, 0xc -.L80240250: -/* BE7E30 80240250 8E420074 */ lw $v0, 0x74($s2) -/* BE7E34 80240254 2442FFFF */ addiu $v0, $v0, -1 -.L80240258: -/* BE7E38 80240258 AE420074 */ sw $v0, 0x74($s2) -.L8024025C: -/* BE7E3C 8024025C 8602008C */ lh $v0, 0x8c($s0) -/* BE7E40 80240260 1440005D */ bnez $v0, .L802403D8 -/* BE7E44 80240264 00000000 */ nop -/* BE7E48 80240268 C6000018 */ lwc1 $f0, 0x18($s0) -/* BE7E4C 8024026C 3C014010 */ lui $at, 0x4010 -/* BE7E50 80240270 44811800 */ mtc1 $at, $f3 -/* BE7E54 80240274 44801000 */ mtc1 $zero, $f2 -/* BE7E58 80240278 46000021 */ cvt.d.s $f0, $f0 -/* BE7E5C 8024027C 4622003C */ c.lt.d $f0, $f2 -/* BE7E60 80240280 00000000 */ nop -/* BE7E64 80240284 45000003 */ bc1f .L80240294 -/* BE7E68 80240288 0200202D */ daddu $a0, $s0, $zero -/* BE7E6C 8024028C 080900A6 */ j .L80240298 -/* BE7E70 80240290 0000282D */ daddu $a1, $zero, $zero -.L80240294: -/* BE7E74 80240294 24050001 */ addiu $a1, $zero, 1 -.L80240298: -/* BE7E78 80240298 0C00F598 */ jal func_8003D660 -/* BE7E7C 8024029C 00000000 */ nop -/* BE7E80 802402A0 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE7E84 802402A4 8E430078 */ lw $v1, 0x78($s2) -/* BE7E88 802402A8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE7E8C 802402AC 00031040 */ sll $v0, $v1, 1 -/* BE7E90 802402B0 00431021 */ addu $v0, $v0, $v1 -/* BE7E94 802402B4 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE7E98 802402B8 00021080 */ sll $v0, $v0, 2 -/* BE7E9C 802402BC 00431021 */ addu $v0, $v0, $v1 -/* BE7EA0 802402C0 C4560004 */ lwc1 $f22, 4($v0) -/* BE7EA4 802402C4 4680B5A0 */ cvt.s.w $f22, $f22 -/* BE7EA8 802402C8 C454000C */ lwc1 $f20, 0xc($v0) -/* BE7EAC 802402CC 4680A520 */ cvt.s.w $f20, $f20 -/* BE7EB0 802402D0 4406B000 */ mfc1 $a2, $f22 -/* BE7EB4 802402D4 4407A000 */ mfc1 $a3, $f20 -/* BE7EB8 802402D8 0C00A720 */ jal atan2 -/* BE7EBC 802402DC 00000000 */ nop -/* BE7EC0 802402E0 8E050018 */ lw $a1, 0x18($s0) -/* BE7EC4 802402E4 44060000 */ mfc1 $a2, $f0 -/* BE7EC8 802402E8 0200202D */ daddu $a0, $s0, $zero -/* BE7ECC 802402EC 0C00EA95 */ jal npc_move_heading -/* BE7ED0 802402F0 AE06000C */ sw $a2, 0xc($s0) -/* BE7ED4 802402F4 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE7ED8 802402F8 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE7EDC 802402FC 4406B000 */ mfc1 $a2, $f22 -/* BE7EE0 80240300 4407A000 */ mfc1 $a3, $f20 -/* BE7EE4 80240304 0C00A7B5 */ jal dist2D -/* BE7EE8 80240308 00000000 */ nop -/* BE7EEC 8024030C C6020018 */ lwc1 $f2, 0x18($s0) -/* BE7EF0 80240310 4602003E */ c.le.s $f0, $f2 -/* BE7EF4 80240314 00000000 */ nop -/* BE7EF8 80240318 4500002F */ bc1f .L802403D8 -/* BE7EFC 8024031C 240403E8 */ addiu $a0, $zero, 0x3e8 -/* BE7F00 80240320 24020002 */ addiu $v0, $zero, 2 -/* BE7F04 80240324 0C00A67F */ jal rand_int -/* BE7F08 80240328 AE420070 */ sw $v0, 0x70($s2) -/* BE7F0C 8024032C 3C035555 */ lui $v1, 0x5555 -/* BE7F10 80240330 34635556 */ ori $v1, $v1, 0x5556 -/* BE7F14 80240334 00430018 */ mult $v0, $v1 -/* BE7F18 80240338 000227C3 */ sra $a0, $v0, 0x1f -/* BE7F1C 8024033C 00004010 */ mfhi $t0 -/* BE7F20 80240340 01042023 */ subu $a0, $t0, $a0 -/* BE7F24 80240344 00041840 */ sll $v1, $a0, 1 -/* BE7F28 80240348 00641821 */ addu $v1, $v1, $a0 -/* BE7F2C 8024034C 00431023 */ subu $v0, $v0, $v1 -/* BE7F30 80240350 24430002 */ addiu $v1, $v0, 2 -/* BE7F34 80240354 AE430074 */ sw $v1, 0x74($s2) -/* BE7F38 80240358 8E62002C */ lw $v0, 0x2c($s3) -/* BE7F3C 8024035C 18400009 */ blez $v0, .L80240384 -/* BE7F40 80240360 24020004 */ addiu $v0, $zero, 4 -/* BE7F44 80240364 8E620004 */ lw $v0, 4($s3) -/* BE7F48 80240368 18400006 */ blez $v0, .L80240384 -/* BE7F4C 8024036C 24020004 */ addiu $v0, $zero, 4 -/* BE7F50 80240370 8E620008 */ lw $v0, 8($s3) -/* BE7F54 80240374 18400003 */ blez $v0, .L80240384 -/* BE7F58 80240378 24020004 */ addiu $v0, $zero, 4 -/* BE7F5C 8024037C 14600002 */ bnez $v1, .L80240388 -/* BE7F60 80240380 00000000 */ nop -.L80240384: -/* BE7F64 80240384 AE420070 */ sw $v0, 0x70($s2) -.L80240388: -/* BE7F68 80240388 0C00A67F */ jal rand_int -/* BE7F6C 8024038C 24042710 */ addiu $a0, $zero, 0x2710 -/* BE7F70 80240390 3C0351EB */ lui $v1, 0x51eb -/* BE7F74 80240394 3463851F */ ori $v1, $v1, 0x851f -/* BE7F78 80240398 00430018 */ mult $v0, $v1 -/* BE7F7C 8024039C 00021FC3 */ sra $v1, $v0, 0x1f -/* BE7F80 802403A0 00004010 */ mfhi $t0 -/* BE7F84 802403A4 00082143 */ sra $a0, $t0, 5 -/* BE7F88 802403A8 00832023 */ subu $a0, $a0, $v1 -/* BE7F8C 802403AC 00041840 */ sll $v1, $a0, 1 -/* BE7F90 802403B0 00641821 */ addu $v1, $v1, $a0 -/* BE7F94 802403B4 000318C0 */ sll $v1, $v1, 3 -/* BE7F98 802403B8 00641821 */ addu $v1, $v1, $a0 -/* BE7F9C 802403BC 00031880 */ sll $v1, $v1, 2 -/* BE7FA0 802403C0 8E640004 */ lw $a0, 4($s3) -/* BE7FA4 802403C4 00431023 */ subu $v0, $v0, $v1 -/* BE7FA8 802403C8 0044102A */ slt $v0, $v0, $a0 -/* BE7FAC 802403CC 10400002 */ beqz $v0, .L802403D8 -/* BE7FB0 802403D0 24020004 */ addiu $v0, $zero, 4 -.L802403D4: -/* BE7FB4 802403D4 AE420070 */ sw $v0, 0x70($s2) -.L802403D8: -/* BE7FB8 802403D8 8FBF0044 */ lw $ra, 0x44($sp) -/* BE7FBC 802403DC 8FB40040 */ lw $s4, 0x40($sp) -/* BE7FC0 802403E0 8FB3003C */ lw $s3, 0x3c($sp) -/* BE7FC4 802403E4 8FB20038 */ lw $s2, 0x38($sp) -/* BE7FC8 802403E8 8FB10034 */ lw $s1, 0x34($sp) -/* BE7FCC 802403EC 8FB00030 */ lw $s0, 0x30($sp) -/* BE7FD0 802403F0 D7B60050 */ ldc1 $f22, 0x50($sp) -/* BE7FD4 802403F4 D7B40048 */ ldc1 $f20, 0x48($sp) -/* BE7FD8 802403F8 03E00008 */ jr $ra -/* BE7FDC 802403FC 27BD0058 */ addiu $sp, $sp, 0x58 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802404C0_BE80A0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802404C0_BE80A0.s deleted file mode 100644 index 6de28c3f1a..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802404C0_BE80A0.s +++ /dev/null @@ -1,120 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802404C0_BE80A0 -/* BE80A0 802404C0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE80A4 802404C4 AFB40040 */ sw $s4, 0x40($sp) -/* BE80A8 802404C8 0080A02D */ daddu $s4, $a0, $zero -/* BE80AC 802404CC AFBF0044 */ sw $ra, 0x44($sp) -/* BE80B0 802404D0 AFB3003C */ sw $s3, 0x3c($sp) -/* BE80B4 802404D4 AFB20038 */ sw $s2, 0x38($sp) -/* BE80B8 802404D8 AFB10034 */ sw $s1, 0x34($sp) -/* BE80BC 802404DC AFB00030 */ sw $s0, 0x30($sp) -/* BE80C0 802404E0 8E910148 */ lw $s1, 0x148($s4) -/* BE80C4 802404E4 00A0902D */ daddu $s2, $a1, $zero -/* BE80C8 802404E8 86240008 */ lh $a0, 8($s1) -/* BE80CC 802404EC 0C00EABB */ jal get_npc_unsafe -/* BE80D0 802404F0 00C0982D */ daddu $s3, $a2, $zero -/* BE80D4 802404F4 8E430014 */ lw $v1, 0x14($s2) -/* BE80D8 802404F8 04600031 */ bltz $v1, .L802405C0 -/* BE80DC 802404FC 0040802D */ daddu $s0, $v0, $zero -/* BE80E0 80240500 0260202D */ daddu $a0, $s3, $zero -/* BE80E4 80240504 AFA00010 */ sw $zero, 0x10($sp) -/* BE80E8 80240508 8E460024 */ lw $a2, 0x24($s2) -/* BE80EC 8024050C 8E470028 */ lw $a3, 0x28($s2) -/* BE80F0 80240510 0C01242D */ jal func_800490B4 -/* BE80F4 80240514 0220282D */ daddu $a1, $s1, $zero -/* BE80F8 80240518 10400029 */ beqz $v0, .L802405C0 -/* BE80FC 8024051C 0000202D */ daddu $a0, $zero, $zero -/* BE8100 80240520 0200282D */ daddu $a1, $s0, $zero -/* BE8104 80240524 0000302D */ daddu $a2, $zero, $zero -/* BE8108 80240528 860300A8 */ lh $v1, 0xa8($s0) -/* BE810C 8024052C 3C013F80 */ lui $at, 0x3f80 -/* BE8110 80240530 44810000 */ mtc1 $at, $f0 -/* BE8114 80240534 3C014000 */ lui $at, 0x4000 -/* BE8118 80240538 44811000 */ mtc1 $at, $f2 -/* BE811C 8024053C 3C01C1A0 */ lui $at, 0xc1a0 -/* BE8120 80240540 44812000 */ mtc1 $at, $f4 -/* BE8124 80240544 2402000F */ addiu $v0, $zero, 0xf -/* BE8128 80240548 AFA2001C */ sw $v0, 0x1c($sp) -/* BE812C 8024054C 44833000 */ mtc1 $v1, $f6 -/* BE8130 80240550 00000000 */ nop -/* BE8134 80240554 468031A0 */ cvt.s.w $f6, $f6 -/* BE8138 80240558 44073000 */ mfc1 $a3, $f6 -/* BE813C 8024055C 27A20028 */ addiu $v0, $sp, 0x28 -/* BE8140 80240560 AFA20020 */ sw $v0, 0x20($sp) -/* BE8144 80240564 E7A00010 */ swc1 $f0, 0x10($sp) -/* BE8148 80240568 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE814C 8024056C 0C01BFA4 */ jal fx_emote -/* BE8150 80240570 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE8154 80240574 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BE8158 80240578 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BE815C 8024057C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BE8160 80240580 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BE8164 80240584 8C460028 */ lw $a2, 0x28($v0) -/* BE8168 80240588 0C00A720 */ jal atan2 -/* BE816C 8024058C 8C470030 */ lw $a3, 0x30($v0) -/* BE8170 80240590 0200202D */ daddu $a0, $s0, $zero -/* BE8174 80240594 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BE8178 80240598 3C060020 */ lui $a2, 0x20 -/* BE817C 8024059C 0C012530 */ jal func_800494C0 -/* BE8180 802405A0 E480000C */ swc1 $f0, 0xc($a0) -/* BE8184 802405A4 8E220018 */ lw $v0, 0x18($s1) -/* BE8188 802405A8 9442002A */ lhu $v0, 0x2a($v0) -/* BE818C 802405AC 30420001 */ andi $v0, $v0, 1 -/* BE8190 802405B0 14400029 */ bnez $v0, .L80240658 -/* BE8194 802405B4 2402000A */ addiu $v0, $zero, 0xa -/* BE8198 802405B8 08090196 */ j .L80240658 -/* BE819C 802405BC 2402000C */ addiu $v0, $zero, 0xc -.L802405C0: -/* BE81A0 802405C0 8602008C */ lh $v0, 0x8c($s0) -/* BE81A4 802405C4 14400025 */ bnez $v0, .L8024065C -/* BE81A8 802405C8 00000000 */ nop -/* BE81AC 802405CC 9602008E */ lhu $v0, 0x8e($s0) -/* BE81B0 802405D0 2442FFFF */ addiu $v0, $v0, -1 -/* BE81B4 802405D4 A602008E */ sh $v0, 0x8e($s0) -/* BE81B8 802405D8 00021400 */ sll $v0, $v0, 0x10 -/* BE81BC 802405DC 1440001F */ bnez $v0, .L8024065C -/* BE81C0 802405E0 00000000 */ nop -/* BE81C4 802405E4 8E820074 */ lw $v0, 0x74($s4) -/* BE81C8 802405E8 2442FFFF */ addiu $v0, $v0, -1 -/* BE81CC 802405EC 10400019 */ beqz $v0, .L80240654 -/* BE81D0 802405F0 AE820074 */ sw $v0, 0x74($s4) -/* BE81D4 802405F4 8E220018 */ lw $v0, 0x18($s1) -/* BE81D8 802405F8 9442002A */ lhu $v0, 0x2a($v0) -/* BE81DC 802405FC 30420010 */ andi $v0, $v0, 0x10 -/* BE81E0 80240600 14400007 */ bnez $v0, .L80240620 -/* BE81E4 80240604 00000000 */ nop -/* BE81E8 80240608 C600000C */ lwc1 $f0, 0xc($s0) -/* BE81EC 8024060C 3C014334 */ lui $at, 0x4334 -/* BE81F0 80240610 44816000 */ mtc1 $at, $f12 -/* BE81F4 80240614 0C00A6C9 */ jal clamp_angle -/* BE81F8 80240618 460C0300 */ add.s $f12, $f0, $f12 -/* BE81FC 8024061C E600000C */ swc1 $f0, 0xc($s0) -.L80240620: -/* BE8200 80240620 8E440008 */ lw $a0, 8($s2) -/* BE8204 80240624 000417C2 */ srl $v0, $a0, 0x1f -/* BE8208 80240628 00822021 */ addu $a0, $a0, $v0 -/* BE820C 8024062C 00042043 */ sra $a0, $a0, 1 -/* BE8210 80240630 0C00A67F */ jal rand_int -/* BE8214 80240634 24840001 */ addiu $a0, $a0, 1 -/* BE8218 80240638 8E430008 */ lw $v1, 8($s2) -/* BE821C 8024063C 000327C2 */ srl $a0, $v1, 0x1f -/* BE8220 80240640 00641821 */ addu $v1, $v1, $a0 -/* BE8224 80240644 00031843 */ sra $v1, $v1, 1 -/* BE8228 80240648 00621821 */ addu $v1, $v1, $v0 -/* BE822C 8024064C 08090197 */ j .L8024065C -/* BE8230 80240650 A603008E */ sh $v1, 0x8e($s0) -.L80240654: -/* BE8234 80240654 24020004 */ addiu $v0, $zero, 4 -.L80240658: -/* BE8238 80240658 AE820070 */ sw $v0, 0x70($s4) -.L8024065C: -/* BE823C 8024065C 8FBF0044 */ lw $ra, 0x44($sp) -/* BE8240 80240660 8FB40040 */ lw $s4, 0x40($sp) -/* BE8244 80240664 8FB3003C */ lw $s3, 0x3c($sp) -/* BE8248 80240668 8FB20038 */ lw $s2, 0x38($sp) -/* BE824C 8024066C 8FB10034 */ lw $s1, 0x34($sp) -/* BE8250 80240670 8FB00030 */ lw $s0, 0x30($sp) -/* BE8254 80240674 03E00008 */ jr $ra -/* BE8258 80240678 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024067C_BE825C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024067C_BE825C.s deleted file mode 100644 index a3d0dc5271..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024067C_BE825C.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024067C_BE825C -/* BE825C 8024067C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE8260 80240680 AFB10014 */ sw $s1, 0x14($sp) -/* BE8264 80240684 0080882D */ daddu $s1, $a0, $zero -/* BE8268 80240688 AFBF001C */ sw $ra, 0x1c($sp) -/* BE826C 8024068C AFB20018 */ sw $s2, 0x18($sp) -/* BE8270 80240690 AFB00010 */ sw $s0, 0x10($sp) -/* BE8274 80240694 8E300148 */ lw $s0, 0x148($s1) -/* BE8278 80240698 86040008 */ lh $a0, 8($s0) -/* BE827C 8024069C 0C00EABB */ jal get_npc_unsafe -/* BE8280 802406A0 00A0902D */ daddu $s2, $a1, $zero -/* BE8284 802406A4 8E230078 */ lw $v1, 0x78($s1) -/* BE8288 802406A8 24630001 */ addiu $v1, $v1, 1 -/* BE828C 802406AC AE230078 */ sw $v1, 0x78($s1) -/* BE8290 802406B0 8E0400D0 */ lw $a0, 0xd0($s0) -/* BE8294 802406B4 8C840000 */ lw $a0, ($a0) -/* BE8298 802406B8 0064182A */ slt $v1, $v1, $a0 -/* BE829C 802406BC 14600002 */ bnez $v1, .L802406C8 -/* BE82A0 802406C0 0040282D */ daddu $a1, $v0, $zero -/* BE82A4 802406C4 AE200078 */ sw $zero, 0x78($s1) -.L802406C8: -/* BE82A8 802406C8 8E0200CC */ lw $v0, 0xcc($s0) -/* BE82AC 802406CC 8C420004 */ lw $v0, 4($v0) -/* BE82B0 802406D0 ACA20028 */ sw $v0, 0x28($a1) -/* BE82B4 802406D4 8E0200D0 */ lw $v0, 0xd0($s0) -/* BE82B8 802406D8 8C42007C */ lw $v0, 0x7c($v0) -/* BE82BC 802406DC 04410004 */ bgez $v0, .L802406F0 -/* BE82C0 802406E0 00000000 */ nop -/* BE82C4 802406E4 C6400000 */ lwc1 $f0, ($s2) -/* BE82C8 802406E8 080901C4 */ j .L80240710 -/* BE82CC 802406EC E4A00018 */ swc1 $f0, 0x18($a1) -.L802406F0: -/* BE82D0 802406F0 3C018024 */ lui $at, %hi(D_80245058_BECC38) -/* BE82D4 802406F4 D4225058 */ ldc1 $f2, %lo(D_80245058_BECC38)($at) -/* BE82D8 802406F8 44820000 */ mtc1 $v0, $f0 -/* BE82DC 802406FC 00000000 */ nop -/* BE82E0 80240700 46800021 */ cvt.d.w $f0, $f0 -/* BE82E4 80240704 46220003 */ div.d $f0, $f0, $f2 -/* BE82E8 80240708 46200020 */ cvt.s.d $f0, $f0 -/* BE82EC 8024070C E4A00018 */ swc1 $f0, 0x18($a1) -.L80240710: -/* BE82F0 80240710 24020001 */ addiu $v0, $zero, 1 -/* BE82F4 80240714 AE220070 */ sw $v0, 0x70($s1) -/* BE82F8 80240718 8FBF001C */ lw $ra, 0x1c($sp) -/* BE82FC 8024071C 8FB20018 */ lw $s2, 0x18($sp) -/* BE8300 80240720 8FB10014 */ lw $s1, 0x14($sp) -/* BE8304 80240724 8FB00010 */ lw $s0, 0x10($sp) -/* BE8308 80240728 03E00008 */ jr $ra -/* BE830C 8024072C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024094C_BE852C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024094C_BE852C.s deleted file mode 100644 index 0bb529ed2b..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024094C_BE852C.s +++ /dev/null @@ -1,80 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024094C_BE852C -/* BE852C 8024094C 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE8530 80240950 AFB3003C */ sw $s3, 0x3c($sp) -/* BE8534 80240954 0080982D */ daddu $s3, $a0, $zero -/* BE8538 80240958 AFBF0040 */ sw $ra, 0x40($sp) -/* BE853C 8024095C AFB20038 */ sw $s2, 0x38($sp) -/* BE8540 80240960 AFB10034 */ sw $s1, 0x34($sp) -/* BE8544 80240964 AFB00030 */ sw $s0, 0x30($sp) -/* BE8548 80240968 8E720148 */ lw $s2, 0x148($s3) -/* BE854C 8024096C 00A0882D */ daddu $s1, $a1, $zero -/* BE8550 80240970 86440008 */ lh $a0, 8($s2) -/* BE8554 80240974 0C00EABB */ jal get_npc_unsafe -/* BE8558 80240978 00C0802D */ daddu $s0, $a2, $zero -/* BE855C 8024097C 0200202D */ daddu $a0, $s0, $zero -/* BE8560 80240980 0240282D */ daddu $a1, $s2, $zero -/* BE8564 80240984 24030001 */ addiu $v1, $zero, 1 -/* BE8568 80240988 AFA30010 */ sw $v1, 0x10($sp) -/* BE856C 8024098C 8E260024 */ lw $a2, 0x24($s1) -/* BE8570 80240990 8E270028 */ lw $a3, 0x28($s1) -/* BE8574 80240994 0C01242D */ jal func_800490B4 -/* BE8578 80240998 0040802D */ daddu $s0, $v0, $zero -/* BE857C 8024099C 1440001E */ bnez $v0, .L80240A18 -/* BE8580 802409A0 0200202D */ daddu $a0, $s0, $zero -/* BE8584 802409A4 24040002 */ addiu $a0, $zero, 2 -/* BE8588 802409A8 0200282D */ daddu $a1, $s0, $zero -/* BE858C 802409AC 0000302D */ daddu $a2, $zero, $zero -/* BE8590 802409B0 860300A8 */ lh $v1, 0xa8($s0) -/* BE8594 802409B4 3C013F80 */ lui $at, 0x3f80 -/* BE8598 802409B8 44810000 */ mtc1 $at, $f0 -/* BE859C 802409BC 3C014000 */ lui $at, 0x4000 -/* BE85A0 802409C0 44811000 */ mtc1 $at, $f2 -/* BE85A4 802409C4 3C01C1A0 */ lui $at, 0xc1a0 -/* BE85A8 802409C8 44812000 */ mtc1 $at, $f4 -/* BE85AC 802409CC 2402000F */ addiu $v0, $zero, 0xf -/* BE85B0 802409D0 AFA2001C */ sw $v0, 0x1c($sp) -/* BE85B4 802409D4 44833000 */ mtc1 $v1, $f6 -/* BE85B8 802409D8 00000000 */ nop -/* BE85BC 802409DC 468031A0 */ cvt.s.w $f6, $f6 -/* BE85C0 802409E0 44073000 */ mfc1 $a3, $f6 -/* BE85C4 802409E4 27A20028 */ addiu $v0, $sp, 0x28 -/* BE85C8 802409E8 AFA20020 */ sw $v0, 0x20($sp) -/* BE85CC 802409EC E7A00010 */ swc1 $f0, 0x10($sp) -/* BE85D0 802409F0 E7A20014 */ swc1 $f2, 0x14($sp) -/* BE85D4 802409F4 0C01BFA4 */ jal fx_emote -/* BE85D8 802409F8 E7A40018 */ swc1 $f4, 0x18($sp) -/* BE85DC 802409FC 8E4200CC */ lw $v0, 0xcc($s2) -/* BE85E0 80240A00 8C430000 */ lw $v1, ($v0) -/* BE85E4 80240A04 24020019 */ addiu $v0, $zero, 0x19 -/* BE85E8 80240A08 A602008E */ sh $v0, 0x8e($s0) -/* BE85EC 80240A0C 2402000E */ addiu $v0, $zero, 0xe -/* BE85F0 80240A10 08090293 */ j .L80240A4C -/* BE85F4 80240A14 AE030028 */ sw $v1, 0x28($s0) -.L80240A18: -/* BE85F8 80240A18 0C00F598 */ jal func_8003D660 -/* BE85FC 80240A1C 24050001 */ addiu $a1, $zero, 1 -/* BE8600 80240A20 8E050018 */ lw $a1, 0x18($s0) -/* BE8604 80240A24 8E06000C */ lw $a2, 0xc($s0) -/* BE8608 80240A28 0C00EA95 */ jal npc_move_heading -/* BE860C 80240A2C 0200202D */ daddu $a0, $s0, $zero -/* BE8610 80240A30 8602008E */ lh $v0, 0x8e($s0) -/* BE8614 80240A34 9603008E */ lhu $v1, 0x8e($s0) -/* BE8618 80240A38 18400003 */ blez $v0, .L80240A48 -/* BE861C 80240A3C 2462FFFF */ addiu $v0, $v1, -1 -/* BE8620 80240A40 08090294 */ j .L80240A50 -/* BE8624 80240A44 A602008E */ sh $v0, 0x8e($s0) -.L80240A48: -/* BE8628 80240A48 2402000C */ addiu $v0, $zero, 0xc -.L80240A4C: -/* BE862C 80240A4C AE620070 */ sw $v0, 0x70($s3) -.L80240A50: -/* BE8630 80240A50 8FBF0040 */ lw $ra, 0x40($sp) -/* BE8634 80240A54 8FB3003C */ lw $s3, 0x3c($sp) -/* BE8638 80240A58 8FB20038 */ lw $s2, 0x38($sp) -/* BE863C 80240A5C 8FB10034 */ lw $s1, 0x34($sp) -/* BE8640 80240A60 8FB00030 */ lw $s0, 0x30($sp) -/* BE8644 80240A64 03E00008 */ jr $ra -/* BE8648 80240A68 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240AD4_BE86B4.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240AD4_BE86B4.s deleted file mode 100644 index a2117ace32..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240AD4_BE86B4.s +++ /dev/null @@ -1,55 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240AD4_BE86B4 -/* BE86B4 80240AD4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BE86B8 80240AD8 AFB10014 */ sw $s1, 0x14($sp) -/* BE86BC 80240ADC 0080882D */ daddu $s1, $a0, $zero -/* BE86C0 80240AE0 AFBF001C */ sw $ra, 0x1c($sp) -/* BE86C4 80240AE4 AFB20018 */ sw $s2, 0x18($sp) -/* BE86C8 80240AE8 AFB00010 */ sw $s0, 0x10($sp) -/* BE86CC 80240AEC 8E300148 */ lw $s0, 0x148($s1) -/* BE86D0 80240AF0 86040008 */ lh $a0, 8($s0) -/* BE86D4 80240AF4 0C00EABB */ jal get_npc_unsafe -/* BE86D8 80240AF8 00A0902D */ daddu $s2, $a1, $zero -/* BE86DC 80240AFC 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE86E0 80240B00 8E240078 */ lw $a0, 0x78($s1) -/* BE86E4 80240B04 8C630000 */ lw $v1, ($v1) -/* BE86E8 80240B08 0083182A */ slt $v1, $a0, $v1 -/* BE86EC 80240B0C 10600013 */ beqz $v1, .L80240B5C -/* BE86F0 80240B10 0040302D */ daddu $a2, $v0, $zero -/* BE86F4 80240B14 00041040 */ sll $v0, $a0, 1 -/* BE86F8 80240B18 00441021 */ addu $v0, $v0, $a0 -/* BE86FC 80240B1C 00022880 */ sll $a1, $v0, 2 -.L80240B20: -/* BE8700 80240B20 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE8704 80240B24 C4C2003C */ lwc1 $f2, 0x3c($a2) -/* BE8708 80240B28 00A31021 */ addu $v0, $a1, $v1 -/* BE870C 80240B2C C4400008 */ lwc1 $f0, 8($v0) -/* BE8710 80240B30 46800020 */ cvt.s.w $f0, $f0 -/* BE8714 80240B34 4602003E */ c.le.s $f0, $f2 -/* BE8718 80240B38 00000000 */ nop -/* BE871C 80240B3C 45020003 */ bc1fl .L80240B4C -/* BE8720 80240B40 24840001 */ addiu $a0, $a0, 1 -/* BE8724 80240B44 080902D7 */ j .L80240B5C -/* BE8728 80240B48 AE240078 */ sw $a0, 0x78($s1) -.L80240B4C: -/* BE872C 80240B4C 8C620000 */ lw $v0, ($v1) -/* BE8730 80240B50 0082102A */ slt $v0, $a0, $v0 -/* BE8734 80240B54 1440FFF2 */ bnez $v0, .L80240B20 -/* BE8738 80240B58 24A5000C */ addiu $a1, $a1, 0xc -.L80240B5C: -/* BE873C 80240B5C C6400000 */ lwc1 $f0, ($s2) -/* BE8740 80240B60 E4C00018 */ swc1 $f0, 0x18($a2) -/* BE8744 80240B64 8E0200CC */ lw $v0, 0xcc($s0) -/* BE8748 80240B68 8C420004 */ lw $v0, 4($v0) -/* BE874C 80240B6C ACC20028 */ sw $v0, 0x28($a2) -/* BE8750 80240B70 24020001 */ addiu $v0, $zero, 1 -/* BE8754 80240B74 AE200074 */ sw $zero, 0x74($s1) -/* BE8758 80240B78 AE220070 */ sw $v0, 0x70($s1) -/* BE875C 80240B7C 8FBF001C */ lw $ra, 0x1c($sp) -/* BE8760 80240B80 8FB20018 */ lw $s2, 0x18($sp) -/* BE8764 80240B84 8FB10014 */ lw $s1, 0x14($sp) -/* BE8768 80240B88 8FB00010 */ lw $s0, 0x10($sp) -/* BE876C 80240B8C 03E00008 */ jr $ra -/* BE8770 80240B90 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240B94_BE8774.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240B94_BE8774.s deleted file mode 100644 index b78b39f2c0..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240B94_BE8774.s +++ /dev/null @@ -1,214 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240B94_BE8774 -/* BE8774 80240B94 27BDFF98 */ addiu $sp, $sp, -0x68 -/* BE8778 80240B98 AFB40058 */ sw $s4, 0x58($sp) -/* BE877C 80240B9C 0080A02D */ daddu $s4, $a0, $zero -/* BE8780 80240BA0 AFBF0060 */ sw $ra, 0x60($sp) -/* BE8784 80240BA4 AFB5005C */ sw $s5, 0x5c($sp) -/* BE8788 80240BA8 AFB30054 */ sw $s3, 0x54($sp) -/* BE878C 80240BAC AFB20050 */ sw $s2, 0x50($sp) -/* BE8790 80240BB0 AFB1004C */ sw $s1, 0x4c($sp) -/* BE8794 80240BB4 AFB00048 */ sw $s0, 0x48($sp) -/* BE8798 80240BB8 8E910148 */ lw $s1, 0x148($s4) -/* BE879C 80240BBC 86240008 */ lh $a0, 8($s1) -/* BE87A0 80240BC0 0C00EABB */ jal get_npc_unsafe -/* BE87A4 80240BC4 00A0802D */ daddu $s0, $a1, $zero -/* BE87A8 80240BC8 8E83000C */ lw $v1, 0xc($s4) -/* BE87AC 80240BCC 0280202D */ daddu $a0, $s4, $zero -/* BE87B0 80240BD0 8C650000 */ lw $a1, ($v1) -/* BE87B4 80240BD4 0C0B1EAF */ jal get_variable -/* BE87B8 80240BD8 0040902D */ daddu $s2, $v0, $zero -/* BE87BC 80240BDC AFA00018 */ sw $zero, 0x18($sp) -/* BE87C0 80240BE0 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE87C4 80240BE4 8C630094 */ lw $v1, 0x94($v1) -/* BE87C8 80240BE8 AFA3001C */ sw $v1, 0x1c($sp) -/* BE87CC 80240BEC 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE87D0 80240BF0 8C630080 */ lw $v1, 0x80($v1) -/* BE87D4 80240BF4 AFA30020 */ sw $v1, 0x20($sp) -/* BE87D8 80240BF8 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE87DC 80240BFC 8C630088 */ lw $v1, 0x88($v1) -/* BE87E0 80240C00 AFA30024 */ sw $v1, 0x24($sp) -/* BE87E4 80240C04 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE87E8 80240C08 8C63008C */ lw $v1, 0x8c($v1) -/* BE87EC 80240C0C 27B50018 */ addiu $s5, $sp, 0x18 -/* BE87F0 80240C10 AFA30028 */ sw $v1, 0x28($sp) -/* BE87F4 80240C14 8E2300D0 */ lw $v1, 0xd0($s1) -/* BE87F8 80240C18 3C014282 */ lui $at, 0x4282 -/* BE87FC 80240C1C 44810000 */ mtc1 $at, $f0 -/* BE8800 80240C20 8C630090 */ lw $v1, 0x90($v1) -/* BE8804 80240C24 0040982D */ daddu $s3, $v0, $zero -/* BE8808 80240C28 E7A00030 */ swc1 $f0, 0x30($sp) -/* BE880C 80240C2C A7A00034 */ sh $zero, 0x34($sp) -/* BE8810 80240C30 16000005 */ bnez $s0, .L80240C48 -/* BE8814 80240C34 AFA3002C */ sw $v1, 0x2c($sp) -/* BE8818 80240C38 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE881C 80240C3C 30420004 */ andi $v0, $v0, 4 -/* BE8820 80240C40 10400044 */ beqz $v0, .L80240D54 -/* BE8824 80240C44 00000000 */ nop -.L80240C48: -/* BE8828 80240C48 2404F7FF */ addiu $a0, $zero, -0x801 -/* BE882C 80240C4C AE800070 */ sw $zero, 0x70($s4) -/* BE8830 80240C50 A640008E */ sh $zero, 0x8e($s2) -/* BE8834 80240C54 8E2200CC */ lw $v0, 0xcc($s1) -/* BE8838 80240C58 8E430000 */ lw $v1, ($s2) -/* BE883C 80240C5C 8C420000 */ lw $v0, ($v0) -/* BE8840 80240C60 00641824 */ and $v1, $v1, $a0 -/* BE8844 80240C64 AE430000 */ sw $v1, ($s2) -/* BE8848 80240C68 AE420028 */ sw $v0, 0x28($s2) -/* BE884C 80240C6C 8E2200D0 */ lw $v0, 0xd0($s1) -/* BE8850 80240C70 8C420098 */ lw $v0, 0x98($v0) -/* BE8854 80240C74 54400005 */ bnel $v0, $zero, .L80240C8C -/* BE8858 80240C78 2402FDFF */ addiu $v0, $zero, -0x201 -/* BE885C 80240C7C 34620200 */ ori $v0, $v1, 0x200 -/* BE8860 80240C80 2403FFF7 */ addiu $v1, $zero, -9 -/* BE8864 80240C84 08090325 */ j .L80240C94 -/* BE8868 80240C88 00431024 */ and $v0, $v0, $v1 -.L80240C8C: -/* BE886C 80240C8C 00621024 */ and $v0, $v1, $v0 -/* BE8870 80240C90 34420008 */ ori $v0, $v0, 8 -.L80240C94: -/* BE8874 80240C94 AE420000 */ sw $v0, ($s2) -/* BE8878 80240C98 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE887C 80240C9C 30420004 */ andi $v0, $v0, 4 -/* BE8880 80240CA0 10400008 */ beqz $v0, .L80240CC4 -/* BE8884 80240CA4 24020063 */ addiu $v0, $zero, 0x63 -/* BE8888 80240CA8 AE820070 */ sw $v0, 0x70($s4) -/* BE888C 80240CAC AE800074 */ sw $zero, 0x74($s4) -/* BE8890 80240CB0 8E2200B0 */ lw $v0, 0xb0($s1) -/* BE8894 80240CB4 2403FFFB */ addiu $v1, $zero, -5 -/* BE8898 80240CB8 00431024 */ and $v0, $v0, $v1 -/* BE889C 80240CBC 0809033C */ j .L80240CF0 -/* BE88A0 80240CC0 AE2200B0 */ sw $v0, 0xb0($s1) -.L80240CC4: -/* BE88A4 80240CC4 8E220000 */ lw $v0, ($s1) -/* BE88A8 80240CC8 3C034000 */ lui $v1, 0x4000 -/* BE88AC 80240CCC 00431024 */ and $v0, $v0, $v1 -/* BE88B0 80240CD0 10400007 */ beqz $v0, .L80240CF0 -/* BE88B4 80240CD4 3C03BFFF */ lui $v1, 0xbfff -/* BE88B8 80240CD8 2402000C */ addiu $v0, $zero, 0xc -/* BE88BC 80240CDC AE820070 */ sw $v0, 0x70($s4) -/* BE88C0 80240CE0 8E220000 */ lw $v0, ($s1) -/* BE88C4 80240CE4 3463FFFF */ ori $v1, $v1, 0xffff -/* BE88C8 80240CE8 00431024 */ and $v0, $v0, $v1 -/* BE88CC 80240CEC AE220000 */ sw $v0, ($s1) -.L80240CF0: -/* BE88D0 80240CF0 27A50038 */ addiu $a1, $sp, 0x38 -/* BE88D4 80240CF4 27A6003C */ addiu $a2, $sp, 0x3c -/* BE88D8 80240CF8 C6400038 */ lwc1 $f0, 0x38($s2) -/* BE88DC 80240CFC 864200A8 */ lh $v0, 0xa8($s2) -/* BE88E0 80240D00 3C0142C8 */ lui $at, 0x42c8 -/* BE88E4 80240D04 44812000 */ mtc1 $at, $f4 -/* BE88E8 80240D08 44823000 */ mtc1 $v0, $f6 -/* BE88EC 80240D0C 00000000 */ nop -/* BE88F0 80240D10 468031A0 */ cvt.s.w $f6, $f6 -/* BE88F4 80240D14 27A20044 */ addiu $v0, $sp, 0x44 -/* BE88F8 80240D18 E7A00038 */ swc1 $f0, 0x38($sp) -/* BE88FC 80240D1C C640003C */ lwc1 $f0, 0x3c($s2) -/* BE8900 80240D20 C6420040 */ lwc1 $f2, 0x40($s2) -/* BE8904 80240D24 46060000 */ add.s $f0, $f0, $f6 -/* BE8908 80240D28 E7A40044 */ swc1 $f4, 0x44($sp) -/* BE890C 80240D2C E7A20040 */ swc1 $f2, 0x40($sp) -/* BE8910 80240D30 E7A0003C */ swc1 $f0, 0x3c($sp) -/* BE8914 80240D34 AFA20010 */ sw $v0, 0x10($sp) -/* BE8918 80240D38 8E440080 */ lw $a0, 0x80($s2) -/* BE891C 80240D3C 0C0372DF */ jal func_800DCB7C -/* BE8920 80240D40 27A70040 */ addiu $a3, $sp, 0x40 -/* BE8924 80240D44 10400003 */ beqz $v0, .L80240D54 -/* BE8928 80240D48 00000000 */ nop -/* BE892C 80240D4C C7A0003C */ lwc1 $f0, 0x3c($sp) -/* BE8930 80240D50 E640003C */ swc1 $f0, 0x3c($s2) -.L80240D54: -/* BE8934 80240D54 8E830070 */ lw $v1, 0x70($s4) -/* BE8938 80240D58 2C620064 */ sltiu $v0, $v1, 0x64 -/* BE893C 80240D5C 10400042 */ beqz $v0, L80240E68_BE8A48 -/* BE8940 80240D60 00031080 */ sll $v0, $v1, 2 -/* BE8944 80240D64 3C018024 */ lui $at, %hi(jtbl_80245060_BECC40) -/* BE8948 80240D68 00220821 */ addu $at, $at, $v0 -/* BE894C 80240D6C 8C225060 */ lw $v0, %lo(jtbl_80245060_BECC40)($at) -/* BE8950 80240D70 00400008 */ jr $v0 -/* BE8954 80240D74 00000000 */ nop -glabel L80240D78_BE8958 -/* BE8958 80240D78 0280202D */ daddu $a0, $s4, $zero -/* BE895C 80240D7C 0260282D */ daddu $a1, $s3, $zero -/* BE8960 80240D80 0C090000 */ jal func_80240000_BE7BE0 -/* BE8964 80240D84 02A0302D */ daddu $a2, $s5, $zero -glabel L80240D88_BE8968 -/* BE8968 80240D88 0280202D */ daddu $a0, $s4, $zero -/* BE896C 80240D8C 0260282D */ daddu $a1, $s3, $zero -/* BE8970 80240D90 0C090056 */ jal func_80240158_BE7D38 -/* BE8974 80240D94 02A0302D */ daddu $a2, $s5, $zero -/* BE8978 80240D98 0809039A */ j L80240E68_BE8A48 -/* BE897C 80240D9C 00000000 */ nop -glabel L80240DA0_BE8980 -/* BE8980 80240DA0 0280202D */ daddu $a0, $s4, $zero -/* BE8984 80240DA4 0260282D */ daddu $a1, $s3, $zero -/* BE8988 80240DA8 0C090100 */ jal arn_05_UnkNpcAIFunc1 -/* BE898C 80240DAC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DB0_BE8990 -/* BE8990 80240DB0 0280202D */ daddu $a0, $s4, $zero -/* BE8994 80240DB4 0260282D */ daddu $a1, $s3, $zero -/* BE8998 80240DB8 0C090130 */ jal func_802404C0_BE80A0 -/* BE899C 80240DBC 02A0302D */ daddu $a2, $s5, $zero -/* BE89A0 80240DC0 0809039A */ j L80240E68_BE8A48 -/* BE89A4 80240DC4 00000000 */ nop -glabel L80240DC8_BE89A8 -/* BE89A8 80240DC8 0280202D */ daddu $a0, $s4, $zero -/* BE89AC 80240DCC 0260282D */ daddu $a1, $s3, $zero -/* BE89B0 80240DD0 0C09019F */ jal func_8024067C_BE825C -/* BE89B4 80240DD4 02A0302D */ daddu $a2, $s5, $zero -/* BE89B8 80240DD8 0809039A */ j L80240E68_BE8A48 -/* BE89BC 80240DDC 00000000 */ nop -glabel L80240DE0_BE89C0 -/* BE89C0 80240DE0 0280202D */ daddu $a0, $s4, $zero -/* BE89C4 80240DE4 0260282D */ daddu $a1, $s3, $zero -/* BE89C8 80240DE8 0C0901CC */ jal arn_05_NpcJumpFunc2 -/* BE89CC 80240DEC 02A0302D */ daddu $a2, $s5, $zero -glabel L80240DF0_BE89D0 -/* BE89D0 80240DF0 0280202D */ daddu $a0, $s4, $zero -/* BE89D4 80240DF4 0260282D */ daddu $a1, $s3, $zero -/* BE89D8 80240DF8 0C0901E9 */ jal arn_05_NpcJumpFunc -/* BE89DC 80240DFC 02A0302D */ daddu $a2, $s5, $zero -/* BE89E0 80240E00 0809039A */ j L80240E68_BE8A48 -/* BE89E4 80240E04 00000000 */ nop -glabel L80240E08_BE89E8 -/* BE89E8 80240E08 0280202D */ daddu $a0, $s4, $zero -/* BE89EC 80240E0C 0260282D */ daddu $a1, $s3, $zero -/* BE89F0 80240E10 0C090207 */ jal arn_05_UnkNpcAIFunc13 -/* BE89F4 80240E14 02A0302D */ daddu $a2, $s5, $zero -glabel L80240E18_BE89F8 -/* BE89F8 80240E18 0280202D */ daddu $a0, $s4, $zero -/* BE89FC 80240E1C 0260282D */ daddu $a1, $s3, $zero -/* BE8A00 80240E20 0C090253 */ jal func_8024094C_BE852C -/* BE8A04 80240E24 02A0302D */ daddu $a2, $s5, $zero -/* BE8A08 80240E28 0809039A */ j L80240E68_BE8A48 -/* BE8A0C 80240E2C 00000000 */ nop -glabel L80240E30_BE8A10 -/* BE8A10 80240E30 0280202D */ daddu $a0, $s4, $zero -/* BE8A14 80240E34 0260282D */ daddu $a1, $s3, $zero -/* BE8A18 80240E38 0C09029B */ jal arn_05_UnkNpcDurationFlagFunc -/* BE8A1C 80240E3C 02A0302D */ daddu $a2, $s5, $zero -/* BE8A20 80240E40 0809039A */ j L80240E68_BE8A48 -/* BE8A24 80240E44 00000000 */ nop -glabel L80240E48_BE8A28 -/* BE8A28 80240E48 0280202D */ daddu $a0, $s4, $zero -/* BE8A2C 80240E4C 0260282D */ daddu $a1, $s3, $zero -/* BE8A30 80240E50 0C0902B5 */ jal func_80240AD4_BE86B4 -/* BE8A34 80240E54 02A0302D */ daddu $a2, $s5, $zero -/* BE8A38 80240E58 0809039A */ j L80240E68_BE8A48 -/* BE8A3C 80240E5C 00000000 */ nop -glabel L80240E60_BE8A40 -/* BE8A40 80240E60 0C0129CF */ jal func_8004A73C -/* BE8A44 80240E64 0280202D */ daddu $a0, $s4, $zero -glabel L80240E68_BE8A48 -/* BE8A48 80240E68 8FBF0060 */ lw $ra, 0x60($sp) -/* BE8A4C 80240E6C 8FB5005C */ lw $s5, 0x5c($sp) -/* BE8A50 80240E70 8FB40058 */ lw $s4, 0x58($sp) -/* BE8A54 80240E74 8FB30054 */ lw $s3, 0x54($sp) -/* BE8A58 80240E78 8FB20050 */ lw $s2, 0x50($sp) -/* BE8A5C 80240E7C 8FB1004C */ lw $s1, 0x4c($sp) -/* BE8A60 80240E80 8FB00048 */ lw $s0, 0x48($sp) -/* BE8A64 80240E84 0000102D */ daddu $v0, $zero, $zero -/* BE8A68 80240E88 03E00008 */ jr $ra -/* BE8A6C 80240E8C 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240E90_BE8A70.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240E90_BE8A70.s deleted file mode 100644 index a0d12bec4f..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80240E90_BE8A70.s +++ /dev/null @@ -1,126 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240E90_BE8A70 -/* BE8A70 80240E90 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* BE8A74 80240E94 AFB20030 */ sw $s2, 0x30($sp) -/* BE8A78 80240E98 0080902D */ daddu $s2, $a0, $zero -/* BE8A7C 80240E9C AFBF0034 */ sw $ra, 0x34($sp) -/* BE8A80 80240EA0 AFB1002C */ sw $s1, 0x2c($sp) -/* BE8A84 80240EA4 AFB00028 */ sw $s0, 0x28($sp) -/* BE8A88 80240EA8 F7B60040 */ sdc1 $f22, 0x40($sp) -/* BE8A8C 80240EAC F7B40038 */ sdc1 $f20, 0x38($sp) -/* BE8A90 80240EB0 8E500148 */ lw $s0, 0x148($s2) -/* BE8A94 80240EB4 0C00EABB */ jal get_npc_unsafe -/* BE8A98 80240EB8 86040008 */ lh $a0, 8($s0) -/* BE8A9C 80240EBC 0040882D */ daddu $s1, $v0, $zero -/* BE8AA0 80240EC0 C62C0038 */ lwc1 $f12, 0x38($s1) -/* BE8AA4 80240EC4 8E430078 */ lw $v1, 0x78($s2) -/* BE8AA8 80240EC8 C62E0040 */ lwc1 $f14, 0x40($s1) -/* BE8AAC 80240ECC 00031040 */ sll $v0, $v1, 1 -/* BE8AB0 80240ED0 00431021 */ addu $v0, $v0, $v1 -/* BE8AB4 80240ED4 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE8AB8 80240ED8 00021080 */ sll $v0, $v0, 2 -/* BE8ABC 80240EDC 00431021 */ addu $v0, $v0, $v1 -/* BE8AC0 80240EE0 C4560004 */ lwc1 $f22, 4($v0) -/* BE8AC4 80240EE4 4680B5A0 */ cvt.s.w $f22, $f22 -/* BE8AC8 80240EE8 C454000C */ lwc1 $f20, 0xc($v0) -/* BE8ACC 80240EEC 4680A520 */ cvt.s.w $f20, $f20 -/* BE8AD0 80240EF0 4406B000 */ mfc1 $a2, $f22 -/* BE8AD4 80240EF4 4407A000 */ mfc1 $a3, $f20 -/* BE8AD8 80240EF8 E7AC0018 */ swc1 $f12, 0x18($sp) -/* BE8ADC 80240EFC 0C00A720 */ jal atan2 -/* BE8AE0 80240F00 E7AE0020 */ swc1 $f14, 0x20($sp) -/* BE8AE4 80240F04 8E250018 */ lw $a1, 0x18($s1) -/* BE8AE8 80240F08 44060000 */ mfc1 $a2, $f0 -/* BE8AEC 80240F0C 0220202D */ daddu $a0, $s1, $zero -/* BE8AF0 80240F10 0C00EA95 */ jal npc_move_heading -/* BE8AF4 80240F14 AE26000C */ sw $a2, 0xc($s1) -/* BE8AF8 80240F18 27A50018 */ addiu $a1, $sp, 0x18 -/* BE8AFC 80240F1C 27A6001C */ addiu $a2, $sp, 0x1c -/* BE8B00 80240F20 C6200038 */ lwc1 $f0, 0x38($s1) -/* BE8B04 80240F24 8E430078 */ lw $v1, 0x78($s2) -/* BE8B08 80240F28 3C01447A */ lui $at, 0x447a -/* BE8B0C 80240F2C 44812000 */ mtc1 $at, $f4 -/* BE8B10 80240F30 00031040 */ sll $v0, $v1, 1 -/* BE8B14 80240F34 00431021 */ addu $v0, $v0, $v1 -/* BE8B18 80240F38 00021080 */ sll $v0, $v0, 2 -/* BE8B1C 80240F3C E7A00018 */ swc1 $f0, 0x18($sp) -/* BE8B20 80240F40 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE8B24 80240F44 C620003C */ lwc1 $f0, 0x3c($s1) -/* BE8B28 80240F48 C6220040 */ lwc1 $f2, 0x40($s1) -/* BE8B2C 80240F4C 00431021 */ addu $v0, $v0, $v1 -/* BE8B30 80240F50 C4460008 */ lwc1 $f6, 8($v0) -/* BE8B34 80240F54 468031A0 */ cvt.s.w $f6, $f6 -/* BE8B38 80240F58 27A20024 */ addiu $v0, $sp, 0x24 -/* BE8B3C 80240F5C 46060000 */ add.s $f0, $f0, $f6 -/* BE8B40 80240F60 E7A20020 */ swc1 $f2, 0x20($sp) -/* BE8B44 80240F64 E7A40024 */ swc1 $f4, 0x24($sp) -/* BE8B48 80240F68 E7A0001C */ swc1 $f0, 0x1c($sp) -/* BE8B4C 80240F6C AFA20010 */ sw $v0, 0x10($sp) -/* BE8B50 80240F70 8E240080 */ lw $a0, 0x80($s1) -/* BE8B54 80240F74 0C0372DF */ jal func_800DCB7C -/* BE8B58 80240F78 27A70020 */ addiu $a3, $sp, 0x20 -/* BE8B5C 80240F7C 8E430078 */ lw $v1, 0x78($s2) -/* BE8B60 80240F80 C7A2001C */ lwc1 $f2, 0x1c($sp) -/* BE8B64 80240F84 00031040 */ sll $v0, $v1, 1 -/* BE8B68 80240F88 00431021 */ addu $v0, $v0, $v1 -/* BE8B6C 80240F8C 8E0300D0 */ lw $v1, 0xd0($s0) -/* BE8B70 80240F90 00021080 */ sll $v0, $v0, 2 -/* BE8B74 80240F94 00431021 */ addu $v0, $v0, $v1 -/* BE8B78 80240F98 C4400008 */ lwc1 $f0, 8($v0) -/* BE8B7C 80240F9C 46800020 */ cvt.s.w $f0, $f0 -/* BE8B80 80240FA0 46001080 */ add.s $f2, $f2, $f0 -/* BE8B84 80240FA4 C620003C */ lwc1 $f0, 0x3c($s1) -/* BE8B88 80240FA8 3C014000 */ lui $at, 0x4000 -/* BE8B8C 80240FAC 44813800 */ mtc1 $at, $f7 -/* BE8B90 80240FB0 44803000 */ mtc1 $zero, $f6 -/* BE8B94 80240FB4 46001001 */ sub.s $f0, $f2, $f0 -/* BE8B98 80240FB8 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BE8B9C 80240FBC 46000121 */ cvt.d.s $f4, $f0 -/* BE8BA0 80240FC0 4624303C */ c.lt.d $f6, $f4 -/* BE8BA4 80240FC4 00000000 */ nop -/* BE8BA8 80240FC8 45000005 */ bc1f .L80240FE0 -/* BE8BAC 80240FCC E7A00024 */ swc1 $f0, 0x24($sp) -/* BE8BB0 80240FD0 C620003C */ lwc1 $f0, 0x3c($s1) -/* BE8BB4 80240FD4 46000021 */ cvt.d.s $f0, $f0 -/* BE8BB8 80240FD8 08090403 */ j .L8024100C -/* BE8BBC 80240FDC 46260000 */ add.d $f0, $f0, $f6 -.L80240FE0: -/* BE8BC0 80240FE0 3C01C000 */ lui $at, 0xc000 -/* BE8BC4 80240FE4 44810800 */ mtc1 $at, $f1 -/* BE8BC8 80240FE8 44800000 */ mtc1 $zero, $f0 -/* BE8BCC 80240FEC 00000000 */ nop -/* BE8BD0 80240FF0 4620203C */ c.lt.d $f4, $f0 -/* BE8BD4 80240FF4 00000000 */ nop -/* BE8BD8 80240FF8 45020006 */ bc1fl .L80241014 -/* BE8BDC 80240FFC E622003C */ swc1 $f2, 0x3c($s1) -/* BE8BE0 80241000 C620003C */ lwc1 $f0, 0x3c($s1) -/* BE8BE4 80241004 46000021 */ cvt.d.s $f0, $f0 -/* BE8BE8 80241008 46260001 */ sub.d $f0, $f0, $f6 -.L8024100C: -/* BE8BEC 8024100C 46200020 */ cvt.s.d $f0, $f0 -/* BE8BF0 80241010 E620003C */ swc1 $f0, 0x3c($s1) -.L80241014: -/* BE8BF4 80241014 C62C0038 */ lwc1 $f12, 0x38($s1) -/* BE8BF8 80241018 C62E0040 */ lwc1 $f14, 0x40($s1) -/* BE8BFC 8024101C 4406B000 */ mfc1 $a2, $f22 -/* BE8C00 80241020 4407A000 */ mfc1 $a3, $f20 -/* BE8C04 80241024 0C00A7B5 */ jal dist2D -/* BE8C08 80241028 00000000 */ nop -/* BE8C0C 8024102C C6220018 */ lwc1 $f2, 0x18($s1) -/* BE8C10 80241030 4600103C */ c.lt.s $f2, $f0 -/* BE8C14 80241034 00000000 */ nop -/* BE8C18 80241038 45010003 */ bc1t .L80241048 -/* BE8C1C 8024103C E7A00024 */ swc1 $f0, 0x24($sp) -/* BE8C20 80241040 24020002 */ addiu $v0, $zero, 2 -/* BE8C24 80241044 AE420070 */ sw $v0, 0x70($s2) -.L80241048: -/* BE8C28 80241048 8FBF0034 */ lw $ra, 0x34($sp) -/* BE8C2C 8024104C 8FB20030 */ lw $s2, 0x30($sp) -/* BE8C30 80241050 8FB1002C */ lw $s1, 0x2c($sp) -/* BE8C34 80241054 8FB00028 */ lw $s0, 0x28($sp) -/* BE8C38 80241058 D7B60040 */ ldc1 $f22, 0x40($sp) -/* BE8C3C 8024105C D7B40038 */ ldc1 $f20, 0x38($sp) -/* BE8C40 80241060 03E00008 */ jr $ra -/* BE8C44 80241064 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80241068_BE8C48.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80241068_BE8C48.s deleted file mode 100644 index 360a87c543..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_80241068_BE8C48.s +++ /dev/null @@ -1,59 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241068_BE8C48 -/* BE8C48 80241068 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BE8C4C 8024106C AFB10014 */ sw $s1, 0x14($sp) -/* BE8C50 80241070 0080882D */ daddu $s1, $a0, $zero -/* BE8C54 80241074 AFBF0020 */ sw $ra, 0x20($sp) -/* BE8C58 80241078 AFB3001C */ sw $s3, 0x1c($sp) -/* BE8C5C 8024107C AFB20018 */ sw $s2, 0x18($sp) -/* BE8C60 80241080 AFB00010 */ sw $s0, 0x10($sp) -/* BE8C64 80241084 8E320148 */ lw $s2, 0x148($s1) -/* BE8C68 80241088 86440008 */ lh $a0, 8($s2) -/* BE8C6C 8024108C 0C00EABB */ jal get_npc_unsafe -/* BE8C70 80241090 00A0982D */ daddu $s3, $a1, $zero -/* BE8C74 80241094 0040802D */ daddu $s0, $v0, $zero -/* BE8C78 80241098 9602008E */ lhu $v0, 0x8e($s0) -/* BE8C7C 8024109C 2442FFFF */ addiu $v0, $v0, -1 -/* BE8C80 802410A0 A602008E */ sh $v0, 0x8e($s0) -/* BE8C84 802410A4 00021400 */ sll $v0, $v0, 0x10 -/* BE8C88 802410A8 0441001D */ bgez $v0, .L80241120 -/* BE8C8C 802410AC 00000000 */ nop -/* BE8C90 802410B0 8E220074 */ lw $v0, 0x74($s1) -/* BE8C94 802410B4 2442FFFF */ addiu $v0, $v0, -1 -/* BE8C98 802410B8 04400014 */ bltz $v0, .L8024110C -/* BE8C9C 802410BC AE220074 */ sw $v0, 0x74($s1) -/* BE8CA0 802410C0 C600000C */ lwc1 $f0, 0xc($s0) -/* BE8CA4 802410C4 3C014334 */ lui $at, 0x4334 -/* BE8CA8 802410C8 44816000 */ mtc1 $at, $f12 -/* BE8CAC 802410CC 0C00A6C9 */ jal clamp_angle -/* BE8CB0 802410D0 460C0300 */ add.s $f12, $f0, $f12 -/* BE8CB4 802410D4 E600000C */ swc1 $f0, 0xc($s0) -/* BE8CB8 802410D8 8E640008 */ lw $a0, 8($s3) -/* BE8CBC 802410DC 000417C2 */ srl $v0, $a0, 0x1f -/* BE8CC0 802410E0 00822021 */ addu $a0, $a0, $v0 -/* BE8CC4 802410E4 00042043 */ sra $a0, $a0, 1 -/* BE8CC8 802410E8 0C00A67F */ jal rand_int -/* BE8CCC 802410EC 24840001 */ addiu $a0, $a0, 1 -/* BE8CD0 802410F0 8E630008 */ lw $v1, 8($s3) -/* BE8CD4 802410F4 000327C2 */ srl $a0, $v1, 0x1f -/* BE8CD8 802410F8 00641821 */ addu $v1, $v1, $a0 -/* BE8CDC 802410FC 00031843 */ sra $v1, $v1, 1 -/* BE8CE0 80241100 00621821 */ addu $v1, $v1, $v0 -/* BE8CE4 80241104 08090448 */ j .L80241120 -/* BE8CE8 80241108 A603008E */ sh $v1, 0x8e($s0) -.L8024110C: -/* BE8CEC 8024110C 24020004 */ addiu $v0, $zero, 4 -/* BE8CF0 80241110 AE220070 */ sw $v0, 0x70($s1) -/* BE8CF4 80241114 8E4200CC */ lw $v0, 0xcc($s2) -/* BE8CF8 80241118 8C420000 */ lw $v0, ($v0) -/* BE8CFC 8024111C AE020028 */ sw $v0, 0x28($s0) -.L80241120: -/* BE8D00 80241120 8FBF0020 */ lw $ra, 0x20($sp) -/* BE8D04 80241124 8FB3001C */ lw $s3, 0x1c($sp) -/* BE8D08 80241128 8FB20018 */ lw $s2, 0x18($sp) -/* BE8D0C 8024112C 8FB10014 */ lw $s1, 0x14($sp) -/* BE8D10 80241130 8FB00010 */ lw $s0, 0x10($sp) -/* BE8D14 80241134 03E00008 */ jr $ra -/* BE8D18 80241138 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024113C_BE8D1C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024113C_BE8D1C.s deleted file mode 100644 index 5baa3c3e0e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_8024113C_BE8D1C.s +++ /dev/null @@ -1,104 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024113C_BE8D1C -/* BE8D1C 8024113C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BE8D20 80241140 AFB40040 */ sw $s4, 0x40($sp) -/* BE8D24 80241144 0080A02D */ daddu $s4, $a0, $zero -/* BE8D28 80241148 AFBF0048 */ sw $ra, 0x48($sp) -/* BE8D2C 8024114C AFB50044 */ sw $s5, 0x44($sp) -/* BE8D30 80241150 AFB3003C */ sw $s3, 0x3c($sp) -/* BE8D34 80241154 AFB20038 */ sw $s2, 0x38($sp) -/* BE8D38 80241158 AFB10034 */ sw $s1, 0x34($sp) -/* BE8D3C 8024115C AFB00030 */ sw $s0, 0x30($sp) -/* BE8D40 80241160 8E930148 */ lw $s3, 0x148($s4) -/* BE8D44 80241164 86640008 */ lh $a0, 8($s3) -/* BE8D48 80241168 8E90000C */ lw $s0, 0xc($s4) -/* BE8D4C 8024116C 0C00EABB */ jal get_npc_unsafe -/* BE8D50 80241170 00A0882D */ daddu $s1, $a1, $zero -/* BE8D54 80241174 0280202D */ daddu $a0, $s4, $zero -/* BE8D58 80241178 8E050000 */ lw $a1, ($s0) -/* BE8D5C 8024117C 0C0B1EAF */ jal get_variable -/* BE8D60 80241180 0040A82D */ daddu $s5, $v0, $zero -/* BE8D64 80241184 AFA00010 */ sw $zero, 0x10($sp) -/* BE8D68 80241188 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE8D6C 8024118C 8C630094 */ lw $v1, 0x94($v1) -/* BE8D70 80241190 AFA30014 */ sw $v1, 0x14($sp) -/* BE8D74 80241194 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE8D78 80241198 8C630080 */ lw $v1, 0x80($v1) -/* BE8D7C 8024119C AFA30018 */ sw $v1, 0x18($sp) -/* BE8D80 802411A0 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE8D84 802411A4 8C630088 */ lw $v1, 0x88($v1) -/* BE8D88 802411A8 AFA3001C */ sw $v1, 0x1c($sp) -/* BE8D8C 802411AC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE8D90 802411B0 8C63008C */ lw $v1, 0x8c($v1) -/* BE8D94 802411B4 27B20010 */ addiu $s2, $sp, 0x10 -/* BE8D98 802411B8 AFA30020 */ sw $v1, 0x20($sp) -/* BE8D9C 802411BC 8E6300D0 */ lw $v1, 0xd0($s3) -/* BE8DA0 802411C0 3C0142C8 */ lui $at, 0x42c8 -/* BE8DA4 802411C4 44810000 */ mtc1 $at, $f0 -/* BE8DA8 802411C8 8C630090 */ lw $v1, 0x90($v1) -/* BE8DAC 802411CC 0040802D */ daddu $s0, $v0, $zero -/* BE8DB0 802411D0 E7A00028 */ swc1 $f0, 0x28($sp) -/* BE8DB4 802411D4 A7A0002C */ sh $zero, 0x2c($sp) -/* BE8DB8 802411D8 12200007 */ beqz $s1, .L802411F8 -/* BE8DBC 802411DC AFA30024 */ sw $v1, 0x24($sp) -/* BE8DC0 802411E0 AE800070 */ sw $zero, 0x70($s4) -/* BE8DC4 802411E4 8EA20000 */ lw $v0, ($s5) -/* BE8DC8 802411E8 2403F7FF */ addiu $v1, $zero, -0x801 -/* BE8DCC 802411EC A6A0008E */ sh $zero, 0x8e($s5) -/* BE8DD0 802411F0 00431024 */ and $v0, $v0, $v1 -/* BE8DD4 802411F4 AEA20000 */ sw $v0, ($s5) -.L802411F8: -/* BE8DD8 802411F8 8E830070 */ lw $v1, 0x70($s4) -/* BE8DDC 802411FC 2C620005 */ sltiu $v0, $v1, 5 -/* BE8DE0 80241200 1040001E */ beqz $v0, .L8024127C -/* BE8DE4 80241204 00031080 */ sll $v0, $v1, 2 -/* BE8DE8 80241208 3C018024 */ lui $at, %hi(jtbl_802451F0_BECDD0) -/* BE8DEC 8024120C 00220821 */ addu $at, $at, $v0 -/* BE8DF0 80241210 8C2251F0 */ lw $v0, %lo(jtbl_802451F0_BECDD0)($at) -/* BE8DF4 80241214 00400008 */ jr $v0 -/* BE8DF8 80241218 00000000 */ nop -glabel L8024121C_BE8DFC -/* BE8DFC 8024121C 0280202D */ daddu $a0, $s4, $zero -/* BE8E00 80241220 0200282D */ daddu $a1, $s0, $zero -/* BE8E04 80241224 0C090000 */ jal func_80240000_BE7BE0 -/* BE8E08 80241228 0240302D */ daddu $a2, $s2, $zero -glabel L8024122C_BE8E0C -/* BE8E0C 8024122C 0280202D */ daddu $a0, $s4, $zero -/* BE8E10 80241230 0200282D */ daddu $a1, $s0, $zero -/* BE8E14 80241234 0C0903A4 */ jal func_80240E90_BE8A70 -/* BE8E18 80241238 0240302D */ daddu $a2, $s2, $zero -/* BE8E1C 8024123C 0809049F */ j .L8024127C -/* BE8E20 80241240 00000000 */ nop -glabel L80241244_BE8E24 -/* BE8E24 80241244 0280202D */ daddu $a0, $s4, $zero -/* BE8E28 80241248 0200282D */ daddu $a1, $s0, $zero -/* BE8E2C 8024124C 0C090100 */ jal arn_05_UnkNpcAIFunc1 -/* BE8E30 80241250 0240302D */ daddu $a2, $s2, $zero -glabel L80241254_BE8E34 -/* BE8E34 80241254 0280202D */ daddu $a0, $s4, $zero -/* BE8E38 80241258 0200282D */ daddu $a1, $s0, $zero -/* BE8E3C 8024125C 0C09041A */ jal func_80241068_BE8C48 -/* BE8E40 80241260 0240302D */ daddu $a2, $s2, $zero -/* BE8E44 80241264 0809049F */ j .L8024127C -/* BE8E48 80241268 00000000 */ nop -glabel L8024126C_BE8E4C -/* BE8E4C 8024126C 0280202D */ daddu $a0, $s4, $zero -/* BE8E50 80241270 0200282D */ daddu $a1, $s0, $zero -/* BE8E54 80241274 0C09019F */ jal func_8024067C_BE825C -/* BE8E58 80241278 0240302D */ daddu $a2, $s2, $zero -.L8024127C: -/* BE8E5C 8024127C C6A0003C */ lwc1 $f0, 0x3c($s5) -/* BE8E60 80241280 4600008D */ trunc.w.s $f2, $f0 -/* BE8E64 80241284 E662006C */ swc1 $f2, 0x6c($s3) -/* BE8E68 80241288 8FBF0048 */ lw $ra, 0x48($sp) -/* BE8E6C 8024128C 8FB50044 */ lw $s5, 0x44($sp) -/* BE8E70 80241290 8FB40040 */ lw $s4, 0x40($sp) -/* BE8E74 80241294 8FB3003C */ lw $s3, 0x3c($sp) -/* BE8E78 80241298 8FB20038 */ lw $s2, 0x38($sp) -/* BE8E7C 8024129C 8FB10034 */ lw $s1, 0x34($sp) -/* BE8E80 802412A0 8FB00030 */ lw $s0, 0x30($sp) -/* BE8E84 802412A4 0000102D */ daddu $v0, $zero, $zero -/* BE8E88 802412A8 03E00008 */ jr $ra -/* BE8E8C 802412AC 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412B0_BE8E90.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412B0_BE8E90.s deleted file mode 100644 index 886ce53858..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412B0_BE8E90.s +++ /dev/null @@ -1,10 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802412B0_BE8E90 -/* BE8E90 802412B0 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* BE8E94 802412B4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* BE8E98 802412B8 8C420010 */ lw $v0, 0x10($v0) -/* BE8E9C 802412BC 00021042 */ srl $v0, $v0, 1 -/* BE8EA0 802412C0 03E00008 */ jr $ra -/* BE8EA4 802412C4 30420002 */ andi $v0, $v0, 2 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412C8_BE8EA8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412C8_BE8EA8.s deleted file mode 100644 index 30cf723205..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_05/BE7BE0/func_802412C8_BE8EA8.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802412C8_BE8EA8 -/* BE8EA8 802412C8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BE8EAC 802412CC AFBF0010 */ sw $ra, 0x10($sp) -/* BE8EB0 802412D0 8C82000C */ lw $v0, 0xc($a0) -/* BE8EB4 802412D4 0C0B1EAF */ jal get_variable -/* BE8EB8 802412D8 8C450000 */ lw $a1, ($v0) -/* BE8EBC 802412DC 0C03AC5A */ jal func_800EB168 -/* BE8EC0 802412E0 0040202D */ daddu $a0, $v0, $zero -/* BE8EC4 802412E4 8FBF0010 */ lw $ra, 0x10($sp) -/* BE8EC8 802412E8 24020002 */ addiu $v0, $zero, 2 -/* BE8ECC 802412EC 03E00008 */ jr $ra -/* BE8ED0 802412F0 27BD0018 */ addiu $sp, $sp, 0x18 -/* BE8ED4 802412F4 00000000 */ nop -/* BE8ED8 802412F8 00000000 */ nop -/* BE8EDC 802412FC 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240000_BECDF0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240000_BECDF0.s deleted file mode 100644 index 149747c9a9..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240000_BECDF0.s +++ /dev/null @@ -1,23 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BECDF0 -/* BECDF0 80240000 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* BECDF4 80240004 AFBF001C */ sw $ra, 0x1c($sp) -/* BECDF8 80240008 AFB00018 */ sw $s0, 0x18($sp) -/* BECDFC 8024000C 8C900084 */ lw $s0, 0x84($a0) -/* BECE00 80240010 C6000008 */ lwc1 $f0, 8($s0) -/* BECE04 80240014 240400A2 */ addiu $a0, $zero, 0xa2 -/* BECE08 80240018 E7A00010 */ swc1 $f0, 0x10($sp) -/* BECE0C 8024001C 8E060000 */ lw $a2, ($s0) -/* BECE10 80240020 8E070004 */ lw $a3, 4($s0) -/* BECE14 80240024 0C05267B */ jal sfx_adjust_env_sound_pos -/* BECE18 80240028 0000282D */ daddu $a1, $zero, $zero -/* BECE1C 8024002C 86020044 */ lh $v0, 0x44($s0) -/* BECE20 80240030 8FBF001C */ lw $ra, 0x1c($sp) -/* BECE24 80240034 8FB00018 */ lw $s0, 0x18($sp) -/* BECE28 80240038 28420002 */ slti $v0, $v0, 2 -/* BECE2C 8024003C 38420001 */ xori $v0, $v0, 1 -/* BECE30 80240040 00021040 */ sll $v0, $v0, 1 -/* BECE34 80240044 03E00008 */ jr $ra -/* BECE38 80240048 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_8024004C_BECE3C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_8024004C_BECE3C.s deleted file mode 100644 index 3a608e1ce6..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_8024004C_BECE3C.s +++ /dev/null @@ -1,93 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024004C_BECE3C -/* BECE3C 8024004C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BECE40 80240050 AFB20020 */ sw $s2, 0x20($sp) -/* BECE44 80240054 0080902D */ daddu $s2, $a0, $zero -/* BECE48 80240058 AFBF0024 */ sw $ra, 0x24($sp) -/* BECE4C 8024005C AFB1001C */ sw $s1, 0x1c($sp) -/* BECE50 80240060 AFB00018 */ sw $s0, 0x18($sp) -/* BECE54 80240064 10A0004A */ beqz $a1, .L80240190 -/* BECE58 80240068 8E51000C */ lw $s1, 0xc($s2) -/* BECE5C 8024006C 0C00AB39 */ jal heap_malloc -/* BECE60 80240070 24040058 */ addiu $a0, $zero, 0x58 -/* BECE64 80240074 0000202D */ daddu $a0, $zero, $zero -/* BECE68 80240078 3C05FD05 */ lui $a1, 0xfd05 -/* BECE6C 8024007C 34A50F81 */ ori $a1, $a1, 0xf81 -/* BECE70 80240080 0040802D */ daddu $s0, $v0, $zero -/* BECE74 80240084 0200302D */ daddu $a2, $s0, $zero -/* BECE78 80240088 0C0B2026 */ jal set_variable -/* BECE7C 8024008C AE500084 */ sw $s0, 0x84($s2) -/* BECE80 80240090 8E250000 */ lw $a1, ($s1) -/* BECE84 80240094 26310004 */ addiu $s1, $s1, 4 -/* BECE88 80240098 0C0B1EAF */ jal get_variable -/* BECE8C 8024009C 0240202D */ daddu $a0, $s2, $zero -/* BECE90 802400A0 AE020038 */ sw $v0, 0x38($s0) -/* BECE94 802400A4 8E250000 */ lw $a1, ($s1) -/* BECE98 802400A8 26310004 */ addiu $s1, $s1, 4 -/* BECE9C 802400AC 0C0B1EAF */ jal get_variable -/* BECEA0 802400B0 0240202D */ daddu $a0, $s2, $zero -/* BECEA4 802400B4 AE02003C */ sw $v0, 0x3c($s0) -/* BECEA8 802400B8 8E250000 */ lw $a1, ($s1) -/* BECEAC 802400BC 26310004 */ addiu $s1, $s1, 4 -/* BECEB0 802400C0 0C0B210B */ jal get_float_variable -/* BECEB4 802400C4 0240202D */ daddu $a0, $s2, $zero -/* BECEB8 802400C8 E600000C */ swc1 $f0, 0xc($s0) -/* BECEBC 802400CC 8E250000 */ lw $a1, ($s1) -/* BECEC0 802400D0 26310004 */ addiu $s1, $s1, 4 -/* BECEC4 802400D4 0C0B210B */ jal get_float_variable -/* BECEC8 802400D8 0240202D */ daddu $a0, $s2, $zero -/* BECECC 802400DC E6000010 */ swc1 $f0, 0x10($s0) -/* BECED0 802400E0 8E250000 */ lw $a1, ($s1) -/* BECED4 802400E4 26310004 */ addiu $s1, $s1, 4 -/* BECED8 802400E8 0C0B210B */ jal get_float_variable -/* BECEDC 802400EC 0240202D */ daddu $a0, $s2, $zero -/* BECEE0 802400F0 E6000014 */ swc1 $f0, 0x14($s0) -/* BECEE4 802400F4 8E250000 */ lw $a1, ($s1) -/* BECEE8 802400F8 26310004 */ addiu $s1, $s1, 4 -/* BECEEC 802400FC 0C0B210B */ jal get_float_variable -/* BECEF0 80240100 0240202D */ daddu $a0, $s2, $zero -/* BECEF4 80240104 E6000018 */ swc1 $f0, 0x18($s0) -/* BECEF8 80240108 8E250000 */ lw $a1, ($s1) -/* BECEFC 8024010C 26310004 */ addiu $s1, $s1, 4 -/* BECF00 80240110 0C0B210B */ jal get_float_variable -/* BECF04 80240114 0240202D */ daddu $a0, $s2, $zero -/* BECF08 80240118 E600001C */ swc1 $f0, 0x1c($s0) -/* BECF0C 8024011C 8E250000 */ lw $a1, ($s1) -/* BECF10 80240120 26310004 */ addiu $s1, $s1, 4 -/* BECF14 80240124 0C0B210B */ jal get_float_variable -/* BECF18 80240128 0240202D */ daddu $a0, $s2, $zero -/* BECF1C 8024012C E6000020 */ swc1 $f0, 0x20($s0) -/* BECF20 80240130 8E250000 */ lw $a1, ($s1) -/* BECF24 80240134 26310004 */ addiu $s1, $s1, 4 -/* BECF28 80240138 0C0B210B */ jal get_float_variable -/* BECF2C 8024013C 0240202D */ daddu $a0, $s2, $zero -/* BECF30 80240140 E6000024 */ swc1 $f0, 0x24($s0) -/* BECF34 80240144 8E250000 */ lw $a1, ($s1) -/* BECF38 80240148 0C0B210B */ jal get_float_variable -/* BECF3C 8024014C 0240202D */ daddu $a0, $s2, $zero -/* BECF40 80240150 3C013F80 */ lui $at, 0x3f80 -/* BECF44 80240154 44811000 */ mtc1 $at, $f2 -/* BECF48 80240158 E6000028 */ swc1 $f0, 0x28($s0) -/* BECF4C 8024015C AFA00014 */ sw $zero, 0x14($sp) -/* BECF50 80240160 E7A20010 */ swc1 $f2, 0x10($sp) -/* BECF54 80240164 8E05000C */ lw $a1, 0xc($s0) -/* BECF58 80240168 8E060010 */ lw $a2, 0x10($s0) -/* BECF5C 8024016C 8E070014 */ lw $a3, 0x14($s0) -/* BECF60 80240170 0C01CA6C */ jal func_800729B0 -/* BECF64 80240174 24040002 */ addiu $a0, $zero, 2 -/* BECF68 80240178 AE020050 */ sw $v0, 0x50($s0) -/* BECF6C 8024017C A600004E */ sh $zero, 0x4e($s0) -/* BECF70 80240180 A6000048 */ sh $zero, 0x48($s0) -/* BECF74 80240184 A600004A */ sh $zero, 0x4a($s0) -/* BECF78 80240188 A6000044 */ sh $zero, 0x44($s0) -/* BECF7C 8024018C A6000046 */ sh $zero, 0x46($s0) -.L80240190: -/* BECF80 80240190 8FBF0024 */ lw $ra, 0x24($sp) -/* BECF84 80240194 8FB20020 */ lw $s2, 0x20($sp) -/* BECF88 80240198 8FB1001C */ lw $s1, 0x1c($sp) -/* BECF8C 8024019C 8FB00018 */ lw $s0, 0x18($sp) -/* BECF90 802401A0 24020002 */ addiu $v0, $zero, 2 -/* BECF94 802401A4 03E00008 */ jr $ra -/* BECF98 802401A8 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802401AC_BECF9C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802401AC_BECF9C.s deleted file mode 100644 index 861f1697f2..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802401AC_BECF9C.s +++ /dev/null @@ -1,276 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802401AC_BECF9C -/* BECF9C 802401AC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BECFA0 802401B0 AFBF0020 */ sw $ra, 0x20($sp) -/* BECFA4 802401B4 AFB1001C */ sw $s1, 0x1c($sp) -/* BECFA8 802401B8 AFB00018 */ sw $s0, 0x18($sp) -/* BECFAC 802401BC 8C910084 */ lw $s1, 0x84($a0) -/* BECFB0 802401C0 86230044 */ lh $v1, 0x44($s1) -/* BECFB4 802401C4 3C108011 */ lui $s0, %hi(gPlayerStatus) -/* BECFB8 802401C8 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus) -/* BECFBC 802401CC 2C620005 */ sltiu $v0, $v1, 5 -/* BECFC0 802401D0 1040008A */ beqz $v0, L802403FC_BED1EC -/* BECFC4 802401D4 00031080 */ sll $v0, $v1, 2 -/* BECFC8 802401D8 3C018024 */ lui $at, %hi(jtbl_80247900_BF46F0) -/* BECFCC 802401DC 00220821 */ addu $at, $at, $v0 -/* BECFD0 802401E0 8C227900 */ lw $v0, %lo(jtbl_80247900_BF46F0)($at) -/* BECFD4 802401E4 00400008 */ jr $v0 -/* BECFD8 802401E8 00000000 */ nop -glabel L802401EC_BECFDC -/* BECFDC 802401EC 8E22003C */ lw $v0, 0x3c($s1) -/* BECFE0 802401F0 86270046 */ lh $a3, 0x46($s1) -/* BECFE4 802401F4 AFA20010 */ sw $v0, 0x10($sp) -/* BECFE8 802401F8 8E250010 */ lw $a1, 0x10($s1) -/* BECFEC 802401FC 8E26001C */ lw $a2, 0x1c($s1) -/* BECFF0 80240200 0C00A8ED */ jal update_lerp -/* BECFF4 80240204 24040005 */ addiu $a0, $zero, 5 -/* BECFF8 80240208 86270046 */ lh $a3, 0x46($s1) -/* BECFFC 8024020C 8E22003C */ lw $v0, 0x3c($s1) -/* BED000 80240210 E6200004 */ swc1 $f0, 4($s1) -/* BED004 80240214 AFA20010 */ sw $v0, 0x10($sp) -/* BED008 80240218 8E25000C */ lw $a1, 0xc($s1) -/* BED00C 8024021C 8E260018 */ lw $a2, 0x18($s1) -/* BED010 80240220 0C00A8ED */ jal update_lerp -/* BED014 80240224 0000202D */ daddu $a0, $zero, $zero -/* BED018 80240228 86270046 */ lh $a3, 0x46($s1) -/* BED01C 8024022C 8E22003C */ lw $v0, 0x3c($s1) -/* BED020 80240230 E6200000 */ swc1 $f0, ($s1) -/* BED024 80240234 AFA20010 */ sw $v0, 0x10($sp) -/* BED028 80240238 8E250014 */ lw $a1, 0x14($s1) -/* BED02C 8024023C 8E260020 */ lw $a2, 0x20($s1) -/* BED030 80240240 0C00A8ED */ jal update_lerp -/* BED034 80240244 0000202D */ daddu $a0, $zero, $zero -/* BED038 80240248 8E220050 */ lw $v0, 0x50($s1) -/* BED03C 8024024C E6200008 */ swc1 $f0, 8($s1) -/* BED040 80240250 C6200000 */ lwc1 $f0, ($s1) -/* BED044 80240254 8C42000C */ lw $v0, 0xc($v0) -/* BED048 80240258 E4400008 */ swc1 $f0, 8($v0) -/* BED04C 8024025C 8E220050 */ lw $v0, 0x50($s1) -/* BED050 80240260 C6200004 */ lwc1 $f0, 4($s1) -/* BED054 80240264 8C42000C */ lw $v0, 0xc($v0) -/* BED058 80240268 E440000C */ swc1 $f0, 0xc($v0) -/* BED05C 8024026C 8E220050 */ lw $v0, 0x50($s1) -/* BED060 80240270 C6200008 */ lwc1 $f0, 8($s1) -/* BED064 80240274 8C42000C */ lw $v0, 0xc($v0) -/* BED068 80240278 E4400010 */ swc1 $f0, 0x10($v0) -/* BED06C 8024027C 96220046 */ lhu $v0, 0x46($s1) -/* BED070 80240280 8E23003C */ lw $v1, 0x3c($s1) -/* BED074 80240284 24420001 */ addiu $v0, $v0, 1 -/* BED078 80240288 A6220046 */ sh $v0, 0x46($s1) -/* BED07C 8024028C 00021400 */ sll $v0, $v0, 0x10 -/* BED080 80240290 00021403 */ sra $v0, $v0, 0x10 -/* BED084 80240294 0043102A */ slt $v0, $v0, $v1 -/* BED088 80240298 14400058 */ bnez $v0, L802403FC_BED1EC -/* BED08C 8024029C 24020001 */ addiu $v0, $zero, 1 -/* BED090 802402A0 A6220044 */ sh $v0, 0x44($s1) -/* BED094 802402A4 080900FF */ j L802403FC_BED1EC -/* BED098 802402A8 A6200046 */ sh $zero, 0x46($s1) -glabel L802402AC_BED09C -/* BED09C 802402AC 96220046 */ lhu $v0, 0x46($s1) -/* BED0A0 802402B0 24420001 */ addiu $v0, $v0, 1 -/* BED0A4 802402B4 A6220046 */ sh $v0, 0x46($s1) -/* BED0A8 802402B8 00021400 */ sll $v0, $v0, 0x10 -/* BED0AC 802402BC 00021403 */ sra $v0, $v0, 0x10 -/* BED0B0 802402C0 2842003C */ slti $v0, $v0, 0x3c -/* BED0B4 802402C4 1440004D */ bnez $v0, L802403FC_BED1EC -/* BED0B8 802402C8 24020002 */ addiu $v0, $zero, 2 -/* BED0BC 802402CC 8E230050 */ lw $v1, 0x50($s1) -/* BED0C0 802402D0 A6220044 */ sh $v0, 0x44($s1) -/* BED0C4 802402D4 A6200046 */ sh $zero, 0x46($s1) -/* BED0C8 802402D8 8C63000C */ lw $v1, 0xc($v1) -/* BED0CC 802402DC 24020001 */ addiu $v0, $zero, 1 -/* BED0D0 802402E0 AC620070 */ sw $v0, 0x70($v1) -/* BED0D4 802402E4 8E220050 */ lw $v0, 0x50($s1) -/* BED0D8 802402E8 8C42000C */ lw $v0, 0xc($v0) -/* BED0DC 802402EC 080900FF */ j L802403FC_BED1EC -/* BED0E0 802402F0 AC400074 */ sw $zero, 0x74($v0) -glabel L802402F4_BED0E4 -/* BED0E4 802402F4 96220046 */ lhu $v0, 0x46($s1) -/* BED0E8 802402F8 24420001 */ addiu $v0, $v0, 1 -/* BED0EC 802402FC A6220046 */ sh $v0, 0x46($s1) -/* BED0F0 80240300 00021400 */ sll $v0, $v0, 0x10 -/* BED0F4 80240304 00021403 */ sra $v0, $v0, 0x10 -/* BED0F8 80240308 2842003C */ slti $v0, $v0, 0x3c -/* BED0FC 8024030C 1440003B */ bnez $v0, L802403FC_BED1EC -/* BED100 80240310 00000000 */ nop -/* BED104 80240314 3C013F80 */ lui $at, 0x3f80 -/* BED108 80240318 44810000 */ mtc1 $at, $f0 -/* BED10C 8024031C AFA00014 */ sw $zero, 0x14($sp) -/* BED110 80240320 E7A00010 */ swc1 $f0, 0x10($sp) -/* BED114 80240324 8E250018 */ lw $a1, 0x18($s1) -/* BED118 80240328 8E26001C */ lw $a2, 0x1c($s1) -/* BED11C 8024032C 8E270020 */ lw $a3, 0x20($s1) -/* BED120 80240330 0C01C9AC */ jal func_800726B0 -/* BED124 80240334 24040001 */ addiu $a0, $zero, 1 -/* BED128 80240338 AE220054 */ sw $v0, 0x54($s1) -/* BED12C 8024033C 8C43000C */ lw $v1, 0xc($v0) -/* BED130 80240340 9222003B */ lbu $v0, 0x3b($s1) -/* BED134 80240344 A0620034 */ sb $v0, 0x34($v1) -/* BED138 80240348 8E220054 */ lw $v0, 0x54($s1) -/* BED13C 8024034C 8C42000C */ lw $v0, 0xc($v0) -/* BED140 80240350 AC400020 */ sw $zero, 0x20($v0) -/* BED144 80240354 8E250018 */ lw $a1, 0x18($s1) -/* BED148 80240358 8E260028 */ lw $a2, 0x28($s1) -/* BED14C 8024035C 8E270020 */ lw $a3, 0x20($s1) -/* BED150 80240360 0C044898 */ jal create_shadow_type -/* BED154 80240364 0000202D */ daddu $a0, $zero, $zero -/* BED158 80240368 3C014210 */ lui $at, 0x4210 -/* BED15C 8024036C 44810000 */ mtc1 $at, $f0 -/* BED160 80240370 AE220040 */ sw $v0, 0x40($s1) -/* BED164 80240374 24020003 */ addiu $v0, $zero, 3 -/* BED168 80240378 A6220044 */ sh $v0, 0x44($s1) -/* BED16C 8024037C 24020001 */ addiu $v0, $zero, 1 -/* BED170 80240380 A6200046 */ sh $zero, 0x46($s1) -/* BED174 80240384 AE20002C */ sw $zero, 0x2c($s1) -/* BED178 80240388 A6220048 */ sh $v0, 0x48($s1) -/* BED17C 8024038C 080900FF */ j L802403FC_BED1EC -/* BED180 80240390 E6200030 */ swc1 $f0, 0x30($s1) -glabel L80240394_BED184 -/* BED184 80240394 0000202D */ daddu $a0, $zero, $zero -/* BED188 80240398 3C054210 */ lui $a1, 0x4210 -/* BED18C 8024039C 3C064198 */ lui $a2, 0x4198 -/* BED190 802403A0 86270046 */ lh $a3, 0x46($s1) -/* BED194 802403A4 24020078 */ addiu $v0, $zero, 0x78 -/* BED198 802403A8 0C00A8ED */ jal update_lerp -/* BED19C 802403AC AFA20010 */ sw $v0, 0x10($sp) -/* BED1A0 802403B0 96220046 */ lhu $v0, 0x46($s1) -/* BED1A4 802403B4 E6200030 */ swc1 $f0, 0x30($s1) -/* BED1A8 802403B8 24420001 */ addiu $v0, $v0, 1 -/* BED1AC 802403BC A6220046 */ sh $v0, 0x46($s1) -/* BED1B0 802403C0 00021400 */ sll $v0, $v0, 0x10 -/* BED1B4 802403C4 00021403 */ sra $v0, $v0, 0x10 -/* BED1B8 802403C8 28420078 */ slti $v0, $v0, 0x78 -/* BED1BC 802403CC 1440000B */ bnez $v0, L802403FC_BED1EC -/* BED1C0 802403D0 24030001 */ addiu $v1, $zero, 1 -/* BED1C4 802403D4 C620002C */ lwc1 $f0, 0x2c($s1) -/* BED1C8 802403D8 24020002 */ addiu $v0, $zero, 2 -/* BED1CC 802403DC A6220048 */ sh $v0, 0x48($s1) -/* BED1D0 802403E0 24020004 */ addiu $v0, $zero, 4 -/* BED1D4 802403E4 A620004C */ sh $zero, 0x4c($s1) -/* BED1D8 802403E8 A623004A */ sh $v1, 0x4a($s1) -/* BED1DC 802403EC A623004E */ sh $v1, 0x4e($s1) -/* BED1E0 802403F0 A6220044 */ sh $v0, 0x44($s1) -/* BED1E4 802403F4 A6200046 */ sh $zero, 0x46($s1) -/* BED1E8 802403F8 E6200034 */ swc1 $f0, 0x34($s1) -glabel L802403FC_BED1EC -/* BED1EC 802403FC 8623004A */ lh $v1, 0x4a($s1) -/* BED1F0 80240400 24020001 */ addiu $v0, $zero, 1 -/* BED1F4 80240404 10620005 */ beq $v1, $v0, .L8024041C -/* BED1F8 80240408 24020002 */ addiu $v0, $zero, 2 -/* BED1FC 8024040C 1062001E */ beq $v1, $v0, .L80240488 -/* BED200 80240410 00000000 */ nop -/* BED204 80240414 0809014C */ j .L80240530 -/* BED208 80240418 00000000 */ nop -.L8024041C: -/* BED20C 8024041C 8627004C */ lh $a3, 0x4c($s1) -/* BED210 80240420 24100078 */ addiu $s0, $zero, 0x78 -/* BED214 80240424 AFB00010 */ sw $s0, 0x10($sp) -/* BED218 80240428 8E250034 */ lw $a1, 0x34($s1) -/* BED21C 8024042C 3C0644B4 */ lui $a2, 0x44b4 -/* BED220 80240430 0C00A8ED */ jal update_lerp -/* BED224 80240434 24040004 */ addiu $a0, $zero, 4 -/* BED228 80240438 8627004C */ lh $a3, 0x4c($s1) -/* BED22C 8024043C E620002C */ swc1 $f0, 0x2c($s1) -/* BED230 80240440 AFB00010 */ sw $s0, 0x10($sp) -/* BED234 80240444 8E25001C */ lw $a1, 0x1c($s1) -/* BED238 80240448 8E260024 */ lw $a2, 0x24($s1) -/* BED23C 8024044C 0C00A8ED */ jal update_lerp -/* BED240 80240450 2404000A */ addiu $a0, $zero, 0xa -/* BED244 80240454 9622004C */ lhu $v0, 0x4c($s1) -/* BED248 80240458 E6200004 */ swc1 $f0, 4($s1) -/* BED24C 8024045C 24420001 */ addiu $v0, $v0, 1 -/* BED250 80240460 A622004C */ sh $v0, 0x4c($s1) -/* BED254 80240464 00021400 */ sll $v0, $v0, 0x10 -/* BED258 80240468 00021403 */ sra $v0, $v0, 0x10 -/* BED25C 8024046C 0050102A */ slt $v0, $v0, $s0 -/* BED260 80240470 1440002F */ bnez $v0, .L80240530 -/* BED264 80240474 2402010E */ addiu $v0, $zero, 0x10e -/* BED268 80240478 A622004C */ sh $v0, 0x4c($s1) -/* BED26C 8024047C 24020002 */ addiu $v0, $zero, 2 -/* BED270 80240480 0809014B */ j .L8024052C -/* BED274 80240484 A622004A */ sh $v0, 0x4a($s1) -.L80240488: -/* BED278 80240488 8622004C */ lh $v0, 0x4c($s1) -/* BED27C 8024048C 44826000 */ mtc1 $v0, $f12 -/* BED280 80240490 00000000 */ nop -/* BED284 80240494 0C00A8BB */ jal sin_deg -/* BED288 80240498 46806320 */ cvt.s.w $f12, $f12 -/* BED28C 8024049C 3C013F80 */ lui $at, 0x3f80 -/* BED290 802404A0 44811000 */ mtc1 $at, $f2 -/* BED294 802404A4 00000000 */ nop -/* BED298 802404A8 46020000 */ add.s $f0, $f0, $f2 -/* BED29C 802404AC 46000000 */ add.s $f0, $f0, $f0 -/* BED2A0 802404B0 C6220024 */ lwc1 $f2, 0x24($s1) -/* BED2A4 802404B4 8622004C */ lh $v0, 0x4c($s1) -/* BED2A8 802404B8 46001080 */ add.s $f2, $f2, $f0 -/* BED2AC 802404BC 24420008 */ addiu $v0, $v0, 8 -/* BED2B0 802404C0 44826000 */ mtc1 $v0, $f12 -/* BED2B4 802404C4 00000000 */ nop -/* BED2B8 802404C8 46806320 */ cvt.s.w $f12, $f12 -/* BED2BC 802404CC 0C00A6C9 */ jal clamp_angle -/* BED2C0 802404D0 E6220004 */ swc1 $f2, 4($s1) -/* BED2C4 802404D4 4600010D */ trunc.w.s $f4, $f0 -/* BED2C8 802404D8 44022000 */ mfc1 $v0, $f4 -/* BED2CC 802404DC C6200004 */ lwc1 $f0, 4($s1) -/* BED2D0 802404E0 A622004C */ sh $v0, 0x4c($s1) -/* BED2D4 802404E4 C60C0028 */ lwc1 $f12, 0x28($s0) -/* BED2D8 802404E8 8E060030 */ lw $a2, 0x30($s0) -/* BED2DC 802404EC 3C0141A0 */ lui $at, 0x41a0 -/* BED2E0 802404F0 44817000 */ mtc1 $at, $f14 -/* BED2E4 802404F4 E7A00010 */ swc1 $f0, 0x10($sp) -/* BED2E8 802404F8 C602002C */ lwc1 $f2, 0x2c($s0) -/* BED2EC 802404FC C6200008 */ lwc1 $f0, 8($s1) -/* BED2F0 80240500 E7A00014 */ swc1 $f0, 0x14($sp) -/* BED2F4 80240504 8E270000 */ lw $a3, ($s1) -/* BED2F8 80240508 0C00A7CB */ jal dist3D -/* BED2FC 8024050C 460E1380 */ add.s $f14, $f2, $f14 -/* BED300 80240510 3C0141F0 */ lui $at, 0x41f0 -/* BED304 80240514 44811000 */ mtc1 $at, $f2 -/* BED308 80240518 00000000 */ nop -/* BED30C 8024051C 4600103C */ c.lt.s $f2, $f0 -/* BED310 80240520 00000000 */ nop -/* BED314 80240524 45010002 */ bc1t .L80240530 -/* BED318 80240528 24020003 */ addiu $v0, $zero, 3 -.L8024052C: -/* BED31C 8024052C A622004E */ sh $v0, 0x4e($s1) -.L80240530: -/* BED320 80240530 86230048 */ lh $v1, 0x48($s1) -/* BED324 80240534 24020001 */ addiu $v0, $zero, 1 -/* BED328 80240538 10620005 */ beq $v1, $v0, .L80240550 -/* BED32C 8024053C 24020002 */ addiu $v0, $zero, 2 -/* BED330 80240540 10620008 */ beq $v1, $v0, .L80240564 -/* BED334 80240544 00000000 */ nop -/* BED338 80240548 08090169 */ j .L802405A4 -/* BED33C 8024054C 00000000 */ nop -.L80240550: -/* BED340 80240550 C620002C */ lwc1 $f0, 0x2c($s1) -/* BED344 80240554 C62C0030 */ lwc1 $f12, 0x30($s1) -/* BED348 80240558 0C00A6C9 */ jal clamp_angle -/* BED34C 8024055C 460C0300 */ add.s $f12, $f0, $f12 -/* BED350 80240560 E620002C */ swc1 $f0, 0x2c($s1) -.L80240564: -/* BED354 80240564 8E220054 */ lw $v0, 0x54($s1) -/* BED358 80240568 C620002C */ lwc1 $f0, 0x2c($s1) -/* BED35C 8024056C 8C42000C */ lw $v0, 0xc($v0) -/* BED360 80240570 E4400024 */ swc1 $f0, 0x24($v0) -/* BED364 80240574 8E220054 */ lw $v0, 0x54($s1) -/* BED368 80240578 C6200018 */ lwc1 $f0, 0x18($s1) -/* BED36C 8024057C 8C42000C */ lw $v0, 0xc($v0) -/* BED370 80240580 E4400004 */ swc1 $f0, 4($v0) -/* BED374 80240584 8E220054 */ lw $v0, 0x54($s1) -/* BED378 80240588 C6200004 */ lwc1 $f0, 4($s1) -/* BED37C 8024058C 8C42000C */ lw $v0, 0xc($v0) -/* BED380 80240590 E4400008 */ swc1 $f0, 8($v0) -/* BED384 80240594 8E220054 */ lw $v0, 0x54($s1) -/* BED388 80240598 C6200020 */ lwc1 $f0, 0x20($s1) -/* BED38C 8024059C 8C42000C */ lw $v0, 0xc($v0) -/* BED390 802405A0 E440000C */ swc1 $f0, 0xc($v0) -.L802405A4: -/* BED394 802405A4 8FBF0020 */ lw $ra, 0x20($sp) -/* BED398 802405A8 8FB1001C */ lw $s1, 0x1c($sp) -/* BED39C 802405AC 8FB00018 */ lw $s0, 0x18($sp) -/* BED3A0 802405B0 0000102D */ daddu $v0, $zero, $zero -/* BED3A4 802405B4 03E00008 */ jr $ra -/* BED3A8 802405B8 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405BC_BED3AC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405BC_BED3AC.s deleted file mode 100644 index 4762dfb5be..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405BC_BED3AC.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802405BC_BED3AC -/* BED3AC 802405BC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BED3B0 802405C0 AFB00010 */ sw $s0, 0x10($sp) -/* BED3B4 802405C4 0080802D */ daddu $s0, $a0, $zero -/* BED3B8 802405C8 AFBF0014 */ sw $ra, 0x14($sp) -/* BED3BC 802405CC 8E02000C */ lw $v0, 0xc($s0) -/* BED3C0 802405D0 0C0B1EAF */ jal get_variable -/* BED3C4 802405D4 8C450000 */ lw $a1, ($v0) -/* BED3C8 802405D8 8E030084 */ lw $v1, 0x84($s0) -/* BED3CC 802405DC 8FBF0014 */ lw $ra, 0x14($sp) -/* BED3D0 802405E0 8463004E */ lh $v1, 0x4e($v1) -/* BED3D4 802405E4 8FB00010 */ lw $s0, 0x10($sp) -/* BED3D8 802405E8 00621826 */ xor $v1, $v1, $v0 -/* BED3DC 802405EC 2C630001 */ sltiu $v1, $v1, 1 -/* BED3E0 802405F0 00031040 */ sll $v0, $v1, 1 -/* BED3E4 802405F4 03E00008 */ jr $ra -/* BED3E8 802405F8 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405FC_BED3EC.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405FC_BED3EC.s deleted file mode 100644 index 3c2fc03cc1..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_802405FC_BED3EC.s +++ /dev/null @@ -1,72 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802405FC_BED3EC -/* BED3EC 802405FC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BED3F0 80240600 AFB20020 */ sw $s2, 0x20($sp) -/* BED3F4 80240604 0080902D */ daddu $s2, $a0, $zero -/* BED3F8 80240608 AFBF0024 */ sw $ra, 0x24($sp) -/* BED3FC 8024060C AFB1001C */ sw $s1, 0x1c($sp) -/* BED400 80240610 AFB00018 */ sw $s0, 0x18($sp) -/* BED404 80240614 10A00035 */ beqz $a1, .L802406EC -/* BED408 80240618 8E51000C */ lw $s1, 0xc($s2) -/* BED40C 8024061C 0C00AB39 */ jal heap_malloc -/* BED410 80240620 24040058 */ addiu $a0, $zero, 0x58 -/* BED414 80240624 0040802D */ daddu $s0, $v0, $zero -/* BED418 80240628 AE500084 */ sw $s0, 0x84($s2) -/* BED41C 8024062C 8E250000 */ lw $a1, ($s1) -/* BED420 80240630 26310004 */ addiu $s1, $s1, 4 -/* BED424 80240634 0C0B1EAF */ jal get_variable -/* BED428 80240638 0240202D */ daddu $a0, $s2, $zero -/* BED42C 8024063C AE020038 */ sw $v0, 0x38($s0) -/* BED430 80240640 8E250000 */ lw $a1, ($s1) -/* BED434 80240644 26310004 */ addiu $s1, $s1, 4 -/* BED438 80240648 0C0B210B */ jal get_float_variable -/* BED43C 8024064C 0240202D */ daddu $a0, $s2, $zero -/* BED440 80240650 E6000018 */ swc1 $f0, 0x18($s0) -/* BED444 80240654 8E250000 */ lw $a1, ($s1) -/* BED448 80240658 26310004 */ addiu $s1, $s1, 4 -/* BED44C 8024065C 0C0B210B */ jal get_float_variable -/* BED450 80240660 0240202D */ daddu $a0, $s2, $zero -/* BED454 80240664 E6000024 */ swc1 $f0, 0x24($s0) -/* BED458 80240668 8E250000 */ lw $a1, ($s1) -/* BED45C 8024066C 26310004 */ addiu $s1, $s1, 4 -/* BED460 80240670 0C0B210B */ jal get_float_variable -/* BED464 80240674 0240202D */ daddu $a0, $s2, $zero -/* BED468 80240678 E6000020 */ swc1 $f0, 0x20($s0) -/* BED46C 8024067C 8E250000 */ lw $a1, ($s1) -/* BED470 80240680 0C0B210B */ jal get_float_variable -/* BED474 80240684 0240202D */ daddu $a0, $s2, $zero -/* BED478 80240688 3C013F80 */ lui $at, 0x3f80 -/* BED47C 8024068C 44811000 */ mtc1 $at, $f2 -/* BED480 80240690 E6000028 */ swc1 $f0, 0x28($s0) -/* BED484 80240694 AFA00014 */ sw $zero, 0x14($sp) -/* BED488 80240698 E7A20010 */ swc1 $f2, 0x10($sp) -/* BED48C 8024069C 8E050018 */ lw $a1, 0x18($s0) -/* BED490 802406A0 8E060024 */ lw $a2, 0x24($s0) -/* BED494 802406A4 8E070020 */ lw $a3, 0x20($s0) -/* BED498 802406A8 0C01C9AC */ jal func_800726B0 -/* BED49C 802406AC 24040001 */ addiu $a0, $zero, 1 -/* BED4A0 802406B0 AE020054 */ sw $v0, 0x54($s0) -/* BED4A4 802406B4 8C43000C */ lw $v1, 0xc($v0) -/* BED4A8 802406B8 9202003B */ lbu $v0, 0x3b($s0) -/* BED4AC 802406BC A0620034 */ sb $v0, 0x34($v1) -/* BED4B0 802406C0 8E020054 */ lw $v0, 0x54($s0) -/* BED4B4 802406C4 8C42000C */ lw $v0, 0xc($v0) -/* BED4B8 802406C8 AC400020 */ sw $zero, 0x20($v0) -/* BED4BC 802406CC 8E050018 */ lw $a1, 0x18($s0) -/* BED4C0 802406D0 8E060028 */ lw $a2, 0x28($s0) -/* BED4C4 802406D4 8E070020 */ lw $a3, 0x20($s0) -/* BED4C8 802406D8 0C044898 */ jal create_shadow_type -/* BED4CC 802406DC 0000202D */ daddu $a0, $zero, $zero -/* BED4D0 802406E0 AE020040 */ sw $v0, 0x40($s0) -/* BED4D4 802406E4 2402010E */ addiu $v0, $zero, 0x10e -/* BED4D8 802406E8 A602004C */ sh $v0, 0x4c($s0) -.L802406EC: -/* BED4DC 802406EC 8FBF0024 */ lw $ra, 0x24($sp) -/* BED4E0 802406F0 8FB20020 */ lw $s2, 0x20($sp) -/* BED4E4 802406F4 8FB1001C */ lw $s1, 0x1c($sp) -/* BED4E8 802406F8 8FB00018 */ lw $s0, 0x18($sp) -/* BED4EC 802406FC 24020002 */ addiu $v0, $zero, 2 -/* BED4F0 80240700 03E00008 */ jr $ra -/* BED4F4 80240704 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240708_BED4F8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240708_BED4F8.s deleted file mode 100644 index 4152671378..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BECDF0/func_80240708_BED4F8.s +++ /dev/null @@ -1,67 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240708_BED4F8 -/* BED4F8 80240708 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BED4FC 8024070C AFBF0014 */ sw $ra, 0x14($sp) -/* BED500 80240710 AFB00010 */ sw $s0, 0x10($sp) -/* BED504 80240714 8C900084 */ lw $s0, 0x84($a0) -/* BED508 80240718 8602004C */ lh $v0, 0x4c($s0) -/* BED50C 8024071C 44826000 */ mtc1 $v0, $f12 -/* BED510 80240720 00000000 */ nop -/* BED514 80240724 0C00A8BB */ jal sin_deg -/* BED518 80240728 46806320 */ cvt.s.w $f12, $f12 -/* BED51C 8024072C 3C013F80 */ lui $at, 0x3f80 -/* BED520 80240730 44811000 */ mtc1 $at, $f2 -/* BED524 80240734 00000000 */ nop -/* BED528 80240738 46020000 */ add.s $f0, $f0, $f2 -/* BED52C 8024073C 46000000 */ add.s $f0, $f0, $f0 -/* BED530 80240740 C6020024 */ lwc1 $f2, 0x24($s0) -/* BED534 80240744 8602004C */ lh $v0, 0x4c($s0) -/* BED538 80240748 46001080 */ add.s $f2, $f2, $f0 -/* BED53C 8024074C 24420008 */ addiu $v0, $v0, 8 -/* BED540 80240750 44826000 */ mtc1 $v0, $f12 -/* BED544 80240754 00000000 */ nop -/* BED548 80240758 46806320 */ cvt.s.w $f12, $f12 -/* BED54C 8024075C 0C00A6C9 */ jal clamp_angle -/* BED550 80240760 E6020004 */ swc1 $f2, 4($s0) -/* BED554 80240764 4600010D */ trunc.w.s $f4, $f0 -/* BED558 80240768 44022000 */ mfc1 $v0, $f4 -/* BED55C 8024076C 00000000 */ nop -/* BED560 80240770 A602004C */ sh $v0, 0x4c($s0) -/* BED564 80240774 3C028011 */ lui $v0, %hi(gPlayerStatus) -/* BED568 80240778 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) -/* BED56C 8024077C C44C0028 */ lwc1 $f12, 0x28($v0) -/* BED570 80240780 C44E0030 */ lwc1 $f14, 0x30($v0) -/* BED574 80240784 8E060018 */ lw $a2, 0x18($s0) -/* BED578 80240788 0C00A7B5 */ jal dist2D -/* BED57C 8024078C 8E070020 */ lw $a3, 0x20($s0) -/* BED580 80240790 3C0141F0 */ lui $at, 0x41f0 -/* BED584 80240794 44811000 */ mtc1 $at, $f2 -/* BED588 80240798 00000000 */ nop -/* BED58C 8024079C 4602003E */ c.le.s $f0, $f2 -/* BED590 802407A0 00000000 */ nop -/* BED594 802407A4 45000002 */ bc1f .L802407B0 -/* BED598 802407A8 24020003 */ addiu $v0, $zero, 3 -/* BED59C 802407AC A602004E */ sh $v0, 0x4e($s0) -.L802407B0: -/* BED5A0 802407B0 8E020054 */ lw $v0, 0x54($s0) -/* BED5A4 802407B4 C6000018 */ lwc1 $f0, 0x18($s0) -/* BED5A8 802407B8 8C42000C */ lw $v0, 0xc($v0) -/* BED5AC 802407BC E4400004 */ swc1 $f0, 4($v0) -/* BED5B0 802407C0 8E020054 */ lw $v0, 0x54($s0) -/* BED5B4 802407C4 C6000004 */ lwc1 $f0, 4($s0) -/* BED5B8 802407C8 8C42000C */ lw $v0, 0xc($v0) -/* BED5BC 802407CC E4400008 */ swc1 $f0, 8($v0) -/* BED5C0 802407D0 8E020054 */ lw $v0, 0x54($s0) -/* BED5C4 802407D4 C6000020 */ lwc1 $f0, 0x20($s0) -/* BED5C8 802407D8 8C42000C */ lw $v0, 0xc($v0) -/* BED5CC 802407DC E440000C */ swc1 $f0, 0xc($v0) -/* BED5D0 802407E0 8FBF0014 */ lw $ra, 0x14($sp) -/* BED5D4 802407E4 8FB00010 */ lw $s0, 0x10($sp) -/* BED5D8 802407E8 0000102D */ daddu $v0, $zero, $zero -/* BED5DC 802407EC 03E00008 */ jr $ra -/* BED5E0 802407F0 27BD0018 */ addiu $sp, $sp, 0x18 -/* BED5E4 802407F4 00000000 */ nop -/* BED5E8 802407F8 00000000 */ nop -/* BED5EC 802407FC 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED5F0/func_80240800_BED5F0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED5F0/func_80240800_BED5F0.s deleted file mode 100644 index 86de817313..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED5F0/func_80240800_BED5F0.s +++ /dev/null @@ -1,33 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240800_BED5F0 -/* BED5F0 80240800 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BED5F4 80240804 AFB00010 */ sw $s0, 0x10($sp) -/* BED5F8 80240808 0080802D */ daddu $s0, $a0, $zero -/* BED5FC 8024080C 3C05FE36 */ lui $a1, 0xfe36 -/* BED600 80240810 AFBF0014 */ sw $ra, 0x14($sp) -/* BED604 80240814 0C0B210B */ jal get_float_variable -/* BED608 80240818 34A53C80 */ ori $a1, $a1, 0x3c80 -/* BED60C 8024081C 46000086 */ mov.s $f2, $f0 -/* BED610 80240820 3C018024 */ lui $at, %hi(D_80247940_BF4730) -/* BED614 80240824 D4247940 */ ldc1 $f4, %lo(D_80247940_BF4730)($at) -/* BED618 80240828 46001021 */ cvt.d.s $f0, $f2 -/* BED61C 8024082C 4620203E */ c.le.d $f4, $f0 -/* BED620 80240830 00000000 */ nop -/* BED624 80240834 45000003 */ bc1f .L80240844 -/* BED628 80240838 0200202D */ daddu $a0, $s0, $zero -/* BED62C 8024083C 46240001 */ sub.d $f0, $f0, $f4 -/* BED630 80240840 462000A0 */ cvt.s.d $f2, $f0 -.L80240844: -/* BED634 80240844 3C05FE36 */ lui $a1, 0xfe36 -/* BED638 80240848 44061000 */ mfc1 $a2, $f2 -/* BED63C 8024084C 0C0B2190 */ jal set_float_variable -/* BED640 80240850 34A53C80 */ ori $a1, $a1, 0x3c80 -/* BED644 80240854 8FBF0014 */ lw $ra, 0x14($sp) -/* BED648 80240858 8FB00010 */ lw $s0, 0x10($sp) -/* BED64C 8024085C 24020002 */ addiu $v0, $zero, 2 -/* BED650 80240860 03E00008 */ jr $ra -/* BED654 80240864 27BD0018 */ addiu $sp, $sp, 0x18 -/* BED658 80240868 00000000 */ nop -/* BED65C 8024086C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240B00_BED8F0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/arn_07_func_80240B00_BED8F0.s similarity index 99% rename from ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240B00_BED8F0.s rename to ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/arn_07_func_80240B00_BED8F0.s index d1f549b6ac..31c9e120e6 100644 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240B00_BED8F0.s +++ b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/arn_07_func_80240B00_BED8F0.s @@ -1,6 +1,14 @@ .set noat # allow manual use of $at .set noreorder # don't insert nops after branches +.section .rodata +glabel D_80247958_BF4748 +.double 0.09 + +glabel D_80247960_BF4750 +.double 0.09 + +.section .text glabel func_80240B00_BED8F0 /* BED8F0 80240B00 27BDFF80 */ addiu $sp, $sp, -0x80 /* BED8F4 80240B04 AFB3004C */ sw $s3, 0x4c($sp) diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240950_BED740.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240950_BED740.s deleted file mode 100644 index 1ebc83ba2b..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80240950_BED740.s +++ /dev/null @@ -1,116 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240950_BED740 -/* BED740 80240950 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* BED744 80240954 AFB3002C */ sw $s3, 0x2c($sp) -/* BED748 80240958 0080982D */ daddu $s3, $a0, $zero -/* BED74C 8024095C AFBF0030 */ sw $ra, 0x30($sp) -/* BED750 80240960 AFB20028 */ sw $s2, 0x28($sp) -/* BED754 80240964 AFB10024 */ sw $s1, 0x24($sp) -/* BED758 80240968 AFB00020 */ sw $s0, 0x20($sp) -/* BED75C 8024096C 8E710148 */ lw $s1, 0x148($s3) -/* BED760 80240970 86240008 */ lh $a0, 8($s1) -/* BED764 80240974 0C00EABB */ jal get_npc_unsafe -/* BED768 80240978 00A0902D */ daddu $s2, $a1, $zero -/* BED76C 8024097C 8E440004 */ lw $a0, 4($s2) -/* BED770 80240980 0040802D */ daddu $s0, $v0, $zero -/* BED774 80240984 00041FC2 */ srl $v1, $a0, 0x1f -/* BED778 80240988 00832021 */ addu $a0, $a0, $v1 -/* BED77C 8024098C 00042043 */ sra $a0, $a0, 1 -/* BED780 80240990 0C00A67F */ jal rand_int -/* BED784 80240994 24840001 */ addiu $a0, $a0, 1 -/* BED788 80240998 8E430004 */ lw $v1, 4($s2) -/* BED78C 8024099C 000327C2 */ srl $a0, $v1, 0x1f -/* BED790 802409A0 00641821 */ addu $v1, $v1, $a0 -/* BED794 802409A4 00031843 */ sra $v1, $v1, 1 -/* BED798 802409A8 00621821 */ addu $v1, $v1, $v0 -/* BED79C 802409AC A603008E */ sh $v1, 0x8e($s0) -/* BED7A0 802409B0 8E2300D0 */ lw $v1, 0xd0($s1) -/* BED7A4 802409B4 C6000040 */ lwc1 $f0, 0x40($s0) -/* BED7A8 802409B8 C4640000 */ lwc1 $f4, ($v1) -/* BED7AC 802409BC 46802120 */ cvt.s.w $f4, $f4 -/* BED7B0 802409C0 C4620008 */ lwc1 $f2, 8($v1) -/* BED7B4 802409C4 468010A0 */ cvt.s.w $f2, $f2 -/* BED7B8 802409C8 E7A00010 */ swc1 $f0, 0x10($sp) -/* BED7BC 802409CC 8E2200D0 */ lw $v0, 0xd0($s1) -/* BED7C0 802409D0 44061000 */ mfc1 $a2, $f2 -/* BED7C4 802409D4 C440000C */ lwc1 $f0, 0xc($v0) -/* BED7C8 802409D8 46800020 */ cvt.s.w $f0, $f0 -/* BED7CC 802409DC E7A00014 */ swc1 $f0, 0x14($sp) -/* BED7D0 802409E0 8E2200D0 */ lw $v0, 0xd0($s1) -/* BED7D4 802409E4 44052000 */ mfc1 $a1, $f4 -/* BED7D8 802409E8 C4400010 */ lwc1 $f0, 0x10($v0) -/* BED7DC 802409EC 46800020 */ cvt.s.w $f0, $f0 -/* BED7E0 802409F0 E7A00018 */ swc1 $f0, 0x18($sp) -/* BED7E4 802409F4 8C640018 */ lw $a0, 0x18($v1) -/* BED7E8 802409F8 0C0123F5 */ jal is_point_within_region -/* BED7EC 802409FC 8E070038 */ lw $a3, 0x38($s0) -/* BED7F0 80240A00 1040000E */ beqz $v0, .L80240A3C -/* BED7F4 80240A04 00000000 */ nop -/* BED7F8 80240A08 8E2200D0 */ lw $v0, 0xd0($s1) -/* BED7FC 80240A0C C60C0038 */ lwc1 $f12, 0x38($s0) -/* BED800 80240A10 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BED804 80240A14 C4460000 */ lwc1 $f6, ($v0) -/* BED808 80240A18 468031A0 */ cvt.s.w $f6, $f6 -/* BED80C 80240A1C 44063000 */ mfc1 $a2, $f6 -/* BED810 80240A20 C4460008 */ lwc1 $f6, 8($v0) -/* BED814 80240A24 468031A0 */ cvt.s.w $f6, $f6 -/* BED818 80240A28 44073000 */ mfc1 $a3, $f6 -/* BED81C 80240A2C 0C00A720 */ jal atan2 -/* BED820 80240A30 00000000 */ nop -/* BED824 80240A34 0809029B */ j .L80240A6C -/* BED828 80240A38 E600000C */ swc1 $f0, 0xc($s0) -.L80240A3C: -/* BED82C 80240A3C 0C00A67F */ jal rand_int -/* BED830 80240A40 2404003C */ addiu $a0, $zero, 0x3c -/* BED834 80240A44 C60C000C */ lwc1 $f12, 0xc($s0) -/* BED838 80240A48 44820000 */ mtc1 $v0, $f0 -/* BED83C 80240A4C 00000000 */ nop -/* BED840 80240A50 46800020 */ cvt.s.w $f0, $f0 -/* BED844 80240A54 46006300 */ add.s $f12, $f12, $f0 -/* BED848 80240A58 3C0141F0 */ lui $at, 0x41f0 -/* BED84C 80240A5C 44810000 */ mtc1 $at, $f0 -/* BED850 80240A60 0C00A6C9 */ jal clamp_angle -/* BED854 80240A64 46006301 */ sub.s $f12, $f12, $f0 -/* BED858 80240A68 E600000C */ swc1 $f0, 0xc($s0) -.L80240A6C: -/* BED85C 80240A6C 8E2200CC */ lw $v0, 0xcc($s1) -/* BED860 80240A70 8C420004 */ lw $v0, 4($v0) -/* BED864 80240A74 AE020028 */ sw $v0, 0x28($s0) -/* BED868 80240A78 AE600074 */ sw $zero, 0x74($s3) -/* BED86C 80240A7C 8E2200D0 */ lw $v0, 0xd0($s1) -/* BED870 80240A80 8C420014 */ lw $v0, 0x14($v0) -/* BED874 80240A84 04410004 */ bgez $v0, .L80240A98 -/* BED878 80240A88 00000000 */ nop -/* BED87C 80240A8C C6400000 */ lwc1 $f0, ($s2) -/* BED880 80240A90 080902AE */ j .L80240AB8 -/* BED884 80240A94 E6000018 */ swc1 $f0, 0x18($s0) -.L80240A98: -/* BED888 80240A98 3C018024 */ lui $at, %hi(D_80247950_BF4740) -/* BED88C 80240A9C D4227950 */ ldc1 $f2, %lo(D_80247950_BF4740)($at) -/* BED890 80240AA0 44820000 */ mtc1 $v0, $f0 -/* BED894 80240AA4 00000000 */ nop -/* BED898 80240AA8 46800021 */ cvt.d.w $f0, $f0 -/* BED89C 80240AAC 46220003 */ div.d $f0, $f0, $f2 -/* BED8A0 80240AB0 46200020 */ cvt.s.d $f0, $f0 -/* BED8A4 80240AB4 E6000018 */ swc1 $f0, 0x18($s0) -.L80240AB8: -/* BED8A8 80240AB8 C600003C */ lwc1 $f0, 0x3c($s0) -/* BED8AC 80240ABC 3C014059 */ lui $at, 0x4059 -/* BED8B0 80240AC0 44811800 */ mtc1 $at, $f3 -/* BED8B4 80240AC4 44801000 */ mtc1 $zero, $f2 -/* BED8B8 80240AC8 46000021 */ cvt.d.s $f0, $f0 -/* BED8BC 80240ACC 46220002 */ mul.d $f0, $f0, $f2 -/* BED8C0 80240AD0 00000000 */ nop -/* BED8C4 80240AD4 24020001 */ addiu $v0, $zero, 1 -/* BED8C8 80240AD8 4620018D */ trunc.w.d $f6, $f0 -/* BED8CC 80240ADC E626007C */ swc1 $f6, 0x7c($s1) -/* BED8D0 80240AE0 AE620070 */ sw $v0, 0x70($s3) -/* BED8D4 80240AE4 8FBF0030 */ lw $ra, 0x30($sp) -/* BED8D8 80240AE8 8FB3002C */ lw $s3, 0x2c($sp) -/* BED8DC 80240AEC 8FB20028 */ lw $s2, 0x28($sp) -/* BED8E0 80240AF0 8FB10024 */ lw $s1, 0x24($sp) -/* BED8E4 80240AF4 8FB00020 */ lw $s0, 0x20($sp) -/* BED8E8 80240AF8 03E00008 */ jr $ra -/* BED8EC 80240AFC 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802411E8_BEDFD8.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802411E8_BEDFD8.s deleted file mode 100644 index 555b4ab1cf..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802411E8_BEDFD8.s +++ /dev/null @@ -1,225 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802411E8_BEDFD8 -/* BEDFD8 802411E8 27BDFF88 */ addiu $sp, $sp, -0x78 -/* BEDFDC 802411EC AFB3004C */ sw $s3, 0x4c($sp) -/* BEDFE0 802411F0 0080982D */ daddu $s3, $a0, $zero -/* BEDFE4 802411F4 AFBF0054 */ sw $ra, 0x54($sp) -/* BEDFE8 802411F8 AFB40050 */ sw $s4, 0x50($sp) -/* BEDFEC 802411FC AFB20048 */ sw $s2, 0x48($sp) -/* BEDFF0 80241200 AFB10044 */ sw $s1, 0x44($sp) -/* BEDFF4 80241204 AFB00040 */ sw $s0, 0x40($sp) -/* BEDFF8 80241208 F7BA0070 */ sdc1 $f26, 0x70($sp) -/* BEDFFC 8024120C F7B80068 */ sdc1 $f24, 0x68($sp) -/* BEE000 80241210 F7B60060 */ sdc1 $f22, 0x60($sp) -/* BEE004 80241214 F7B40058 */ sdc1 $f20, 0x58($sp) -/* BEE008 80241218 8E710148 */ lw $s1, 0x148($s3) -/* BEE00C 8024121C 00A0902D */ daddu $s2, $a1, $zero -/* BEE010 80241220 86240008 */ lh $a0, 8($s1) -/* BEE014 80241224 0C00EABB */ jal get_npc_unsafe -/* BEE018 80241228 00C0A02D */ daddu $s4, $a2, $zero -/* BEE01C 8024122C 0040802D */ daddu $s0, $v0, $zero -/* BEE020 80241230 C6200078 */ lwc1 $f0, 0x78($s1) -/* BEE024 80241234 46800020 */ cvt.s.w $f0, $f0 -/* BEE028 80241238 46000021 */ cvt.d.s $f0, $f0 -/* BEE02C 8024123C 3C014059 */ lui $at, 0x4059 -/* BEE030 80241240 44811800 */ mtc1 $at, $f3 -/* BEE034 80241244 44801000 */ mtc1 $zero, $f2 -/* BEE038 80241248 8602008E */ lh $v0, 0x8e($s0) -/* BEE03C 8024124C 9603008E */ lhu $v1, 0x8e($s0) -/* BEE040 80241250 46220003 */ div.d $f0, $f0, $f2 -/* BEE044 80241254 46200620 */ cvt.s.d $f24, $f0 -/* BEE048 80241258 C6200088 */ lwc1 $f0, 0x88($s1) -/* BEE04C 8024125C 46800020 */ cvt.s.w $f0, $f0 -/* BEE050 80241260 46000021 */ cvt.d.s $f0, $f0 -/* BEE054 80241264 46220003 */ div.d $f0, $f0, $f2 -/* BEE058 80241268 46200020 */ cvt.s.d $f0, $f0 -/* BEE05C 8024126C 18400003 */ blez $v0, .L8024127C -/* BEE060 80241270 4600C680 */ add.s $f26, $f24, $f0 -/* BEE064 80241274 2462FFFF */ addiu $v0, $v1, -1 -/* BEE068 80241278 A602008E */ sh $v0, 0x8e($s0) -.L8024127C: -/* BEE06C 8024127C 8E220070 */ lw $v0, 0x70($s1) -/* BEE070 80241280 18400034 */ blez $v0, .L80241354 -/* BEE074 80241284 00000000 */ nop -/* BEE078 80241288 C62C0074 */ lwc1 $f12, 0x74($s1) -/* BEE07C 8024128C 46806320 */ cvt.s.w $f12, $f12 -/* BEE080 80241290 44820000 */ mtc1 $v0, $f0 -/* BEE084 80241294 00000000 */ nop -/* BEE088 80241298 46800020 */ cvt.s.w $f0, $f0 -/* BEE08C 8024129C 46000021 */ cvt.d.s $f0, $f0 -/* BEE090 802412A0 46220003 */ div.d $f0, $f0, $f2 -/* BEE094 802412A4 0C00A8BB */ jal sin_deg -/* BEE098 802412A8 462005A0 */ cvt.s.d $f22, $f0 -/* BEE09C 802412AC 8E020000 */ lw $v0, ($s0) -/* BEE0A0 802412B0 30420008 */ andi $v0, $v0, 8 -/* BEE0A4 802412B4 10400003 */ beqz $v0, .L802412C4 -/* BEE0A8 802412B8 46000506 */ mov.s $f20, $f0 -/* BEE0AC 802412BC 080904C1 */ j .L80241304 -/* BEE0B0 802412C0 0000102D */ daddu $v0, $zero, $zero -.L802412C4: -/* BEE0B4 802412C4 27A50028 */ addiu $a1, $sp, 0x28 -/* BEE0B8 802412C8 27A6002C */ addiu $a2, $sp, 0x2c -/* BEE0BC 802412CC C6000038 */ lwc1 $f0, 0x38($s0) -/* BEE0C0 802412D0 C602003C */ lwc1 $f2, 0x3c($s0) -/* BEE0C4 802412D4 C6040040 */ lwc1 $f4, 0x40($s0) -/* BEE0C8 802412D8 3C01447A */ lui $at, 0x447a -/* BEE0CC 802412DC 44813000 */ mtc1 $at, $f6 -/* BEE0D0 802412E0 27A20034 */ addiu $v0, $sp, 0x34 -/* BEE0D4 802412E4 E7A00028 */ swc1 $f0, 0x28($sp) -/* BEE0D8 802412E8 E7A2002C */ swc1 $f2, 0x2c($sp) -/* BEE0DC 802412EC E7A40030 */ swc1 $f4, 0x30($sp) -/* BEE0E0 802412F0 E7A60034 */ swc1 $f6, 0x34($sp) -/* BEE0E4 802412F4 AFA20010 */ sw $v0, 0x10($sp) -/* BEE0E8 802412F8 8E040080 */ lw $a0, 0x80($s0) -/* BEE0EC 802412FC 0C0372DF */ jal func_800DCB7C -/* BEE0F0 80241300 27A70030 */ addiu $a3, $sp, 0x30 -.L80241304: -/* BEE0F4 80241304 10400007 */ beqz $v0, .L80241324 -/* BEE0F8 80241308 00000000 */ nop -/* BEE0FC 8024130C 4616A082 */ mul.s $f2, $f20, $f22 -/* BEE100 80241310 00000000 */ nop -/* BEE104 80241314 C7A0002C */ lwc1 $f0, 0x2c($sp) -/* BEE108 80241318 46180000 */ add.s $f0, $f0, $f24 -/* BEE10C 8024131C 080904CC */ j .L80241330 -/* BEE110 80241320 46020000 */ add.s $f0, $f0, $f2 -.L80241324: -/* BEE114 80241324 4616A002 */ mul.s $f0, $f20, $f22 -/* BEE118 80241328 00000000 */ nop -/* BEE11C 8024132C 4600D000 */ add.s $f0, $f26, $f0 -.L80241330: -/* BEE120 80241330 E600003C */ swc1 $f0, 0x3c($s0) -/* BEE124 80241334 8E220074 */ lw $v0, 0x74($s1) -/* BEE128 80241338 2442000A */ addiu $v0, $v0, 0xa -/* BEE12C 8024133C 44826000 */ mtc1 $v0, $f12 -/* BEE130 80241340 00000000 */ nop -/* BEE134 80241344 0C00A6C9 */ jal clamp_angle -/* BEE138 80241348 46806320 */ cvt.s.w $f12, $f12 -/* BEE13C 8024134C 4600020D */ trunc.w.s $f8, $f0 -/* BEE140 80241350 E6280074 */ swc1 $f8, 0x74($s1) -.L80241354: -/* BEE144 80241354 8E220090 */ lw $v0, 0x90($s1) -/* BEE148 80241358 1C400040 */ bgtz $v0, .L8024145C -/* BEE14C 8024135C 2442FFFF */ addiu $v0, $v0, -1 -/* BEE150 80241360 860200A8 */ lh $v0, 0xa8($s0) -/* BEE154 80241364 C600003C */ lwc1 $f0, 0x3c($s0) -/* BEE158 80241368 44821000 */ mtc1 $v0, $f2 -/* BEE15C 8024136C 00000000 */ nop -/* BEE160 80241370 468010A0 */ cvt.s.w $f2, $f2 -/* BEE164 80241374 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BEE168 80241378 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BEE16C 8024137C 46020000 */ add.s $f0, $f0, $f2 -/* BEE170 80241380 3C014024 */ lui $at, 0x4024 -/* BEE174 80241384 44812800 */ mtc1 $at, $f5 -/* BEE178 80241388 44802000 */ mtc1 $zero, $f4 -/* BEE17C 8024138C C442002C */ lwc1 $f2, 0x2c($v0) -/* BEE180 80241390 46000021 */ cvt.d.s $f0, $f0 -/* BEE184 80241394 46240000 */ add.d $f0, $f0, $f4 -/* BEE188 80241398 460010A1 */ cvt.d.s $f2, $f2 -/* BEE18C 8024139C 4620103C */ c.lt.d $f2, $f0 -/* BEE190 802413A0 00000000 */ nop -/* BEE194 802413A4 4500002E */ bc1f .L80241460 -/* BEE198 802413A8 0280202D */ daddu $a0, $s4, $zero -/* BEE19C 802413AC 24020001 */ addiu $v0, $zero, 1 -/* BEE1A0 802413B0 AFA20010 */ sw $v0, 0x10($sp) -/* BEE1A4 802413B4 8E460024 */ lw $a2, 0x24($s2) -/* BEE1A8 802413B8 8E470028 */ lw $a3, 0x28($s2) -/* BEE1AC 802413BC 0C01242D */ jal func_800490B4 -/* BEE1B0 802413C0 0220282D */ daddu $a1, $s1, $zero -/* BEE1B4 802413C4 10400026 */ beqz $v0, .L80241460 -/* BEE1B8 802413C8 0000202D */ daddu $a0, $zero, $zero -/* BEE1BC 802413CC 0200282D */ daddu $a1, $s0, $zero -/* BEE1C0 802413D0 0000302D */ daddu $a2, $zero, $zero -/* BEE1C4 802413D4 2412000C */ addiu $s2, $zero, 0xc -/* BEE1C8 802413D8 860300A8 */ lh $v1, 0xa8($s0) -/* BEE1CC 802413DC 3C013F80 */ lui $at, 0x3f80 -/* BEE1D0 802413E0 44810000 */ mtc1 $at, $f0 -/* BEE1D4 802413E4 3C014000 */ lui $at, 0x4000 -/* BEE1D8 802413E8 44811000 */ mtc1 $at, $f2 -/* BEE1DC 802413EC 3C01C1A0 */ lui $at, 0xc1a0 -/* BEE1E0 802413F0 44812000 */ mtc1 $at, $f4 -/* BEE1E4 802413F4 44834000 */ mtc1 $v1, $f8 -/* BEE1E8 802413F8 00000000 */ nop -/* BEE1EC 802413FC 46804220 */ cvt.s.w $f8, $f8 -/* BEE1F0 80241400 44074000 */ mfc1 $a3, $f8 -/* BEE1F4 80241404 27A20038 */ addiu $v0, $sp, 0x38 -/* BEE1F8 80241408 AFB2001C */ sw $s2, 0x1c($sp) -/* BEE1FC 8024140C AFA20020 */ sw $v0, 0x20($sp) -/* BEE200 80241410 E7A00010 */ swc1 $f0, 0x10($sp) -/* BEE204 80241414 E7A20014 */ swc1 $f2, 0x14($sp) -/* BEE208 80241418 0C01BFA4 */ jal fx_emote -/* BEE20C 8024141C E7A40018 */ swc1 $f4, 0x18($sp) -/* BEE210 80241420 0200202D */ daddu $a0, $s0, $zero -/* BEE214 80241424 240502F4 */ addiu $a1, $zero, 0x2f4 -/* BEE218 80241428 C480003C */ lwc1 $f0, 0x3c($a0) -/* BEE21C 8024142C 3C060020 */ lui $a2, 0x20 -/* BEE220 80241430 0C012530 */ jal func_800494C0 -/* BEE224 80241434 E4800064 */ swc1 $f0, 0x64($a0) -/* BEE228 80241438 8E220018 */ lw $v0, 0x18($s1) -/* BEE22C 8024143C 9442002A */ lhu $v0, 0x2a($v0) -/* BEE230 80241440 30420001 */ andi $v0, $v0, 1 -/* BEE234 80241444 10400003 */ beqz $v0, .L80241454 -/* BEE238 80241448 2402000A */ addiu $v0, $zero, 0xa -/* BEE23C 8024144C 0809053F */ j .L802414FC -/* BEE240 80241450 AE620070 */ sw $v0, 0x70($s3) -.L80241454: -/* BEE244 80241454 0809053F */ j .L802414FC -/* BEE248 80241458 AE720070 */ sw $s2, 0x70($s3) -.L8024145C: -/* BEE24C 8024145C AE220090 */ sw $v0, 0x90($s1) -.L80241460: -/* BEE250 80241460 8602008C */ lh $v0, 0x8c($s0) -/* BEE254 80241464 14400025 */ bnez $v0, .L802414FC -/* BEE258 80241468 00000000 */ nop -/* BEE25C 8024146C 8602008E */ lh $v0, 0x8e($s0) -/* BEE260 80241470 1C400022 */ bgtz $v0, .L802414FC -/* BEE264 80241474 00000000 */ nop -/* BEE268 80241478 8E620074 */ lw $v0, 0x74($s3) -/* BEE26C 8024147C 2442FFFF */ addiu $v0, $v0, -1 -/* BEE270 80241480 1840001D */ blez $v0, .L802414F8 -/* BEE274 80241484 AE620074 */ sw $v0, 0x74($s3) -/* BEE278 80241488 8E220018 */ lw $v0, 0x18($s1) -/* BEE27C 8024148C 9442002A */ lhu $v0, 0x2a($v0) -/* BEE280 80241490 30420010 */ andi $v0, $v0, 0x10 -/* BEE284 80241494 14400007 */ bnez $v0, .L802414B4 -/* BEE288 80241498 00000000 */ nop -/* BEE28C 8024149C C600000C */ lwc1 $f0, 0xc($s0) -/* BEE290 802414A0 3C014334 */ lui $at, 0x4334 -/* BEE294 802414A4 44816000 */ mtc1 $at, $f12 -/* BEE298 802414A8 0C00A6C9 */ jal clamp_angle -/* BEE29C 802414AC 460C0300 */ add.s $f12, $f0, $f12 -/* BEE2A0 802414B0 E600000C */ swc1 $f0, 0xc($s0) -.L802414B4: -/* BEE2A4 802414B4 0C00A67F */ jal rand_int -/* BEE2A8 802414B8 240403E8 */ addiu $a0, $zero, 0x3e8 -/* BEE2AC 802414BC 3C032E8B */ lui $v1, 0x2e8b -/* BEE2B0 802414C0 3463A2E9 */ ori $v1, $v1, 0xa2e9 -/* BEE2B4 802414C4 00430018 */ mult $v0, $v1 -/* BEE2B8 802414C8 00021FC3 */ sra $v1, $v0, 0x1f -/* BEE2BC 802414CC 00004010 */ mfhi $t0 -/* BEE2C0 802414D0 00082043 */ sra $a0, $t0, 1 -/* BEE2C4 802414D4 00832023 */ subu $a0, $a0, $v1 -/* BEE2C8 802414D8 00041840 */ sll $v1, $a0, 1 -/* BEE2CC 802414DC 00641821 */ addu $v1, $v1, $a0 -/* BEE2D0 802414E0 00031880 */ sll $v1, $v1, 2 -/* BEE2D4 802414E4 00641823 */ subu $v1, $v1, $a0 -/* BEE2D8 802414E8 00431023 */ subu $v0, $v0, $v1 -/* BEE2DC 802414EC 24420005 */ addiu $v0, $v0, 5 -/* BEE2E0 802414F0 0809053F */ j .L802414FC -/* BEE2E4 802414F4 A602008E */ sh $v0, 0x8e($s0) -.L802414F8: -/* BEE2E8 802414F8 AE600070 */ sw $zero, 0x70($s3) -.L802414FC: -/* BEE2EC 802414FC 8FBF0054 */ lw $ra, 0x54($sp) -/* BEE2F0 80241500 8FB40050 */ lw $s4, 0x50($sp) -/* BEE2F4 80241504 8FB3004C */ lw $s3, 0x4c($sp) -/* BEE2F8 80241508 8FB20048 */ lw $s2, 0x48($sp) -/* BEE2FC 8024150C 8FB10044 */ lw $s1, 0x44($sp) -/* BEE300 80241510 8FB00040 */ lw $s0, 0x40($sp) -/* BEE304 80241514 D7BA0070 */ ldc1 $f26, 0x70($sp) -/* BEE308 80241518 D7B80068 */ ldc1 $f24, 0x68($sp) -/* BEE30C 8024151C D7B60060 */ ldc1 $f22, 0x60($sp) -/* BEE310 80241520 D7B40058 */ ldc1 $f20, 0x58($sp) -/* BEE314 80241524 03E00008 */ jr $ra -/* BEE318 80241528 27BD0078 */ addiu $sp, $sp, 0x78 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802415A4_BEE394.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802415A4_BEE394.s deleted file mode 100644 index 9e218dd416..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802415A4_BEE394.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802415A4_BEE394 -/* BEE394 802415A4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BEE398 802415A8 AFB00010 */ sw $s0, 0x10($sp) -/* BEE39C 802415AC 0080802D */ daddu $s0, $a0, $zero -/* BEE3A0 802415B0 AFBF0014 */ sw $ra, 0x14($sp) -/* BEE3A4 802415B4 8E020148 */ lw $v0, 0x148($s0) -/* BEE3A8 802415B8 0C00EABB */ jal get_npc_unsafe -/* BEE3AC 802415BC 84440008 */ lh $a0, 8($v0) -/* BEE3B0 802415C0 9443008E */ lhu $v1, 0x8e($v0) -/* BEE3B4 802415C4 C440003C */ lwc1 $f0, 0x3c($v0) -/* BEE3B8 802415C8 24640001 */ addiu $a0, $v1, 1 -/* BEE3BC 802415CC 00031C00 */ sll $v1, $v1, 0x10 -/* BEE3C0 802415D0 00031B83 */ sra $v1, $v1, 0xe -/* BEE3C4 802415D4 A444008E */ sh $a0, 0x8e($v0) -/* BEE3C8 802415D8 3C018024 */ lui $at, %hi(D_80243BC0_BF09B0) -/* BEE3CC 802415DC 00230821 */ addu $at, $at, $v1 -/* BEE3D0 802415E0 C4223BC0 */ lwc1 $f2, %lo(D_80243BC0_BF09B0)($at) -/* BEE3D4 802415E4 8443008E */ lh $v1, 0x8e($v0) -/* BEE3D8 802415E8 46020000 */ add.s $f0, $f0, $f2 -/* BEE3DC 802415EC 28630005 */ slti $v1, $v1, 5 -/* BEE3E0 802415F0 14600003 */ bnez $v1, .L80241600 -/* BEE3E4 802415F4 E440003C */ swc1 $f0, 0x3c($v0) -/* BEE3E8 802415F8 2402000C */ addiu $v0, $zero, 0xc -/* BEE3EC 802415FC AE020070 */ sw $v0, 0x70($s0) -.L80241600: -/* BEE3F0 80241600 8FBF0014 */ lw $ra, 0x14($sp) -/* BEE3F4 80241604 8FB00010 */ lw $s0, 0x10($sp) -/* BEE3F8 80241608 03E00008 */ jr $ra -/* BEE3FC 8024160C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802417A8_BEE598.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802417A8_BEE598.s deleted file mode 100644 index fa2fc20c4d..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_802417A8_BEE598.s +++ /dev/null @@ -1,243 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802417A8_BEE598 -/* BEE598 802417A8 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BEE59C 802417AC AFB20030 */ sw $s2, 0x30($sp) -/* BEE5A0 802417B0 0080902D */ daddu $s2, $a0, $zero -/* BEE5A4 802417B4 AFBF0038 */ sw $ra, 0x38($sp) -/* BEE5A8 802417B8 AFB30034 */ sw $s3, 0x34($sp) -/* BEE5AC 802417BC AFB1002C */ sw $s1, 0x2c($sp) -/* BEE5B0 802417C0 AFB00028 */ sw $s0, 0x28($sp) -/* BEE5B4 802417C4 F7B60048 */ sdc1 $f22, 0x48($sp) -/* BEE5B8 802417C8 F7B40040 */ sdc1 $f20, 0x40($sp) -/* BEE5BC 802417CC 8E510148 */ lw $s1, 0x148($s2) -/* BEE5C0 802417D0 86240008 */ lh $a0, 8($s1) -/* BEE5C4 802417D4 0C00EABB */ jal get_npc_unsafe -/* BEE5C8 802417D8 00A0982D */ daddu $s3, $a1, $zero -/* BEE5CC 802417DC 0040802D */ daddu $s0, $v0, $zero -/* BEE5D0 802417E0 0200202D */ daddu $a0, $s0, $zero -/* BEE5D4 802417E4 C6220088 */ lwc1 $f2, 0x88($s1) -/* BEE5D8 802417E8 468010A0 */ cvt.s.w $f2, $f2 -/* BEE5DC 802417EC 460010A1 */ cvt.d.s $f2, $f2 -/* BEE5E0 802417F0 C604001C */ lwc1 $f4, 0x1c($s0) -/* BEE5E4 802417F4 C6000014 */ lwc1 $f0, 0x14($s0) -/* BEE5E8 802417F8 8E050018 */ lw $a1, 0x18($s0) -/* BEE5EC 802417FC 46002100 */ add.s $f4, $f4, $f0 -/* BEE5F0 80241800 8E06000C */ lw $a2, 0xc($s0) -/* BEE5F4 80241804 C6200078 */ lwc1 $f0, 0x78($s1) -/* BEE5F8 80241808 46800020 */ cvt.s.w $f0, $f0 -/* BEE5FC 8024180C E604001C */ swc1 $f4, 0x1c($s0) -/* BEE600 80241810 3C014059 */ lui $at, 0x4059 -/* BEE604 80241814 44812800 */ mtc1 $at, $f5 -/* BEE608 80241818 44802000 */ mtc1 $zero, $f4 -/* BEE60C 8024181C 46000021 */ cvt.d.s $f0, $f0 -/* BEE610 80241820 46240003 */ div.d $f0, $f0, $f4 -/* BEE614 80241824 46200520 */ cvt.s.d $f20, $f0 -/* BEE618 80241828 46241083 */ div.d $f2, $f2, $f4 -/* BEE61C 8024182C 0C00EA95 */ jal npc_move_heading -/* BEE620 80241830 462015A0 */ cvt.s.d $f22, $f2 -/* BEE624 80241834 C604001C */ lwc1 $f4, 0x1c($s0) -/* BEE628 80241838 44801000 */ mtc1 $zero, $f2 -/* BEE62C 8024183C 44801800 */ mtc1 $zero, $f3 -/* BEE630 80241840 46002021 */ cvt.d.s $f0, $f4 -/* BEE634 80241844 4620103E */ c.le.d $f2, $f0 -/* BEE638 80241848 00000000 */ nop -/* BEE63C 8024184C 45000030 */ bc1f .L80241910 -/* BEE640 80241850 00000000 */ nop -/* BEE644 80241854 C600003C */ lwc1 $f0, 0x3c($s0) -/* BEE648 80241858 46040000 */ add.s $f0, $f0, $f4 -/* BEE64C 8024185C E600003C */ swc1 $f0, 0x3c($s0) -/* BEE650 80241860 8E2200CC */ lw $v0, 0xcc($s1) -/* BEE654 80241864 8C420024 */ lw $v0, 0x24($v0) -/* BEE658 80241868 AE020028 */ sw $v0, 0x28($s0) -/* BEE65C 8024186C A2200007 */ sb $zero, 7($s1) -/* BEE660 80241870 8E020000 */ lw $v0, ($s0) -/* BEE664 80241874 30420008 */ andi $v0, $v0, 8 -/* BEE668 80241878 14400011 */ bnez $v0, .L802418C0 -/* BEE66C 8024187C 0000102D */ daddu $v0, $zero, $zero -/* BEE670 80241880 27A50018 */ addiu $a1, $sp, 0x18 -/* BEE674 80241884 27A6001C */ addiu $a2, $sp, 0x1c -/* BEE678 80241888 C6000038 */ lwc1 $f0, 0x38($s0) -/* BEE67C 8024188C C602003C */ lwc1 $f2, 0x3c($s0) -/* BEE680 80241890 C6040040 */ lwc1 $f4, 0x40($s0) -/* BEE684 80241894 3C01447A */ lui $at, 0x447a -/* BEE688 80241898 44813000 */ mtc1 $at, $f6 -/* BEE68C 8024189C 27A20024 */ addiu $v0, $sp, 0x24 -/* BEE690 802418A0 E7A00018 */ swc1 $f0, 0x18($sp) -/* BEE694 802418A4 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BEE698 802418A8 E7A40020 */ swc1 $f4, 0x20($sp) -/* BEE69C 802418AC E7A60024 */ swc1 $f6, 0x24($sp) -/* BEE6A0 802418B0 AFA20010 */ sw $v0, 0x10($sp) -/* BEE6A4 802418B4 8E040080 */ lw $a0, 0x80($s0) -/* BEE6A8 802418B8 0C0372DF */ jal func_800DCB7C -/* BEE6AC 802418BC 27A70020 */ addiu $a3, $sp, 0x20 -.L802418C0: -/* BEE6B0 802418C0 1040000B */ beqz $v0, .L802418F0 -/* BEE6B4 802418C4 00000000 */ nop -/* BEE6B8 802418C8 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BEE6BC 802418CC 46140080 */ add.s $f2, $f0, $f20 -/* BEE6C0 802418D0 C600003C */ lwc1 $f0, 0x3c($s0) -/* BEE6C4 802418D4 4600103E */ c.le.s $f2, $f0 -/* BEE6C8 802418D8 00000000 */ nop -/* BEE6CC 802418DC 4500008D */ bc1f .L80241B14 -/* BEE6D0 802418E0 00000000 */ nop -/* BEE6D4 802418E4 E602003C */ swc1 $f2, 0x3c($s0) -/* BEE6D8 802418E8 080906C5 */ j .L80241B14 -/* BEE6DC 802418EC AE400070 */ sw $zero, 0x70($s2) -.L802418F0: -/* BEE6E0 802418F0 C602003C */ lwc1 $f2, 0x3c($s0) -/* BEE6E4 802418F4 C6000064 */ lwc1 $f0, 0x64($s0) -/* BEE6E8 802418F8 4602003E */ c.le.s $f0, $f2 -/* BEE6EC 802418FC 00000000 */ nop -/* BEE6F0 80241900 45030084 */ bc1tl .L80241B14 -/* BEE6F4 80241904 AE400070 */ sw $zero, 0x70($s2) -/* BEE6F8 80241908 080906C5 */ j .L80241B14 -/* BEE6FC 8024190C 00000000 */ nop -.L80241910: -/* BEE700 80241910 4622003C */ c.lt.d $f0, $f2 -/* BEE704 80241914 00000000 */ nop -/* BEE708 80241918 4500007E */ bc1f .L80241B14 -/* BEE70C 8024191C 00000000 */ nop -/* BEE710 80241920 9602008E */ lhu $v0, 0x8e($s0) -/* BEE714 80241924 24420001 */ addiu $v0, $v0, 1 -/* BEE718 80241928 A602008E */ sh $v0, 0x8e($s0) -/* BEE71C 8024192C 00021400 */ sll $v0, $v0, 0x10 -/* BEE720 80241930 8E630020 */ lw $v1, 0x20($s3) -/* BEE724 80241934 00021403 */ sra $v0, $v0, 0x10 -/* BEE728 80241938 0043102A */ slt $v0, $v0, $v1 -/* BEE72C 8024193C 14400026 */ bnez $v0, .L802419D8 -/* BEE730 80241940 00000000 */ nop -/* BEE734 80241944 C60C0038 */ lwc1 $f12, 0x38($s0) -/* BEE738 80241948 C60E0040 */ lwc1 $f14, 0x40($s0) -/* BEE73C 8024194C 3C02800F */ lui $v0, %hi(gPlayerStatusPtr) -/* BEE740 80241950 8C427B30 */ lw $v0, %lo(gPlayerStatusPtr)($v0) -/* BEE744 80241954 A600008E */ sh $zero, 0x8e($s0) -/* BEE748 80241958 8C460028 */ lw $a2, 0x28($v0) -/* BEE74C 8024195C 0C00A720 */ jal atan2 -/* BEE750 80241960 8C470030 */ lw $a3, 0x30($v0) -/* BEE754 80241964 46000506 */ mov.s $f20, $f0 -/* BEE758 80241968 C60C000C */ lwc1 $f12, 0xc($s0) -/* BEE75C 8024196C 0C00A70A */ jal get_clamped_angle_diff -/* BEE760 80241970 4600A386 */ mov.s $f14, $f20 -/* BEE764 80241974 46000086 */ mov.s $f2, $f0 -/* BEE768 80241978 8E62001C */ lw $v0, 0x1c($s3) -/* BEE76C 8024197C 46001005 */ abs.s $f0, $f2 -/* BEE770 80241980 44822000 */ mtc1 $v0, $f4 -/* BEE774 80241984 00000000 */ nop -/* BEE778 80241988 46802120 */ cvt.s.w $f4, $f4 -/* BEE77C 8024198C 4600203C */ c.lt.s $f4, $f0 -/* BEE780 80241990 00000000 */ nop -/* BEE784 80241994 4500000D */ bc1f .L802419CC -/* BEE788 80241998 00000000 */ nop -/* BEE78C 8024199C 44800000 */ mtc1 $zero, $f0 -/* BEE790 802419A0 C614000C */ lwc1 $f20, 0xc($s0) -/* BEE794 802419A4 4600103C */ c.lt.s $f2, $f0 -/* BEE798 802419A8 00000000 */ nop -/* BEE79C 802419AC 45000006 */ bc1f .L802419C8 -/* BEE7A0 802419B0 00021023 */ negu $v0, $v0 -/* BEE7A4 802419B4 44820000 */ mtc1 $v0, $f0 -/* BEE7A8 802419B8 00000000 */ nop -/* BEE7AC 802419BC 46800020 */ cvt.s.w $f0, $f0 -/* BEE7B0 802419C0 08090673 */ j .L802419CC -/* BEE7B4 802419C4 4600A500 */ add.s $f20, $f20, $f0 -.L802419C8: -/* BEE7B8 802419C8 4604A500 */ add.s $f20, $f20, $f4 -.L802419CC: -/* BEE7BC 802419CC 0C00A6C9 */ jal clamp_angle -/* BEE7C0 802419D0 4600A306 */ mov.s $f12, $f20 -/* BEE7C4 802419D4 E600000C */ swc1 $f0, 0xc($s0) -.L802419D8: -/* BEE7C8 802419D8 8E020000 */ lw $v0, ($s0) -/* BEE7CC 802419DC 30420008 */ andi $v0, $v0, 8 -/* BEE7D0 802419E0 1040000A */ beqz $v0, .L80241A0C -/* BEE7D4 802419E4 27A50018 */ addiu $a1, $sp, 0x18 -/* BEE7D8 802419E8 C602003C */ lwc1 $f2, 0x3c($s0) -/* BEE7DC 802419EC C600001C */ lwc1 $f0, 0x1c($s0) -/* BEE7E0 802419F0 46001080 */ add.s $f2, $f2, $f0 -/* BEE7E4 802419F4 4616103C */ c.lt.s $f2, $f22 -/* BEE7E8 802419F8 00000000 */ nop -/* BEE7EC 802419FC 45020045 */ bc1fl .L80241B14 -/* BEE7F0 80241A00 E602003C */ swc1 $f2, 0x3c($s0) -/* BEE7F4 80241A04 080906C4 */ j .L80241B10 -/* BEE7F8 80241A08 E616003C */ swc1 $f22, 0x3c($s0) -.L80241A0C: -/* BEE7FC 80241A0C C6000038 */ lwc1 $f0, 0x38($s0) -/* BEE800 80241A10 27A6001C */ addiu $a2, $sp, 0x1c -/* BEE804 80241A14 E7A00018 */ swc1 $f0, 0x18($sp) -/* BEE808 80241A18 860200A8 */ lh $v0, 0xa8($s0) -/* BEE80C 80241A1C C600001C */ lwc1 $f0, 0x1c($s0) -/* BEE810 80241A20 C604003C */ lwc1 $f4, 0x3c($s0) -/* BEE814 80241A24 44821000 */ mtc1 $v0, $f2 -/* BEE818 80241A28 00000000 */ nop -/* BEE81C 80241A2C 468010A0 */ cvt.s.w $f2, $f2 -/* BEE820 80241A30 46000005 */ abs.s $f0, $f0 -/* BEE824 80241A34 46020000 */ add.s $f0, $f0, $f2 -/* BEE828 80241A38 C6060040 */ lwc1 $f6, 0x40($s0) -/* BEE82C 80241A3C 27A20024 */ addiu $v0, $sp, 0x24 -/* BEE830 80241A40 46022100 */ add.s $f4, $f4, $f2 -/* BEE834 80241A44 3C014024 */ lui $at, 0x4024 -/* BEE838 80241A48 44811800 */ mtc1 $at, $f3 -/* BEE83C 80241A4C 44801000 */ mtc1 $zero, $f2 -/* BEE840 80241A50 46000021 */ cvt.d.s $f0, $f0 -/* BEE844 80241A54 46220000 */ add.d $f0, $f0, $f2 -/* BEE848 80241A58 E7A60020 */ swc1 $f6, 0x20($sp) -/* BEE84C 80241A5C E7A4001C */ swc1 $f4, 0x1c($sp) -/* BEE850 80241A60 46200020 */ cvt.s.d $f0, $f0 -/* BEE854 80241A64 E7A00024 */ swc1 $f0, 0x24($sp) -/* BEE858 80241A68 AFA20010 */ sw $v0, 0x10($sp) -/* BEE85C 80241A6C 8E040080 */ lw $a0, 0x80($s0) -/* BEE860 80241A70 0C0372DF */ jal func_800DCB7C -/* BEE864 80241A74 27A70020 */ addiu $a3, $sp, 0x20 -/* BEE868 80241A78 10400015 */ beqz $v0, .L80241AD0 -/* BEE86C 80241A7C 00000000 */ nop -/* BEE870 80241A80 860200A8 */ lh $v0, 0xa8($s0) -/* BEE874 80241A84 C604001C */ lwc1 $f4, 0x1c($s0) -/* BEE878 80241A88 44820000 */ mtc1 $v0, $f0 -/* BEE87C 80241A8C 00000000 */ nop -/* BEE880 80241A90 46800020 */ cvt.s.w $f0, $f0 -/* BEE884 80241A94 46002085 */ abs.s $f2, $f4 -/* BEE888 80241A98 46020000 */ add.s $f0, $f0, $f2 -/* BEE88C 80241A9C C7A20024 */ lwc1 $f2, 0x24($sp) -/* BEE890 80241AA0 4600103E */ c.le.s $f2, $f0 -/* BEE894 80241AA4 00000000 */ nop -/* BEE898 80241AA8 45000005 */ bc1f .L80241AC0 -/* BEE89C 80241AAC 00000000 */ nop -/* BEE8A0 80241AB0 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BEE8A4 80241AB4 AE00001C */ sw $zero, 0x1c($s0) -/* BEE8A8 80241AB8 080906C5 */ j .L80241B14 -/* BEE8AC 80241ABC E600003C */ swc1 $f0, 0x3c($s0) -.L80241AC0: -/* BEE8B0 80241AC0 C600003C */ lwc1 $f0, 0x3c($s0) -/* BEE8B4 80241AC4 46040000 */ add.s $f0, $f0, $f4 -/* BEE8B8 80241AC8 080906C5 */ j .L80241B14 -/* BEE8BC 80241ACC E600003C */ swc1 $f0, 0x3c($s0) -.L80241AD0: -/* BEE8C0 80241AD0 C606003C */ lwc1 $f6, 0x3c($s0) -/* BEE8C4 80241AD4 860200A8 */ lh $v0, 0xa8($s0) -/* BEE8C8 80241AD8 46163081 */ sub.s $f2, $f6, $f22 -/* BEE8CC 80241ADC 44820000 */ mtc1 $v0, $f0 -/* BEE8D0 80241AE0 00000000 */ nop -/* BEE8D4 80241AE4 46800020 */ cvt.s.w $f0, $f0 -/* BEE8D8 80241AE8 46001080 */ add.s $f2, $f2, $f0 -/* BEE8DC 80241AEC C604001C */ lwc1 $f4, 0x1c($s0) -/* BEE8E0 80241AF0 46002005 */ abs.s $f0, $f4 -/* BEE8E4 80241AF4 4602003C */ c.lt.s $f0, $f2 -/* BEE8E8 80241AF8 00000000 */ nop -/* BEE8EC 80241AFC 45020005 */ bc1fl .L80241B14 -/* BEE8F0 80241B00 AE00001C */ sw $zero, 0x1c($s0) -/* BEE8F4 80241B04 46043000 */ add.s $f0, $f6, $f4 -/* BEE8F8 80241B08 080906C5 */ j .L80241B14 -/* BEE8FC 80241B0C E600003C */ swc1 $f0, 0x3c($s0) -.L80241B10: -/* BEE900 80241B10 AE00001C */ sw $zero, 0x1c($s0) -.L80241B14: -/* BEE904 80241B14 8FBF0038 */ lw $ra, 0x38($sp) -/* BEE908 80241B18 8FB30034 */ lw $s3, 0x34($sp) -/* BEE90C 80241B1C 8FB20030 */ lw $s2, 0x30($sp) -/* BEE910 80241B20 8FB1002C */ lw $s1, 0x2c($sp) -/* BEE914 80241B24 8FB00028 */ lw $s0, 0x28($sp) -/* BEE918 80241B28 D7B60048 */ ldc1 $f22, 0x48($sp) -/* BEE91C 80241B2C D7B40040 */ ldc1 $f20, 0x40($sp) -/* BEE920 80241B30 03E00008 */ jr $ra -/* BEE924 80241B34 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241B38_BEE928.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241B38_BEE928.s deleted file mode 100644 index 281cb2d957..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241B38_BEE928.s +++ /dev/null @@ -1,79 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241B38_BEE928 -/* BEE928 80241B38 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* BEE92C 80241B3C AFB00028 */ sw $s0, 0x28($sp) -/* BEE930 80241B40 00A0802D */ daddu $s0, $a1, $zero -/* BEE934 80241B44 AFB1002C */ sw $s1, 0x2c($sp) -/* BEE938 80241B48 00C0882D */ daddu $s1, $a2, $zero -/* BEE93C 80241B4C AFBF0034 */ sw $ra, 0x34($sp) -/* BEE940 80241B50 AFB20030 */ sw $s2, 0x30($sp) -/* BEE944 80241B54 AE200070 */ sw $zero, 0x70($s1) -/* BEE948 80241B58 8C830000 */ lw $v1, ($a0) -/* BEE94C 80241B5C 2402FDFF */ addiu $v0, $zero, -0x201 -/* BEE950 80241B60 A480008E */ sh $zero, 0x8e($a0) -/* BEE954 80241B64 00621824 */ and $v1, $v1, $v0 -/* BEE958 80241B68 34650800 */ ori $a1, $v1, 0x800 -/* BEE95C 80241B6C AC850000 */ sw $a1, ($a0) -/* BEE960 80241B70 8E0200D0 */ lw $v0, 0xd0($s0) -/* BEE964 80241B74 8C420034 */ lw $v0, 0x34($v0) -/* BEE968 80241B78 10400003 */ beqz $v0, .L80241B88 -/* BEE96C 80241B7C 00E0902D */ daddu $s2, $a3, $zero -/* BEE970 80241B80 080906E4 */ j .L80241B90 -/* BEE974 80241B84 34620808 */ ori $v0, $v1, 0x808 -.L80241B88: -/* BEE978 80241B88 2402FFF7 */ addiu $v0, $zero, -9 -/* BEE97C 80241B8C 00A21024 */ and $v0, $a1, $v0 -.L80241B90: -/* BEE980 80241B90 AC820000 */ sw $v0, ($a0) -/* BEE984 80241B94 27A20024 */ addiu $v0, $sp, 0x24 -/* BEE988 80241B98 27A50018 */ addiu $a1, $sp, 0x18 -/* BEE98C 80241B9C C4800038 */ lwc1 $f0, 0x38($a0) -/* BEE990 80241BA0 C482003C */ lwc1 $f2, 0x3c($a0) -/* BEE994 80241BA4 C4840040 */ lwc1 $f4, 0x40($a0) -/* BEE998 80241BA8 3C01447A */ lui $at, 0x447a -/* BEE99C 80241BAC 44813000 */ mtc1 $at, $f6 -/* BEE9A0 80241BB0 27A6001C */ addiu $a2, $sp, 0x1c -/* BEE9A4 80241BB4 E7A00018 */ swc1 $f0, 0x18($sp) -/* BEE9A8 80241BB8 E7A2001C */ swc1 $f2, 0x1c($sp) -/* BEE9AC 80241BBC E7A40020 */ swc1 $f4, 0x20($sp) -/* BEE9B0 80241BC0 E7A60024 */ swc1 $f6, 0x24($sp) -/* BEE9B4 80241BC4 AFA20010 */ sw $v0, 0x10($sp) -/* BEE9B8 80241BC8 8C840080 */ lw $a0, 0x80($a0) -/* BEE9BC 80241BCC 0C0372DF */ jal func_800DCB7C -/* BEE9C0 80241BD0 27A70020 */ addiu $a3, $sp, 0x20 -/* BEE9C4 80241BD4 C7A20024 */ lwc1 $f2, 0x24($sp) -/* BEE9C8 80241BD8 3C014059 */ lui $at, 0x4059 -/* BEE9CC 80241BDC 44812800 */ mtc1 $at, $f5 -/* BEE9D0 80241BE0 44802000 */ mtc1 $zero, $f4 -/* BEE9D4 80241BE4 460010A1 */ cvt.d.s $f2, $f2 -/* BEE9D8 80241BE8 46241082 */ mul.d $f2, $f2, $f4 -/* BEE9DC 80241BEC 00000000 */ nop -/* BEE9E0 80241BF0 C7A0001C */ lwc1 $f0, 0x1c($sp) -/* BEE9E4 80241BF4 46000021 */ cvt.d.s $f0, $f0 -/* BEE9E8 80241BF8 46240002 */ mul.d $f0, $f0, $f4 -/* BEE9EC 80241BFC 00000000 */ nop -/* BEE9F0 80241C00 3C013FE0 */ lui $at, 0x3fe0 -/* BEE9F4 80241C04 44812800 */ mtc1 $at, $f5 -/* BEE9F8 80241C08 44802000 */ mtc1 $zero, $f4 -/* BEE9FC 80241C0C 00000000 */ nop -/* BEEA00 80241C10 46241080 */ add.d $f2, $f2, $f4 -/* BEEA04 80241C14 AE000074 */ sw $zero, 0x74($s0) -/* BEEA08 80241C18 46240000 */ add.d $f0, $f0, $f4 -/* BEEA0C 80241C1C AE000090 */ sw $zero, 0x90($s0) -/* BEEA10 80241C20 4620120D */ trunc.w.d $f8, $f2 -/* BEEA14 80241C24 E6080078 */ swc1 $f8, 0x78($s0) -/* BEEA18 80241C28 4620020D */ trunc.w.d $f8, $f0 -/* BEEA1C 80241C2C E6080088 */ swc1 $f8, 0x88($s0) -/* BEEA20 80241C30 8E420014 */ lw $v0, 0x14($s2) -/* BEEA24 80241C34 AE220074 */ sw $v0, 0x74($s1) -/* BEEA28 80241C38 8E0200B0 */ lw $v0, 0xb0($s0) -/* BEEA2C 80241C3C 34420010 */ ori $v0, $v0, 0x10 -/* BEEA30 80241C40 AE0200B0 */ sw $v0, 0xb0($s0) -/* BEEA34 80241C44 8FBF0034 */ lw $ra, 0x34($sp) -/* BEEA38 80241C48 8FB20030 */ lw $s2, 0x30($sp) -/* BEEA3C 80241C4C 8FB1002C */ lw $s1, 0x2c($sp) -/* BEEA40 80241C50 8FB00028 */ lw $s0, 0x28($sp) -/* BEEA44 80241C54 03E00008 */ jr $ra -/* BEEA48 80241C58 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241C5C_BEEA4C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241C5C_BEEA4C.s deleted file mode 100644 index aa8e548e4e..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_07/BED740/func_80241C5C_BEEA4C.s +++ /dev/null @@ -1,140 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80241C5C_BEEA4C -/* BEEA4C 80241C5C 27BDFFB0 */ addiu $sp, $sp, -0x50 -/* BEEA50 80241C60 AFB40040 */ sw $s4, 0x40($sp) -/* BEEA54 80241C64 0080A02D */ daddu $s4, $a0, $zero -/* BEEA58 80241C68 AFBF0048 */ sw $ra, 0x48($sp) -/* BEEA5C 80241C6C AFB50044 */ sw $s5, 0x44($sp) -/* BEEA60 80241C70 AFB3003C */ sw $s3, 0x3c($sp) -/* BEEA64 80241C74 AFB20038 */ sw $s2, 0x38($sp) -/* BEEA68 80241C78 AFB10034 */ sw $s1, 0x34($sp) -/* BEEA6C 80241C7C AFB00030 */ sw $s0, 0x30($sp) -/* BEEA70 80241C80 8E920148 */ lw $s2, 0x148($s4) -/* BEEA74 80241C84 86440008 */ lh $a0, 8($s2) -/* BEEA78 80241C88 8E90000C */ lw $s0, 0xc($s4) -/* BEEA7C 80241C8C 0C00EABB */ jal get_npc_unsafe -/* BEEA80 80241C90 00A0882D */ daddu $s1, $a1, $zero -/* BEEA84 80241C94 0280202D */ daddu $a0, $s4, $zero -/* BEEA88 80241C98 8E050000 */ lw $a1, ($s0) -/* BEEA8C 80241C9C 0C0B1EAF */ jal get_variable -/* BEEA90 80241CA0 0040A82D */ daddu $s5, $v0, $zero -/* BEEA94 80241CA4 AFA00010 */ sw $zero, 0x10($sp) -/* BEEA98 80241CA8 8E4300D0 */ lw $v1, 0xd0($s2) -/* BEEA9C 80241CAC 8C630030 */ lw $v1, 0x30($v1) -/* BEEAA0 80241CB0 AFA30014 */ sw $v1, 0x14($sp) -/* BEEAA4 80241CB4 8E4300D0 */ lw $v1, 0xd0($s2) -/* BEEAA8 80241CB8 8C63001C */ lw $v1, 0x1c($v1) -/* BEEAAC 80241CBC AFA30018 */ sw $v1, 0x18($sp) -/* BEEAB0 80241CC0 8E4300D0 */ lw $v1, 0xd0($s2) -/* BEEAB4 80241CC4 8C630024 */ lw $v1, 0x24($v1) -/* BEEAB8 80241CC8 AFA3001C */ sw $v1, 0x1c($sp) -/* BEEABC 80241CCC 8E4300D0 */ lw $v1, 0xd0($s2) -/* BEEAC0 80241CD0 8C630028 */ lw $v1, 0x28($v1) -/* BEEAC4 80241CD4 27B30010 */ addiu $s3, $sp, 0x10 -/* BEEAC8 80241CD8 AFA30020 */ sw $v1, 0x20($sp) -/* BEEACC 80241CDC 8E4300D0 */ lw $v1, 0xd0($s2) -/* BEEAD0 80241CE0 3C0142F0 */ lui $at, 0x42f0 -/* BEEAD4 80241CE4 44810000 */ mtc1 $at, $f0 -/* BEEAD8 80241CE8 8C63002C */ lw $v1, 0x2c($v1) -/* BEEADC 80241CEC 0040802D */ daddu $s0, $v0, $zero -/* BEEAE0 80241CF0 E7A00028 */ swc1 $f0, 0x28($sp) -/* BEEAE4 80241CF4 A7A0002C */ sh $zero, 0x2c($sp) -/* BEEAE8 80241CF8 12200006 */ beqz $s1, .L80241D14 -/* BEEAEC 80241CFC AFA30024 */ sw $v1, 0x24($sp) -/* BEEAF0 80241D00 02A0202D */ daddu $a0, $s5, $zero -/* BEEAF4 80241D04 0240282D */ daddu $a1, $s2, $zero -/* BEEAF8 80241D08 0280302D */ daddu $a2, $s4, $zero -/* BEEAFC 80241D0C 0C0906CE */ jal func_80241B38_BEE928 -/* BEEB00 80241D10 0200382D */ daddu $a3, $s0, $zero -.L80241D14: -/* BEEB04 80241D14 2402FFFE */ addiu $v0, $zero, -2 -/* BEEB08 80241D18 A2A200AB */ sb $v0, 0xab($s5) -/* BEEB0C 80241D1C 8E4300B0 */ lw $v1, 0xb0($s2) -/* BEEB10 80241D20 30620004 */ andi $v0, $v1, 4 -/* BEEB14 80241D24 10400007 */ beqz $v0, .L80241D44 -/* BEEB18 80241D28 00000000 */ nop -/* BEEB1C 80241D2C 824200B4 */ lb $v0, 0xb4($s2) -/* BEEB20 80241D30 1440003C */ bnez $v0, .L80241E24 -/* BEEB24 80241D34 0000102D */ daddu $v0, $zero, $zero -/* BEEB28 80241D38 2402FFFB */ addiu $v0, $zero, -5 -/* BEEB2C 80241D3C 00621024 */ and $v0, $v1, $v0 -/* BEEB30 80241D40 AE4200B0 */ sw $v0, 0xb0($s2) -.L80241D44: -/* BEEB34 80241D44 8E830070 */ lw $v1, 0x70($s4) -/* BEEB38 80241D48 2C62000F */ sltiu $v0, $v1, 0xf -/* BEEB3C 80241D4C 10400034 */ beqz $v0, L80241E20_BEEC10 -/* BEEB40 80241D50 00031080 */ sll $v0, $v1, 2 -/* BEEB44 80241D54 3C018024 */ lui $at, %hi(jtbl_80247968_BF4758) -/* BEEB48 80241D58 00220821 */ addu $at, $at, $v0 -/* BEEB4C 80241D5C 8C227968 */ lw $v0, %lo(jtbl_80247968_BF4758)($at) -/* BEEB50 80241D60 00400008 */ jr $v0 -/* BEEB54 80241D64 00000000 */ nop -glabel L80241D68_BEEB58 -/* BEEB58 80241D68 0280202D */ daddu $a0, $s4, $zero -/* BEEB5C 80241D6C 0200282D */ daddu $a1, $s0, $zero -/* BEEB60 80241D70 0C090254 */ jal func_80240950_BED740 -/* BEEB64 80241D74 0260302D */ daddu $a2, $s3, $zero -glabel L80241D78_BEEB68 -/* BEEB68 80241D78 0280202D */ daddu $a0, $s4, $zero -/* BEEB6C 80241D7C 0200282D */ daddu $a1, $s0, $zero -/* BEEB70 80241D80 0C0902C0 */ jal func_80240B00_BED8F0 -/* BEEB74 80241D84 0260302D */ daddu $a2, $s3, $zero -/* BEEB78 80241D88 08090789 */ j .L80241E24 -/* BEEB7C 80241D8C 0000102D */ daddu $v0, $zero, $zero -glabel L80241D90_BEEB80 -/* BEEB80 80241D90 0280202D */ daddu $a0, $s4, $zero -/* BEEB84 80241D94 0200282D */ daddu $a1, $s0, $zero -/* BEEB88 80241D98 0C09044A */ jal arn_07_UnkNpcAIFunc1 -/* BEEB8C 80241D9C 0260302D */ daddu $a2, $s3, $zero -glabel L80241DA0_BEEB90 -/* BEEB90 80241DA0 0280202D */ daddu $a0, $s4, $zero -/* BEEB94 80241DA4 0200282D */ daddu $a1, $s0, $zero -/* BEEB98 80241DA8 0C09047A */ jal func_802411E8_BEDFD8 -/* BEEB9C 80241DAC 0260302D */ daddu $a2, $s3, $zero -/* BEEBA0 80241DB0 08090789 */ j .L80241E24 -/* BEEBA4 80241DB4 0000102D */ daddu $v0, $zero, $zero -glabel L80241DB8_BEEBA8 -/* BEEBA8 80241DB8 0280202D */ daddu $a0, $s4, $zero -/* BEEBAC 80241DBC 0200282D */ daddu $a1, $s0, $zero -/* BEEBB0 80241DC0 0C09054B */ jal arn_07_UnkNpcAIFunc2 -/* BEEBB4 80241DC4 0260302D */ daddu $a2, $s3, $zero -glabel L80241DC8_BEEBB8 -/* BEEBB8 80241DC8 0280202D */ daddu $a0, $s4, $zero -/* BEEBBC 80241DCC 0200282D */ daddu $a1, $s0, $zero -/* BEEBC0 80241DD0 0C090569 */ jal func_802415A4_BEE394 -/* BEEBC4 80241DD4 0260302D */ daddu $a2, $s3, $zero -/* BEEBC8 80241DD8 08090789 */ j .L80241E24 -/* BEEBCC 80241DDC 0000102D */ daddu $v0, $zero, $zero -glabel L80241DE0_BEEBD0 -/* BEEBD0 80241DE0 0280202D */ daddu $a0, $s4, $zero -/* BEEBD4 80241DE4 0200282D */ daddu $a1, $s0, $zero -/* BEEBD8 80241DE8 0C090584 */ jal arn_07_UnkNpcAIFunc14 -/* BEEBDC 80241DEC 0260302D */ daddu $a2, $s3, $zero -/* BEEBE0 80241DF0 08090789 */ j .L80241E24 -/* BEEBE4 80241DF4 0000102D */ daddu $v0, $zero, $zero -glabel L80241DF8_BEEBE8 -/* BEEBE8 80241DF8 0280202D */ daddu $a0, $s4, $zero -/* BEEBEC 80241DFC 0200282D */ daddu $a1, $s0, $zero -/* BEEBF0 80241E00 0C0905D1 */ jal arn_07_UnkNpcAIFunc3 -/* BEEBF4 80241E04 0260302D */ daddu $a2, $s3, $zero -/* BEEBF8 80241E08 08090789 */ j .L80241E24 -/* BEEBFC 80241E0C 0000102D */ daddu $v0, $zero, $zero -glabel L80241E10_BEEC00 -/* BEEC00 80241E10 0280202D */ daddu $a0, $s4, $zero -/* BEEC04 80241E14 0200282D */ daddu $a1, $s0, $zero -/* BEEC08 80241E18 0C0905EA */ jal func_802417A8_BEE598 -/* BEEC0C 80241E1C 0260302D */ daddu $a2, $s3, $zero -glabel L80241E20_BEEC10 -/* BEEC10 80241E20 0000102D */ daddu $v0, $zero, $zero -.L80241E24: -/* BEEC14 80241E24 8FBF0048 */ lw $ra, 0x48($sp) -/* BEEC18 80241E28 8FB50044 */ lw $s5, 0x44($sp) -/* BEEC1C 80241E2C 8FB40040 */ lw $s4, 0x40($sp) -/* BEEC20 80241E30 8FB3003C */ lw $s3, 0x3c($sp) -/* BEEC24 80241E34 8FB20038 */ lw $s2, 0x38($sp) -/* BEEC28 80241E38 8FB10034 */ lw $s1, 0x34($sp) -/* BEEC2C 80241E3C 8FB00030 */ lw $s0, 0x30($sp) -/* BEEC30 80241E40 03E00008 */ jr $ra -/* BEEC34 80241E44 27BD0050 */ addiu $sp, $sp, 0x50 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_80240000_BF47A0.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_80240000_BF47A0.s deleted file mode 100644 index dbecdd5bee..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_80240000_BF47A0.s +++ /dev/null @@ -1,40 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BF47A0 -/* BF47A0 80240000 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BF47A4 80240004 AFB00018 */ sw $s0, 0x18($sp) -/* BF47A8 80240008 AFBF001C */ sw $ra, 0x1c($sp) -/* BF47AC 8024000C F7B40020 */ sdc1 $f20, 0x20($sp) -/* BF47B0 80240010 10A00005 */ beqz $a1, .L80240028 -/* BF47B4 80240014 0080802D */ daddu $s0, $a0, $zero -/* BF47B8 80240018 AE000070 */ sw $zero, 0x70($s0) -/* BF47BC 8024001C 3C040001 */ lui $a0, 1 -/* BF47C0 80240020 0C037FBF */ jal func_800DFEFC -/* BF47C4 80240024 34840007 */ ori $a0, $a0, 7 -.L80240028: -/* BF47C8 80240028 0C038D36 */ jal func_800E34D8 -/* BF47CC 8024002C 00000000 */ nop -/* BF47D0 80240030 46000506 */ mov.s $f20, $f0 -/* BF47D4 80240034 4600A306 */ mov.s $f12, $f20 -/* BF47D8 80240038 0C038D45 */ jal func_800E3514 -/* BF47DC 8024003C 27A50010 */ addiu $a1, $sp, 0x10 -/* BF47E0 80240040 3C028011 */ lui $v0, %hi(gPlayerStatus) -/* BF47E4 80240044 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) -/* BF47E8 80240048 E440002C */ swc1 $f0, 0x2c($v0) -/* BF47EC 8024004C C6000070 */ lwc1 $f0, 0x70($s0) -/* BF47F0 80240050 46800020 */ cvt.s.w $f0, $f0 -/* BF47F4 80240054 4600A505 */ abs.s $f20, $f20 -/* BF47F8 80240058 46140000 */ add.s $f0, $f0, $f20 -/* BF47FC 8024005C 4600008D */ trunc.w.s $f2, $f0 -/* BF4800 80240060 44021000 */ mfc1 $v0, $f2 -/* BF4804 80240064 00000000 */ nop -/* BF4808 80240068 AE020070 */ sw $v0, 0x70($s0) -/* BF480C 8024006C 28420033 */ slti $v0, $v0, 0x33 -/* BF4810 80240070 38420001 */ xori $v0, $v0, 1 -/* BF4814 80240074 8FBF001C */ lw $ra, 0x1c($sp) -/* BF4818 80240078 8FB00018 */ lw $s0, 0x18($sp) -/* BF481C 8024007C D7B40020 */ ldc1 $f20, 0x20($sp) -/* BF4820 80240080 00021040 */ sll $v0, $v0, 1 -/* BF4824 80240084 03E00008 */ jr $ra -/* BF4828 80240088 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_8024008C_BF482C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_8024008C_BF482C.s deleted file mode 100644 index b543a6678f..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF47A0/func_8024008C_BF482C.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024008C_BF482C -/* BF482C 8024008C 3C018011 */ lui $at, %hi(gPlayerStatus+0x2C) -/* BF4830 80240090 C422EFF4 */ lwc1 $f2, %lo(gPlayerStatus+0x2C)($at) -/* BF4834 80240094 3C01C120 */ lui $at, 0xc120 -/* BF4838 80240098 44810000 */ mtc1 $at, $f0 -/* BF483C 8024009C 00000000 */ nop -/* BF4840 802400A0 4600103C */ c.lt.s $f2, $f0 -/* BF4844 802400A4 00000000 */ nop -/* BF4848 802400A8 45010002 */ bc1t .L802400B4 -/* BF484C 802400AC 24020002 */ addiu $v0, $zero, 2 -/* BF4850 802400B0 0000102D */ daddu $v0, $zero, $zero -.L802400B4: -/* BF4854 802400B4 03E00008 */ jr $ra -/* BF4858 802400B8 00000000 */ nop -/* BF485C 802400BC 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400C0_BF4860.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400C0_BF4860.s deleted file mode 100644 index d137264b84..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400C0_BF4860.s +++ /dev/null @@ -1,9 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802400C0_BF4860 -/* BF4860 802400C0 24020001 */ addiu $v0, $zero, 1 -/* BF4864 802400C4 3C018011 */ lui $at, %hi(gPlayerData) -/* BF4868 802400C8 A022F290 */ sb $v0, %lo(gPlayerData)($at) -/* BF486C 802400CC 03E00008 */ jr $ra -/* BF4870 802400D0 24020002 */ addiu $v0, $zero, 2 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400D4_BF4874.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400D4_BF4874.s deleted file mode 100644 index 76b40e8d9a..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400D4_BF4874.s +++ /dev/null @@ -1,12 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802400D4_BF4874 -/* BF4874 802400D4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BF4878 802400D8 AFBF0010 */ sw $ra, 0x10($sp) -/* BF487C 802400DC 0C03BCC0 */ jal func_800EF300 -/* BF4880 802400E0 00000000 */ nop -/* BF4884 802400E4 8FBF0010 */ lw $ra, 0x10($sp) -/* BF4888 802400E8 24020002 */ addiu $v0, $zero, 2 -/* BF488C 802400EC 03E00008 */ jr $ra -/* BF4890 802400F0 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400F4_BF4894.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400F4_BF4894.s deleted file mode 100644 index 65489b21d7..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_802400F4_BF4894.s +++ /dev/null @@ -1,48 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802400F4_BF4894 -/* BF4894 802400F4 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* BF4898 802400F8 AFB00018 */ sw $s0, 0x18($sp) -/* BF489C 802400FC AFB1001C */ sw $s1, 0x1c($sp) -/* BF48A0 80240100 3C118011 */ lui $s1, %hi(gPlayerStatus) -/* BF48A4 80240104 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus) -/* BF48A8 80240108 AFBF0020 */ sw $ra, 0x20($sp) -/* BF48AC 8024010C F7B40028 */ sdc1 $f20, 0x28($sp) -/* BF48B0 80240110 10A00002 */ beqz $a1, .L8024011C -/* BF48B4 80240114 0080802D */ daddu $s0, $a0, $zero -/* BF48B8 80240118 AE000070 */ sw $zero, 0x70($s0) -.L8024011C: -/* BF48BC 8024011C C622002C */ lwc1 $f2, 0x2c($s1) -/* BF48C0 80240120 3C01C120 */ lui $at, 0xc120 -/* BF48C4 80240124 44810000 */ mtc1 $at, $f0 -/* BF48C8 80240128 00000000 */ nop -/* BF48CC 8024012C 4602003C */ c.lt.s $f0, $f2 -/* BF48D0 80240130 00000000 */ nop -/* BF48D4 80240134 45010013 */ bc1t .L80240184 -/* BF48D8 80240138 0000102D */ daddu $v0, $zero, $zero -/* BF48DC 8024013C 0C038D36 */ jal func_800E34D8 -/* BF48E0 80240140 00000000 */ nop -/* BF48E4 80240144 46000506 */ mov.s $f20, $f0 -/* BF48E8 80240148 4600A306 */ mov.s $f12, $f20 -/* BF48EC 8024014C 0C038D45 */ jal func_800E3514 -/* BF48F0 80240150 27A50010 */ addiu $a1, $sp, 0x10 -/* BF48F4 80240154 E620002C */ swc1 $f0, 0x2c($s1) -/* BF48F8 80240158 C6000070 */ lwc1 $f0, 0x70($s0) -/* BF48FC 8024015C 46800020 */ cvt.s.w $f0, $f0 -/* BF4900 80240160 4600A505 */ abs.s $f20, $f20 -/* BF4904 80240164 46140000 */ add.s $f0, $f0, $f20 -/* BF4908 80240168 4600010D */ trunc.w.s $f4, $f0 -/* BF490C 8024016C 44032000 */ mfc1 $v1, $f4 -/* BF4910 80240170 00000000 */ nop -/* BF4914 80240174 28620033 */ slti $v0, $v1, 0x33 -/* BF4918 80240178 38420001 */ xori $v0, $v0, 1 -/* BF491C 8024017C 00021040 */ sll $v0, $v0, 1 -/* BF4920 80240180 AE030070 */ sw $v1, 0x70($s0) -.L80240184: -/* BF4924 80240184 8FBF0020 */ lw $ra, 0x20($sp) -/* BF4928 80240188 8FB1001C */ lw $s1, 0x1c($sp) -/* BF492C 8024018C 8FB00018 */ lw $s0, 0x18($sp) -/* BF4930 80240190 D7B40028 */ ldc1 $f20, 0x28($sp) -/* BF4934 80240194 03E00008 */ jr $ra -/* BF4938 80240198 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_8024019C_BF493C.s b/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_8024019C_BF493C.s deleted file mode 100644 index 669bcf7b58..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_08/BF4860/func_8024019C_BF493C.s +++ /dev/null @@ -1,71 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024019C_BF493C -/* BF493C 8024019C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* BF4940 802401A0 3C048024 */ lui $a0, %hi(D_80241188_BF5928) -/* BF4944 802401A4 24841188 */ addiu $a0, $a0, %lo(D_80241188_BF5928) -/* BF4948 802401A8 AFBF0018 */ sw $ra, 0x18($sp) -/* BF494C 802401AC AFB10014 */ sw $s1, 0x14($sp) -/* BF4950 802401B0 AFB00010 */ sw $s0, 0x10($sp) -/* BF4954 802401B4 F7B40020 */ sdc1 $f20, 0x20($sp) -/* BF4958 802401B8 8C830000 */ lw $v1, ($a0) -/* BF495C 802401BC 3C118011 */ lui $s1, %hi(gPlayerStatus) -/* BF4960 802401C0 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus) -/* BF4964 802401C4 28620003 */ slti $v0, $v1, 3 -/* BF4968 802401C8 50400007 */ beql $v0, $zero, .L802401E8 -/* BF496C 802401CC 24020003 */ addiu $v0, $zero, 3 -/* BF4970 802401D0 1C60000C */ bgtz $v1, .L80240204 -/* BF4974 802401D4 24620001 */ addiu $v0, $v1, 1 -/* BF4978 802401D8 10600007 */ beqz $v1, .L802401F8 -/* BF497C 802401DC 0000102D */ daddu $v0, $zero, $zero -/* BF4980 802401E0 0809009D */ j .L80240274 -/* BF4984 802401E4 00000000 */ nop -.L802401E8: -/* BF4988 802401E8 10620008 */ beq $v1, $v0, .L8024020C -/* BF498C 802401EC 0000102D */ daddu $v0, $zero, $zero -/* BF4990 802401F0 0809009D */ j .L80240274 -/* BF4994 802401F4 00000000 */ nop -.L802401F8: -/* BF4998 802401F8 24020001 */ addiu $v0, $zero, 1 -/* BF499C 802401FC 0809009C */ j .L80240270 -/* BF49A0 80240200 AC820000 */ sw $v0, ($a0) -.L80240204: -/* BF49A4 80240204 0809009C */ j .L80240270 -/* BF49A8 80240208 AC820000 */ sw $v0, ($a0) -.L8024020C: -/* BF49AC 8024020C 3C108011 */ lui $s0, %hi(wPartnerNpc) -/* BF49B0 80240210 2610C930 */ addiu $s0, $s0, %lo(wPartnerNpc) -/* BF49B4 80240214 0C03BD17 */ jal clear_partner_move_history -/* BF49B8 80240218 8E040000 */ lw $a0, ($s0) -/* BF49BC 8024021C C6200028 */ lwc1 $f0, 0x28($s1) -/* BF49C0 80240220 C6220030 */ lwc1 $f2, 0x30($s1) -/* BF49C4 80240224 4600010D */ trunc.w.s $f4, $f0 -/* BF49C8 80240228 44042000 */ mfc1 $a0, $f4 -/* BF49CC 8024022C 4600110D */ trunc.w.s $f4, $f2 -/* BF49D0 80240230 44052000 */ mfc1 $a1, $f4 -/* BF49D4 80240234 0C03BCF0 */ jal func_800EF3C0 -/* BF49D8 80240238 00000000 */ nop -/* BF49DC 8024023C 0C03BCF5 */ jal func_800EF3D4 -/* BF49E0 80240240 0000202D */ daddu $a0, $zero, $zero -/* BF49E4 80240244 3C0142B4 */ lui $at, 0x42b4 -/* BF49E8 80240248 4481A000 */ mtc1 $at, $f20 -/* BF49EC 8024024C 8E040000 */ lw $a0, ($s0) -/* BF49F0 80240250 4405A000 */ mfc1 $a1, $f20 -/* BF49F4 80240254 0C00ECD0 */ jal set_npc_yaw -/* BF49F8 80240258 00000000 */ nop -/* BF49FC 8024025C 24020002 */ addiu $v0, $zero, 2 -/* BF4A00 80240260 E6340080 */ swc1 $f20, 0x80($s1) -/* BF4A04 80240264 E6340084 */ swc1 $f20, 0x84($s1) -/* BF4A08 80240268 0809009D */ j .L80240274 -/* BF4A0C 8024026C AE2000A8 */ sw $zero, 0xa8($s1) -.L80240270: -/* BF4A10 80240270 0000102D */ daddu $v0, $zero, $zero -.L80240274: -/* BF4A14 80240274 8FBF0018 */ lw $ra, 0x18($sp) -/* BF4A18 80240278 8FB10014 */ lw $s1, 0x14($sp) -/* BF4A1C 8024027C 8FB00010 */ lw $s0, 0x10($sp) -/* BF4A20 80240280 D7B40020 */ ldc1 $f20, 0x20($sp) -/* BF4A24 80240284 03E00008 */ jr $ra -/* BF4A28 80240288 27BD0028 */ addiu $sp, $sp, 0x28 -/* BF4A2C 8024028C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_arn/arn_09/BF6060/func_80240000_BF6060.s b/ver/us/asm/nonmatchings/world/area_arn/arn_09/BF6060/func_80240000_BF6060.s deleted file mode 100644 index fa6618d8c8..0000000000 --- a/ver/us/asm/nonmatchings/world/area_arn/arn_09/BF6060/func_80240000_BF6060.s +++ /dev/null @@ -1,21 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240000_BF6060 -/* BF6060 80240000 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* BF6064 80240004 AFBF0010 */ sw $ra, 0x10($sp) -/* BF6068 80240008 0C04417A */ jal get_entity_by_index -/* BF606C 8024000C 0000202D */ daddu $a0, $zero, $zero -/* BF6070 80240010 50400007 */ beql $v0, $zero, .L80240030 -/* BF6074 80240014 0000102D */ daddu $v0, $zero, $zero -/* BF6078 80240018 84440014 */ lh $a0, 0x14($v0) -/* BF607C 8024001C 3C050000 */ lui $a1, 0 -/* BF6080 80240020 24A501E4 */ addiu $a1, $a1, 0x1e4 -/* BF6084 80240024 0C048052 */ jal play_model_animation -/* BF6088 80240028 00000000 */ nop -/* BF608C 8024002C 24020002 */ addiu $v0, $zero, 2 -.L80240030: -/* BF6090 80240030 8FBF0010 */ lw $ra, 0x10($sp) -/* BF6094 80240034 03E00008 */ jr $ra -/* BF6098 80240038 27BD0018 */ addiu $sp, $sp, 0x18 -/* BF609C 8024003C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/world/area_kzn/kzn_20/C96240/func_802406E0_C96610.s b/ver/us/asm/nonmatchings/world/area_kzn/kzn_20/C96240/func_802406E0_C96610.s index d01fdd6760..5ef2571e01 100644 --- a/ver/us/asm/nonmatchings/world/area_kzn/kzn_20/C96240/func_802406E0_C96610.s +++ b/ver/us/asm/nonmatchings/world/area_kzn/kzn_20/C96240/func_802406E0_C96610.s @@ -13,8 +13,8 @@ glabel func_802406E0_C96610 /* C96630 80240700 8C620000 */ lw $v0, ($v1) /* C96634 80240704 5040000A */ beql $v0, $zero, .L80240730 /* C96638 80240708 00041080 */ sll $v0, $a0, 2 -/* C9663C 8024070C 3C058024 */ lui $a1, %hi(D_802442D0_BE7A80) -/* C96640 80240710 24A542D0 */ addiu $a1, $a1, %lo(D_802442D0_BE7A80) +/* C9663C 8024070C 3C058024 */ lui $a1, %hi(kzn_20_bss) +/* C96640 80240710 24A542D0 */ addiu $a1, $a1, %lo(kzn_20_bss) .L80240714: /* C96644 80240714 24630004 */ addiu $v1, $v1, 4 /* C96648 80240718 24840001 */ addiu $a0, $a0, 1 @@ -24,14 +24,14 @@ glabel func_802406E0_C96610 /* C96658 80240728 24A50004 */ addiu $a1, $a1, 4 /* C9665C 8024072C 00041080 */ sll $v0, $a0, 2 .L80240730: -/* C96660 80240730 3C018024 */ lui $at, %hi(D_802442D0_BE7A80) +/* C96660 80240730 3C018024 */ lui $at, %hi(kzn_20_bss) /* C96664 80240734 00220821 */ addu $at, $at, $v0 -/* C96668 80240738 AC2042D0 */ sw $zero, %lo(D_802442D0_BE7A80)($at) +/* C96668 80240738 AC2042D0 */ sw $zero, %lo(kzn_20_bss)($at) /* C9666C 8024073C 080901DB */ j .L8024076C /* C96670 80240740 00000000 */ nop .L80240744: -/* C96674 80240744 3C038024 */ lui $v1, %hi(D_802442D0_BE7A80) -/* C96678 80240748 246342D0 */ addiu $v1, $v1, %lo(D_802442D0_BE7A80) +/* C96674 80240744 3C038024 */ lui $v1, %hi(kzn_20_bss) +/* C96678 80240748 246342D0 */ addiu $v1, $v1, %lo(kzn_20_bss) /* C9667C 8024074C 0060282D */ daddu $a1, $v1, $zero .L80240750: /* C96680 80240750 24820010 */ addiu $v0, $a0, 0x10 diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 7f705c9ce5..a32aebccda 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -7749,122 +7749,122 @@ segments: start: 0xBDED90 vram: 0x80240000 subsections: - - [0xBDED90, c] - - [0xBE04B0, data] - - [0xBE05C0, data] - - [0xBE0950, data] - - [0xBE3570, data] - - [0xBE35E0, rodata] + - [0xBDED90, c, events] + - [0xBE04B0, .data, header] + - [0xBE05C0, .data, events] + - [0xBE0950, .data, events] + - [0xBE3570, .data, events] + - [0xBE35E0, .rodata, events] - name: world/area_arn/arn_04/ type: code overlay: True start: 0xBE37B0 vram: 0x80240000 subsections: - - [0xBE37B0, c] - - [0xBE6B20, data] - - [0xBE6C30, data] - - [0xBE6E10, data] - - [0xBE77F0, data] - - [0xBE78D0, rodata] - - [0xBE7AD8, rodata] + - [0xBE37B0, .c, events] + - [0xBE6B20, .data, header] + - [0xBE6C30, .data, events] + - [0xBE6E10, .data, events] + - [0xBE77F0, .data, events] + - [0xBE78D0, .rodata, events] + - [0xBE7AD8, .rodata, events] - name: world/area_arn/arn_05/ type: code overlay: True start: 0xBE7BE0 vram: 0x80240000 subsections: - - [0xBE7BE0, c] - - [0xBE8EE0, data] - - [0xBE9290, data] - - [0xBECBE0, data] - - [0xBECC20, rodata] + - [0xBE7BE0, .c, events] + - [0xBE8EE0, .data, header] + - [0xBE9290, .data, events] + - [0xBECBE0, .data, events] + - [0xBECC20, .rodata, events] - name: world/area_arn/arn_07/ type: code overlay: True start: 0xBECDF0 vram: 0x80240000 subsections: - - [0xBECDF0, c] - - [0xBED5F0, c] - - [0xBED660, c] - - [0xBED740, c] - - [0xBEEC80, data] - - [0xBEEE30, data] - - [0xBF0580, data] - - [0xBF46F0, rodata] - - [0xBF4730, rodata] - - [0xBF4740, rodata] + - [0xBECDF0, .c, BECDF0] + - [0xBED5F0, .c, BED5F0] + - [0xBED660, .c, BED660] + - [0xBED740, .c, events] + - [0xBEEC80, .data, header] + - [0xBEEE30, .data, BECDF0] + - [0xBF0580, .data, events] + - [0xBF46F0, .rodata, BECDF0] + - [0xBF4730, .rodata, BED5F0] + - [0xBF4740, .rodata, events] - name: world/area_arn/arn_08/ type: code overlay: True start: 0xBF47A0 vram: 0x80240000 subsections: - - [0xBF47A0, c] - - [0xBF4860, c] - - [0xBF4A30, data] - - [0xBF4B50, data] - - [0xBF5210, data] - - [0xBF5340, data] - - [0xBF5460, data] - - [0xBF59A0, data] - - [0xBF5FF0, data] - - [0xBF6040, rodata] + - [0xBF47A0, .c, BF47A0] + - [0xBF4860, .c, events] + - [0xBF4A30, .data, header] + - [0xBF4B50, .data, events] + - [0xBF5210, .data, events] + - [0xBF5340, .data, events] + - [0xBF5460, .data, events] + - [0xBF59A0, .data, events] + - [0xBF5FF0, .data, events] + - [0xBF6040, .rodata, events] - name: world/area_arn/arn_09/ type: code overlay: True start: 0xBF6060 vram: 0x80240000 subsections: - - [0xBF6060, c] - - [0xBF60A0, data] - - [0xBF61A0, data] - - [0xBF6400, data] - - [0xBF6530, data] - - [0xBF6610, data] - - [0xBF69F0, rodata] + - [0xBF6060, .c, events] + - [0xBF60A0, .data, header] + - [0xBF61A0, .data, events] + - [0xBF6400, .data, events] + - [0xBF6530, .data, events] + - [0xBF6610, .data, events] + - [0xBF69F0, .rodata, events] - name: world/area_arn/arn_10/ type: code overlay: True start: 0xBF6A00 vram: 0x80240000 subsections: - - [0xBF6A00, data] - - [0xBF6B00, data] - - [0xBF6E30, data] - - [0xBF75E0, data] - - [0xBF7670, rodata] + - [0xBF6A00, .data, header] + - [0xBF6B00, .data, events] + - [0xBF6E30, .data, events] + - [0xBF75E0, .data, events] + - [0xBF7670, .rodata, events] - name: world/area_arn/arn_11/ type: code overlay: True start: 0xBF7680 vram: 0x80240000 subsections: - - [0xBF7680, data] - - [0xBF7770, data] - - [0xBF7D00, data] - - [0xBF8780, rodata] + - [0xBF7680, .data, header] + - [0xBF7770, .data, events] + - [0xBF7D00, .data, events] + - [0xBF8780, .rodata, events] - name: world/area_arn/arn_12/ type: code overlay: True start: 0xBF8790 vram: 0x80240000 subsections: - - [0xBF8790, data] - - [0xBF8890, data] - - [0xBF8BB0, data] - - [0xBF9400, rodata] + - [0xBF8790, .data, header] + - [0xBF8890, .data, events] + - [0xBF8BB0, .data, events] + - [0xBF9400, .rodata, events] - name: world/area_arn/arn_13/ type: code overlay: True start: 0xBF9410 vram: 0x80240000 subsections: - - [0xBF9410, data] - - [0xBF9510, data] - - [0xBF9840, data] - - [0xBFA090, rodata] + - [0xBF9410, .data, header] + - [0xBF9510, .data, events] + - [0xBF9840, .data, events] + - [0xBFA090, .rodata, events] - name: world/area_dgb/dgb_00/ type: code overlay: True @@ -10513,370 +10513,382 @@ segments: - 2D_quiz_options - 2E_credits ids: - - [0x19, 0x03B, kmr_03_tattle] - - [0x19, 0x040, kmr_12_tattle] - - [0x19, 0x0BE, arn_02_tattle] + - [0x19, 0x003B, kmr_03_tattle] + - [0x19, 0x0040, kmr_12_tattle] + - [0x19, 0x0060, sbk_00_tattle] + - [0x19, 0x0061, sbk_01_tattle] + - [0x19, 0x00BB, arn_07_tattle] + - [0x19, 0x00BC, arn_03_tattle] + - [0x19, 0x00BD, arn_05_tattle] + - [0x19, 0x00BE, arn_02_tattle] + - [0x19, 0x00BF, arn_04_tattle] + - [0x19, 0x00D3, arn_08_tattle] + - [0x19, 0x00D4, arn_09_tattle] + - [0x19, 0x00D5, arn_10_tattle] + - [0x19, 0x00D6, arn_12_tattle] + - [0x19, 0x00D7, arn_13_tattle] + - [0x19, 0x00D8, arn_11_tattle] - - [0x1C, 0x000, actor_goomba_tattle] - - [0x1C, 0x001, actor_spiked_goomba_tattle] - - [0x1C, 0x002, actor_paragoomba_tattle] - - [0x1C, 0x003, actor_red_goomba_boss_tattle] - - [0x1C, 0x004, actor_blue_goomba_boss_tattle] - - [0x1C, 0x005, actor_goomba_king_tattle] - - [0x1C, 0x006, actor_goomnut_tree_tattle] - - [0x1C, 0x007, actor_koopa_troopa_tattle] - - [0x1C, 0x008, actor_paratroopa_tattle] - - [0x1C, 0x009, actor_fuzzy_tattle] - - [0x1C, 0x00A, actor_bob_omb_tattle] - - [0x1C, 0x00B, actor_bullet_bill_tattle] - - [0x1C, 0x00C, actor_bill_blaster_tattle] - - [0x1C, 0x00D, actor_fake_bowser_tattle] - - [0x1C, 0x00E, actor_red_ninjakoopa_tattle] - - [0x1C, 0x00F, actor_blue_ninjakoopa_tattle] - - [0x1C, 0x010, actor_yellow_ninjakoopa_tattle] - - [0x1C, 0x011, actor_green_ninjakoopa_tattle] - - [0x1C, 0x012, actor_koopa_bros_tattle] - - [0x1C, 0x013, actor_jr_troopa1_tattle] - - [0x1C, 0x014, actor_monty_mole_tattle] - - [0x1C, 0x015, actor_cleft_tattle] - - [0x1C, 0x016, actor_pokey_tattle] - - [0x1C, 0x017, actor_bandit_tattle] - - [0x1C, 0x018, actor_pokey_mummy_tattle] - - [0x1C, 0x019, actor_buzzy_beetle_tattle] - - [0x1C, 0x01A, actor_swooper_tattle] - - [0x1C, 0x01B, actor_buzzar_tattle] - - [0x1C, 0x01C, actor_tutankoopa_tattle] - - [0x1C, 0x01D, actor_chomp_tattle] - - [0x1C, 0x01E, actor_stone_chomp_tattle] - - [0x1C, 0x01F, actor_piranha_plant_tattle] - - [0x1C, 0x020, actor_forest_fuzzy_tattle] - - [0x1C, 0x021, actor_hyper_goomba_tattle] - - [0x1C, 0x022, actor_hyper_paragoomba_tattle] - - [0x1C, 0x023, actor_hyper_cleft_tattle] - - [0x1C, 0x024, actor_clubba_tattle] - - [0x1C, 0x025, actor_tubba_blubba_invincible_tattle] - - [0x1C, 0x026, actor_tubba_heart_tattle] - - [0x1C, 0x027, actor_tubba_blubba_tattle] - - [0x1C, 0x028, actor_jr_troopa2_tattle] - - [0x1C, 0x029, actor_shy_guy_tattle] - - [0x1C, 0x02A, actor_groove_guy_tattle] - - [0x1C, 0x02B, actor_spy_guy_tattle] - - [0x1C, 0x02C, actor_pyro_guy_tattle] - - [0x1C, 0x02D, actor_sky_guy_tattle] - - [0x1C, 0x02E, actor_medi_guy_tattle] - - [0x1C, 0x02F, actor_anti_guy_tattle] - - [0x1C, 0x030, actor_big_lantern_ghost_tattle] - - [0x1C, 0x031, actor_general_guy_tattle] - - [0x1C, 0x032, actor_shy_squad_tattle] - - [0x1C, 0x033, actor_shy_stack_tattle] - - [0x1C, 0x034, actor_stilt_guy_tattle] - - [0x1C, 0x035, actor_hurt_plant_tattle] - - [0x1C, 0x036, actor_m_bush_tattle] - - [0x1C, 0x037, actor_jungle_fuzzy_tattle] - - [0x1C, 0x038, actor_spear_guy_tattle] - - [0x1C, 0x039, actor_putrid_piranha_tattle] - - [0x1C, 0x03A, actor_lava_bubble_tattle] - - [0x1C, 0x03B, actor_spike_top_tattle] - - [0x1C, 0x03C, actor_lava_piranha_phase_1_tattle] - - [0x1C, 0x03D, actor_lava_piranha_phase_2_tattle] - - [0x1C, 0x03E, actor_lava_bud_phase_1_tattle] - - [0x1C, 0x03F, actor_lava_bud_phase_2_tattle] - - [0x1C, 0x040, actor_petit_piranha_tattle] - - [0x1C, 0x041, actor_jr_troopa3_tattle] - - [0x1C, 0x042, actor_lakitu_tattle] - - [0x1C, 0x043, actor_spiny_tattle] - - [0x1C, 0x044, actor_bzzap_tattle] - - [0x1C, 0x045, actor_crazee_dayzee_tattle] - - [0x1C, 0x046, actor_amazy_dayzee_tattle] - - [0x1C, 0x047, actor_monty_mole_boss_tattle] - - [0x1C, 0x048, actor_spike_tattle] - - [0x1C, 0x049, actor_ruff_puff_tattle] - - [0x1C, 0x04A, actor_huff_n_puff_tattle] - - [0x1C, 0x04B, actor_tuff_puff_tattle] - - [0x1C, 0x04C, actor_jr_troopa4_tattle] - - [0x1C, 0x04D, actor_gulpit_tattle] - - [0x1C, 0x04E, actor_gulpit_rocks_tattle] - - [0x1C, 0x04F, actor_monstar_tattle] - - [0x1C, 0x050, actor_frost_piranha_tattle] - - [0x1C, 0x051, actor_white_clubba_tattle] - - [0x1C, 0x052, actor_duplighost_tattle] - - [0x1C, 0x053, actor_ghost_watt_tattle] - - [0x1C, 0x054, actor_ghost_kooper_tattle] - - [0x1C, 0x055, actor_ghost_goombario_tattle] - - [0x1C, 0x056, actor_ghost_sushie_tattle] - - [0x1C, 0x057, actor_ghost_lakilester_tattle] - - [0x1C, 0x058, actor_ghost_parakarry_tattle] - - [0x1C, 0x059, actor_ghost_bombette_tattle] - - [0x1C, 0x05A, actor_ghost_bow_tattle] - - [0x1C, 0x05B, actor_albino_dino_tattle] - - [0x1C, 0x05C, actor_swoopula_tattle] - - [0x1C, 0x05D, actor_crystal_king_tattle] - - [0x1C, 0x05E, actor_crystal_clone_tattle] - - [0x1C, 0x05F, actor_crystal_bit_tattle] - - [0x1C, 0x060, actor_ember_tattle] - - [0x1C, 0x061, actor_dry_bones_tattle] - - [0x1C, 0x062, actor_bony_beetle_tattle] - - [0x1C, 0x063, actor_magikoopa_tattle] - - [0x1C, 0x064, actor_magiclone_tattle] - - [0x1C, 0x065, actor_magikoopa_dup_tattle] - - [0x1C, 0x066, actor_magiclone_dup_tattle] - - [0x1C, 0x067, actor_koopatrol_tattle] - - [0x1C, 0x068, actor_hammer_bros_tattle] - - [0x1C, 0x069, actor_bombshell_bill_tattle] - - [0x1C, 0x06A, actor_bombshell_blaster_tattle] - - [0x1C, 0x06B, actor_jr_troopa5_tattle] - - [0x1C, 0x06C, actor_bowser_phase_1_tattle] - - [0x1C, 0x06D, actor_bowser_phase_2_tattle] - - [0x1C, 0x06E, actor_bowser_phase_3_tattle] - - [0x1C, 0x06F, actor_kent_c_koopa_tattle] - - [0x1C, 0x070, actor_blooper_tattle] - - [0x1C, 0x071, actor_electro_blooper_tattle] - - [0x1C, 0x072, actor_super_blooper_tattle] - - [0x1C, 0x073, actor_blooper_baby_tattle] - - [0x1C, 0x074, actor_the_master_1_tattle] - - [0x1C, 0x075, actor_the_master_2_tattle] - - [0x1C, 0x076, actor_the_master_3_tattle] - - [0x1C, 0x077, actor_chan_tattle] - - [0x1C, 0x078, actor_lee_tattle] - - [0x1C, 0x079, actor_gloomba_tattle] - - [0x1C, 0x07A, actor_paragloomba_tattle] - - [0x1C, 0x07B, actor_spiked_gloomba_tattle] - - [0x1C, 0x07C, actor_dark_koopa_tattle] - - [0x1C, 0x07D, actor_dark_paratroopa_tattle] - - [0x1C, 0x07E, actor_red_magikoopa_tattle] - - [0x1C, 0x07F, actor_flying_red_magikoopa_tattle] - - [0x1C, 0x080, actor_green_magikoopa_tattle] - - [0x1C, 0x081, actor_flying_green_magikoopa_tattle] - - [0x1C, 0x082, actor_yellow_magikoopa_tattle] - - [0x1C, 0x083, actor_flying_yellow_magikoopa_tattle] - - [0x1C, 0x084, actor_gray_magikoopa_tattle] - - [0x1C, 0x085, actor_flying_gray_magikoopa_tattle] - - [0x1C, 0x086, actor_flying_white_magikoopa_tattle] - - [0x1C, 0x087, actor_white_magikoopa_tattle] - - [0x1C, 0x088, actor_magikoopa_boss_tattle] - - [0x1C, 0x089, actor_magikoopa_boss_dup_tattle] - - [0x1C, 0x08A, actor_lee_watt_tattle] - - [0x1C, 0x08B, actor_lee_kooper_tattle] - - [0x1C, 0x08C, actor_lee_goombario_tattle] - - [0x1C, 0x08D, actor_lee_sushie_tattle] - - [0x1C, 0x08E, actor_lee_lakilester_tattle] - - [0x1C, 0x08F, actor_lee_parakarry_tattle] - - [0x1C, 0x090, actor_lee_bombette_tattle] - - [0x1C, 0x091, actor_lee_bow_tattle] - - [0x1C, 0x092, actor_mario_tattle] - - [0x1C, 0x093, actor_slot_machine_start_tattle] - - [0x1C, 0x094, actor_slot_machine_stop_tattle] - - [0x1C, 0x095, actor_whacka_tattle] + - [0x1C, 0x0000, actor_goomba_tattle] + - [0x1C, 0x0001, actor_spiked_goomba_tattle] + - [0x1C, 0x0002, actor_paragoomba_tattle] + - [0x1C, 0x0003, actor_red_goomba_boss_tattle] + - [0x1C, 0x0004, actor_blue_goomba_boss_tattle] + - [0x1C, 0x0005, actor_goomba_king_tattle] + - [0x1C, 0x0006, actor_goomnut_tree_tattle] + - [0x1C, 0x0007, actor_koopa_troopa_tattle] + - [0x1C, 0x0008, actor_paratroopa_tattle] + - [0x1C, 0x0009, actor_fuzzy_tattle] + - [0x1C, 0x000A, actor_bob_omb_tattle] + - [0x1C, 0x000B, actor_bullet_bill_tattle] + - [0x1C, 0x000C, actor_bill_blaster_tattle] + - [0x1C, 0x000D, actor_fake_bowser_tattle] + - [0x1C, 0x000E, actor_red_ninjakoopa_tattle] + - [0x1C, 0x000F, actor_blue_ninjakoopa_tattle] + - [0x1C, 0x0010, actor_yellow_ninjakoopa_tattle] + - [0x1C, 0x0011, actor_green_ninjakoopa_tattle] + - [0x1C, 0x0012, actor_koopa_bros_tattle] + - [0x1C, 0x0013, actor_jr_troopa1_tattle] + - [0x1C, 0x0014, actor_monty_mole_tattle] + - [0x1C, 0x0015, actor_cleft_tattle] + - [0x1C, 0x0016, actor_pokey_tattle] + - [0x1C, 0x0017, actor_bandit_tattle] + - [0x1C, 0x0018, actor_pokey_mummy_tattle] + - [0x1C, 0x0019, actor_buzzy_beetle_tattle] + - [0x1C, 0x001A, actor_swooper_tattle] + - [0x1C, 0x001B, actor_buzzar_tattle] + - [0x1C, 0x001C, actor_tutankoopa_tattle] + - [0x1C, 0x001D, actor_chomp_tattle] + - [0x1C, 0x001E, actor_stone_chomp_tattle] + - [0x1C, 0x001F, actor_piranha_plant_tattle] + - [0x1C, 0x0020, actor_forest_fuzzy_tattle] + - [0x1C, 0x0021, actor_hyper_goomba_tattle] + - [0x1C, 0x0022, actor_hyper_paragoomba_tattle] + - [0x1C, 0x0023, actor_hyper_cleft_tattle] + - [0x1C, 0x0024, actor_clubba_tattle] + - [0x1C, 0x0025, actor_tubba_blubba_invincible_tattle] + - [0x1C, 0x0026, actor_tubba_heart_tattle] + - [0x1C, 0x0027, actor_tubba_blubba_tattle] + - [0x1C, 0x0028, actor_jr_troopa2_tattle] + - [0x1C, 0x0029, actor_shy_guy_tattle] + - [0x1C, 0x002A, actor_groove_guy_tattle] + - [0x1C, 0x002B, actor_spy_guy_tattle] + - [0x1C, 0x002C, actor_pyro_guy_tattle] + - [0x1C, 0x002D, actor_sky_guy_tattle] + - [0x1C, 0x002E, actor_medi_guy_tattle] + - [0x1C, 0x002F, actor_anti_guy_tattle] + - [0x1C, 0x0030, actor_big_lantern_ghost_tattle] + - [0x1C, 0x0031, actor_general_guy_tattle] + - [0x1C, 0x0032, actor_shy_squad_tattle] + - [0x1C, 0x0033, actor_shy_stack_tattle] + - [0x1C, 0x0034, actor_stilt_guy_tattle] + - [0x1C, 0x0035, actor_hurt_plant_tattle] + - [0x1C, 0x0036, actor_m_bush_tattle] + - [0x1C, 0x0037, actor_jungle_fuzzy_tattle] + - [0x1C, 0x0038, actor_spear_guy_tattle] + - [0x1C, 0x0039, actor_putrid_piranha_tattle] + - [0x1C, 0x003A, actor_lava_bubble_tattle] + - [0x1C, 0x003B, actor_spike_top_tattle] + - [0x1C, 0x003C, actor_lava_piranha_phase_1_tattle] + - [0x1C, 0x003D, actor_lava_piranha_phase_2_tattle] + - [0x1C, 0x003E, actor_lava_bud_phase_1_tattle] + - [0x1C, 0x003F, actor_lava_bud_phase_2_tattle] + - [0x1C, 0x0040, actor_petit_piranha_tattle] + - [0x1C, 0x0041, actor_jr_troopa3_tattle] + - [0x1C, 0x0042, actor_lakitu_tattle] + - [0x1C, 0x0043, actor_spiny_tattle] + - [0x1C, 0x0044, actor_bzzap_tattle] + - [0x1C, 0x0045, actor_crazee_dayzee_tattle] + - [0x1C, 0x0046, actor_amazy_dayzee_tattle] + - [0x1C, 0x0047, actor_monty_mole_boss_tattle] + - [0x1C, 0x0048, actor_spike_tattle] + - [0x1C, 0x0049, actor_ruff_puff_tattle] + - [0x1C, 0x004A, actor_huff_n_puff_tattle] + - [0x1C, 0x004B, actor_tuff_puff_tattle] + - [0x1C, 0x004C, actor_jr_troopa4_tattle] + - [0x1C, 0x004D, actor_gulpit_tattle] + - [0x1C, 0x004E, actor_gulpit_rocks_tattle] + - [0x1C, 0x004F, actor_monstar_tattle] + - [0x1C, 0x0050, actor_frost_piranha_tattle] + - [0x1C, 0x0051, actor_white_clubba_tattle] + - [0x1C, 0x0052, actor_duplighost_tattle] + - [0x1C, 0x0053, actor_ghost_watt_tattle] + - [0x1C, 0x0054, actor_ghost_kooper_tattle] + - [0x1C, 0x0055, actor_ghost_goombario_tattle] + - [0x1C, 0x0056, actor_ghost_sushie_tattle] + - [0x1C, 0x0057, actor_ghost_lakilester_tattle] + - [0x1C, 0x0058, actor_ghost_parakarry_tattle] + - [0x1C, 0x0059, actor_ghost_bombette_tattle] + - [0x1C, 0x005A, actor_ghost_bow_tattle] + - [0x1C, 0x005B, actor_albino_dino_tattle] + - [0x1C, 0x005C, actor_swoopula_tattle] + - [0x1C, 0x005D, actor_crystal_king_tattle] + - [0x1C, 0x005E, actor_crystal_clone_tattle] + - [0x1C, 0x005F, actor_crystal_bit_tattle] + - [0x1C, 0x0060, actor_ember_tattle] + - [0x1C, 0x0061, actor_dry_bones_tattle] + - [0x1C, 0x0062, actor_bony_beetle_tattle] + - [0x1C, 0x0063, actor_magikoopa_tattle] + - [0x1C, 0x0064, actor_magiclone_tattle] + - [0x1C, 0x0065, actor_magikoopa_dup_tattle] + - [0x1C, 0x0066, actor_magiclone_dup_tattle] + - [0x1C, 0x0067, actor_koopatrol_tattle] + - [0x1C, 0x0068, actor_hammer_bros_tattle] + - [0x1C, 0x0069, actor_bombshell_bill_tattle] + - [0x1C, 0x006A, actor_bombshell_blaster_tattle] + - [0x1C, 0x006B, actor_jr_troopa5_tattle] + - [0x1C, 0x006C, actor_bowser_phase_1_tattle] + - [0x1C, 0x006D, actor_bowser_phase_2_tattle] + - [0x1C, 0x006E, actor_bowser_phase_3_tattle] + - [0x1C, 0x006F, actor_kent_c_koopa_tattle] + - [0x1C, 0x0070, actor_blooper_tattle] + - [0x1C, 0x0071, actor_electro_blooper_tattle] + - [0x1C, 0x0072, actor_super_blooper_tattle] + - [0x1C, 0x0073, actor_blooper_baby_tattle] + - [0x1C, 0x0074, actor_the_master_1_tattle] + - [0x1C, 0x0075, actor_the_master_2_tattle] + - [0x1C, 0x0076, actor_the_master_3_tattle] + - [0x1C, 0x0077, actor_chan_tattle] + - [0x1C, 0x0078, actor_lee_tattle] + - [0x1C, 0x0079, actor_gloomba_tattle] + - [0x1C, 0x007A, actor_paragloomba_tattle] + - [0x1C, 0x007B, actor_spiked_gloomba_tattle] + - [0x1C, 0x007C, actor_dark_koopa_tattle] + - [0x1C, 0x007D, actor_dark_paratroopa_tattle] + - [0x1C, 0x007E, actor_red_magikoopa_tattle] + - [0x1C, 0x007F, actor_flying_red_magikoopa_tattle] + - [0x1C, 0x0080, actor_green_magikoopa_tattle] + - [0x1C, 0x0081, actor_flying_green_magikoopa_tattle] + - [0x1C, 0x0082, actor_yellow_magikoopa_tattle] + - [0x1C, 0x0083, actor_flying_yellow_magikoopa_tattle] + - [0x1C, 0x0084, actor_gray_magikoopa_tattle] + - [0x1C, 0x0085, actor_flying_gray_magikoopa_tattle] + - [0x1C, 0x0086, actor_flying_white_magikoopa_tattle] + - [0x1C, 0x0087, actor_white_magikoopa_tattle] + - [0x1C, 0x0088, actor_magikoopa_boss_tattle] + - [0x1C, 0x0089, actor_magikoopa_boss_dup_tattle] + - [0x1C, 0x008A, actor_lee_watt_tattle] + - [0x1C, 0x008B, actor_lee_kooper_tattle] + - [0x1C, 0x008C, actor_lee_goombario_tattle] + - [0x1C, 0x008D, actor_lee_sushie_tattle] + - [0x1C, 0x008E, actor_lee_lakilester_tattle] + - [0x1C, 0x008F, actor_lee_parakarry_tattle] + - [0x1C, 0x0090, actor_lee_bombette_tattle] + - [0x1C, 0x0091, actor_lee_bow_tattle] + - [0x1C, 0x0092, actor_mario_tattle] + - [0x1C, 0x0093, actor_slot_machine_start_tattle] + - [0x1C, 0x0094, actor_slot_machine_stop_tattle] + - [0x1C, 0x0095, actor_whacka_tattle] - - [0x1D, 0x007, party_goombario] - - [0x1D, 0x008, party_kooper] - - [0x1D, 0x009, party_bombette] - - [0x1D, 0x00A, party_parakarry] - - [0x1D, 0x00B, party_goompa] - - [0x1D, 0x00C, party_watt] - - [0x1D, 0x00D, party_sushie] - - [0x1D, 0x00E, party_lakilester] - - [0x1D, 0x00F, party_bow] - - [0x1D, 0x010, party_goombaria] - - [0x1D, 0x011, party_twink] - - [0x1D, 0x012, party_peach] - - [0x1D, 0x013, party_mario] + - [0x1D, 0x0007, party_goombario] + - [0x1D, 0x0008, party_kooper] + - [0x1D, 0x0009, party_bombette] + - [0x1D, 0x000A, party_parakarry] + - [0x1D, 0x000B, party_goompa] + - [0x1D, 0x000C, party_watt] + - [0x1D, 0x000D, party_sushie] + - [0x1D, 0x000E, party_lakilester] + - [0x1D, 0x000F, party_bow] + - [0x1D, 0x0010, party_goombaria] + - [0x1D, 0x0011, party_twink] + - [0x1D, 0x0012, party_peach] + - [0x1D, 0x0013, party_mario] - - [0x1D, 0x071, merlee_increase_atk, battle_popup] - - [0x1D, 0x072, merlee_increase_dmg, battle_popup] - - [0x1D, 0x073, merlee_increase_star_points, battle_popup] - - [0x1D, 0x074, merlee_increase_coins, battle_popup] - - [0x1D, 0x075, merlee_end, battle_popup] - - [0x1D, 0x076, charge_hammer, battle_popup] - - [0x1D, 0x077, charge_hammer_more, battle_popup] - - [0x1D, 0x078, charge_jump, battle_popup] - - [0x1D, 0x079, charge_jump_more, battle_popup] - - [0x1D, 0x07A, charge_max, battle_popup] - - [0x1D, 0x07B, enemy_missed, battle_popup] - - [0x1D, 0x07C, partner_dazed, battle_popup] - - [0x1D, 0x07D, charge_goombario, battle_popup] - - [0x1D, 0x07E, charge_goombario_more, battle_popup] - - [0x1D, 0x07F, star_energy_increased, battle_popup] - - [0x1D, 0x080, star_energy_filled, battle_popup] - - [0x1D, 0x081, star_energy_max, battle_popup] - - [0x1D, 0x082, atk_up_n, battle_popup] - - [0x1D, 0x083, def_up_n, battle_popup] + - [0x1D, 0x0071, merlee_increase_atk, battle_popup] + - [0x1D, 0x0072, merlee_increase_dmg, battle_popup] + - [0x1D, 0x0073, merlee_increase_star_points, battle_popup] + - [0x1D, 0x0074, merlee_increase_coins, battle_popup] + - [0x1D, 0x0075, merlee_end, battle_popup] + - [0x1D, 0x0076, charge_hammer, battle_popup] + - [0x1D, 0x0077, charge_hammer_more, battle_popup] + - [0x1D, 0x0078, charge_jump, battle_popup] + - [0x1D, 0x0079, charge_jump_more, battle_popup] + - [0x1D, 0x007A, charge_max, battle_popup] + - [0x1D, 0x007B, enemy_missed, battle_popup] + - [0x1D, 0x007C, partner_dazed, battle_popup] + - [0x1D, 0x007D, charge_goombario, battle_popup] + - [0x1D, 0x007E, charge_goombario_more, battle_popup] + - [0x1D, 0x007F, star_energy_increased, battle_popup] + - [0x1D, 0x0080, star_energy_filled, battle_popup] + - [0x1D, 0x0081, star_energy_max, battle_popup] + - [0x1D, 0x0082, atk_up_n, battle_popup] + - [0x1D, 0x0083, def_up_n, battle_popup] - - [0x1D, 0x086, enemy_transparent, battle_popup] - - [0x1D, 0x087, enemy_electric_charge, battle_popup] + - [0x1D, 0x0086, enemy_transparent, battle_popup] + - [0x1D, 0x0087, enemy_electric_charge, battle_popup] - - [0x1D, 0x088, player_dazed, battle_popup] - - [0x1D, 0x089, player_poisoned, battle_popup] - - [0x1D, 0x08A, player_frozen, battle_popup] - - [0x1D, 0x08B, player_slept, battle_popup] - - [0x1D, 0x08C, player_shrunk, battle_popup] - - [0x1D, 0x08D, player_paralyzed, battle_popup] - - [0x1D, 0x08E, player_electrified, battle_popup] - - [0x1D, 0x08F, player_transparent, battle_popup] - - [0x1D, 0x090, enemy_dazed, battle_popup] - - [0x1D, 0x091, enemy_poisoned, battle_popup] - - [0x1D, 0x092, enemy_frozen, battle_popup] - - [0x1D, 0x093, enemy_slept, battle_popup] - - [0x1D, 0x094, enemy_shrunk, battle_popup] - - [0x1D, 0x095, enemy_paralyzed, battle_popup] - - [0x1D, 0x096, enemy_electrified, battle_popup] - - [0x1D, 0x097, enemy_cannot_move, battle_popup] - - [0x1D, 0x098, water_block_active, battle_popup] - - [0x1D, 0x099, water_block_end, battle_popup] - - [0x1D, 0x09A, cloud_nine_active, battle_popup] - - [0x1D, 0x09B, cloud_nine_end, battle_popup] - - [0x1D, 0x09B, cloud_nine_end, battle_popup] - - [0x1D, 0x09C, atk_up_active, battle_popup] - - [0x1D, 0x09D, atk_up_end, battle_popup] - - [0x1D, 0x09E, enemy_atk_down, battle_popup] + - [0x1D, 0x0088, player_dazed, battle_popup] + - [0x1D, 0x0089, player_poisoned, battle_popup] + - [0x1D, 0x008A, player_frozen, battle_popup] + - [0x1D, 0x008B, player_slept, battle_popup] + - [0x1D, 0x008C, player_shrunk, battle_popup] + - [0x1D, 0x008D, player_paralyzed, battle_popup] + - [0x1D, 0x008E, player_electrified, battle_popup] + - [0x1D, 0x008F, player_transparent, battle_popup] + - [0x1D, 0x0090, enemy_dazed, battle_popup] + - [0x1D, 0x0091, enemy_poisoned, battle_popup] + - [0x1D, 0x0092, enemy_frozen, battle_popup] + - [0x1D, 0x0093, enemy_slept, battle_popup] + - [0x1D, 0x0094, enemy_shrunk, battle_popup] + - [0x1D, 0x0095, enemy_paralyzed, battle_popup] + - [0x1D, 0x0096, enemy_electrified, battle_popup] + - [0x1D, 0x0097, enemy_cannot_move, battle_popup] + - [0x1D, 0x0098, water_block_active, battle_popup] + - [0x1D, 0x0099, water_block_end, battle_popup] + - [0x1D, 0x009A, cloud_nine_active, battle_popup] + - [0x1D, 0x009B, cloud_nine_end, battle_popup] + - [0x1D, 0x009B, cloud_nine_end, battle_popup] + - [0x1D, 0x009C, atk_up_active, battle_popup] + - [0x1D, 0x009D, atk_up_end, battle_popup] + - [0x1D, 0x009E, enemy_atk_down, battle_popup] - - [0x1D, 0x0AF, action_cmd_jump, action_command] - - [0x1D, 0x0B0, action_cmd_hammer, action_command] + - [0x1D, 0x00AF, action_cmd_jump, action_command] + - [0x1D, 0x00B0, action_cmd_hammer, action_command] - - [0x1D, 0x0C0, no_target_jump, battle_popup] - - [0x1D, 0x0C1, no_target_hammer, battle_popup] - - [0x1D, 0x0C2, no_battle_items, battle_popup] + - [0x1D, 0x00C0, no_target_jump, battle_popup] + - [0x1D, 0x00C1, no_target_hammer, battle_popup] + - [0x1D, 0x00C2, no_battle_items, battle_popup] - - [0x1D, 0x0C6, hammer_disabled, battle_popup] - - [0x1D, 0x0C7, jump_disabled, battle_popup] - - [0x1D, 0x0C8, items_disabled, battle_popup] - - [0x1D, 0x0C9, no_switch_used_turn, battle_popup] - - [0x1D, 0x0CA, no_switch_dazed, battle_popup] + - [0x1D, 0x00C6, hammer_disabled, battle_popup] + - [0x1D, 0x00C7, jump_disabled, battle_popup] + - [0x1D, 0x00C8, items_disabled, battle_popup] + - [0x1D, 0x00C9, no_switch_used_turn, battle_popup] + - [0x1D, 0x00CA, no_switch_dazed, battle_popup] - - [0x1D, 0x167, kmr_12_sign_trap] - - [0x1D, 0x168, kmr_12_sign_to_fortress] + - [0x1D, 0x0168, kmr_12_sign_to_fortress] + - [0x1D, 0x0167, kmr_12_sign_trap] - - [0x29, 0x000, actor_goomba] - - [0x29, 0x001, actor_spiked_goomba] - - [0x29, 0x002, actor_paragoomba] - - [0x29, 0x003, actor_red_goomba_boss] - - [0x29, 0x004, actor_blue_goomba_boss] - - [0x29, 0x005, actor_goomba_king] - - [0x29, 0x006, actor_goomnut_tree] - - [0x29, 0x007, actor_koopa_troopa] - - [0x29, 0x008, actor_paratroopa] - - [0x29, 0x009, actor_fuzzy] - - [0x29, 0x00A, actor_bob_omb] - - [0x29, 0x00B, actor_bullet_bill] - - [0x29, 0x00C, actor_bill_blaster] - - [0x29, 0x00D, actor_fake_bowser] - - [0x29, 0x00E, actor_red_ninjakoopa] - - [0x29, 0x00F, actor_blue_ninjakoopa] - - [0x29, 0x010, actor_yellow_ninjakoopa] - - [0x29, 0x011, actor_green_ninjakoopa] - - [0x29, 0x012, actor_koopa_bros] - - [0x29, 0x013, actor_jr_troopa] - - [0x29, 0x014, actor_monty_mole] - - [0x29, 0x015, actor_cleft] - - [0x29, 0x016, actor_pokey] - - [0x29, 0x017, actor_bandit] - - [0x29, 0x018, actor_pokey_mummy] - - [0x29, 0x019, actor_buzzy_beetle] - - [0x29, 0x01A, actor_swooper] - - [0x29, 0x01B, actor_buzzar] - - [0x29, 0x01C, actor_tutankoopa] - - [0x29, 0x01D, actor_chomp] - - [0x29, 0x01E, actor_stone_chomp] - - [0x29, 0x01F, actor_piranha_plant] - - [0x29, 0x020, actor_forest_fuzzy] - - [0x29, 0x021, actor_hyper_goomba] - - [0x29, 0x022, actor_hyper_paragoomba] - - [0x29, 0x023, actor_hyper_cleft] - - [0x29, 0x024, actor_clubba] - - [0x29, 0x025, actor_tubba_blubba] - - [0x29, 0x026, actor_tubba_heart] - - [0x29, 0x027, actor_shy_guy] - - [0x29, 0x028, actor_groove_guy] - - [0x29, 0x029, actor_spy_guy] - - [0x29, 0x02A, actor_pyro_guy] - - [0x29, 0x02B, actor_sky_guy] - - [0x29, 0x02C, actor_medi_guy] - - [0x29, 0x02D, actor_anti_guy] - - [0x29, 0x02E, actor_big_lantern_ghost] - - [0x29, 0x02F, actor_general_guy] - - [0x29, 0x030, actor_shy_squad] - - [0x29, 0x031, actor_shy_stack] - - [0x29, 0x032, actor_stilt_guy] - - [0x29, 0x033, actor_hurt_plant] - - [0x29, 0x034, actor_m_bush] - - [0x29, 0x035, actor_jungle_fuzzy] - - [0x29, 0x036, actor_spear_guy] - - [0x29, 0x037, actor_putrid_piranha] - - [0x29, 0x038, actor_lava_bubble] - - [0x29, 0x039, actor_spike_top] - - [0x29, 0x03A, actor_lava_piranha] - - [0x29, 0x03B, actor_lava_bud] - - [0x29, 0x03C, actor_petit_piranha] - - [0x29, 0x03D, actor_lakitu] - - [0x29, 0x03E, actor_spiny] - - [0x29, 0x03F, actor_bzzap] - - [0x29, 0x040, actor_crazee_dayzee] - - [0x29, 0x041, actor_amazy_dayzee] - - [0x29, 0x042, actor_monty_mole_boss] - - [0x29, 0x043, actor_spike] - - [0x29, 0x044, actor_ruff_puff] - - [0x29, 0x045, actor_huff_n_puff] - - [0x29, 0x046, actor_tuff_puff] - - [0x29, 0x047, actor_gulpit] - - [0x29, 0x048, actor_gulpit_rocks] - - [0x29, 0x049, actor_monstar] - - [0x29, 0x04A, actor_frost_piranha] - - [0x29, 0x04B, actor_white_clubba] - - [0x29, 0x04C, actor_duplighost] - - [0x29, 0x04D, actor_ghost_watt] - - [0x29, 0x04E, actor_ghost_kooper] - - [0x29, 0x04F, actor_ghost_goombario] - - [0x29, 0x050, actor_ghost_sushie] - - [0x29, 0x051, actor_ghost_lakilester] - - [0x29, 0x052, actor_ghost_parakarry] - - [0x29, 0x053, actor_ghost_bombette] - - [0x29, 0x054, actor_ghost_bow] - - [0x29, 0x055, actor_albino_dino] - - [0x29, 0x056, actor_swoopula] - - [0x29, 0x057, actor_crystal_king] - - [0x29, 0x058, actor_crystal_bit] - - [0x29, 0x059, actor_ember] - - [0x29, 0x05A, actor_dry_bones] - - [0x29, 0x05B, actor_bony_beetle] - - [0x29, 0x05C, actor_magikoopa] - - [0x29, 0x05D, actor_koopatrol] - - [0x29, 0x05E, actor_hammer_bros] - - [0x29, 0x05F, actor_bombshell_bill] - - [0x29, 0x060, actor_bombshell_blaster] - - [0x29, 0x061, actor_bowser] - - [0x29, 0x062, actor_kammy_koopa] - - [0x29, 0x063, actor_kent_c_koopa] - - [0x29, 0x064, actor_blooper] - - [0x29, 0x065, actor_electro_blooper] - - [0x29, 0x066, actor_super_blooper] - - [0x29, 0x067, actor_blooper_baby] - - [0x29, 0x068, actor_the_master] - - [0x29, 0x069, actor_chan] - - [0x29, 0x06A, actor_lee] - - [0x29, 0x06B, actor_gloomba] - - [0x29, 0x06C, actor_paragloomba] - - [0x29, 0x06D, actor_spiked_gloomba] - - [0x29, 0x06E, actor_dark_koopa] - - [0x29, 0x06F, actor_dark_paratroopa] - - [0x29, 0x070, actor_red_magikoopa] - - [0x29, 0x071, actor_green_magikoopa] - - [0x29, 0x072, actor_yellow_magikoopa] - - [0x29, 0x073, actor_gray_magikoopa] - - [0x29, 0x074, actor_white_magikoopa] - - [0x29, 0x075, actor_mario] - - [0x29, 0x076, actor_slot_machine_start] - - [0x29, 0x077, actor_slot_machine_stop] - - [0x29, 0x078, actor_whacka] - - [0x29, 0x079, actor_general_guy_dup] - - [0x29, 0x07A, actor_bulb] - - [0x29, 0x07B, actor_shy_squad_dup] - - [0x29, 0x07C, actor_fuzzipede] - - [0x29, 0x07D, actor_monty_hole] - - [0x29, 0x07E, actor_balloon] - - [0x29, 0x07F, actor_lantern] - - [0x29, 0x080, actor_aqua_fuzzy] - - [0x29, 0x081, actor_red_goomba] - - [0x29, 0x082, actor_red_paragoomba] + - [0x29, 0x0000, actor_goomba] + - [0x29, 0x0001, actor_spiked_goomba] + - [0x29, 0x0002, actor_paragoomba] + - [0x29, 0x0003, actor_red_goomba_boss] + - [0x29, 0x0004, actor_blue_goomba_boss] + - [0x29, 0x0005, actor_goomba_king] + - [0x29, 0x0006, actor_goomnut_tree] + - [0x29, 0x0007, actor_koopa_troopa] + - [0x29, 0x0008, actor_paratroopa] + - [0x29, 0x0009, actor_fuzzy] + - [0x29, 0x000A, actor_bob_omb] + - [0x29, 0x000B, actor_bullet_bill] + - [0x29, 0x000C, actor_bill_blaster] + - [0x29, 0x000D, actor_fake_bowser] + - [0x29, 0x000E, actor_red_ninjakoopa] + - [0x29, 0x000F, actor_blue_ninjakoopa] + - [0x29, 0x0010, actor_yellow_ninjakoopa] + - [0x29, 0x0011, actor_green_ninjakoopa] + - [0x29, 0x0012, actor_koopa_bros] + - [0x29, 0x0013, actor_jr_troopa] + - [0x29, 0x0014, actor_monty_mole] + - [0x29, 0x0015, actor_cleft] + - [0x29, 0x0016, actor_pokey] + - [0x29, 0x0017, actor_bandit] + - [0x29, 0x0018, actor_pokey_mummy] + - [0x29, 0x0019, actor_buzzy_beetle] + - [0x29, 0x001A, actor_swooper] + - [0x29, 0x001B, actor_buzzar] + - [0x29, 0x001C, actor_tutankoopa] + - [0x29, 0x001D, actor_chomp] + - [0x29, 0x001E, actor_stone_chomp] + - [0x29, 0x001F, actor_piranha_plant] + - [0x29, 0x0020, actor_forest_fuzzy] + - [0x29, 0x0021, actor_hyper_goomba] + - [0x29, 0x0022, actor_hyper_paragoomba] + - [0x29, 0x0023, actor_hyper_cleft] + - [0x29, 0x0024, actor_clubba] + - [0x29, 0x0025, actor_tubba_blubba] + - [0x29, 0x0026, actor_tubba_heart] + - [0x29, 0x0027, actor_shy_guy] + - [0x29, 0x0028, actor_groove_guy] + - [0x29, 0x0029, actor_spy_guy] + - [0x29, 0x002A, actor_pyro_guy] + - [0x29, 0x002B, actor_sky_guy] + - [0x29, 0x002C, actor_medi_guy] + - [0x29, 0x002D, actor_anti_guy] + - [0x29, 0x002E, actor_big_lantern_ghost] + - [0x29, 0x002F, actor_general_guy] + - [0x29, 0x0030, actor_shy_squad] + - [0x29, 0x0031, actor_shy_stack] + - [0x29, 0x0032, actor_stilt_guy] + - [0x29, 0x0033, actor_hurt_plant] + - [0x29, 0x0034, actor_m_bush] + - [0x29, 0x0035, actor_jungle_fuzzy] + - [0x29, 0x0036, actor_spear_guy] + - [0x29, 0x0037, actor_putrid_piranha] + - [0x29, 0x0038, actor_lava_bubble] + - [0x29, 0x0039, actor_spike_top] + - [0x29, 0x003A, actor_lava_piranha] + - [0x29, 0x003B, actor_lava_bud] + - [0x29, 0x003C, actor_petit_piranha] + - [0x29, 0x003D, actor_lakitu] + - [0x29, 0x003E, actor_spiny] + - [0x29, 0x003F, actor_bzzap] + - [0x29, 0x0040, actor_crazee_dayzee] + - [0x29, 0x0041, actor_amazy_dayzee] + - [0x29, 0x0042, actor_monty_mole_boss] + - [0x29, 0x0043, actor_spike] + - [0x29, 0x0044, actor_ruff_puff] + - [0x29, 0x0045, actor_huff_n_puff] + - [0x29, 0x0046, actor_tuff_puff] + - [0x29, 0x0047, actor_gulpit] + - [0x29, 0x0048, actor_gulpit_rocks] + - [0x29, 0x0049, actor_monstar] + - [0x29, 0x004A, actor_frost_piranha] + - [0x29, 0x004B, actor_white_clubba] + - [0x29, 0x004C, actor_duplighost] + - [0x29, 0x004D, actor_ghost_watt] + - [0x29, 0x004E, actor_ghost_kooper] + - [0x29, 0x004F, actor_ghost_goombario] + - [0x29, 0x0050, actor_ghost_sushie] + - [0x29, 0x0051, actor_ghost_lakilester] + - [0x29, 0x0052, actor_ghost_parakarry] + - [0x29, 0x0053, actor_ghost_bombette] + - [0x29, 0x0054, actor_ghost_bow] + - [0x29, 0x0055, actor_albino_dino] + - [0x29, 0x0056, actor_swoopula] + - [0x29, 0x0057, actor_crystal_king] + - [0x29, 0x0058, actor_crystal_bit] + - [0x29, 0x0059, actor_ember] + - [0x29, 0x005A, actor_dry_bones] + - [0x29, 0x005B, actor_bony_beetle] + - [0x29, 0x005C, actor_magikoopa] + - [0x29, 0x005D, actor_koopatrol] + - [0x29, 0x005E, actor_hammer_bros] + - [0x29, 0x005F, actor_bombshell_bill] + - [0x29, 0x0060, actor_bombshell_blaster] + - [0x29, 0x0061, actor_bowser] + - [0x29, 0x0062, actor_kammy_koopa] + - [0x29, 0x0063, actor_kent_c_koopa] + - [0x29, 0x0064, actor_blooper] + - [0x29, 0x0065, actor_electro_blooper] + - [0x29, 0x0066, actor_super_blooper] + - [0x29, 0x0067, actor_blooper_baby] + - [0x29, 0x0068, actor_the_master] + - [0x29, 0x0069, actor_chan] + - [0x29, 0x006A, actor_lee] + - [0x29, 0x006B, actor_gloomba] + - [0x29, 0x006C, actor_paragloomba] + - [0x29, 0x006D, actor_spiked_gloomba] + - [0x29, 0x006E, actor_dark_koopa] + - [0x29, 0x006F, actor_dark_paratroopa] + - [0x29, 0x0070, actor_red_magikoopa] + - [0x29, 0x0071, actor_green_magikoopa] + - [0x29, 0x0072, actor_yellow_magikoopa] + - [0x29, 0x0073, actor_gray_magikoopa] + - [0x29, 0x0074, actor_white_magikoopa] + - [0x29, 0x0075, actor_mario] + - [0x29, 0x0076, actor_slot_machine_start] + - [0x29, 0x0077, actor_slot_machine_stop] + - [0x29, 0x0078, actor_whacka] + - [0x29, 0x0079, actor_general_guy_dup] + - [0x29, 0x007A, actor_bulb] + - [0x29, 0x007B, actor_shy_squad_dup] + - [0x29, 0x007C, actor_fuzzipede] + - [0x29, 0x007D, actor_monty_hole] + - [0x29, 0x007E, actor_balloon] + - [0x29, 0x007F, actor_lantern] + - [0x29, 0x0080, actor_aqua_fuzzy] + - [0x29, 0x0081, actor_red_goomba] + - [0x29, 0x0082, actor_red_paragoomba] - [0x1C84D30, bin] # junk(?) - [0x1E00000, bin] # junk (player sprite data; can be zeroed out with no effect) - [0x1E40000, PaperMarioMapFS] diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index a237271082..741e6c0d28 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -11937,22 +11937,22 @@ func_80240248_BDA9F8 = 0x80240248; // type:func rom:0xBDA9F8 func_80240350_BDAB00 = 0x80240350; // type:func rom:0xBDAB00 func_802403F0_BDABA0 = 0x802403F0; // type:func rom:0xBDABA0 D_802429E8_BDD198 = 0x802429E8; // type:data rom:0xBDD198 -func_80240000_BDD1B0 = 0x80240000; // type:func rom:0xBDD1B0 +arn_02_func_80240000_BDD1B0 = 0x80240000; // type:func rom:0xBDD1B0 arn_02_UnkNpcAIFunc18 = 0x80240160; // type:func rom:0xBDD310 -func_802401D4_BDD384 = 0x802401D4; // type:func rom:0xBDD384 +arn_02_func_802401D4_BDD384 = 0x802401D4; // type:func rom:0xBDD384 arn_02_UnkNpcAIFunc21 = 0x80240304; // type:func rom:0xBDD4B4 arn_02_UnkNpcAIFunc20 = 0x802403A0; // type:func rom:0xBDD550 arn_02_UnkNpcAIFunc22 = 0x80240428; // type:func rom:0xBDD5D8 -func_802404D0_BDD680 = 0x802404D0; // type:func rom:0xBDD680 +arn_02_func_802404D0_BDD680 = 0x802404D0; // type:func rom:0xBDD680 arn_02_UnkNpcAIFunc16 = 0x80240644; // type:func rom:0xBDD7F4 -func_80240694_BDD844 = 0x80240694; // type:func rom:0xBDD844 -func_80240834_BDD9E4 = 0x80240834; // type:func rom:0xBDD9E4 -func_80240984_BDDB34 = 0x80240984; // type:func rom:0xBDDB34 -func_80240A30_BDDBE0 = 0x80240A30; // type:func rom:0xBDDBE0 +arn_02_func_80240694_BDD844 = 0x80240694; // type:func rom:0xBDD844 +arn_02_func_80240834_BDD9E4 = 0x80240834; // type:func rom:0xBDD9E4 +arn_02_func_80240984_BDDB34 = 0x80240984; // type:func rom:0xBDDB34 +arn_02_func_80240A30_BDDBE0 = 0x80240A30; // type:func rom:0xBDDBE0 arn_02_UnkNpcAIFunc19 = 0x80240B68; // type:func rom:0xBDDD18 arn_02_UnkNpcAIFunc17 = 0x80240BE4; // type:func rom:0xBDDD94 arn_02_UnkDurationCheck = 0x80240C4C; // type:func rom:0xBDDDFC -func_80240C90_BDDE40 = 0x80240C90; // type:func rom:0xBDDE40 +arn_02_func_80240C90_BDDE40 = 0x80240C90; // type:func rom:0xBDDE40 arn_02_entryList = 0x80240FE0; // type:data rom:0xBDE190 arn_02_config = 0x80241000; // type:data rom:0xBDE1B0 arn_02_PlayMusic = 0x80241040; // type:data rom:0xBDE1F0 @@ -11960,7 +11960,7 @@ arn_02_Exit1 = 0x802410F0; // type:data rom:0xBDE2A0 arn_02_Exit2 = 0x8024114C; // type:data rom:0xBDE2FC arn_02_BindExits = 0x802411A8; // type:data rom:0xBDE358 arn_02_Main = 0x802411F0; // type:data rom:0xBDE3A0 -arn_02_padding2 = 0x802412C4; // type:data rom:0xBDE474 +arn_02_padding = 0x802412C4; // type:data rom:0xBDE474 arn_02_MakeEntities = 0x802412D0; // type:data rom:0xBDE480 arn_02_goombaAISettings = 0x802413D0; // type:data rom:0xBDE580 arn_02_GoombaAI = 0x80241400; // type:data rom:0xBDE5B0 @@ -11977,73 +11977,144 @@ D_80241AE8_BDEC98 = 0x80241AE8; // type:data rom:0xBDEC98 D_80241AF0_BDECA0 = 0x80241AF0; // type:data rom:0xBDECA0 D_80241AF8_BDECA8 = 0x80241AF8; // type:data rom:0xBDECA8 D_80241B00_BDECB0 = 0x80241B00; // type:data rom:0xBDECB0 -func_80240000_BDED90 = 0x80240000; // type:func rom:0xBDED90 -func_80240158_BDEEE8 = 0x80240158; // type:func rom:0xBDEEE8 +arn_03_func_80240000_BDED90 = 0x80240000; // type:func rom:0xBDED90 +arn_03_func_80240158_BDEEE8 = 0x80240158; // type:func rom:0xBDEEE8 arn_03_UnkNpcAIFunc1 = 0x80240400; // type:func rom:0xBDF190 -func_802404C0_BDF250 = 0x802404C0; // type:func rom:0xBDF250 -func_8024067C_BDF40C = 0x8024067C; // type:func rom:0xBDF40C +arn_03_func_802404C0_BDF250 = 0x802404C0; // type:func rom:0xBDF250 +arn_03_func_8024067C_BDF40C = 0x8024067C; // type:func rom:0xBDF40C arn_03_NpcJumpFunc2 = 0x80240730; // type:func rom:0xBDF4C0 arn_03_NpcJumpFunc = 0x802407A4; // type:func rom:0xBDF534 arn_03_UnkNpcAIFunc13 = 0x8024081C; // type:func rom:0xBDF5AC -func_8024094C_BDF6DC = 0x8024094C; // type:func rom:0xBDF6DC +arn_03_func_8024094C_BDF6DC = 0x8024094C; // type:func rom:0xBDF6DC arn_03_UnkNpcDurationFlagFunc = 0x80240A6C; // type:func rom:0xBDF7FC -func_80240AD4_BDF864 = 0x80240AD4; // type:func rom:0xBDF864 -func_80240B94_BDF924 = 0x80240B94; // type:func rom:0xBDF924 -func_80240E90_BDFC20 = 0x80240E90; // type:func rom:0xBDFC20 -func_80241068_BDFDF8 = 0x80241068; // type:func rom:0xBDFDF8 -func_8024113C_BDFECC = 0x8024113C; // type:func rom:0xBDFECC -func_802412B0_BE0040 = 0x802412B0; // type:func rom:0xBE0040 +arn_03_func_80240AD4_BDF864 = 0x80240AD4; // type:func rom:0xBDF864 +arn_03_func_80240B94_BDF924 = 0x80240B94; // type:func rom:0xBDF924 +arn_03_func_80240E90_BDFC20 = 0x80240E90; // type:func rom:0xBDFC20 +arn_03_func_80241068_BDFDF8 = 0x80241068; // type:func rom:0xBDFDF8 +arn_03_func_8024113C_BDFECC = 0x8024113C; // type:func rom:0xBDFECC +arn_03_func_802412B0_BE0040 = 0x802412B0; // type:func rom:0xBE0040 arn_03_GetItemName = 0x80241364; // type:func rom:0xBE00F4 arn_03_GetNpcCollisionHeight = 0x802413C8; // type:func rom:0xBE0158 arn_03_SomeXYZFuncTodoRename = 0x80241424; // type:func rom:0xBE01B4 -func_802415F4_BE0384 = 0x802415F4; // type:func rom:0xBE0384 -func_80241648_BE03D8 = 0x80241648; // type:func rom:0xBE03D8 +arn_03_func_802415F4_BE0384 = 0x802415F4; // type:func rom:0xBE0384 +arn_03_func_80241648_BE03D8 = 0x80241648; // type:func rom:0xBE03D8 func_80241680_BE0410 = 0x80241680; // type:func rom:0xBE0410 +arn_03_entryList = 0x80241720; // type:data rom:0xBE04B0 +arn_03_config = 0x80241740; // type:data rom:0xBE04D0 +arn_03_PlayMusic = 0x80241780; // type:data rom:0xBE0510 +arn_03_Exit1 = 0x80241830; // type:data rom:0xBE05C0 +arn_03_Exit2 = 0x8024188C; // type:data rom:0xBE061C +arn_03_BindExits = 0x802418E8; // type:data rom:0xBE0678 +arn_03_EnterWalk = 0x80241930; // type:data rom:0xBE06C0 +arn_03_Main = 0x80241A58; // type:data rom:0xBE07E8 +arn_03_padding1 = 0x80241BB8; // type:data rom:0xBE0948 +arn_03_BooAISettings1 = 0x80241BC0; // type:data rom:0xBE0950 +arn_03_BooAI = 0x80241BF0; // type:data rom:0xBE0980 +arn_03_BooSettings1 = 0x80241C10; // type:data rom:0xBE09A0 +arn_03_BooSettings2 = 0x80241C3C; // type:data rom:0xBE09CC D_80241C68_BE09F8 = 0x80241C68; // type:data rom:0xBE09F8 +arn_03_ShowItemPackage = 0x80241C6C; // type:data rom:0xBE09FC +arn_03_D_80241C9C_BE0A2C = 0x80241C9C; // type:data rom:0xBE0A2C D_80241CCC_BE0A5C = 0x80241CCC; // type:data rom:0xBE0A5C D_80241CD0_BE0A60 = 0x80241CD0; // type:data rom:0xBE0A60 +arn_03_D_80241CD4_BE0A64 = 0x80241CD4; // type:data rom:0xBE0A64 +arn_03_D_80241E18_BE0BA8 = 0x80241E18; // type:data rom:0xBE0BA8 +arn_03_D_80241E68_BE0BF8 = 0x80241E68; // type:data rom:0xBE0BF8 +arn_03_D_80241EB0_BE0C40 = 0x80241EB0; // type:data rom:0xBE0C40 +arn_03_D_80242064_BE0DF4 = 0x80242064; // type:data rom:0xBE0DF4 +arn_03_Boo0Init = 0x802424E0; // type:data rom:0xBE1270 +arn_03_Boo1Interact = 0x8024254C; // type:data rom:0xBE12DC +arn_03_Boo1Init = 0x802428A8; // type:data rom:0xBE1638 +arn_03_D_802428CC_BE165C = 0x802428CC; // type:data rom:0xBE165C +arn_03_D_802429D4_BE1764 = 0x802429D4; // type:data rom:0xBE1764 +arn_03_D_80242B0C_BE189C = 0x80242B0C; // type:data rom:0xBE189C +arn_03_D_80242C60_BE19F0 = 0x80242C60; // type:data rom:0xBE19F0 +arn_03_Boo2Interact = 0x80242DC4; // type:data rom:0xBE1B54 +arn_03_Boo2Init = 0x802431A4; // type:data rom:0xBE1F34 +arn_03_Boo3Interact = 0x802431C8; // type:data rom:0xBE1F58 +arn_03_Boo3Init = 0x80243328; // type:data rom:0xBE20B8 +arn_03_Boo4Init = 0x8024334C; // type:data rom:0xBE20DC +arn_03_Boo0 = 0x80243378; // type:data rom:0xBE2108 +arn_03_Boo1 = 0x80243568; // type:data rom:0xBE22F8 +arn_03_Boo2 = 0x80243758; // type:data rom:0xBE24E8 +arn_03_Boo3 = 0x80243948; // type:data rom:0xBE26D8 +arn_03_Boo4 = 0x80243B38; // type:data rom:0xBE28C8 +arn_03_BooIdle = 0x80243D28; // type:data rom:0xBE2AB8 +arn_03_Boo5Init = 0x80243E90; // type:data rom:0xBE2C20 +arn_03_Boo6Init = 0x80243ECC; // type:data rom:0xBE2C5C +arn_03_Boo7Init = 0x80243F08; // type:data rom:0xBE2C98 +arn_03_Boo8Init = 0x80243F44; // type:data rom:0xBE2CD4 +arn_03_BooGroup = 0x80243F80; // type:data rom:0xBE2D10 +arn_03_npcGroupList1 = 0x80244740; // type:data rom:0xBE34D0 +arn_03_npcGroupList2 = 0x80244788; // type:data rom:0xBE3518 +arn_03_padding3 = 0x802447DC; // type:data rom:0xBE356C +arn_03_D_802447E0_BE3570 = 0x802447E0; // type:data rom:0xBE3570 D_80244860_BE35F0 = 0x80244860; // type:data rom:0xBE35F0 D_80244868_BE35F8 = 0x80244868; // type:data rom:0xBE35F8 -func_80240000_BE37B0 = 0x80240000; // type:func rom:0xBE37B0 -func_80240158_BE3908 = 0x80240158; // type:func rom:0xBE3908 +arn_04_func_80240000_BE37B0 = 0x80240000; // type:func rom:0xBE37B0 +arn_04_func_80240158_BE3908 = 0x80240158; // type:func rom:0xBE3908 arn_04_UnkNpcAIFunc1 = 0x80240400; // type:func rom:0xBE3BB0 -func_802404C0_BE3C70 = 0x802404C0; // type:func rom:0xBE3C70 -func_8024067C_BE3E2C = 0x8024067C; // type:func rom:0xBE3E2C +arn_04_func_802404C0_BE3C70 = 0x802404C0; // type:func rom:0xBE3C70 +arn_04_func_8024067C_BE3E2C = 0x8024067C; // type:func rom:0xBE3E2C arn_04_NpcJumpFunc2 = 0x80240730; // type:func rom:0xBE3EE0 arn_04_NpcJumpFunc = 0x802407A4; // type:func rom:0xBE3F54 arn_04_UnkNpcAIFunc13 = 0x8024081C; // type:func rom:0xBE3FCC -func_8024094C_BE40FC = 0x8024094C; // type:func rom:0xBE40FC +arn_04_func_8024094C_BE40FC = 0x8024094C; // type:func rom:0xBE40FC arn_04_UnkNpcDurationFlagFunc = 0x80240A6C; // type:func rom:0xBE421C -func_80240AD4_BE4284 = 0x80240AD4; // type:func rom:0xBE4284 -func_80240B94_BE4344 = 0x80240B94; // type:func rom:0xBE4344 -func_80240E90_BE4640 = 0x80240E90; // type:func rom:0xBE4640 -func_80241040_BE47F0 = 0x80241040; // type:func rom:0xBE47F0 -dup_arn_04_UnkNpcAIFunc1 = 0x80241668; // type:func rom:0xBE4E18 -func_80241728_BE4ED8 = 0x80241728; // type:func rom:0xBE4ED8 +arn_04_func_80240AD4_BE4284 = 0x80240AD4; // type:func rom:0xBE4284 +arn_04_func_80240B94_BE4344 = 0x80240B94; // type:func rom:0xBE4344 +arn_04_func_80240E90_BE4640 = 0x80240E90; // type:func rom:0xBE4640 +arn_04_func_80241040_BE47F0 = 0x80241040; // type:func rom:0xBE47F0 +arn_04_UnkNpcAIFunc1_copy = 0x80241668; // type:func rom:0xBE4E18 +arn_04_func_80241728_BE4ED8 = 0x80241728; // type:func rom:0xBE4ED8 arn_04_UnkNpcAIFunc2 = 0x80241A6C; // type:func rom:0xBE521C -func_80241AE4_BE5294 = 0x80241AE4; // type:func rom:0xBE5294 +arn_04_func_80241AE4_BE5294 = 0x80241AE4; // type:func rom:0xBE5294 arn_04_UnkNpcAIFunc14 = 0x80241B50; // type:func rom:0xBE5300 arn_04_UnkNpcAIFunc3 = 0x80241C84; // type:func rom:0xBE5434 -func_80241CE8_BE5498 = 0x80241CE8; // type:func rom:0xBE5498 -func_80242078_BE5828 = 0x80242078; // type:func rom:0xBE5828 -func_8024219C_BE594C = 0x8024219C; // type:func rom:0xBE594C +arn_04_func_80241CE8_BE5498 = 0x80241CE8; // type:func rom:0xBE5498 +arn_04_func_80242078_BE5828 = 0x80242078; // type:func rom:0xBE5828 +arn_04_func_8024219C_BE594C = 0x8024219C; // type:func rom:0xBE594C func_80242388_BE5B38 = 0x80242388; // type:func rom:0xBE5B38 arn_04_UnkNpcAIFunc18 = 0x802424E8; // type:func rom:0xBE5C98 -func_8024255C_BE5D0C = 0x8024255C; // type:func rom:0xBE5D0C +arn_04_func_8024255C_BE5D0C = 0x8024255C; // type:func rom:0xBE5D0C arn_04_UnkNpcAIFunc21 = 0x8024268C; // type:func rom:0xBE5E3C arn_04_UnkNpcAIFunc20 = 0x80242728; // type:func rom:0xBE5ED8 arn_04_UnkNpcAIFunc22 = 0x802427B0; // type:func rom:0xBE5F60 -func_80242858_BE6008 = 0x80242858; // type:func rom:0xBE6008 +arn_04_func_80242858_BE6008 = 0x80242858; // type:func rom:0xBE6008 arn_04_UnkNpcAIFunc16 = 0x802429CC; // type:func rom:0xBE617C -func_80242A1C_BE61CC = 0x80242A1C; // type:func rom:0xBE61CC -func_80242BBC_BE636C = 0x80242BBC; // type:func rom:0xBE636C -func_80242D0C_BE64BC = 0x80242D0C; // type:func rom:0xBE64BC -func_80242DB8_BE6568 = 0x80242DB8; // type:func rom:0xBE6568 +arn_04_func_80242A1C_BE61CC = 0x80242A1C; // type:func rom:0xBE61CC +arn_04_func_80242BBC_BE636C = 0x80242BBC; // type:func rom:0xBE636C +arn_04_func_80242D0C_BE64BC = 0x80242D0C; // type:func rom:0xBE64BC +arn_04_func_80242DB8_BE6568 = 0x80242DB8; // type:func rom:0xBE6568 arn_04_UnkNpcAIFunc19 = 0x80242EF0; // type:func rom:0xBE66A0 arn_04_UnkNpcAIFunc17 = 0x80242F6C; // type:func rom:0xBE671C arn_04_UnkDurationCheck = 0x80242FD4; // type:func rom:0xBE6784 -func_80243018_BE67C8 = 0x80243018; // type:func rom:0xBE67C8 -D_802436DC_BE6E8C = 0x802436DC; // type:data rom:0xBE6E8C +arn_04_func_80243018_BE67C8 = 0x80243018; // type:func rom:0xBE67C8 +arn_04_entryList = 0x80243370; // type:data rom:0xBE6B20 +arn_04_config = 0x80243390; // type:data rom:0xBE6B40 +arn_04_PlayMusic = 0x802433D0; // type:data rom:0xBE6B80 +arn_04_Exit1 = 0x80243480; // type:data rom:0xBE6C30 +arn_04_Exit2 = 0x802434DC; // type:data rom:0xBE6C8C +arn_04_ExitWalk = 0x80243538; // type:data rom:0xBE6CE8 +arn_04_main = 0x80243580; // type:data rom:0xBE6D30 +arn_04_padding1 = 0x80243654; // type:data rom:0xBE6E04 +arn_04_goombaAISettings = 0x80243660; // type:data rom:0xBE6E10 +arn_04_goombaAI = 0x80243690; // type:data rom:0xBE6E40 +arn_04_goombaSettings = 0x802436B0; // type:data rom:0xBE6E60 +arn_04_D_802436DC_BE6E8C = 0x802436DC; // type:data rom:0xBE6E8C +arn_04_paragoombaAISettings = 0x802436F4; // type:data rom:0xBE6EA4 +arn_04_paragoombaAI = 0x80243724; // type:data rom:0xBE6ED4 +arn_04_paragoombaSettings = 0x80243794; // type:data rom:0xBE6F44 +arn_04_cleftAISettings = 0x802437C0; // type:data rom:0xBE6F70 +arn_04_cleftAI = 0x802437F0; // type:data rom:0xBE6FA0 +arn_04_cleftSettings = 0x80243814; // type:data rom:0xBE6FC4 +arn_04_Paragoomba = 0x80243840; // type:data rom:0xBE6FF0 +arn_04_Goomba = 0x80243A30; // type:data rom:0xBE71E0 +arn_04_Cleft1 = 0x80243C20; // type:data rom:0xBE73D0 +arn_04_Cleft2 = 0x80243E10; // type:data rom:0xBE75C0 +arn_04_npcGroupList = 0x80244000; // type:data rom:0xBE77B0 +arn_04_padding2 = 0x8024403C; // type:data rom:0xBE77EC +arn_04_makeEntities = 0x80244040; // type:data rom:0xBE77F0 D_80244130_BE78E0 = 0x80244130; // type:data rom:0xBE78E0 D_80244138_BE78E8 = 0x80244138; // type:data rom:0xBE78E8 D_802442D0_BE7A80 = 0x802442D0; // type:data rom:0xBE7A80 @@ -16664,6 +16735,8 @@ D_802440FB = 0x802440FB; // type:data D_802440FF = 0x802440FF; // type:data D_80244100 = 0x80244100; // type:data D_80244104 = 0x80244104; // type:data +code_eb1170_bss = 0x802442D0; // type:data +kzn_20_bss = 0x802442D0; // type:data D_80244494 = 0x80244494; // type:data D_802447C0 = 0x802447C0; // type:data D_80244A20 = 0x80244A20; // type:data diff --git a/ver/us/undefined_syms.txt b/ver/us/undefined_syms.txt index 897538f1ab..6c9576bb49 100644 --- a/ver/us/undefined_syms.txt +++ b/ver/us/undefined_syms.txt @@ -50,4 +50,7 @@ D_800F7BBC = 0x800F7BBC; D_802C05CC = 0x802C05CC; _osViModeNtscLan1 = 0x80095820; _osViModeMPalLan1 = 0x80095870; +kzn_20_bss = 0x802442D0; +code_eb1170_bss = 0x802442D0; +D_000001E4 = 0x1E4; gPauseMenuStrings = 0x8026F778; diff --git a/ver/us/undefined_syms_auto.txt b/ver/us/undefined_syms_auto.txt index 31942d1ca7..15aa81a65d 100644 --- a/ver/us/undefined_syms_auto.txt +++ b/ver/us/undefined_syms_auto.txt @@ -3133,3 +3133,7 @@ jtbl_8022EB80_56DF60 = 0x8022EB80; jtbl_80231320_63CEC0 = 0x80231320; jtbl_80232A20_6847A0 = 0x80232A20; jtbl_80228450_6CBFE0 = 0x80228450; +D_802A285A_732B5A = 0x802A285A; +kzn_20_bss = 0x802442D0; +code_eb1170_bss = 0x802442D0; +D_000001E4 = 0x1E4;