Disassemble area_arn (#251)

This commit is contained in:
Maide 2021-04-03 18:21:49 +01:00 committed by GitHub
parent eacb7bfc55
commit 5c1eefbdc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
399 changed files with 28995 additions and 7936 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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

0
python Normal file
View File

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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 {

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

18
src/world/area_arn/arn.h Normal file
View File

@ -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

View File

@ -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;

View File

@ -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) = {
NpcAISettings N(npcAISettings_802413D0) = {
.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,
.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),
.ai = &N(npcAI_80241400),
.onHit = EnemyNpcHit,
.aux = NULL,
.onDefeat = EnemyNpcDefeat,
.flags = 0x00000000,
.unk_24 = { 0x00, 0x00, 0x00, 0x00 },
.level = 12,
.unk_2A = 0x0000,
};
NpcAISettings N(cleftAISettings) = {
NpcAISettings N(npcAISettings_8024144C) = {
.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,
.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),
.ai = &N(npcAI_8024147C),
.onHit = EnemyNpcHit,
.aux = NULL,
.onDefeat = EnemyNpcDefeat,
.flags = 0x00000000,
.unk_24 = { 0x00, 0x00, 0x00, 0x00 },
.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;
}

View File

@ -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);
});

View File

@ -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);

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
});

View File

@ -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);

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -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);
});

View File

@ -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);

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
});

View File

@ -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);
});

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
}
});

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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);
});

View File

@ -1,3 +0,0 @@
#include "arn_09.h"
INCLUDE_ASM(s32, "world/area_arn/arn_09/BF6060", func_80240000_BF6060);

View File

@ -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);

View File

@ -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;
}

View File

@ -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);
}
}
});

View File

@ -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);

View File

@ -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));
});

View File

@ -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);
}
}
});

View File

@ -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);

View File

@ -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)),
{},
};

View File

@ -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);
}
}
});

View File

@ -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);

View File

@ -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));
});

Some files were not shown because too many files have changed in this diff Show More