[WIP] Work on npc.c (#295)

* formatting

* format + misc work

* lots of work on npc.c

* PR comments, asm delet + other misc fixes

* missed one

* temporarily remove cleanup step for testing

* test fix for splat

* test

* o2

* o0

* fix Yay0decompress.c bug

* debug logging

* stuff

* stuff2

* restore stuff

* more PR comments and some general cleanup

* NPC flags + improve match + misc

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
This commit is contained in:
pixel-stuck 2021-06-15 04:05:16 -04:00 committed by GitHub
parent 6ec6aab984
commit e61e67ea9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
231 changed files with 3016 additions and 4283 deletions

10
Jenkinsfile vendored
View File

@ -49,9 +49,9 @@ pipeline {
}
}
}
post {
always {
cleanWs()
}
}
post {
always {
cleanWs()
}
}
}

View File

@ -102,7 +102,7 @@ typedef struct BlurBuffer {
/* 0xA4 */ f32 z[20];
} BlurBuffer; // size = 0xF4
typedef s32 Palette16[16]; // size = 0x40
typedef s16 Palette16[16]; // size = 0x20
typedef struct Npc {
/* 0x000 */ s32 flags;
@ -115,8 +115,11 @@ typedef struct Npc {
/* 0x01C */ f32 jumpVelocity;
/* 0x020 */ struct BlurBuffer* blurBuf; ///< Null unless flag 0x100000 is set.
/* 0x024 */ s32 spriteInstanceID;
/* 0x028 */ u32 currentAnim;
/* 0x02C */ char unk_2C[4];
/* 0x028 */ union {
/* */ u16 h;
/* */ u32 w;
/* */ } currentAnim;
/* 0x02C */ s32 unk_2C;
/* 0x030 */ f32 animationSpeed;
/* 0x034 */ f32 renderYaw;
/* 0x038 */ Vec3f pos;
@ -128,41 +131,50 @@ typedef struct Npc {
/* 0x078 */ s32 shadowIndex;
/* 0x07C */ f32 shadowScale;
/* 0x080 */ s32 unk_80;
/* 0x084 */ u16 unk_84;
/* 0x086 */ u16 unk_86;
/* 0x084 */ s16 unk_84;
/* 0x086 */ s16 unk_86;
/* 0x088 */ s16 isFacingAway;
/* 0x08A */ s16 yawCamOffset;
/* 0x08C */ s16 turnAroundYawAdjustment;
/* 0x08E */ s16 duration; // TODO: name less vaguely
/* 0x090 */ Vec3s homePos;
/* 0x096 */ char unk_96[12];
/* 0x096 */ s16 unk_96;
/* 0x098 */ s16 unk_98;
/* 0x09A */ s16 unk_9A;
/* 0x09C */ s16 unk_9C;
/* 0x09E */ s16 unk_9E;
/* 0x0A0 */ s16 unk_A0;
/* 0x0A2 */ u16 unk_A2;
/* 0x0A4 */ s8 npcID;
/* 0x0A5 */ char unk_A5;
/* 0x0A6 */ s16 collisionRadius;
/* 0x0A8 */ s16 collisionHeight;
/* 0x0AA */ u8 renderMode;
/* 0x0AA */ s8 renderMode;
/* 0x0AB */ s8 unk_AB;
/* 0x0AC */ u8 alpha;
/* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha
/* 0x0AE */ char unk_AD[2];
/* 0x0AE */ char unk_AE[2];
/* 0x0B0 */ s32** extraAnimList;
/* 0x0B4 */ s8 unk_B4; // some kind of rendering type, 0..4 inclusive
/* 0x0B5 */ char unk_B5[13];
/* 0x0B5 */ s8 unk_B5;
/* 0x0B6 */ s8 unk_B6;
/* 0x0B7 */ s8 unk_B7;
/* 0x0B8 */ char unk_B8[8];
/* 0x0C0 */ s8 unk_C0;
/* 0x0C1 */ s8 paletteCount;
/* 0x0C2 */ char unk_C2[2];
/* 0x0C4 */ UNK_PTR spritePaletteList;
/* 0x0C4 */ s32* spritePaletteList;
/* 0x0C8 */ Palette16 localPaletteData[16];
/* 0x2C8 */ Palette16* localPalettes[16];
/* 0x308 */ char unk_308[0x50];
/* 0x308 */ char unk_308[16];
/* 0x318 */ f32 screenSpaceOffset2D[2];
/* 0x320 */ f32 verticalStretch;
/* 0x324 */ struct EffectInstance* decorations[2];
/* 0x32C */ s8 decorationType[2];
/* 0x32E */ s8 changedDecoration;
/* 0x32F */ char unk_32F;
/* 0x32E */ s8 changedDecoration[2];
/* 0x330 */ s8 decorationInitialised[2];
/* 0x332 */ char unk_332[14];
/* 0x332 */ s16 decorationUnk[2];
/* 0x336 */ char unk_336[10];
} Npc; // size = 0x340
typedef Npc* NpcList[MAX_NPCS];
@ -1950,7 +1962,9 @@ typedef struct EffectInstanceData {
/* 0x28 */ char unk_28[0x4];
/* 0x2C */ s32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ char unk_34[0x4C];
/* 0x34 */ char unk_34[0x30];
/* 0x64 */ f32 unk_64;
/* 0x68 */ char unk_68[0x18];
} EffectInstanceData; // size = 0x80
typedef struct Temp8010F250 {

View File

@ -1533,11 +1533,13 @@ enum Areas {
enum NpcFlags {
NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle
NPC_FLAG_2 = 0x00000002,
NPC_FLAG_4 = 0x00000004,
NPC_FLAG_ENABLE_HIT_SCRIPT = 0x00000008,
NPC_FLAG_HAS_SHADOW = 0x00000010, ///< Set by default and by enable_npc_shadow
NPC_FLAG_NO_AI = 0x00000020, ///< Disable movement AI and collision (idle animation plays)
NPC_FLAG_80 = 0x00000080, // TODO
NPC_FLAG_40 = 0x00000040,
NPC_FLAG_100 = 0x00000100, // TODO
NPC_FLAG_GRAVITY = 0x00000200, ///< Enables gravity. Does nothing if NPC_FLAG_NO_Y_MOVEMENT is set.
NPC_FLAG_LOCK_ANIMS = 0x00000400, ///< Do not allow scripts to change animation
@ -1559,8 +1561,8 @@ enum NpcFlags {
/// - Perform only one lateral collision test during motion
/// - Allow falling below Y=-2000 (by default, NPC_FLAG_NO_Y_MOVEMENT is set when an NPC falls out-of-bounds)
NPC_FLAG_PARTICLE = 0x04000000,
NPC_FLAG_40000000 = 0x40000000,
NPC_FLAG_8000000 = 0x08000000,
NPC_FLAG_NO_ANIMS_LOADED = 0x40000000, ///< Npc has no animations loaded
NPC_FLAG_80000000 = 0x80000000,
};

View File

@ -115,7 +115,7 @@ void func_8006FEF0(s32, f32, f32, f32, f32);
void func_80070190(s32, f32, f32, f32, s32, f32, s32, s32);
void func_80070F70(s32 var1, f32 var2, f32 var3, f32 var4, f32 var5, f32 var6, f32 var7, s32 var8, s32* unk);
void func_80071090(s32, f32, f32, f32, s32);
Effect* func_80071750(s32, f32, f32, f32, f32, s32);
EffectInstance* func_80071750(s32, f32, f32, f32, f32, s32);
Effect* func_800720B0(s32, f32, f32, f32, f32, s32);
void func_80072950(s32, f32, f32, f32, f32, s32 time);
Effect* func_800715D0(s32, f32, f32, f32);
@ -171,7 +171,7 @@ void intro_logos_set_fade_alpha(s16 alpha);
void set_game_mode(s16 idx);
void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5);
void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
void fx_emote(s32, Npc*, f32, f32, f32, f32, f32, s32, s32*);
f32 func_800E0088(f32, f32);
@ -187,8 +187,11 @@ PlayerData* get_player_data(void);
s32 pause_interp_vertical_scroll(s32 deltaBefore);
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy);
s32 func_800DC778(s32, f32*, f32*, f32*, f32*, f32, f32);
s32 func_800DCB7C(s32, f32*, f32*, f32*, f32*);
s32 func_800DDAE4(s32, f32*, f32*, f32*, f32, f32, f32, f32);
s32 func_800DDC44(s32, f32*, f32*, f32*, f32, f32, f32, f32);
s32 func_800DDD94(s32, f32*, f32*, f32*, f32, f32, f32, f32);
Npc* get_npc_by_index(s32 listIndex);
@ -309,7 +312,7 @@ void func_80070130(s32 arg0, f32 arg1, f32 arg2, f32 arg3);
void func_800701F0(s32 arg0, f32 arg1, f32 arg2, f32 arg3);
void add_xz_vec3f(Vec3f* vector, f32 speed, f32 angleDeg);
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg);
void fx_walk_large(s32, f32, f32, f32, s32);
void fx_walk_large(s32, f32, f32, f32, f32);
void func_80138D88(s32, s32, s32, s32, f32);
s32 func_80071030(s32 a0, f32 a1, f32 a2, f32 a3, s32 a4);
@ -355,7 +358,16 @@ void sfx_play_sound_with_params(s32 arg0, u8 arg1, u8 arg2, s16 arg3);
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);
void func_8004A784(Npc* npc, f32 arg1, f32* arg2, s32* arg3, s32* arg4, s32* arg5);
void base_UnkNpcAIFunc1(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory);
void base_UnkNpcAIFunc1(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
s32* func_802DEA40(u16 arg0);
void render_sprite(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
void func_802DE3D8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4);
void guRotateAnglesF(float mf[4][4], f32 x, f32 y, f32 z);
s32 spr_update_sprite(s32 arg0, s32 arg1, f32 arg2);
s32 func_800DC778(s32, f32*, f32*, f32*, f32*, f32, f32);
void sin_cos_rad(f32 rad, f32* outSinTheta, f32* outCosTheta);
void func_8006FB90(f32 arg0, f32 arg1, f32 arg2, f32 arg3);
void func_8006FBF0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
#endif

View File

@ -282,7 +282,8 @@ typedef struct Enemy {
/* 0x58 */ ScriptID hitScriptID;
/* 0x5C */ ScriptID auxScriptID;
/* 0x60 */ ScriptID defeatScriptID;
/* 0x64 */ char unk_64[8];
/* 0x64 */ UNK_PTR unk_64;
/* 0x68 */ char unk_68[4];
/* 0x6C */ s32 varTable[16];
/* 0xAC */ char unk_AC[4];
/* 0xB0 */ s32 unk_B0;

View File

@ -212,7 +212,7 @@ extern s32 gStatsMenuIconIDs[12];
extern s32 gGameState;
extern s16 D_8009A604;
extern s16 gNpcCount;
extern s32 D_8009A64C;
extern s32* D_8009A658;
extern s32 gOverrideFlags;

View File

@ -7,7 +7,8 @@ void func_802E1400(Entity* entity) {
struct802E1400* temp = entity->dataBuf;
if (entity->collisionFlags & 1) {
if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) {
if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND)
|| (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) {
exec_entity_updatecmd(entity);
temp->unk_22 = 8;
}

View File

@ -149,8 +149,8 @@ void func_802E38D8(Entity* entity) {
if ((temp->unk_04 == 0) || (temp->unk_06 == 0)) {
temp->unk_03 = 1;
set_entity_commandlist(get_entity_by_index(create_entity(&D_802EA07C, entity->position.x, entity->position.y,
entity->position.z,
entity->rotation.y, 0x80000000)), &D_802E9E54);
entity->position.z,
entity->rotation.y, 0x80000000)), &D_802E9E54);
entity->flags |= 0x20000020;
}
}

View File

@ -99,7 +99,7 @@ void func_802E421C(Entity* entity) {
}
entityIndex = create_entity(entityData, entity->position.x, entity->position.y, entity->position.z, entity->rotation.y,
0x80000000);
0x80000000);
entityTemp = get_entity_by_index(entityIndex);
entityTemp->flags |= 1;

View File

@ -53,7 +53,8 @@ s32 func_802E8858(Entity* entity) {
s32 phi_a0 = FALSE;
if (entity->collisionFlags & 1) {
if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) {
if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND)
|| (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) {
set_action_state(ACTION_STATE_FALLING);
phi_a0 = TRUE;
}

View File

@ -12,7 +12,8 @@ s32 D_800779D0 = 0xF7F7F700;
s32 D_800779D4 = 0;
s32 D_800779D8[] = { 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000,
0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52,
0xF7F7F700, 0x00000000, 0x00000000, };
0xF7F7F700, 0x00000000, 0x00000000,
};
s32 D_80077A24 = 0x01010101;
s32 D_80077A28 = 0;

View File

@ -95,8 +95,10 @@ s32 dispatch_damage_event_partner(s32 damageAmount, s32 event, s32 stopMotion) {
set_goal_pos_to_part(walkMovement, 0x100, 0);
}
show_damage_popup(walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, battleStatus->lastAttackDamage, 1);
func_802666E4(partner, walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, battleStatus->lastAttackDamage);
show_damage_popup(walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z,
battleStatus->lastAttackDamage, 1);
func_802666E4(partner, walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z,
battleStatus->lastAttackDamage);
if (battleStatus->lastAttackDamage > 0) {
func_80267018(partner, 1);

View File

@ -152,7 +152,8 @@ void gfx_task_background(void) {
gSPEndDisplayList(gMasterGfxPos++);
// TODO these << 3 >> 3 shouldn't be necessary. There's almost definitely something we're missing here...
ASSERT((s32)((u32)((gMasterGfxPos - gDisplayContext->backgroundGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->backgroundGfx))
ASSERT((s32)((u32)((gMasterGfxPos - gDisplayContext->backgroundGfx) << 3) >> 3) < ARRAY_COUNT(
gDisplayContext->backgroundGfx))
nuGfxTaskStart(&gDisplayContext->backgroundGfx[0], (u32)(gMasterGfxPos - gDisplayContext->backgroundGfx) * 8,
NU_GFX_UCODE_F3DEX2, NU_SC_NOSWAPBUFFER);

View File

@ -87,7 +87,7 @@ ApiStatus DoNpcDefeat(ScriptInstance* script, s32 isInitialCall) {
ScriptInstance* newScript;
kill_script(script);
npc->currentAnim = owner->animList[6];
npc->currentAnim.w = owner->animList[6];
newScript = start_script(&SCRIPT_NpcDefeat, 10, 0);
owner->defeatScript = newScript;
owner->defeatScriptID = newScript->id;
@ -528,7 +528,7 @@ ApiStatus func_80045900(ScriptInstance* script, s32 isInitialCall) {
s32 unk;
if (!(enemy->unk_B0 & 0x10)) {
npc->currentAnim = *enemy->animList;
npc->currentAnim.w = *enemy->animList;
}
if (!(enemy->unk_B0 & 0x8)) {

View File

@ -166,7 +166,7 @@ void func_80049E3C(ScriptInstance* script) {
Npc* npc = get_npc_unsafe(enemy->npcID);
func_800494C0(npc, 0x3E1, 0);
npc->currentAnim = enemy->animList[4];
npc->currentAnim.w = enemy->animList[4];
npc->jumpVelocity = 10.0f;
npc->jumpScale = 2.5f;
npc->moveToPos.y = npc->pos.y;
@ -205,7 +205,8 @@ 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->wander.point.x, enemy->territory->wander.point.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

@ -187,7 +187,7 @@ void snd_update_bgm_fade(BGMPlayer* player) {
func_8004E444(player);
}
void func_8004E444(BGMPlayer *arg0) {
void func_8004E444(BGMPlayer* arg0) {
u16 mult = (arg0->fadeInfo.currentVolume.u16 * arg0->unk_3C) >> 15;
s32 i;
@ -450,7 +450,7 @@ INCLUDE_ASM(s32, "28910_len_5090", func_8005068C);
INCLUDE_ASM(s32, "28910_len_5090", func_800506C8, s32 arg0, s32 arg1);
void func_80050770(BGMPlayer *player, f32 arg1) {
void func_80050770(BGMPlayer* player, f32 arg1) {
if (arg1 > 2.0) {
arg1 = 2.0f;
} else if (arg1 < 0.25) {

View File

@ -462,7 +462,7 @@ void snd_get_sequence_player_and_track(u32 playerIndex, s32** outCurrentTrackDat
}
void snd_get_sequence_player(u32 playerIndex, BGMPlayer** outPlayer) {
switch (playerIndex) {
switch (playerIndex) {
case 0:
*outPlayer = D_8009A664;
break;
@ -546,10 +546,12 @@ InstrumentGroup* snd_get_BK_instruments(s32 bankGroup, u32 bankIndex) {
INCLUDE_ASM(s32, "2e230_len_2190", snd_load_BK_to_bank, s32 bkFileOffset, SoundBank* bank, s32 bankIndex, s32 arg3);
void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount, u8 arg4);
void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount,
u8 arg4);
// float weirdness
#ifdef NON_MATCHING
void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank *bank, Instruments instruments, u32 instrumentCount, u8 arg4) {
void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, Instruments instruments, u32 instrumentCount,
u8 arg4) {
SoundBank* sb = bank;
Instrument* defaultInstrument = D_8009A5C0->defaultInstrument;
f32 freq = D_8009A5C0->actualFrequency;
@ -582,7 +584,8 @@ void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank *bank, Instruments i
}
}
#else
INCLUDE_ASM(void, "2e230_len_2190", snd_swizzle_BK_instruments, s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount, u8 arg4);
INCLUDE_ASM(void, "2e230_len_2190", snd_swizzle_BK_instruments, s32 bkFileOffset, SoundBank* bank,
InstrumentGroup instruments, s32 instrumentCount, u8 arg4);
#endif
@ -610,7 +613,7 @@ INCLUDE_ASM(void, "2e230_len_2190", snd_read_rom, s32 arg0, s32* arg1, s32 arg2)
INCLUDE_ASM(s32, "2e230_len_2190", snd_memset);
void snd_bcopy(s8* src, s8 *dest, s32 size) {
void snd_bcopy(s8* src, s8* dest, s32 size) {
if (size > 0) {
while (size-- != 0) {
*dest++ = *src++;

View File

@ -6,7 +6,7 @@ extern u32 D_E0200734[];
u32 func_E0200000(s32 arg0) {
s32 temp_v0 = D_E0200690 * 4;
D_E0200690 = (u32) ((temp_v0 + 2) * (temp_v0 + 3)) / 4;
D_E0200690 = (u32)((temp_v0 + 2) * (temp_v0 + 3)) / 4;
return D_E0200690 % (arg0 + 1);
}

View File

@ -402,34 +402,34 @@ s32 can_switch_to_player(void) {
s32 ret = player->koStatus == 0xD;
if (debuff == 9) {
ret = FALSE;
ret = FALSE;
}
if (debuff == 10) {
ret = FALSE;
ret = FALSE;
}
if (debuff == 6) {
ret = TRUE;
ret = TRUE;
}
if (debuff == 3) {
ret = TRUE;
ret = TRUE;
}
if (debuff == 4) {
ret = TRUE;
ret = TRUE;
}
if (debuff == 5) {
ret = TRUE;
ret = TRUE;
}
if (debuff == 7) {
ret = TRUE;
ret = TRUE;
}
if (debuff == 8) {
ret = TRUE;
ret = TRUE;
}
if (player->stoneStatus == 0xC) {
ret = TRUE;
ret = TRUE;
}
if (battleStatus->outtaSightActive) {
ret = TRUE;
ret = TRUE;
}
return !ret;
}

View File

@ -60,7 +60,7 @@ f32 length2D(f32 x, f32 y) {
HeapNode* _heap_create(s32* addr, u32 size) {
if (size < 32) {
return (HeapNode*) -1;
return (HeapNode*)-1;
} else {
HeapNode* heapNode = ALIGN16((s32)addr);
@ -123,7 +123,7 @@ typedef struct {
u32 func_8006DDC0(s64 arg0, s64 arg1);
u64 func_8006D800(s64 arg0, s64 arg1);
char *int_to_string(s32 arg01, char *arg1, s32 arg2) {
char* int_to_string(s32 arg01, char* arg1, s32 arg2) {
Unk_struct_43F0 unk_struct;
s32 phi_s4 = 0x26;
s32 phi_fp = 0;
@ -136,7 +136,7 @@ char *int_to_string(s32 arg01, char *arg1, s32 arg2) {
unk_struct.unk_39 = 0;
while (TRUE) {
u8 (*new_var)[];
u8(*new_var)[];
unk_struct.unk_00[phi_s4] = (*(new_var = &D_800743E0))[func_8006DDC0(arg0, arg2)];
arg0 = func_8006D800(arg0, arg2);
@ -156,7 +156,7 @@ char *int_to_string(s32 arg01, char *arg1, s32 arg2) {
return arg1;
}
#else
INCLUDE_ASM(char*, "43F0", int_to_string, s32 arg01, char *arg1, s32 arg2);
INCLUDE_ASM(char*, "43F0", int_to_string, s32 arg01, char* arg1, s32 arg2);
#endif
// should maybe be called bzero
@ -483,9 +483,11 @@ f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration) {
case EASING_QUARTIC_IN:
return start + (QUART(elapsed) * (end - start) / QUART(duration));
case EASING_COS_SLOW_OVERSHOOT:
return end - (((end - start) * cos_rad(((f32)elapsed / duration) * PI_D * 4.0) * (duration - elapsed) * (duration - elapsed)) / SQ((f32)duration));
return end - (((end - start) * cos_rad(((f32)elapsed / duration) * PI_D * 4.0) * (duration - elapsed) *
(duration - elapsed)) / SQ((f32)duration));
case EASING_COS_FAST_OVERSHOOT:
return end - (((end - start) * cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 15.0) * (duration - elapsed) * (duration - elapsed)) / SQ((f32)duration));
return end - (((end - start) * cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 15.0) * (duration - elapsed) *
(duration - elapsed)) / SQ((f32)duration));
case EASING_QUADRATIC_OUT:
val1s = duration - elapsed;
return (start + (end - start)) - ((SQ(val1s) * (end - start))) / SQ(duration);
@ -496,7 +498,8 @@ f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration) {
val1s = duration - elapsed;
return (start + (end - start)) - ((QUART(val1s) * (end - start))) / QUART(duration);
case EASING_COS_BOUNCE:
temp_f4 = cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 40.0) * (duration - elapsed) * (duration - elapsed) / SQ((f32)duration);
temp_f4 = cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 40.0) * (duration - elapsed) *
(duration - elapsed) / SQ((f32)duration);
if (temp_f4 < 0.0f) {
temp_f4 = -temp_f4;
}

View File

@ -14,13 +14,13 @@ INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FA10);
INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FA70);
INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_large, s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4);
INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_large, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_normal, s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5);
INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_normal, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FB90);
INCLUDE_ASM(void, "4ac90_len_3910", func_8006FB90, f32 arg0, f32 arg1, f32 arg2, f32 arg3);
INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FBF0);
INCLUDE_ASM(void, "4ac90_len_3910", func_8006FBF0, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FC50);
@ -128,7 +128,8 @@ INCLUDE_ASM(s32, "4ac90_len_3910", func_80070EB0);
INCLUDE_ASM(s32, "4ac90_len_3910", func_80070F10);
INCLUDE_ASM(void, "4ac90_len_3910", func_80070F70, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7, s32* arg8);
INCLUDE_ASM(void, "4ac90_len_3910", func_80070F70, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6,
s32 arg7, s32* arg8);
INCLUDE_ASM(s32, "4ac90_len_3910", func_80070FD0);
@ -170,7 +171,7 @@ INCLUDE_ASM(void, "4ac90_len_3910", func_80071690, s32 arg0, f32 arg1, f32 arg2,
INCLUDE_ASM(Effect*, "4ac90_len_3910", func_800716F0, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5);
INCLUDE_ASM(Effect*, "4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
INCLUDE_ASM(EffectInstance*, "4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
INCLUDE_ASM(s32, "4ac90_len_3910", func_800717B0);

View File

@ -21,7 +21,7 @@ s32 func_800E26C4(void) {
actionState == ACTION_STATE_RUN ||
actionState == ACTION_STATE_USE_TWEESTER ||
actionState == ACTION_STATE_SPIN
) {
) {
return 1;
}
@ -86,8 +86,8 @@ INCLUDE_ASM(s32, "7bb60_len_41b0", func_800E2F60);
// }
// }
void gravity_use_fall_params(void) {
PlayerStatus *playerStatus;
f32 *floats = D_800F7B60;
PlayerStatus* playerStatus;
f32* floats = D_800F7B60;
do {} while (0);
playerStatus = &gPlayerStatus;
if (playerStatus->flags & 0x40000) {
@ -380,10 +380,10 @@ void set_action_state(s32 actionState) {
if (actionState < ACTION_STATE_TALK)
if (actionState >= 0) {
#endif
playerStatus->prevActionState = playerStatus->actionState;
playerStatus->actionState = actionState;
playerStatus->flags |= 0x80000000;
}
playerStatus->prevActionState = playerStatus->actionState;
playerStatus->actionState = actionState;
playerStatus->flags |= 0x80000000;
}
return;
}
@ -538,7 +538,7 @@ void func_800E636C(s32 arg0) {
s32 listIndex = D_8010C96C;
if (listIndex >= 0) {
get_npc_by_index(listIndex)->currentAnim = arg0;
get_npc_by_index(listIndex)->currentAnim.w = arg0;
}
}

View File

@ -21,7 +21,7 @@ INCLUDE_ASM(s32, "C50A0", func_8012FE78);
INCLUDE_ASM(s32, "C50A0", func_801309F0);
s32 next_sequence_step(ItemEntity *itemEntity) {
s32 next_sequence_step(ItemEntity* itemEntity) {
s32* currentState = itemEntity->currentState;
switch (*currentState++) {

View File

@ -68,7 +68,8 @@ s32 D_8014F6B4[] = { 0x000001C1, 0x000001C2, 0x000001C3, 0x000001C4, 0x000001C5,
extern s32 D_80159AD4;
INCLUDE_ASM(void, "DF950", sfx_compute_spatialized_sound_params_2, f32 posX, f32 posY, f32 posZ, s16* volume, s16* pan, u32 sourceFlags);
INCLUDE_ASM(void, "DF950", sfx_compute_spatialized_sound_params_2, f32 posX, f32 posY, f32 posZ, s16* volume, s16* pan,
u32 sourceFlags);
void sfx_reset_door_sounds(void) {
gCurrentDoorSoundsSet = 0;
@ -129,7 +130,8 @@ void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID) {
INCLUDE_ASM(s32, "DF950", sfx_play_sound_at_position, s32 soundID, s32 value2, f32 posX, f32 posY,
f32 posZ);
INCLUDE_ASM(void, "DF950", sfx_get_spatialized_sound_params, f32 arg0, f32 arg1, f32 arg2, s16* arg3, s16* arg4, s32 arg5);
INCLUDE_ASM(void, "DF950", sfx_get_spatialized_sound_params, f32 arg0, f32 arg1, f32 arg2, s16* arg3, s16* arg4,
s32 arg5);
INCLUDE_ASM(s32, "DF950", sfx_compute_spatialized_sound_params_0);

View File

@ -315,7 +315,7 @@ void update_entity_inverse_rotation_matrix(Entity* entity);
void delete_entity(s32 entityIndex);
void delete_entity_and_unload_data(s32 entityIndex);
void func_8011085C(s32 shadowIndex);
s32 entity_get_collision_flags(Entity *entity);
s32 entity_get_collision_flags(Entity* entity);
void func_801117DC(StaticEntityData* data);
void func_80112344(Entity* entity);
@ -514,7 +514,7 @@ void render_entities(void) {
gPlayerStatusPtr->position.z,
entity->position.x,
entity->position.z) > 200.0f
) {
) {
continue;
}
@ -658,8 +658,8 @@ ShadowList* get_shadow_list(void) {
return ret;
}
s32 func_80110678(Npc *npc) {
if (npc->currentAnim != 0) {
s32 func_80110678(Npc* npc) {
if (npc->currentAnim.w != 0) {
npc->flags |= 0x1000000;
return 1;
}
@ -732,7 +732,7 @@ void func_8011085C(s32 shadowIndex) {
(*gCurrentShadowListPtr)[shadowIndex] = NULL;
}
s32 entity_get_collision_flags(Entity *entity) {
s32 entity_get_collision_flags(Entity* entity) {
u32 listIndex = entity->listIndex;
s32 ret = 0;
u32 flag;
@ -804,13 +804,13 @@ s32 is_player_action_state(ActionState actionState) {
return actionState == gPlayerActionState;
}
void func_80110BCC(Entity *entity) {
void func_80110BCC(Entity* entity) {
if (!(entity->flags & 8)) {
set_entity_model_render_command_list(entity->virtualModelIndex);
}
}
void func_80110BF8(Entity *entity) {
void func_80110BF8(Entity* entity) {
entity->unk_07 = 0;
entity->flags &= ~0x00010000;
}

View File

@ -30,7 +30,7 @@ ApiStatus func_80218770_6DE530(ScriptInstance* script, s32 isInitialCall) {
SelectableTarget* selectableTarget;
battleStatus->moveCategory = 6;
do {} while(0);
do {} while (0);
battleStatus->selectedItemID = 0;
battleStatus->selectedMoveID = 0x98;
battleStatus->currentTargetListFlags = D_8008FC44;

View File

@ -135,7 +135,7 @@ ApiStatus N(func_802A15A0_733670)(ScriptInstance* script, s32 isInitialCall) {
}
temp = 0;
if((script->varTable[11] < 0) || (script->varTable[11] <= 0 && script->varTable[12] < 0)) {
if ((script->varTable[11] < 0) || (script->varTable[11] <= 0 && script->varTable[12] < 0)) {
temp = 1;
}

View File

@ -41,7 +41,7 @@ u32 N(BattleAreaAngleStuff1)(f32 x, f32 y) {
}
ApiStatus N(BattleAreaAngleStuff2)(ScriptInstance* script, s32 isInitialCall) {
Bytecode *args = script->ptrReadPos;
Bytecode* args = script->ptrReadPos;
s32 var1 = get_variable(script, *args++);
s32 var2 = get_variable(script, *args++);
s32 var3 = get_variable(script, *args++);

View File

@ -147,7 +147,7 @@ void exec_entity_model_commandlist(s32 idx) {
entityModel = (*gCurrentEntityModelList)[idx];
if (entityModel != NULL && (entityModel->flags)) {
if (!(entityModel->flags & 0x20)) {
if(!(entityModel->flags & 0x20000)) {
if (!(entityModel->flags & 0x20000)) {
entityModel->flags &= ~0x100;
entityModel->nextFrameTime -= entityModel->timeScale;
if (entityModel->nextFrameTime <= 0.0f) {

View File

@ -256,8 +256,8 @@ ApiStatus func_802C94A0(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus SetModelFlags(ScriptInstance *script, s32 isInitialCall) {
Bytecode *args = script->ptrReadPos;
ApiStatus SetModelFlags(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 modelIndex;
s32 a1;
s32 enable;
@ -412,7 +412,7 @@ void set_zone_enabled(s32 zoneID, s32 enabled) {
}
}
ApiStatus SetZoneEnabled(ScriptInstance *script, s32 isInitialCall) {
ApiStatus SetZoneEnabled(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 idx = get_variable(script, *args++);
s32 enabled = get_variable(script, *args++);

View File

@ -20,7 +20,7 @@ ApiStatus SpeakToNpc(ScriptInstance* script, s32 isInitialCall) {
INCLUDE_ASM(ApiStatus, "evt/msg_api", _show_message, ScriptInstance* script, s32 isInitialCall, s32 arg2);
ApiStatus ShowMessageAtScreenPos(ScriptInstance *script, s32 isInitialCall) {
ApiStatus ShowMessageAtScreenPos(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
if (isInitialCall) {
@ -46,7 +46,7 @@ ApiStatus ShowMessageAtScreenPos(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE1;
}
ApiStatus ShowMessageAtWorldPos(ScriptInstance *script, s32 isInitialCall) {
ApiStatus ShowMessageAtWorldPos(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PrintContext** currentPrintContext;
s32* currentCameraID = &gCurrentCameraID;
@ -112,7 +112,7 @@ ApiStatus SwitchMessage(ScriptInstance* script, s32 isInitialCall) {
}
}
ApiStatus ShowChoice(ScriptInstance *script, s32 isInitialCall) {
ApiStatus ShowChoice(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PrintContext** temp802DB268;

View File

@ -15,11 +15,11 @@ void set_npc_animation(Npc* npc, u32 arg1) {
PlayerData* playerData = &gPlayerData;
if (arg1 - 0x101 < 9) {
npc->currentAnim = gPartnerAnimations[playerData->currentPartner].anims[arg1 - 0x101];
npc->currentAnim.w = gPartnerAnimations[playerData->currentPartner].anims[arg1 - 0x101];
} else if ((arg1 - 0x201) < 0x10) {
npc->currentAnim = get_enemy(npc->npcID)->animList[arg1 - 0x201];
npc->currentAnim.w = get_enemy(npc->npcID)->animList[arg1 - 0x201];
} else {
npc->currentAnim = arg1;
npc->currentAnim.w = arg1;
}
}
@ -189,7 +189,7 @@ ApiStatus GetNpcAnimation(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
set_variable(script, outVar, npc->currentAnim);
set_variable(script, outVar, npc->currentAnim.w);
return ApiStatus_DONE2;
}

1341
src/npc.c

File diff suppressed because it is too large Load Diff

128
src/npc.h
View File

@ -20,11 +20,11 @@ void npc_list_update_current(void);
/// Presumably did something once upon a time but got commented out.
void npc_iter_no_op(void);
void npc_create(NpcBlueprint* blueprint, NpcAnimID animList[], s32 skipLoadingAnims);
s32 npc_create(NpcBlueprint* blueprint, NpcAnimID** animList, s32 skipLoadingAnims);
void npc_create_basic(NpcBlueprint* blueprint);
void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID animList[]);
void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID** animList);
void npc_create_partner(NpcBlueprint* blueprint);
@ -48,7 +48,7 @@ s32 func_800397E8();
/// Updates all NPCs.
void npc_list_update(void);
s32 func_80039DA4();
f32 func_80039DA4();
void npc_appendGfx(Npc* npc);
@ -70,29 +70,29 @@ void update_npc_blur(Npc* npc);
void appendGfx_npc_blur(Npc* npc);
s32 func_8003B184();
void func_8003B184(void);
s32 func_8003B198();
void func_8003B198(void);
void func_8003B1A8(void);
s32 func_8003B1B0();
void func_8003B1B0(void);
void set_npc_yaw(Npc* npc, f32 yaw);
s32 func_8003B3D0();
void func_8003B3D0(Npc* npc, s32 arg1);
s32 func_8003B3F8();
void func_8003B3F8(Npc* npc, s32 arg1);
s32 func_8003B420();
void func_8003B420(Npc* npc);
s32 func_8003B44C();
s32 func_8003B464();
s32 func_8003B47C();
void func_8003B47C(Npc* npc, s32 arg1, s32 arg2);
s32 func_8003B500();
void func_8003B500(Npc* npc, s32 arg1, s32 arg2);
s32 func_8003B5B4();
@ -102,45 +102,45 @@ s32 func_8003BA60();
s32 func_8003BED8();
s32 func_8003C3D8();
void func_8003C3D8(Npc* npc, s32 idx, s8 decorationType);
s32 func_8003C428();
void func_8003C428(Npc* npc, s32 idx);
s32 func_8003C444();
s32 npc_update_decorations(Npc* npc);
s32 func_8003C53C();
void func_8003C53C(Npc* npc, s32 idx);
s32 func_8003C61C();
void func_8003C61C(Npc* npc, s32 idx);
void func_8003C658(void);
void func_8003C658(Npc* npc, s32 idx);
void func_8003C660(void);
void func_8003C660(Npc* npc, s32 idx);
s32 func_8003C668();
void func_8003C668(Npc* npc, s32 idx);
s32 func_8003C78C();
void func_8003C78C(Npc* npc, s32 idx);
s32 func_8003C7A8();
void func_8003C7A8(Npc* npc, s32 idx);
void func_8003C8AC(void);
void func_8003C8AC(Npc* npc, s32 idx);
s32 func_8003C8B4();
void func_8003C8B4(Npc* npc, s32 idx);
s32 func_8003C984();
void func_8003C984(Npc* npc, s32 idx);
s32 func_8003C9A8();
void func_8003C9A8(Npc* npc, s32 idx);
s32 func_8003CB20();
void func_8003CB20(Npc* npc, s32 idx);
s32 func_8003CB44();
void func_8003CB44(Npc* npc, s32 idx);
s32 func_8003CC8C();
void func_8003CC8C(Npc* npc, s32 idx);
s32 func_8003CCB0();
void func_8003CCB0(Npc* npc, s32 idx);
void func_8003CFA0(void);
void func_8003CFA0(Npc* npc, s32 idx);
s32 func_8003CFA8();
void func_8003CFA8(Npc* npc, s32 idx);
/// Finds the closest NPC to a given point within a radius. Ignores Y position.
///
@ -168,19 +168,19 @@ Npc* npc_find_near(f32 x, f32 y, f32 z, f32 radius);
/// @returns NULL if there are no NPCs within radius
Npc* npc_find_near_simple(f32 x, f32 y, f32 z, f32 radius);
s32 func_8003D1D4();
//s32 func_8003D1D4();
s32 func_8003D2F8();
s32 func_8003D2F8(Npc* npc);
s32 func_8003D3BC();
void func_8003D3BC(Npc* npc);
s32 func_8003D624();
void func_8003D624(Npc* npc, s16 arg1, s16 arg2, s16 arg3, s32 arg4, s32 arg5, s32 arg6);
s32 func_8003D660();
void func_8003D660(Npc* npc, s32 arg1);
s32 func_8003D788();
void func_8003D788(Npc* npc, s32 arg1);
s32 func_8003DA38();
void func_8003DA38(Npc* npc, s32 arg1);
s32 func_8003DC38();
@ -211,24 +211,58 @@ void npc_dyn_entity_draw_no_op(void);
void make_npcs(s8 flags, s8 mapID, s32* npcGroupList);
s32 kill_encounter();
s32 kill_encounter(Enemy* enemy);
s32 kill_enemy();
void kill_enemy(Enemy* enemy);
s32 bind_enemy_ai();
/// Binds the specified ai script to the specified enemy
///
/// @param enemy pointer to the enemy to bind the script to
/// @param aiScriptBytecode pointer to the script to be bound.
s32 bind_enemy_ai(Enemy* enemy, Script* aiScriptBytecode);
s32 bind_enemy_aux();
/// Binds the specified auxillary script to the specified enemy
///
/// @param enemy pointer to the enemy to bind the script to
/// @param auxScriptBytecode pointer to the script to be bound.
s32 bind_enemy_aux(Enemy* enemy, Script* auxScriptBytecode);
s32 bind_enemy_interact();
/// Binds the specified interact script to the specified enemy
///
/// @param enemy pointer to the enemy to bind the script to
/// @param interactScriptBytecode pointer to the script to be bound.
s32 bind_enemy_interact(Enemy* enemy, Script* interactScriptBytecode);
s32 bind_npc_ai();
/// Binds the specified ai script to the npc matching the specified npcId
///
/// @param npcID ID of the desired npc
/// @param npcAiBytecode pointer to the script to be bound.
void bind_npc_ai(s32 npcID, Script* npcAiBytecode);
s32 bind_npc_aux();
/// Binds the specified auxillary script to the npc matching the specified npcId
///
/// @param npcID ID of the desired npc
/// @param npcAuxBytecode pointer to the script to be bound.
void bind_npc_aux(s32 npcID, Script* npcAuxBytecode);
s32 bind_npc_interact();
/// Binds the specified interact script to the npc matching the specified npcId
///
/// @param npcID ID of the desired npc
/// @param npcInteractBytecode pointer to the script to be bound.
void bind_npc_interact(s32 npcID, Script* npcInteractBytecode);
/// Looks for an enemy matching the specified npcID.
///
/// @param npcID ID of the npc bound to the desired enemy.
///
/// @returns pointer to Enemy struct, if one is found. If one is not found, a panic occurs.
Enemy* get_enemy(NpcID npcID);
s32 get_enemy_safe();
/// Same as get_enemy(), with the exception of always returning a value if an enemy is not found.
///
/// @param npcID ID of the npc bound to the desired enemy.
///
/// @returns pointer to Enemy struct, if one is found. Otherwise, NULL.
Enemy* get_enemy_safe(s32 npcID);
#endif

View File

@ -2,6 +2,6 @@
f32 D_80093DD0 = M_DTOR;
INCLUDE_ASM(s32, "os/3f6d0_len_320", guRotateAnglesF);
INCLUDE_ASM(void, "os/3f6d0_len_320", guRotateAnglesF, float mf[4][4], f32 x, f32 y, f32 z);
INCLUDE_ASM(s32, "os/3f6d0_len_320", guRotateAngles);

View File

@ -156,7 +156,7 @@ void pause_items_init(s8* arg0) {
setup_pause_menu_tab(&D_8024F5C0, 1);
*arg0 = 1;
}
}
INCLUDE_ASM(s32, "pause/pause_items", pause_items_handle_input);

View File

@ -53,14 +53,16 @@ Vtx spr_defaultQuad[] = {
};
Vp D_802DF3D0 = {{
{ 640, 480, 511, 0 },
{ 640, 480, 511, 0 },
}};
{ 640, 480, 511, 0 },
{ 640, 480, 511, 0 },
}
};
Vp D_802DF3E0 = {{
{ 640, 480, 511, 0 },
{ 640, 480, 512, 0 },
}};
{ 640, 480, 511, 0 },
{ 640, 480, 512, 0 },
}
};
Gfx D_802DF3F0[] = {
gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING),
@ -232,7 +234,8 @@ void spr_init_sprites(s32 playerSpriteSet) {
}
flags = (&spr_playerSpriteSets[playerSpriteSet])->initiallyLoaded;
func_802DED60((&spr_playerSpriteSets[playerSpriteSet])->cacheSize, (&spr_playerSpriteSets[playerSpriteSet])->rasterSize);
func_802DED60((&spr_playerSpriteSets[playerSpriteSet])->cacheSize,
(&spr_playerSpriteSets[playerSpriteSet])->rasterSize);
for (i = 1; i < 0xE; i++) {
if ((flags >> i) & 1) {
@ -277,7 +280,7 @@ s32 func_802DDA84(void) {
INCLUDE_ASM(void, "sprite", func_802DDA8C, s32 arg0, s32 arg1, f32 arg2);
INCLUDE_ASM(s32, "sprite", render_sprite);
INCLUDE_ASM(void, "sprite", render_sprite, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
INCLUDE_ASM(s32, "sprite", func_802DDEC4);
@ -293,7 +296,7 @@ INCLUDE_ASM(s32, "sprite", func_802DE0EC);
INCLUDE_ASM(s32, "sprite", spr_update_sprite, s32 arg0, s32 arg1, f32 arg2);
INCLUDE_ASM(s32, "sprite", func_802DE3D8);
INCLUDE_ASM(void, "sprite", func_802DE3D8, s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4);
INCLUDE_ASM(s32, "sprite", func_802DE5C8);
@ -309,6 +312,6 @@ INCLUDE_ASM(s32, "sprite", func_802DE8DC);
INCLUDE_ASM(s32, "sprite", func_802DE9D8);
INCLUDE_ASM(s32, "sprite", func_802DEA40);
INCLUDE_ASM(s32*, "sprite", func_802DEA40, u16 arg0);
INCLUDE_ASM(s32, "sprite", func_802DEA6C);

View File

@ -33,7 +33,8 @@ void func_802B6000_E287F0(void) {
gPlayerStatus.gravityIntegrator[3] = -0.0987f;
gPlayerStatus.flags |= 8;
D_802B6240 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z);
D_802B6240 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, gPlayerStatus.lastGoodPosition.x,
gPlayerStatus.lastGoodPosition.z);
gPlayerStatus.currentSpeed = func_800E0088(gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z) / 18.0f;
}

View File

@ -167,7 +167,7 @@ StaticNpc N(npcGroup_802418AC) = {
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,
@ -202,7 +202,7 @@ NpcGroupList N(npcGroupList_80241A9C) = {
s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
f32 phi_f20;
s32 ret = FALSE;
@ -217,8 +217,8 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E
}
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
atan2(npc->pos.x, npc->pos.z,
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
ret = FALSE;
}
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
@ -234,13 +234,13 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E
void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
npc->duration = 12;
@ -263,7 +263,7 @@ void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (npc->duration % 3 == 0) {
@ -277,7 +277,8 @@ void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_10.z = npc->pos.z;
enemy->unk_07 = 1;
npc->moveSpeed = aiSettings->chaseSpeed;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
if (npc->duration < 15) {
npc->duration = 15;
}
@ -289,11 +290,11 @@ void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -311,9 +312,9 @@ void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkDurationCheck.inc.c"
s32 N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall) {
s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
EnemyTerritoryThing territory;

View File

@ -21,8 +21,7 @@ Script N(80241040) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -154,10 +154,12 @@ Script N(interact_80241EB0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(2) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0073));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0073));
SI_AREA_FLAG(2) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0074));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0074));
SI_AREA_FLAG(2) = 0;
}
}
@ -256,7 +258,8 @@ Script N(init_802424E0) = SCRIPT({
Script N(interact_8024254C) = SCRIPT({
if (SI_MAP_VAR(0) != 0) {
if (SI_MAP_VAR(0) >= SI_MAP_VAR(1)) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0081));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0081));
SI_VAR(0) = 118;
SI_VAR(1) = 1;
await N(80241C6C);
@ -266,17 +269,20 @@ Script N(interact_8024254C) = SCRIPT({
SI_SAVE_FLAG(1020) = 0;
return;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0080));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0080));
return;
}
}
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(3) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0079));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0079));
SI_AREA_FLAG(3) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007A));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x007A));
SI_AREA_FLAG(3) = 0;
}
}
@ -296,7 +302,8 @@ Script N(interact_8024254C) = SCRIPT({
if (SI_SAVE_FLAG(1015) == 0) {
if (SI_SAVE_VAR(348) == 18) {
await N(80241E68);
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007F));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x007F));
EndSpeech(-1, 9765124, 9765121, 0);
SI_MAP_VAR(0) = 0;
SI_MAP_VAR(1) = 450;
@ -344,7 +351,7 @@ Script N(802429D4) = SCRIPT({
}
spawn {
MakeLerp(0, 255, 40, 0);
10:
10:
UpdateLerp();
func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0);
sleep 1;
@ -365,7 +372,7 @@ Script N(80242B0C) = SCRIPT({
}
spawn {
MakeLerp(255, 0, 40, 0);
10:
10:
UpdateLerp();
func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0);
sleep 1;
@ -408,10 +415,12 @@ Script N(interact_80242DC4) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(4) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0082));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0082));
SI_AREA_FLAG(4) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0083));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0083));
SI_AREA_FLAG(4) = 0;
}
}
@ -472,10 +481,12 @@ Script N(interact_802431C8) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(5) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008C));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x008C));
SI_AREA_FLAG(5) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008D));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x008D));
SI_AREA_FLAG(5) = 0;
}
}
@ -850,7 +861,7 @@ Script N(makeEntities) = SCRIPT({
void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -872,7 +883,7 @@ void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -970,7 +981,7 @@ void N(func_8024067C_BDF40C)(ScriptInstance* script, NpcAISettings* aiSettings,
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1012,7 +1023,7 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -1123,7 +1134,7 @@ void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
} else {
script->functionTemp[0].s = 4;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
}
}

View File

@ -20,8 +20,7 @@ Script N(80241780) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -57,8 +57,8 @@ NpcSettings N(npcSettings_802436B0) = {
};
f32 N(D_802436DC_BE6E8C)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
NpcAISettings N(npcAISettings_802436F4) = {
@ -127,7 +127,7 @@ StaticNpc N(npcGroup_80243840) = {
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,
@ -161,7 +161,7 @@ StaticNpc N(npcGroup_80243A30) = {
.yaw = 90,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,
@ -277,7 +277,7 @@ Script N(makeEntities) = SCRIPT({
void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -299,7 +299,7 @@ void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -397,7 +397,7 @@ void N(func_8024067C_BE3E2C)(ScriptInstance* script, NpcAISettings* aiSettings,
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -439,7 +439,7 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -508,14 +508,14 @@ void N(func_80240E90_BE4640)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -637,9 +637,9 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -667,7 +667,8 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_arn/arn_04/events", arn_04_func_80241040_BE47F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_arn/arn_04/events", arn_04_func_80241040_BE47F0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1_copy.inc.c"
@ -754,9 +755,9 @@ ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, EnemyTerritoryThing* territory) {
s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
f32 phi_f20;
s32 ret = FALSE;
@ -771,8 +772,8 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E
}
if (fabsf(get_clamped_angle_diff(phi_f20,
atan2(npc->pos.x, npc->pos.z,
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
atan2(npc->pos.x, npc->pos.z,
gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) {
ret = FALSE;
}
if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) {
@ -788,13 +789,13 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E
void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (script->functionTemp[1].s <= 0) {
script->functionTemp[1].s = aiSettings->unk_14;
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
npc->duration = 12;
@ -817,7 +818,7 @@ void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
if (npc->duration % 3 == 0) {
@ -831,7 +832,8 @@ void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings,
enemy->unk_10.z = npc->pos.z;
enemy->unk_07 = 1;
npc->moveSpeed = aiSettings->chaseSpeed;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9;
if (npc->duration < 15) {
npc->duration = 15;
}
@ -843,11 +845,11 @@ void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings,
void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -867,7 +869,7 @@ void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings,
ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++);
EnemyTerritoryThing territory;

View File

@ -21,8 +21,7 @@ Script N(802433D0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -103,10 +103,12 @@ Script N(interact_80241794) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(6) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0092));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0092));
SI_AREA_FLAG(6) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0093));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0093));
SI_AREA_FLAG(6) = 0;
}
}
@ -133,10 +135,12 @@ Script N(interact_80241924) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(7) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0099));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x0099));
SI_AREA_FLAG(7) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009A));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x009A));
SI_AREA_FLAG(7) = 0;
}
}
@ -170,13 +174,16 @@ Script N(interact_80241AB4) = SCRIPT({
>= STORY_CH5_STAR_SPRIT_DEPARTED {
if (SI_SAVE_FLAG(1014) == 1) {
if (SI_AREA_FLAG(9) == 1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AE));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00AE));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B0));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00B0));
}
} else {
SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AA));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00AA));
SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_9));
ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_9), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AB));
SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_A));
@ -224,10 +231,12 @@ Script N(interact_80241E28) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
if (SI_AREA_FLAG(8) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B3));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00B3));
SI_AREA_FLAG(8) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B4));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00B4));
SI_AREA_FLAG(8) = 0;
}
}
@ -994,7 +1003,7 @@ Script N(makeEntities) = SCRIPT({
void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -1016,7 +1025,7 @@ void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1040,7 +1049,7 @@ void N(func_8024067C_BE825C)(ScriptInstance* script, NpcAISettings* aiSettings,
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1082,7 +1091,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -1194,7 +1203,7 @@ void N(func_80241068_BE8C48)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
} else {
script->functionTemp[0].s = 4;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
}
}

View File

@ -24,8 +24,7 @@ Script N(80241360) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -148,7 +148,7 @@ ApiStatus N(func_802401AC_BECF9C)(ScriptInstance* script, s32 isInitialCall) {
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_00, ptr->unk_04, ptr->unk_08) > 30.0f)) {
ptr->unk_4E = 3;
}
break;
@ -568,8 +568,7 @@ Script N(main) = SCRIPT({
}
== STORY_CH3_BEGAN_PEACH_MISSION {
MakeNpcs(0, N(npcGroupList_802478E8));
}
else {
} else {
MakeNpcs(0, N(npcGroupList_802478B8));
}
}

View File

@ -86,8 +86,8 @@ Script N(makeEntities) = SCRIPT({
});
f32 N(D_80243BC0_BF09B0)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
NpcAISettings N(npcAISettings_80243BD8) = {
@ -316,9 +316,11 @@ Script N(80243FE8) = SCRIPT({
SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00CE));
ShowChoice(1966093);
if (SI_VAR(0) == 0) {
ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00CF));
ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0,
MESSAGE_ID(0x0E, 0x00CF));
} else {
ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00D0));
ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0,
MESSAGE_ID(0x0E, 0x00D0));
}
SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00D1));
UseSettingsFrom(0, 175, 0, 0);
@ -1167,14 +1169,14 @@ void N(func_80240950_BED740)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -1295,9 +1297,9 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1325,7 +1327,8 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_arn/arn_07/events", arn_07_func_80240B00_BED8F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_arn/arn_07/events", arn_07_func_80240B00_BED8F0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"

View File

@ -32,8 +32,7 @@ Script N(80241F10) = SCRIPT({
}
== STORY_CH3_BEGAN_PEACH_MISSION {
SetMusicTrack(0, SONG_STAR_SPIRIT_THEME, 1, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
PlayAmbientSounds(AMBIENT_WIND);
}

View File

@ -1,6 +1,6 @@
#include "arn_08.h"
ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_BF47A0)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 temp_f20;
s32 colliderID;
@ -13,11 +13,11 @@ ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) {
temp_f20 = func_800E34D8();
playerStatus->position.y = func_800E3514(temp_f20, &colliderID);
script->functionTemp[0].s += fabsf(temp_f20);
do {} while(0);
do {} while (0);
return (script->functionTemp[0].s > 50) * ApiStatus_DONE2;
}
ApiStatus N(func_8024008C_BF482C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024008C_BF482C)(ScriptInstance* script, s32 isInitialCall) {
if (gPlayerStatus.position.y < -10.0f) {
return ApiStatus_DONE2;
}

View File

@ -158,7 +158,7 @@ Script N(80240BA0) = SCRIPT({
PlaySound(0x8000004B);
spawn {
SI_VAR(0) = 0;
10:
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);
@ -417,17 +417,17 @@ Script N(makeEntities) = SCRIPT({
}
});
ApiStatus N(func_802400C0_BF4860)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802400C0_BF4860)(ScriptInstance* script, s32 isInitialCall) {
gPlayerData.bootsLevel = 1;
return ApiStatus_DONE2;
}
ApiStatus N(func_802400D4_BF4874)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802400D4_BF4874)(ScriptInstance* script, s32 isInitialCall) {
func_800EF300();
return ApiStatus_DONE2;
}
ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802400F4_BF4894)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
if (isInitialCall) {
@ -447,7 +447,7 @@ ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_8024019C_BF493C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024019C_BF493C)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32* dataPtr = &N(D_80241188_BF5928);

View File

@ -21,8 +21,7 @@ Script N(80240300) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -176,7 +176,7 @@ NpcGroupList N(npcGroupList_80240974) = {
{},
};
ApiStatus N(func_80240000_BF6060)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_BF6060)(ScriptInstance* script, s32 isInitialCall) {
Entity* entity = get_entity_by_index(0);
if (entity == NULL) {

View File

@ -20,8 +20,7 @@ Script N(802400A0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -197,7 +197,7 @@ StaticNpc N(npcGroup_802409C8) = {
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,

View File

@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -19,8 +19,7 @@ Script N(80240050) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -197,7 +197,7 @@ StaticNpc N(npcGroup_802409CC) = {
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,

View File

@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -198,7 +198,7 @@ StaticNpc N(npcGroup_802409DC) = {
.yaw = 270,
.dropFlags = 0x80,
.itemDropChance = 20,
{ ITEM_DRIED_SHROOM, 10, 0 },
{ ITEM_DRIED_SHROOM, 10, 0 },
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.maxCoinBonus = 2,

View File

@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}

View File

@ -1,7 +1,7 @@
#include "dgb_00.h"
#include "message_ids.h"
ApiStatus N(func_80240000_BFA0A0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_BFA0A0)(ScriptInstance* script, s32 isInitialCall) {
sprintf(&D_800D9230, "arn_20_shape");
sprintf(&D_800D91E0, "arn_20_hit");
sprintf(&D_800B0CF0, "arn_tex");
@ -28,8 +28,7 @@ Script N(80240110) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
@ -66,8 +65,7 @@ Script N(802402D0) = SCRIPT({
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
spawn N(80240F50);
await N(80241AA0);
}
else {
} else {
bind N(exitDoubleDoor_8024021C) to TRIGGER_WALL_PRESS_A 18;
}
}

View File

@ -162,7 +162,7 @@ Script N(80240DDC) = SCRIPT({
RandInt(5, SI_VAR(10));
SI_VAR(10) += 2;
SI_VAR(11) = 0;
10:
10:
SI_VAR(3) = SI_VAR(0);
SI_VAR(3) += 1;
SetNpcPos(NPC_BOO0, SI_VAR(3), SI_VAR(1), SI_VAR(2));
@ -700,8 +700,7 @@ Script N(80242B84) = SCRIPT({
}
== 9 {
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00DA));
}
else {
} else {
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D6));
}
}

View File

@ -27,8 +27,7 @@ Script N(802434A0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -417,8 +416,7 @@ Script N(802449C4) = SCRIPT({
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetGroupEnabled(112, 0);
ModifyColliderFlags(0, 40, 0x7FFFFE00);
}
else {
} else {
SetGroupEnabled(210, 0);
ModifyColliderFlags(0, 50, 0x7FFFFE00);
}
@ -465,8 +463,8 @@ Script N(makeEntities) = SCRIPT({
});
f32 N(D_80244CD0_C02550)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
Script N(80244CE8) = SCRIPT({
@ -493,14 +491,14 @@ void N(func_80240120_BFD9A0)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -622,9 +620,9 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -652,7 +650,8 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_dgb/dgb_01/BFD9A0", dgb_01_func_802402D0_BFDB50, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_dgb/dgb_01/BFD9A0", dgb_01_func_802402D0_BFDB50, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"
@ -679,7 +678,7 @@ void N(func_80240D74_BFE5F4)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkFunc5.inc.c"
ApiStatus N(func_8024142C_BFECAC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024142C_BFECAC)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Bytecode* args = script->ptrReadPos;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -739,7 +738,7 @@ ApiStatus N(func_8024142C_BFECAC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241618_BFEE98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f0;
@ -749,7 +748,7 @@ void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings,
if (npc->duration <= 0) {
npc->flags &= ~0x00200000;
npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1);
npc->currentAnim = enemy->animList[8];
npc->currentAnim.w = enemy->animList[8];
npc->moveSpeed = aiSettings->chaseSpeed;
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20);
@ -766,13 +765,14 @@ void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241770_BFEFF0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241770_BFEFF0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
npc->duration = 0;
script->functionTemp[0].s = 14;
} else {
@ -788,7 +788,7 @@ void N(func_80241770_BFEFF0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
void N(func_80241874_BFF0F4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241874_BFF0F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 i;
@ -811,7 +811,7 @@ void N(func_80241874_BFF0F4)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[0].s = 15;
}
void N(func_80241954_BFF1D4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241954_BFF1D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -855,7 +855,7 @@ void N(func_80241954_BFF1D4)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241BF0_BFF470)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241BF0_BFF470)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -865,12 +865,12 @@ void N(func_80241BF0_BFF470)(ScriptInstance *script, NpcAISettings *aiSettings,
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
}
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
npc->duration = 20;
script->functionTemp[0].s = 17;
}
void N(func_80241CA8_BFF528)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241CA8_BFF528)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -893,7 +893,7 @@ void N(func_80241CA8_BFF528)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241E28_BFF6A8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241E28_BFF6A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -903,7 +903,7 @@ void N(func_80241E28_BFF6A8)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241E70_BFF6F0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241E70_BFF6F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -920,7 +920,7 @@ void N(func_80241E70_BFF6F0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241EF0_BFF770)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241EF0_BFF770)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -932,7 +932,7 @@ void N(func_80241EF0_BFF770)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[1].s = 0x1E;
}
void N(func_80241F98_BFF818)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241F98_BFF818)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX = npc->pos.x;
@ -976,7 +976,7 @@ void N(func_80241F98_BFF818)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_802422B0_BFFB30)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1255,7 +1255,7 @@ const char N(dgb_00_name_hack)[] = "dgb_00";
ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -1277,7 +1277,7 @@ ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1302,7 +1302,7 @@ ApiStatus N(func_80242BA8_C00428)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1324,7 +1324,7 @@ ApiStatus N(func_80242BA8_C00428)(ScriptInstance* script, NpcAISettings* aiSetti
#include "world/common/UnkFunc16.inc.c"
ApiStatus N(func_802430C0_C00940)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1345,7 +1345,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;

View File

@ -33,8 +33,7 @@ Script N(802414B0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -280,7 +279,7 @@ StaticNpc N(npcGroup_80241E08)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -349,7 +348,7 @@ StaticNpc N(npcGroup_802421E8)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -421,9 +420,9 @@ NpcGroupList N(npcGroupList_802425C8) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
s32 N(func_80240208_C2EDA8)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -439,7 +438,8 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -460,9 +460,9 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -480,7 +480,7 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -545,26 +545,26 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_802408D0_C2F470)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802408D0_C2F470)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240958_C2F4F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -598,7 +598,7 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -611,16 +611,16 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_80240C10_C2F7B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C10_C2F7B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -630,19 +630,19 @@ void N(func_80240C10_C2F7B0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240C74_C2F814)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C74_C2F814)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_80240D1C_C2F8BC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240D1C_C2F8BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -673,11 +673,11 @@ void N(func_80240D1C_C2F8BC)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -687,16 +687,17 @@ void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240F00_C2FAA0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -709,9 +710,9 @@ void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241078_C2FC18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -722,9 +723,9 @@ void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -742,7 +743,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -753,7 +754,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}

View File

@ -37,8 +37,7 @@ Script N(80242870) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -536,7 +535,7 @@ StaticNpc N(npcGroup_80243DE8)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -604,7 +603,7 @@ StaticNpc N(npcGroup_802441C8)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -673,7 +672,7 @@ StaticNpc N(npcGroup_802445A8)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -746,9 +745,9 @@ NpcGroupList N(npcGroupList_80244988) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240458_C31938)(ScriptInstance *script) {
s32 N(func_80240458_C31938)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -764,7 +763,8 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -785,9 +785,9 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -805,7 +805,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -872,7 +872,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -894,7 +894,7 @@ ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -919,7 +919,7 @@ ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -941,7 +941,7 @@ ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, NpcAISettings* aiSetti
#include "world/common/UnkFunc16.inc.c"
ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -962,7 +962,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -1026,9 +1026,9 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -1046,7 +1046,7 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -1114,26 +1114,26 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_80241C7C_C3315C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241C7C_C3315C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241D04_C331E4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -1167,7 +1167,7 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -1180,16 +1180,16 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_80241FBC_C3349C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241FBC_C3349C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -1199,19 +1199,19 @@ void N(func_80241FBC_C3349C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80242020_C33500)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242020_C33500)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_802420C8_C335A8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802420C8_C335A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -1242,11 +1242,11 @@ void N(func_802420C8_C335A8)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1256,16 +1256,17 @@ void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_802422AC_C3378C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802422AC_C3378C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -1278,9 +1279,9 @@ void N(func_802422AC_C3378C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80242424_C33904)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242424_C33904)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -1291,9 +1292,9 @@ void N(func_80242424_C33904)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -1311,7 +1312,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -1322,7 +1323,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}

View File

@ -29,8 +29,7 @@ Script N(80243170) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -108,8 +107,8 @@ static s32 N(pad_3558)[] = {
};
f32 N(D_80243560_C39A90)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
Script N(80243578) = SCRIPT({
@ -402,14 +401,14 @@ void N(func_80240000_C36530)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -531,9 +530,9 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -561,7 +560,8 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_dgb/dgb_04/C36530", dgb_04_func_802401B0_C366E0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_dgb/dgb_04/C36530", dgb_04_func_802401B0_C366E0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"
@ -588,7 +588,7 @@ void N(func_80240C54_C37184)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkFunc5.inc.c"
ApiStatus N(func_8024130C_C3783C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024130C_C3783C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Bytecode* args = script->ptrReadPos;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -647,7 +647,7 @@ ApiStatus N(func_8024130C_C3783C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802414F8_C37A28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f0;
@ -657,7 +657,7 @@ void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings,
if (npc->duration <= 0) {
npc->flags &= ~0x00200000;
npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1);
npc->currentAnim = enemy->animList[8];
npc->currentAnim.w = enemy->animList[8];
npc->moveSpeed = aiSettings->chaseSpeed;
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20);
@ -674,13 +674,14 @@ void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241650_C37B80)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241650_C37B80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
npc->duration = 0;
script->functionTemp[0].s = 14;
} else {
@ -696,7 +697,7 @@ void N(func_80241650_C37B80)(ScriptInstance *script, NpcAISettings *aiSettings,
}
void N(func_80241754_C37C84)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241754_C37C84)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -710,7 +711,7 @@ void N(func_80241754_C37C84)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[0].s = 15;
}
void N(func_802417F8_C37D28)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802417F8_C37D28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -754,7 +755,7 @@ void N(func_802417F8_C37D28)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241A94_C37FC4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241A94_C37FC4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -764,12 +765,12 @@ void N(func_80241A94_C37FC4)(ScriptInstance *script, NpcAISettings *aiSettings,
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
}
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
npc->duration = 20;
script->functionTemp[0].s = 17;
}
void N(func_80241B4C_C3807C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241B4C_C3807C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -792,7 +793,7 @@ void N(func_80241B4C_C3807C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241CCC_C381FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241CCC_C381FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -802,7 +803,7 @@ void N(func_80241CCC_C381FC)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241D14_C38244)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241D14_C38244)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -819,7 +820,7 @@ void N(func_80241D14_C38244)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241D94_C382C4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241D94_C382C4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -831,7 +832,7 @@ void N(func_80241D94_C382C4)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[1].s = 0x1E;
}
void N(func_80241E3C_C3836C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241E3C_C3836C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX = npc->pos.x;
@ -875,7 +876,7 @@ void N(func_80241E3C_C3836C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -955,7 +956,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkFunc17.inc.c"
ApiStatus N(func_8024240C_C3893C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024240C_C3893C)(ScriptInstance* script, s32 isInitialCall) {
func_802E5690(get_variable(script, *script->ptrReadPos));
return ApiStatus_DONE2;
}
@ -985,7 +986,7 @@ typedef struct {
} N(UnkStruct);
ApiStatus N(func_8024259C_C38ACC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
N(UnkStruct)* ptr;
s32 i;
@ -1057,7 +1058,8 @@ ApiStatus N(func_8024259C_C38ACC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
#else
INCLUDE_ASM(ApiStatus, "world/area_dgb/dgb_04/C36530", dgb_04_func_8024259C_C38ACC, ScriptInstance *script, s32 isInitialCall)
INCLUDE_ASM(ApiStatus, "world/area_dgb/dgb_04/C36530", dgb_04_func_8024259C_C38ACC, ScriptInstance* script,
s32 isInitialCall)
#endif
ApiStatus N(func_802427EC_C38D1C)(ScriptInstance* script, s32 isInitialCall) {
@ -1092,8 +1094,8 @@ typedef struct {
s32 unk_64;
} N(UserData);
ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) {
Bytecode *args = script->ptrReadPos;
ApiStatus N(func_802429D0_C38F00)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Npc* npc = get_npc_safe(-4);
f32 sinTheta, cosTheta;
s32 i;
@ -1111,7 +1113,8 @@ ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) {
scriptPtr->unk_5C = get_entity_by_index(get_variable(script, *args));
for (i = 0, userDataPtr = scriptPtr; i < 3; i++) {
userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1);
userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f,
scriptPtr->unk_5C->position.z, 1.0f, -1);
save = 0.0f;
userDataPtr->unk_2C[i] = save;
userDataPtr->unk_20[i] = save;
@ -1219,8 +1222,8 @@ ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
s32 N(func_80242F08_C39438)(ScriptInstance *script, s32 isInitialCall) {
Bytecode *args = script->ptrReadPos;
s32 N(func_80242F08_C39438)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 ret = 0;
if (isInitialCall) {

View File

@ -30,8 +30,7 @@ Script N(802414E0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -202,7 +201,7 @@ StaticNpc N(npcGroup_80241B4C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -270,7 +269,7 @@ StaticNpc N(npcGroup_80241F2C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -334,14 +333,14 @@ NpcGroupList N(npcGroupList_8024230C) = {
{},
};
ApiStatus N(func_80240000_C3AA10)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_C3AA10)(ScriptInstance* script, s32 isInitialCall) {
if (gPlayerStatus.position.y >= -210.0f) {
return ApiStatus_BLOCK;
}
return ApiStatus_DONE2;
}
ApiStatus N(func_80240030_C3AA40)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240030_C3AA40)(ScriptInstance* script, s32 isInitialCall) {
if (gPlayerStatus.position.y > -270.0f) {
return ApiStatus_BLOCK;
}
@ -356,9 +355,9 @@ ApiStatus N(func_80240030_C3AA40)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
s32 N(func_80240268_C3AC78)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -374,7 +373,8 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -395,26 +395,26 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
void N(func_8024067C_C3B08C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024067C_C3B08C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240704_C3B114)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -448,7 +448,7 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -461,16 +461,16 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_802409BC_C3B3CC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802409BC_C3B3CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -480,19 +480,19 @@ void N(func_802409BC_C3B3CC)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240A20_C3B430)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240A20_C3B430)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_80240AC8_C3B4D8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240AC8_C3B4D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -523,11 +523,11 @@ void N(func_80240AC8_C3B4D8)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -537,16 +537,17 @@ void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240CAC_C3B6BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -559,9 +560,9 @@ void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240E24_C3B834)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -572,9 +573,9 @@ void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -592,7 +593,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -603,7 +604,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}
@ -676,9 +677,9 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -696,7 +697,7 @@ ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;

View File

@ -25,8 +25,7 @@ Script N(80240320) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -139,10 +138,12 @@ NpcSettings N(npcSettings_80240840) = {
Script N(interact_8024086C) = SCRIPT({
if (SI_AREA_FLAG(4) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F0));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00F0));
SI_AREA_FLAG(4) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F1));
SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E,
0x00F1));
SI_AREA_FLAG(4) = 0;
}
});

View File

@ -29,8 +29,7 @@ Script N(80241490) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -189,7 +188,7 @@ StaticNpc N(npcGroup_80241A7C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -265,9 +264,9 @@ static const s32 N(pad_1E74)[] = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
s32 N(func_80240208_C3DDF8)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -283,7 +282,8 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -304,26 +304,26 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
void N(func_8024061C_C3E20C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024061C_C3E20C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802406A4_C3E294)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -357,7 +357,7 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -370,16 +370,16 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_8024095C_C3E54C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024095C_C3E54C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -389,19 +389,19 @@ void N(func_8024095C_C3E54C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_802409C0_C3E5B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802409C0_C3E5B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_80240A68_C3E658)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240A68_C3E658)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -432,11 +432,11 @@ void N(func_80240A68_C3E658)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -446,16 +446,17 @@ void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C4C_C3E83C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -468,9 +469,9 @@ void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240DC4_C3E9B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -481,9 +482,9 @@ void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -501,7 +502,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -512,7 +513,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}
@ -585,9 +586,9 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241170_C3ED60)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -605,7 +606,7 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -626,7 +627,7 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) {
switch (script->functionTemp[0].s) {
case 0:
func_800495A0(script, npcAISettings, territoryPtr);
func_800495A0(script, npcAISettings, territoryPtr);
case 1:
func_800496B8(script, npcAISettings, territoryPtr);
break;

View File

@ -39,8 +39,7 @@ Script N(80243CF0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -255,8 +254,8 @@ NpcSettings N(npcSettings_80244434) = {
};
f32 N(D_80244460_C44210)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
Script N(80244478) = SCRIPT({
@ -534,7 +533,7 @@ StaticNpc N(npcGroup_80245290)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -603,7 +602,7 @@ StaticNpc N(npcGroup_80245670)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -672,7 +671,7 @@ StaticNpc N(npcGroup_80245A50)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -956,7 +955,7 @@ Script N(802469E0) = SCRIPT({
ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -978,7 +977,7 @@ ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1003,7 +1002,7 @@ ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -1025,7 +1024,7 @@ ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, NpcAISettings* aiSetti
#include "world/common/UnkFunc16.inc.c"
ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1046,7 +1045,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -1118,9 +1117,9 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80241098_C40E48)(ScriptInstance *script) {
s32 N(func_80241098_C40E48)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -1136,7 +1135,8 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -1157,9 +1157,9 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
ApiStatus N(func_802414AC_C4125C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -1177,7 +1177,7 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -1248,14 +1248,14 @@ void N(func_80241760_C41510)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -1377,9 +1377,9 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1407,7 +1407,8 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_dgb/dgb_08/C3FDB0", dgb_08_func_80241910_C416C0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_dgb/dgb_08/C3FDB0", dgb_08_func_80241910_C416C0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1_copy.inc.c"
@ -1494,7 +1495,7 @@ ApiStatus N(func_80242A6C_C4281C)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242C58_C42A08)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f0;
@ -1504,7 +1505,7 @@ void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings,
if (npc->duration <= 0) {
npc->flags &= ~0x00200000;
npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1);
npc->currentAnim = enemy->animList[8];
npc->currentAnim.w = enemy->animList[8];
npc->moveSpeed = aiSettings->chaseSpeed;
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20);
@ -1521,13 +1522,14 @@ void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80242DB0_C42B60)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242DB0_C42B60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
npc->duration = 0;
script->functionTemp[0].s = 14;
} else {
@ -1543,7 +1545,7 @@ void N(func_80242DB0_C42B60)(ScriptInstance *script, NpcAISettings *aiSettings,
}
void N(func_80242EB4_C42C64)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242EB4_C42C64)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 i;
@ -1565,7 +1567,7 @@ void N(func_80242EB4_C42C64)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[0].s = 15;
}
void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242F94_C42D44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -1611,7 +1613,7 @@ void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80243230_C42FE0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80243230_C42FE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1621,12 +1623,12 @@ void N(func_80243230_C42FE0)(ScriptInstance *script, NpcAISettings *aiSettings,
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
}
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
npc->duration = 20;
script->functionTemp[0].s = 17;
}
void N(func_802432E8_C43098)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802432E8_C43098)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -1649,7 +1651,7 @@ void N(func_802432E8_C43098)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80243468_C43218)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80243468_C43218)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1659,7 +1661,7 @@ void N(func_80243468_C43218)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_802434B0_C43260)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802434B0_C43260)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1676,7 +1678,7 @@ void N(func_802434B0_C43260)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80243530_C432E0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80243530_C432E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1688,7 +1690,7 @@ void N(func_80243530_C432E0)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[1].s = 0x1E;
}
void N(func_802435D8_C43388)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802435D8_C43388)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX = npc->pos.x;
@ -1732,7 +1734,7 @@ void N(func_802435D8_C43388)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_802438F0_C436A0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1836,7 +1838,7 @@ ApiStatus N(func_80243C10_C439C0)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80243C50_C43A00)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80243C50_C43A00)(ScriptInstance* script, s32 isInitialCall) {
func_800494C0(get_npc_unsafe(script->owner1.enemy->npcID), 0x32F, 0);
return ApiStatus_DONE2;
}

View File

@ -35,8 +35,7 @@ Script N(80243880) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -299,8 +298,8 @@ NpcSettings N(npcSettings_8024432C) = {
};
f32 N(D_80244358_C4AF38)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
Script N(80244370) = SCRIPT({
@ -422,7 +421,7 @@ StaticNpc N(npcGroup_80244920)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -500,7 +499,7 @@ StaticNpc N(npcGroup_80244D6C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -604,9 +603,9 @@ NpcGroupList N(npcGroupList_8024533C) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
s32 N(func_80240208_C46DE8)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -622,7 +621,8 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -643,9 +643,9 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -663,7 +663,7 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -728,26 +728,26 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_802408D0_C474B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802408D0_C474B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240958_C47538)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -781,7 +781,7 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -794,16 +794,16 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_80240C10_C477F0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C10_C477F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -813,19 +813,19 @@ void N(func_80240C10_C477F0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240C74_C47854)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C74_C47854)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_80240D1C_C478FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240D1C_C478FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -856,11 +856,11 @@ void N(func_80240D1C_C478FC)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -870,16 +870,17 @@ void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_80240F00_C47AE0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240F00_C47AE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -892,9 +893,9 @@ void N(func_80240F00_C47AE0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241078_C47C58)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241078_C47C58)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -905,9 +906,9 @@ void N(func_80241078_C47C58)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -925,7 +926,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -936,7 +937,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}
@ -1015,14 +1016,14 @@ void N(func_80241424_C48004)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -1144,9 +1145,9 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1174,7 +1175,8 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_dgb/dgb_09/C46BE0", dgb_09_func_802415D4_C481B4, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_dgb/dgb_09/C46BE0", dgb_09_func_802415D4_C481B4, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"
@ -1261,7 +1263,7 @@ ApiStatus N(func_80242730_C49310)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024291C_C494FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f0;
@ -1271,7 +1273,7 @@ void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings,
if (npc->duration <= 0) {
npc->flags &= ~0x00200000;
npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1);
npc->currentAnim = enemy->animList[8];
npc->currentAnim.w = enemy->animList[8];
npc->moveSpeed = aiSettings->chaseSpeed;
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20);
@ -1288,13 +1290,14 @@ void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80242A74_C49654)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242A74_C49654)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) {
npc->duration = 0;
script->functionTemp[0].s = 14;
} else {
@ -1310,7 +1313,7 @@ void N(func_80242A74_C49654)(ScriptInstance *script, NpcAISettings *aiSettings,
}
void N(func_80242B78_C49758)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242B78_C49758)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1324,7 +1327,7 @@ void N(func_80242B78_C49758)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[0].s = 15;
}
void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242C1C_C497FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -1370,7 +1373,7 @@ void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80242EB8_C49A98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242EB8_C49A98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1380,12 +1383,12 @@ void N(func_80242EB8_C49A98)(ScriptInstance *script, NpcAISettings *aiSettings,
sfx_stop_sound(0x80000011);
enemy->varTable[0] &= ~0x1000;
}
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
npc->duration = 20;
script->functionTemp[0].s = 17;
}
void N(func_80242F70_C49B50)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242F70_C49B50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posY, posZ, posW;
@ -1408,7 +1411,7 @@ void N(func_80242F70_C49B50)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_802430F0_C49CD0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802430F0_C49CD0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1418,7 +1421,7 @@ void N(func_802430F0_C49CD0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80243138_C49D18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80243138_C49D18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1435,7 +1438,7 @@ void N(func_80243138_C49D18)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_802431B8_C49D98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802431B8_C49D98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1447,7 +1450,7 @@ void N(func_802431B8_C49D98)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[1].s = 0x1E;
}
void N(func_80243260_C49E40)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80243260_C49E40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX = npc->pos.x;
@ -1491,7 +1494,7 @@ void N(func_80243260_C49E40)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80243578_C4A158)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;

View File

@ -20,8 +20,7 @@ Script N(80240250) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -292,9 +291,9 @@ Script N(makeEntities) = SCRIPT({
}
});
ApiStatus N(func_80240000_C4C390)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_C4C390)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 *array = script->array;
s32* array = script->array;
f32 distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[3]);
script->varTable[0] = 1;
@ -308,10 +307,10 @@ ApiStatus N(func_80240000_C4C390)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802400A0_C4C430)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 distance;
s32 *array = script->array;
s32* array = script->array;
distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[4]);
script->varTable[0] = 0;
@ -325,7 +324,7 @@ ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 var;
@ -345,7 +344,7 @@ ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_802401C0_C4C550)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802401C0_C4C550)(ScriptInstance* script, s32 isInitialCall) {
if (gPlayerStatus.position.y > -60.0f) {
return ApiStatus_BLOCK;
}

View File

@ -24,8 +24,7 @@ Script N(802400D0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}

View File

@ -19,8 +19,7 @@ Script N(80240310) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}

View File

@ -19,8 +19,7 @@ Script N(80240050) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}

View File

@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}

View File

@ -32,8 +32,7 @@ Script N(802418E0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -452,9 +451,9 @@ Script N(makeEntities) = SCRIPT({
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C4F718)(ScriptInstance *script) {
s32 N(func_80240208_C4F718)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -470,7 +469,8 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -491,9 +491,9 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -511,7 +511,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -578,7 +578,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -600,7 +600,7 @@ ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -625,7 +625,7 @@ ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -668,7 +668,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;

View File

@ -38,8 +38,7 @@ Script N(80241480) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -205,7 +204,7 @@ StaticNpc N(npcGroup_80241A4C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -274,7 +273,7 @@ StaticNpc N(npcGroup_80241E2C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -342,7 +341,7 @@ StaticNpc N(npcGroup_8024220C)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -410,7 +409,7 @@ StaticNpc N(npcGroup_802425EC)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -478,7 +477,7 @@ StaticNpc N(npcGroup_802429CC)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -546,7 +545,7 @@ StaticNpc N(npcGroup_80242DAC)[] = {
.dropFlags = 0x80,
.itemDropChance = 5,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 10, 0 },
{ ITEM_SUPER_SHROOM, 10, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
@ -622,9 +621,9 @@ NpcGroupList N(npcGroupList_8024318C) = {
#include "world/common/UnkNpcAIFunc5.inc.c"
s32 N(func_80240208_C52748)(ScriptInstance *script) {
s32 N(func_80240208_C52748)(ScriptInstance* script) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Camera* camera = CAM(gCurrentCamID);
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
f32 phi_f20;
@ -640,7 +639,8 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) {
phi_f20 = 270.0f;
}
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) {
ret = FALSE;
}
@ -661,26 +661,26 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) {
#include "world/common/UnkFunc7.inc.c"
void N(func_8024061C_C52B5C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024061C_C52B5C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->duration > 0) {
npc->duration--;
}
if (npc->duration == 1) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
script->functionTemp[0].s = 1;
}
}
void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802406A4_C52BE4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerData* playerData = get_player_data();
s32 phi_s2 = FALSE;
s32 var;
@ -714,7 +714,7 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings,
if (phi_s2) {
func_800494C0(npc, 0xB000000E, 0);
npc->currentAnim = enemy->animList[11];
npc->currentAnim.w = enemy->animList[11];
npc->duration = 10;
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
func_800494C0(npc, 0x2F4, 0x200000);
@ -727,16 +727,16 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings,
} else if (npc->duration == 57) {
func_800494C0(npc, 0xB000000D, 0);
} else if (npc->duration == 59) {
npc->currentAnim = enemy->animList[12];
npc->currentAnim.w = enemy->animList[12];
} else if (npc->duration == 60) {
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->duration = 0;
}
}
void N(func_8024095C_C52E9C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_8024095C_C52E9C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
@ -746,19 +746,19 @@ void N(func_8024095C_C52E9C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_802409C0_C52F00)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802409C0_C52F00)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = (rand_int(1000) % 2) + 2;
script->functionTemp[0].s = 4;
}
void N(func_80240A68_C52FA8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240A68_C52FA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
@ -789,11 +789,11 @@ void N(func_80240A68_C52FA8)(ScriptInstance *script, NpcAISettings *aiSettings,
void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -803,16 +803,17 @@ void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
void N(func_80240C4C_C5318C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240C4C_C5318C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 var;
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
script->functionTemp[0].s = 12;
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim = enemy->animList[0];
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x,
enemy->territory->wander.point.z) <= npc->moveSpeed) {
npc->currentAnim.w = enemy->animList[0];
npc->duration = 15;
enemy->varTable[7] = 50;
script->functionTemp[0].s = 3;
@ -825,9 +826,9 @@ void N(func_80240C4C_C5318C)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80240DC4_C53304)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80240DC4_C53304)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
if (npc->turnAroundYawAdjustment == 0) {
npc->duration--;
@ -838,9 +839,9 @@ void N(func_80240DC4_C53304)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -858,7 +859,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 30;
npc->currentAnim = enemy->animList[10];
npc->currentAnim.w = enemy->animList[10];
npc->flags &= ~0x800;
enemy->varTable[0] = 0;
if (!enemy->territory->wander.isFlying) {
@ -869,7 +870,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->unk_B0 & 4) {
script->functionTemp[0].s = 99;
script->functionTemp[1].s = 40;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
enemy->unk_B0 &= ~4;
}
@ -942,9 +943,9 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80241170_C536B0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241170_C536B0)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -962,7 +963,7 @@ ApiStatus N(func_80241170_C536B0)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;

View File

@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}

View File

@ -31,8 +31,7 @@ Script N(802412C0) = SCRIPT({
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
@ -471,9 +470,11 @@ Script N(idle_80242A24) = SCRIPT({
SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00F7));
ShowChoice(1966093);
if (SI_VAR(0) == 0) {
ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F8));
ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E,
0x00F8));
} else {
ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F9));
ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E,
0x00F9));
}
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
SetCamSpeed(0, 4.0);
@ -684,7 +685,7 @@ Script N(makeEntities) = SCRIPT({
ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -706,7 +707,7 @@ ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -731,7 +732,7 @@ ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -774,7 +775,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -839,9 +840,9 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
#include "world/common/UnkFunc1.inc.c"
ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc *npc = get_npc_unsafe(0);
Npc* npc = get_npc_unsafe(0);
f32 posX, posZ;
if (isInitialCall) {

View File

@ -426,8 +426,7 @@ Script N(enterWalk_80244C14) = SCRIPT({
== 10 {
spawn 0x80285C50;
spawn N(80244A28);
}
else {
} else {
SI_VAR(0) = N(80244A28);
spawn EnterWalk;
}
@ -449,8 +448,7 @@ Script N(main) = SCRIPT({
match STORY_PROGRESS {
-53..6 {
MakeNpcs(0, N(npcGroupList_8024B47C));
}
else {
} else {
MakeNpcs(0, N(npcGroupList_8024B464));
}
}
@ -1340,11 +1338,11 @@ Script N(80247D90) = SCRIPT({
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 5, SI_VAR(8));
EnablePartnerAI();
SI_VAR(12) = 1;
}
else {
} else {
DisablePartnerAI(0);
sleep 1;
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 5, SI_VAR(9));
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1),
5, SI_VAR(9));
if (SI_VAR(10) != 0) {
SpeakToPlayer(SI_VAR(2), SI_VAR(3), SI_VAR(4), 0, SI_VAR(10));
}
@ -1374,7 +1372,8 @@ Script N(80248090) = SCRIPT({
Script N(interact_802480E0) = SCRIPT({
if (STORY_PROGRESS >= STORY_CH2_STAR_SPRIT_DEPARTED) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_00, Anim_5), NPC_ANIM(mouser, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0062));
SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_00, Anim_5), NPC_ANIM(mouser, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D,
0x0062));
return;
}
match SI_AREA_VAR(0) {
@ -1422,9 +1421,9 @@ Script N(interact_8024821C) = SCRIPT({
}
< 39 {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D, 0x0066));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D, 0x0067));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D,
0x0067));
}
}
});
@ -1515,7 +1514,8 @@ Script N(interact_80248864) = SCRIPT({
if (SI_SAVE_FLAG(761) == 1) {
N(func_802431B4_95E3B4)();
if (SI_VAR(0) == 1) {
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x007B));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x007B));
return;
}
}
@ -1523,14 +1523,20 @@ Script N(interact_80248864) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH2_STAR_SPRIT_DEPARTED {
if (SI_AREA_FLAG(1) == 0) {
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006C));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006D));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006E));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x006C));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x006D));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x006E));
SI_AREA_FLAG(1) = 1;
} else {
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006F));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0070));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0071));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x006F));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0070));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0071));
SI_AREA_FLAG(1) = 0;
}
}
@ -1538,11 +1544,13 @@ Script N(interact_80248864) = SCRIPT({
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0072));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0073));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0074));
}
else {
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0075));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0076));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0077));
} else {
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0075));
SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0076));
SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0077));
}
}
});
@ -1601,16 +1609,19 @@ Script N(interact_80248D54) = SCRIPT({
if (SI_SAVE_FLAG(754) == 1) {
FindKeyItem(ITEM_MELODY, SI_VAR(0));
if (SI_VAR(0) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0084));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0084));
return;
} else {
if (SI_SAVE_FLAG(755) == 0) {
if (STORY_PROGRESS < STORY_CH7_BEGAN_PEACH_MISSION) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0085));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0085));
SetPlayerAnimation(ANIM_NOD_YES);
sleep 30;
SetPlayerAnimation(ANIM_10002);
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0086));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0086));
SI_SAVE_FLAG(755) = 1;
return;
}
@ -1620,28 +1631,33 @@ Script N(interact_80248D54) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH2_STAR_SPRIT_DEPARTED {
if (SI_AREA_FLAG(2) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007C));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x007C));
SI_AREA_FLAG(2) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007D));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x007D));
SI_AREA_FLAG(2) = 0;
}
}
< STORY_CH5_STAR_SPRIT_DEPARTED {
if (SI_AREA_FLAG(2) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007E));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x007E));
SI_AREA_FLAG(2) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007F));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x007F));
SI_AREA_FLAG(2) = 0;
}
}
else {
} else {
if (SI_AREA_FLAG(2) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0080));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0080));
SI_AREA_FLAG(2) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0081));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0081));
SI_AREA_FLAG(2) = 0;
}
}
@ -1653,11 +1669,13 @@ Script N(interact_80248D54) = SCRIPT({
== 0 {}
== -1 {}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0082));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0082));
SetNpcAnimation(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_3));
sleep 60;
SetNpcAnimation(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_1));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0083));
SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x0083));
SI_VAR(0) = 104;
SI_VAR(1) = 1;
await N(802451BC);
@ -1739,8 +1757,7 @@ Script N(idle_8024918C) = SCRIPT({
await N(8024C4C8);
EnableNpcBlur(-1, 0);
STORY_PROGRESS = STORY_CH2_SHADY_MOUSE_ENTERED_SHOP;
}
else {
} else {
SetNpcAnimation(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_1));
SetNpcPos(NPC_SELF, 20, 0, -375);
}
@ -1750,7 +1767,8 @@ Script N(idle_8024918C) = SCRIPT({
Script N(interact_80249750) = SCRIPT({
if (SI_AREA_VAR(4) == 4) {
if (SI_AREA_VAR(5) == 1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0088));
SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x0088));
await N(80248090);
if (SI_VAR(12) != 0) {
return;
@ -1787,23 +1805,28 @@ Script N(interact_802498E8) = SCRIPT({
FindKeyItem(ITEM_FOURTH_DEGREE_CARD, SI_VAR(4));
FindKeyItem(ITEM_DIPLOMA, SI_VAR(5));
if (SI_VAR(1) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009A));
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x009A));
return;
}
if (SI_VAR(2) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009B));
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x009B));
return;
}
if (SI_VAR(3) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009C));
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x009C));
return;
}
if (SI_VAR(4) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009D));
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x009D));
return;
}
if (SI_VAR(5) != -1) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009E));
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D,
0x009E));
return;
}
SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0099));
@ -2331,7 +2354,8 @@ Script N(8024B7B0) = SCRIPT({
N(func_80243578_95E778)();
func_802D2C14(1);
await N(8024B614);
SpeakToPlayer(NPC_MOUSER1, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x008D));
SpeakToPlayer(NPC_MOUSER1, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0,
MESSAGE_ID(0x0D, 0x008D));
SI_VAR(0) = 119;
SI_VAR(1) = 1;
await N(8024B5B4);
@ -2376,8 +2400,7 @@ Script N(8024B894) = SCRIPT({
}
== 167 {
SI_AREA_VAR(4) = 3;
}
else {
} else {
SI_AREA_VAR(4) = 0;
}
}
@ -2848,7 +2871,7 @@ Script N(makeEntities) = SCRIPT({
ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -2870,7 +2893,7 @@ ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -2895,7 +2918,7 @@ ApiStatus N(func_80240C5C_95BE5C)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -2938,7 +2961,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;
@ -3024,7 +3047,7 @@ ApiStatus N(func_80241470_95C670)(ScriptInstance* script, s32 isInitialCall) {
#include "world/common/Set80151310.inc.c"
// Ok good luck.
ApiStatus N(func_802415AC_95C7AC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802415AC_95C7AC)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemyID;
u16 phi_s0 = get_variable(script, SI_SAVE_FLAG(1768));
u16 phi_s7 = get_variable(script, SI_SAVE_FLAG(1769));
@ -3083,7 +3106,7 @@ ApiStatus N(func_802415AC_95C7AC)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkFunc31.inc.c"
ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance* script, s32 isInitialCall) {
u16 quizzesAnswered = gPlayerData.quizzesAnswered;
if (quizzesAnswered < 999) {
@ -3100,13 +3123,16 @@ ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance* script, s32 isInitialCall) {
EffectInstanceDataThing* effectPtr;
if (isInitialCall) {
N(D_8024DFE0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)));
N(D_8024DFE4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)));
N(D_8024DFE8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)), 1.0f, 0);
N(D_8024DFE0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)));
N(D_8024DFE4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)));
N(D_8024DFE8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)), 1.0f, 0);
effectPtr = N(D_8024DFE0)->unk_0C;
effectPtr->unk_18 = 0;
@ -3131,7 +3157,7 @@ ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance* script, s32 isInitialCall) {
EffectInstanceDataThing* effectPtr;
if (isInitialCall) {
@ -3156,12 +3182,12 @@ ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80241EAC_95D0AC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241EAC_95D0AC)(ScriptInstance* script, s32 isInitialCall) {
N(D_8024DFE0)->unk_0C->unk_34 = get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2;
}
ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance* script, s32 isInitialCall) {
s32 var = get_variable(script, *script->ptrReadPos);
EffectInstanceDataThing* effectPtr = N(D_8024DFE0)->unk_0C;
@ -3183,17 +3209,17 @@ ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241F60_95D160)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241F60_95D160)(ScriptInstance* script, s32 isInitialCall) {
N(D_8024DFE8)->unk_0C->unk_1C = 0;
return ApiStatus_DONE2;
}
ApiStatus N(func_80241F78_95D178)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241F78_95D178)(ScriptInstance* script, s32 isInitialCall) {
N(D_8024DFE8)->unk_0C->unk_1C = 1;
return ApiStatus_DONE2;
}
ApiStatus N(func_80241F94_95D194)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241F94_95D194)(ScriptInstance* script, s32 isInitialCall) {
N(D_8024DFE8)->unk_0C->unk_1C = 2;
return ApiStatus_DONE2;
}
@ -3220,7 +3246,7 @@ void N(func_80242468_95D668)(void) {
}
}
ApiStatus N(func_802424D4_95D6D4)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802424D4_95D6D4)(ScriptInstance* script, s32 isInitialCall) {
N(D_8024DFC0) = create_dynamic_entity_frontUI(NULL, N(func_80242468_95D668));
return ApiStatus_DONE2;
}
@ -3276,7 +3302,7 @@ ApiStatus N(func_802427BC_95D9BC)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80242858_95DA58)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80242858_95DA58)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
N(Unk_Struct_2)* temp_s1 = get_variable(script, *script->ptrReadPos);
N(Unk_Struct_1)* ptr;
@ -3401,20 +3427,20 @@ ApiStatus N(func_80242858_95DA58)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkYawFunc.inc.c"
ApiStatus N(func_80243014_95E214)(ScriptInstance *script, s32 isInitialCall) {
Npc *npc = get_npc_unsafe(script->varTable[2]);
ApiStatus N(func_80243014_95E214)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(script->varTable[2]);
N(D_8024E1B4) = npc->currentAnim;
npc->currentAnim = script->varTable[4];
N(D_8024E1B4) = npc->currentAnim.w;
npc->currentAnim.w = script->varTable[4];
return ApiStatus_DONE2;
}
ApiStatus N(func_80243058_95E258)(ScriptInstance *script, s32 isInitialCall) {
get_npc_unsafe(script->varTable[2])->currentAnim = N(D_8024E1B4);
ApiStatus N(func_80243058_95E258)(ScriptInstance* script, s32 isInitialCall) {
get_npc_unsafe(script->varTable[2])->currentAnim.w = N(D_8024E1B4);
return ApiStatus_DONE2;
}
ApiStatus N(func_80243084_95E284)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80243084_95E284)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
playerData->unk_328 = playerData->frameCounter;
@ -3429,7 +3455,8 @@ void N(func_802430C8_95E2C8)(N(Unk_Struct_1)* ptr, s32 arg1) {
switch (arg1) {
case 2:
if (ptr->unk_1C >= 6) {
if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x, playerStatus->position.z))) < 30.0f) {
if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x,
playerStatus->position.z))) < 30.0f) {
start_script(N(80248504), 1, 0);
ptr->unk_20 = 4;
}
@ -3444,7 +3471,7 @@ void N(func_802430C8_95E2C8)(N(Unk_Struct_1)* ptr, s32 arg1) {
}
}
ApiStatus N(func_802431B4_95E3B4)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802431B4_95E3B4)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
s32 val = (playerData->frameCounter - playerData->unk_328) / 3600;
@ -3457,9 +3484,9 @@ ApiStatus N(func_802431B4_95E3B4)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_802431FC_95E3FC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802431FC_95E3FC)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc *npc = get_npc_safe(script->owner2.npcID);
Npc* npc = get_npc_safe(script->owner2.npcID);
s32 rand;
f32 temp_f22;
f32 temp_f24;
@ -3480,9 +3507,9 @@ ApiStatus N(func_802431FC_95E3FC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80243350_95E550)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80243350_95E550)(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode *args = script->ptrReadPos;
Bytecode* args = script->ptrReadPos;
f32 var1 = get_variable(script, *args++);
f32 var2 = get_variable(script, *args++);
f32 var3 = get_variable(script, *args++);

View File

@ -182,8 +182,7 @@ Script N(main) = SCRIPT({
match SI_VAR(0) {
2, 3 {
await N(80243D10);
}
else {
} else {
SI_VAR(0) = N(80243C9C);
spawn EnterWalk;
}
@ -192,7 +191,7 @@ Script N(main) = SCRIPT({
spawn {
SetTexPanner(162, 1);
SI_VAR(0) = 0;
123:
123:
SI_VAR(0) += 420;
if (SI_VAR(0) > 65536) {
SI_VAR(0) += -65536;
@ -2043,7 +2042,7 @@ Script N(interact_8024ADE4) = SCRIPT({
await N(8024D494);
spawn {
MakeLerp(0, 255, 60, 0);
0:
0:
UpdateLerp();
N(UnkFunc32)(3, SI_VAR(0));
sleep 1;
@ -2058,7 +2057,7 @@ Script N(interact_8024ADE4) = SCRIPT({
N(Call800EB168)(SI_VAR(10));
sleep 45;
MakeLerp(255, 0, 30, 0);
1:
1:
UpdateLerp();
N(UnkFunc32)(0, SI_VAR(0));
sleep 1;
@ -2170,8 +2169,7 @@ Script N(8024B5A0) = SCRIPT({
SpeakToPlayer(NPC_PARTNER, 0x40006, 0x40001, 5, SI_VAR(8));
EnablePartnerAI();
SI_VAR(12) = 1;
}
else {
} else {
DisablePartnerAI(0);
sleep 1;
SpeakToPlayer(NPC_PARTNER, 0x40006, 0x40001, 5, SI_VAR(9));
@ -2223,8 +2221,7 @@ Script N(interact_8024B8F0) = SCRIPT({
}
}
}
}
else {
} else {
SpeakToPlayer(NPC_SELF, 0xB80004, 0xB80001, 0, MESSAGE_ID(0x0D, 0x00B3));
}
}
@ -2248,8 +2245,7 @@ Script N(interact_8024BA9C) = SCRIPT({
}
< STORY_CH5_STAR_SPRIT_DEPARTED {
SpeakToPlayer(NPC_SELF, 0x930204, 0x930201, 0, MESSAGE_ID(0x0D, 0x0093));
}
else {
} else {
SpeakToPlayer(NPC_SELF, 0x930204, 0x930201, 0, MESSAGE_ID(0x0D, 0x0094));
}
}
@ -2276,8 +2272,7 @@ Script N(interact_8024BBD0) = SCRIPT({
}
< STORY_CH5_STAR_SPRIT_DEPARTED {
SpeakToPlayer(NPC_SELF, 0x930004, 0x930001, 0, MESSAGE_ID(0x0D, 0x00A3));
}
else {
} else {
SpeakToPlayer(NPC_SELF, 0x930004, 0x930001, 0, MESSAGE_ID(0x0D, 0x00A4));
}
}
@ -2314,8 +2309,7 @@ Script N(interact_8024BD4C) = SCRIPT({
SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00A8));
SI_AREA_FLAG(4) = 0;
}
}
else {
} else {
if (SI_AREA_FLAG(4) == 0) {
SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00A9));
SI_AREA_FLAG(4) = 1;
@ -2344,8 +2338,7 @@ Script N(interact_8024BF34) = SCRIPT({
}
< STORY_CH5_STAR_SPRIT_DEPARTED {
SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00AD));
}
else {
} else {
SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00AE));
}
}
@ -2439,7 +2432,7 @@ Script N(interact_8024C4EC) = SCRIPT({
< STORY_CH2_BOUGHT_SECRET_ITEMS {
SI_VAR(11) = 0;
SpeakToPlayer(NPC_DISGUISED_MOUSTAFA, 0xBC0004, 0xBC0001, 0, MESSAGE_ID(0x0D, 0x00B4));
0:
0:
ShowChoice(MESSAGE_ID(0x1E, 0x0019));
if (SI_VAR(0) == 1) {
ContinueSpeech(2, 0xBC0004, 0xBC0001, 0, MESSAGE_ID(0x0D, 0x00B6));
@ -2448,7 +2441,7 @@ Script N(interact_8024C4EC) = SCRIPT({
} else {
EndSpeech(2, 12320772, 12320769, 0);
}
1:
1:
SI_VAR(0) = 0;
SI_VAR(1) = 2;
await N(80248A50);
@ -2618,8 +2611,7 @@ Script N(init_8024D04C) = SCRIPT({
InterpNpcYaw(NPC_SELF, 270, 0);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_200000)), TRUE);
SetNpcAnimation(NPC_SELF, 0xBC0005);
}
else {
} else {
BindNpcIdle(NPC_SELF, N(idle_8024C450));
BindNpcInteract(NPC_SELF, N(interact_8024C4EC));
}
@ -3124,7 +3116,7 @@ ApiStatus N(func_80240300_9694C0)(ScriptInstance* script, s32 isInitialCall) {
#include "world/common/Set80151310.inc.c"
ApiStatus N(func_8024043C_9695FC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024043C_9695FC)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemyID;
u16 phi_s0 = get_variable(script, SI_SAVE_FLAG(1768));
u16 phi_s7 = get_variable(script, SI_SAVE_FLAG(1769));
@ -3183,7 +3175,7 @@ ApiStatus N(func_8024043C_9695FC)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkFunc31.inc.c"
ApiStatus N(func_802409EC_969BAC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802409EC_969BAC)(ScriptInstance* script, s32 isInitialCall) {
u16 quizzesAnswered = gPlayerData.quizzesAnswered;
if (quizzesAnswered < 999) {
@ -3200,13 +3192,16 @@ ApiStatus N(func_802409EC_969BAC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80240A70_969C30)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240A70_969C30)(ScriptInstance* script, s32 isInitialCall) {
EffectInstanceDataThing* effectPtr;
if (isInitialCall) {
N(D_8024EFC0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)));
N(D_8024EFC4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)));
N(D_8024EFC8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)), 1.0f, 0);
N(D_8024EFC0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)));
N(D_8024EFC4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)));
N(D_8024EFC8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)),
get_variable(script, SI_ARRAY(3)), 1.0f, 0);
effectPtr = N(D_8024EFC0)->unk_0C;
effectPtr->unk_18 = 0;
@ -3231,7 +3226,7 @@ ApiStatus N(func_80240A70_969C30)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80240C88_969E48)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240C88_969E48)(ScriptInstance* script, s32 isInitialCall) {
EffectInstanceDataThing* effectPtr;
if (isInitialCall) {
@ -3256,12 +3251,12 @@ ApiStatus N(func_80240C88_969E48)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80240D3C_969EFC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240D3C_969EFC)(ScriptInstance* script, s32 isInitialCall) {
((N(temp)*)N(D_8024EFC0))->unk_0C->unk_34 = get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2;
}
ApiStatus N(func_80240D70_969F30)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240D70_969F30)(ScriptInstance* script, s32 isInitialCall) {
s32 var = get_variable(script, *script->ptrReadPos);
EffectInstanceDataThing* effectPtr = N(D_8024EFC0)->unk_0C;
@ -3283,17 +3278,17 @@ ApiStatus N(func_80240D70_969F30)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80240DF0_969FB0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240DF0_969FB0)(ScriptInstance* script, s32 isInitialCall) {
((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 0;
return ApiStatus_DONE2;
}
ApiStatus N(func_80240E08_969FC8)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240E08_969FC8)(ScriptInstance* script, s32 isInitialCall) {
((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 1;
return ApiStatus_DONE2;
}
ApiStatus N(func_80240E24_969FE4)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240E24_969FE4)(ScriptInstance* script, s32 isInitialCall) {
((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 2;
return ApiStatus_DONE2;
}
@ -3320,12 +3315,12 @@ void N(func_802412F8_96A4B8)(void) {
}
}
ApiStatus N(func_80241364_96A524)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241364_96A524)(ScriptInstance* script, s32 isInitialCall) {
gPauseMenuCursorPosY = create_dynamic_entity_frontUI(NULL, N(func_802412F8_96A4B8));
return ApiStatus_DONE2;
}
ApiStatus N(func_80241394_96A554)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241394_96A554)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
Bytecode* args = script->ptrReadPos;
s32 var1 = get_variable(script, *args++);
@ -3361,7 +3356,7 @@ ApiStatus N(func_80241394_96A554)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_802414C0_96A680)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802414C0_96A680)(ScriptInstance* script, s32 isInitialCall) {
s32 i;
if (isInitialCall) {
@ -3387,7 +3382,7 @@ ApiStatus N(func_802414C0_96A680)(ScriptInstance *script, s32 isInitialCall) {
return (script->functionTemp[0].s == 255) * ApiStatus_DONE2;
}
ApiStatus N(func_802415CC_96A78C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802415CC_96A78C)(ScriptInstance* script, s32 isInitialCall) {
s32 i;
if (isInitialCall) {
@ -3418,7 +3413,7 @@ ApiStatus N(func_802415CC_96A78C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_802416FC_96A8BC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802416FC_96A8BC)(ScriptInstance* script, s32 isInitialCall) {
s32 ret;
N(D_8024EFCC) = script;
@ -3440,7 +3435,7 @@ ApiStatus N(func_802416FC_96A8BC)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241874_96AA34)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241874_96AA34)(ScriptInstance* script, s32 isInitialCall) {
func_8013A854(get_variable(script, SI_ARRAY(0)));
func_8013A854(get_variable(script, SI_ARRAY(1)));
func_8013A854(get_variable(script, SI_ARRAY(2)));
@ -3487,19 +3482,22 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) {
gDPSetTextureLUT(gMasterGfxPos++, G_TT_RGBA16);
gDPLoadTLUT_pal16(gMasterGfxPos++, 0, 0xFFFFFFFF);
gDPTileSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTLUTCmd(gMasterGfxPos++, G_TX_LOADTILE, 15);
gDPPipeSync(gMasterGfxPos++);
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, subroutine_arg2E, subroutine_arg2C);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 0, subroutine_arg2E, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 0, subroutine_arg2E, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP,
8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, subroutine_arg2E, subroutine_arg2F);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 0, subroutine_arg2E, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 0, subroutine_arg2E, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, subroutine_arg2E, subroutine_arg2F);
guTranslateF(&subroutine_arg6, ptr->unk_20 - (subroutine_arg2E / 2) - 30, 0.0f, 0.0f);
@ -3552,7 +3550,8 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) {
gMatrixListPos++;
func_802DE044(&subroutine_arg2C, ptr->unk_18, ptr->unk_1C);
func_8013AF70(get_variable(N(D_8024EFCC), SI_ARRAY(3)), subroutine_arg2C, subroutine_arg2D, subroutine_arg2E, subroutine_arg2F, -(subroutine_arg2E / 2), subroutine_arg2F / 2, 0xFF, &subroutine_arg26, 0x10, &subroutine_arg6);
func_8013AF70(get_variable(N(D_8024EFCC), SI_ARRAY(3)), subroutine_arg2C, subroutine_arg2D, subroutine_arg2E,
subroutine_arg2F, -(subroutine_arg2E / 2), subroutine_arg2F / 2, 0xFF, &subroutine_arg26, 0x10, &subroutine_arg6);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
@ -3562,14 +3561,15 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) {
INCLUDE_ASM(u32, "world/area_dro/dro_02/9694C0", dro_02_func_8024190C_96AACC, D_8024F010_Struct* ptr, Matrix4f matrix);
#endif
void N(func_80242214_96B3D4)(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4) {
void N(func_80242214_96B3D4)(s32 arg0, f32* arg1, f32* arg2, f32* arg3, f32* arg4) {
s32* CC_ptr = &N(D_8024EFCC);
D_8024F010_Struct* F010_ptr;
Matrix4f sp20;
Matrix4f sp60;
Matrix4f spA0;
guPositionF(&spA0, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(*CC_ptr, SI_ARRAY(4)), get_variable(*CC_ptr, SI_ARRAY(5)), get_variable(*CC_ptr, SI_ARRAY(6)));
guPositionF(&spA0, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(*CC_ptr, SI_ARRAY(4)),
get_variable(*CC_ptr, SI_ARRAY(5)), get_variable(*CC_ptr, SI_ARRAY(6)));
F010_ptr = ({ D_8024F010_Struct* a = &N(D_8024F010); &a[arg0]; });
guTranslateF(&sp60, F010_ptr->unk_04, F010_ptr->unk_08, F010_ptr->unk_0C);
@ -3586,7 +3586,7 @@ void N(func_80242214_96B3D4)(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg
// Too much work, maybe try again later
#ifdef NON_MATCHING
void func_8024240C_96B5CC(ScriptInstance *script, s32 isInitialCall) {
void func_8024240C_96B5CC(ScriptInstance* script, s32 isInitialCall) {
N(temp)** effect;
N(temp)** effect2;
N(temp)** effect3;
@ -3896,14 +3896,16 @@ void func_8024240C_96B5CC(ScriptInstance *script, s32 isInitialCall) {
}
}
#else
INCLUDE_ASM(void, "world/area_dro/dro_02/9694C0", dro_02_func_8024240C_96B5CC, ScriptInstance *script, s32 isInitialCall);
INCLUDE_ASM(void, "world/area_dro/dro_02/9694C0", dro_02_func_8024240C_96B5CC, ScriptInstance* script,
s32 isInitialCall);
#endif
void N(func_80242EAC_96C06C)(ScriptInstance *script, s32 isInitialCall) {
void N(func_80242EAC_96C06C)(ScriptInstance* script, s32 isInitialCall) {
Matrix4f sp20;
u32 temp_s1;
guPositionF(&sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(N(D_8024EFCC), SI_ARRAY(4)), get_variable(N(D_8024EFCC), SI_ARRAY(5)), get_variable(N(D_8024EFCC), SI_ARRAY(6)));
guPositionF(&sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(N(D_8024EFCC),
SI_ARRAY(4)), get_variable(N(D_8024EFCC), SI_ARRAY(5)), get_variable(N(D_8024EFCC), SI_ARRAY(6)));
temp_s1 = func_8024190C_96AACC(&N(D_8024F010)[0], &sp20);
func_8024190C_96AACC(&N(D_8024F010)[1], &sp20);
@ -3916,12 +3918,12 @@ void N(func_80242EAC_96C06C)(ScriptInstance *script, s32 isInitialCall) {
}
}
ApiStatus N(func_8024303C_96C1FC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024303C_96C1FC)(ScriptInstance* script, s32 isInitialCall) {
sfx_play_sound_with_params(0x202A, 0, 0x18, 0);
return ApiStatus_DONE2;
}
ApiStatus N(func_80243068_96C228)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80243068_96C228)(ScriptInstance* script, s32 isInitialCall) {
sfx_play_sound_with_params(0x202B, 0, 0x68, 0);
return ApiStatus_DONE2;
}
@ -4016,15 +4018,15 @@ ApiStatus N(func_802433E8_96C5A8)(ScriptInstance* script, s32 isInitialCall) {
#include "world/common/UnkYawFunc.inc.c"
ApiStatus N(func_802439FC_96CBBC)(ScriptInstance *script, s32 isInitialCall) {
Npc *npc = get_npc_unsafe(script->varTable[2]);
ApiStatus N(func_802439FC_96CBBC)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(script->varTable[2]);
N(D_8024F3B8) = npc->currentAnim;
npc->currentAnim = script->varTable[4];
N(D_8024F3B8) = npc->currentAnim.w;
npc->currentAnim.w = script->varTable[4];
return ApiStatus_DONE2;
}
ApiStatus N(func_80243A40_96CC00)(ScriptInstance *script, s32 isInitialCall) {
get_npc_unsafe(script->varTable[2])->currentAnim = N(D_8024F3B8);
ApiStatus N(func_80243A40_96CC00)(ScriptInstance* script, s32 isInitialCall) {
get_npc_unsafe(script->varTable[2])->currentAnim.w = N(D_8024F3B8);
return ApiStatus_DONE2;
}

View File

@ -3,7 +3,7 @@
// Same as SpawnSunEffect, but doesn't touch float regs like SpawnSunEffect does
void func_80072950();
ApiStatus N(func_80240000_C9DF20)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240000_C9DF20)(ScriptInstance* script, s32 isInitialCall) {
func_80072950(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -68,13 +68,11 @@ Script N(802414D0) = SCRIPT({
}
== 11 {
FadeInMusic(0, 49, 0, 3000, 0, 127);
}
else {
} else {
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -330,7 +328,7 @@ Script N(main) = SCRIPT({
spawn {
EnableTexPanning(35, 1);
SI_VAR(0) = 0;
0:
0:
RandInt(300, SI_VAR(1));
SI_VAR(1) += 100;
RandInt(1, SI_VAR(2));
@ -540,8 +538,7 @@ Script N(80242FCC) = SCRIPT({
}
< STORY_CH6_BEGAN_PEACH_MISSION {
SwitchMessage(MESSAGE_ID(0x11, 0x0012));
}
else {
} else {
SwitchMessage(MESSAGE_ID(0x11, 0x0013));
}
}
@ -627,9 +624,9 @@ Script N(interact_8024352C) = SCRIPT({
SI_AREA_FLAG(18) = 0;
}
}
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_00, Anim_9), NPC_ANIM(bubulb, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x001C));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_00, Anim_9), NPC_ANIM(bubulb, Palette_00, Anim_8), 0, MESSAGE_ID(0x11,
0x001C));
}
}
});
@ -659,9 +656,9 @@ Script N(interact_802436C0) = SCRIPT({
SI_AREA_FLAG(19) = 0;
}
}
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_01, Anim_3), NPC_ANIM(bubulb, Palette_01, Anim_2), 0, MESSAGE_ID(0x11, 0x0023));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_01, Anim_3), NPC_ANIM(bubulb, Palette_01, Anim_2), 0, MESSAGE_ID(0x11,
0x0023));
}
}
});
@ -691,9 +688,9 @@ Script N(interact_80243854) = SCRIPT({
SI_AREA_FLAG(20) = 0;
}
}
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_02, Anim_9), NPC_ANIM(bubulb, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x002A));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_02, Anim_9), NPC_ANIM(bubulb, Palette_02, Anim_8), 0, MESSAGE_ID(0x11,
0x002A));
}
}
});
@ -723,9 +720,9 @@ Script N(interact_802439E8) = SCRIPT({
SI_AREA_FLAG(21) = 0;
}
}
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_03, Anim_9), NPC_ANIM(bubulb, Palette_03, Anim_8), 0, MESSAGE_ID(0x11, 0x0031));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_03, Anim_9), NPC_ANIM(bubulb, Palette_03, Anim_8), 0, MESSAGE_ID(0x11,
0x0031));
}
}
});
@ -825,9 +822,9 @@ Script N(interact_80243C4C) = SCRIPT({
EndSpeech(-1, NPC_ANIM(tolielup, Palette_00, Anim_3), NPC_ANIM(tolielup, Palette_00, Anim_3), 0);
}
}
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(tolielup, Palette_00, Anim_2), NPC_ANIM(tolielup, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x003A));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(tolielup, Palette_00, Anim_2), NPC_ANIM(tolielup, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x003A));
EndSpeech(-1, NPC_ANIM(tolielup, Palette_00, Anim_3), NPC_ANIM(tolielup, Palette_00, Anim_3), 0);
}
}
@ -1003,19 +1000,23 @@ Script N(init_80244BF4) = SCRIPT({
Script N(interact_80244C98) = SCRIPT({
if (STORY_PROGRESS <= STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE) {
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032));
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0032));
} else {
GetCurrentPartnerID(SI_VAR(0));
if (SI_VAR(0) == 8) {
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032));
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0032));
sleep 10;
DisablePartnerAI(0);
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 5, MESSAGE_ID(0x11, 0x0033));
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00,
Anim_3), 5, MESSAGE_ID(0x11, 0x0033));
SetNpcAnimation(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_1));
EndSpeech(-4, NPC_ANIM(world_lakilester, Palette_00, Anim_9), NPC_ANIM(world_lakilester, Palette_00, Anim_1), 5);
EnablePartnerAI();
} else {
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0034));
SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0034));
}
}
});
@ -1307,7 +1308,7 @@ NpcSettings N(npcSettings_80245E5C) = {
f32 N(D_80245E88_CA3DA8)[] = {
266.0f, 20.0f, 322.0f, 310.0f,
30.0f, 312.0f, 346.0f, 90.0f,
30.0f, 312.0f, 346.0f, 90.0f,
300.0f, 400.0f, 200.0f, 287.0f,
};
@ -1691,7 +1692,7 @@ Script N(802477EC) = SCRIPT({
sleep 1;
}
}
10:
10:
if (SI_MAP_VAR(10) == 0) {
sleep 1;
goto 10;
@ -1802,8 +1803,7 @@ Script N(80247FAC) = SCRIPT({
SetCamPosB(0, 0, -300);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
}
else {
} else {
}
}
if (SI_VAR(15) > 550) {
@ -1869,7 +1869,7 @@ Script N(802485A8) = SCRIPT({
if (SI_SAVE_FLAG(1371) == 0) {
group 0;
func_802D5830(1);
10:
10:
func_802D6420();
SI_VAR(2) = SI_VAR(0);
match SI_VAR(2) {
@ -1887,14 +1887,12 @@ Script N(802485A8) = SCRIPT({
SI_MAP_VAR(11) = SI_VAR(0);
SetPlayerAnimation(ANIM_STAND_STILL);
sleep 20;
}
else {
} else {
match SI_AREA_FLAG(17) {
== 0 {
ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0008), 0, 10, -200);
SI_AREA_FLAG(17) = 1;
}
else {
} else {
ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0009), 0, 10, -200);
}
}
@ -1910,7 +1908,7 @@ Script N(802485A8) = SCRIPT({
if (SI_SAVE_FLAG(1372) == 0) {
group 0;
func_802D5830(1);
20:
20:
func_802D6420();
SI_VAR(2) = SI_VAR(0);
match SI_VAR(2) {
@ -1930,14 +1928,12 @@ Script N(802485A8) = SCRIPT({
SI_MAP_VAR(11) = SI_VAR(0);
SetPlayerAnimation(ANIM_STAND_STILL);
sleep 20;
}
else {
} else {
match SI_AREA_FLAG(17) {
== 0 {
ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0008), 0, 10, -200);
SI_AREA_FLAG(17) = 1;
}
else {
} else {
ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0009), 0, 10, -200);
}
}
@ -2065,8 +2061,7 @@ Script N(80248F48) = SCRIPT({
spawn N(80247588);
SI_VAR(0) = 1;
spawn N(802476F4);
}
else {
} else {
SI_VAR(0) = -700;
spawn N(80246850);
spawn N(80247488);
@ -2092,7 +2087,7 @@ Script N(makeEntities) = SCRIPT({
ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 ret;
f32 max;
f32 posX;
@ -2114,7 +2109,7 @@ ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSetti
}
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -2139,7 +2134,7 @@ ApiStatus N(func_802406BC_C9E5DC)(ScriptInstance* script, NpcAISettings* aiSetti
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
script->functionTemp[2].s = 0;
}
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
if (enemy->territory->patrol.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
} else {
@ -2182,7 +2177,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall || enemy->unk_B0 & 4) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->patrol.isFlying) {
npc->flags = (npc->flags | 0x200) & ~8;

View File

@ -1,6 +1,6 @@
#include "flo_00.h"
ApiStatus N(func_80240F10_C9EE30)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240F10_C9EE30)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = *args++;
s32 var2 = *args++;
@ -11,7 +11,7 @@ ApiStatus N(func_80240F10_C9EE30)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance* script, s32 isInitialCall) {
f32 var1 = get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(-83.0f, 87.0f, script->varTable[9], script->varTable[11]);
f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[9], script->varTable[11]) - var1);
@ -25,8 +25,8 @@ ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance *script, s32 isInitialCall) {
Npc *npc = get_npc_by_index(0);
ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_by_index(0);
f32 temp_f20 = get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(-83.0f, 87.0f, script->varTable[12], script->varTable[14]);
f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[12], script->varTable[14]) - temp_f20);
@ -44,12 +44,12 @@ ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/SyncStatusMenu.inc.c"
ApiStatus N(func_8024139C_C9F2BC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024139C_C9F2BC)(ScriptInstance* script, s32 isInitialCall) {
increment_status_menu_disabled();
return ApiStatus_DONE2;
}
ApiStatus N(func_802413BC_C9F2DC)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802413BC_C9F2DC)(ScriptInstance* script, s32 isInitialCall) {
decrement_status_menu_disabled();
return ApiStatus_DONE2;
}

View File

@ -42,8 +42,7 @@ Script N(802406A0) = SCRIPT({
}
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -353,12 +352,14 @@ Script N(interact_802412BC) = SCRIPT({
}
== STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES {
if (SI_SAVE_FLAG(1411) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0, MESSAGE_ID(0x11, 0x0058));
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0,
MESSAGE_ID(0x11, 0x0058));
SetNpcAnimation(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_6));
} else {
SI_VAR(4) = (int) 3.5;
await N(8024122C);
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_8), NPC_ANIM(petunia, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x0059));
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_8), NPC_ANIM(petunia, Palette_00, Anim_3), 0,
MESSAGE_ID(0x11, 0x0059));
EndSpeech(-1, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0);
SetNpcAnimation(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_4));
sleep 20;
@ -368,7 +369,8 @@ Script N(interact_802412BC) = SCRIPT({
await N(80240F0C);
AddKeyItem(ITEM_MAGICAL_BEAN);
sleep 20;
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005A));
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x005A));
EndSpeech(-1, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0);
STORY_PROGRESS = STORY_CH6_GOT_MAGICAL_BEAN;
}
@ -378,13 +380,14 @@ Script N(interact_802412BC) = SCRIPT({
}
< STORY_CH6_RETURNED_TO_TOAD_TOWN {
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005C));
}
else {
} else {
if (SI_AREA_VAR(1) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005D));
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x005D));
SI_AREA_VAR(1) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005E));
SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x005E));
}
}
}
@ -407,8 +410,7 @@ Script N(init_80241E10) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES {
SetNpcPos(NPC_DAYZEE, 0, -1000, 0);
}
else {
} else {
if (SI_SAVE_FLAG(1366) == 0) {
SetEnemyFlagBits(1, 1, 0);
BindNpcIdle(NPC_SELF, N(npcAI_8024119C));
@ -816,8 +818,7 @@ Script N(init_8024338C) = SCRIPT({
} else {
SetNpcPos(NPC_MONTY_MOLE0, 0, -1000, 0);
}
}
else {
} else {
SetNpcPos(NPC_MONTY_MOLE0, 0, -1000, 0);
}
}
@ -840,8 +841,7 @@ Script N(init_802434CC) = SCRIPT({
} else {
SetNpcPos(NPC_MONTY_MOLE1, 0, -1000, 0);
}
}
else {
} else {
SetNpcPos(NPC_MONTY_MOLE1, 0, -1000, 0);
}
}
@ -864,8 +864,7 @@ Script N(init_8024360C) = SCRIPT({
} else {
SetNpcPos(NPC_MONTY_MOLE2, 0, -1000, 0);
}
}
else {
} else {
SetNpcPos(NPC_MONTY_MOLE2, 0, -1000, 0);
}
}
@ -888,8 +887,7 @@ Script N(init_8024374C) = SCRIPT({
} else {
SetNpcPos(NPC_MONTY_MOLE3, 0, -1000, 0);
}
}
else {
} else {
SetNpcPos(NPC_MONTY_MOLE3, 0, -1000, 0);
}
}
@ -1106,9 +1104,9 @@ ApiStatus N(func_80240040_CA72E0)(ScriptInstance* script, s32 isInitialCall) {
#include "world/common/GetItemName.inc.c"
ApiStatus N(func_80240158_CA73F8)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80240158_CA73F8)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 clamp = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) + 180.0f);
f32 sp10 = -210.0f;
@ -1143,18 +1141,18 @@ ApiStatus N(func_80240158_CA73F8)(ScriptInstance *script, s32 isInitialCall) {
add_vec2D_polar(&sp10, &sp14, 46.0f, clamp);
}
}
npc->currentAnim = enemy->animList[2];
npc->currentAnim.w = enemy->animList[2];
npc->yaw = atan2(npc->pos.x, npc->pos.z, sp10, sp14);
npc_move_heading(npc, 2.0f, npc->yaw);
} else if (temp_f4 > 0.2) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, sp10, sp14);
npc->pos.x = sp10;
npc->pos.z = sp14;
npc->currentAnim = enemy->animList[1];
npc->currentAnim.w = enemy->animList[1];
} else {
npc->pos.x = sp10;
npc->pos.z = sp14;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
}
return ApiStatus_BLOCK;
}

View File

@ -27,8 +27,7 @@ Script N(802407A0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -295,10 +294,12 @@ Script N(interact_80242044) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_GOT_MAGICAL_BEAN {
if (SI_AREA_FLAG(5) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0070));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0070));
SI_AREA_FLAG(5) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0071));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0071));
}
}
< STORY_CH6_GOT_FERTILE_SOIL {
@ -325,29 +326,35 @@ Script N(interact_80242044) = SCRIPT({
await N(80241DBC);
ResetCam(0, 4.0);
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0072));
}
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0072));
}
}
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
if (SI_SAVE_FLAG(1374) == 0) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0072));
} else {
if (STORY_PROGRESS < STORY_CH6_GOT_WATER_STONE) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0073));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0073));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0074));
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0074));
}
ContinueSpeech(-1, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0075));
ContinueSpeech(-1, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0075));
}
}
< STORY_CH6_RETURNED_TO_TOAD_TOWN {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0076));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0077));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0077));
}
}
await N(80240890);
@ -372,12 +379,14 @@ Script N(802424F4) = SCRIPT({
DisablePlayerInput(TRUE);
sleep 10;
if (SI_AREA_VAR(3) < 5) {
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x006E));
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x006E));
GetPlayerPos(SI_VAR(1), SI_VAR(2), SI_VAR(3));
PlayerMoveTo(410, SI_VAR(3), 10);
SI_AREA_VAR(3) += 1;
} else {
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x006F));
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x006F));
SI_AREA_VAR(3) = 0;
}
DisablePlayerInput(FALSE);
@ -391,7 +400,8 @@ Script N(tree1_Callback) = SCRIPT({
if (STORY_PROGRESS < STORY_CH6_GOT_CRYSTAL_BERRY) {
NpcFacePlayer(NPC_POSIE, 1);
sleep 10;
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0067));
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0067));
if (STORY_PROGRESS == STORY_CH6_GOT_FERTILE_SOIL) {
if (SI_SAVE_FLAG(1379) == 1) {
UseSettingsFrom(0, -250, 0, 0);
@ -406,7 +416,8 @@ Script N(tree1_Callback) = SCRIPT({
if (SI_SAVE_FLAG(1374) == 0) {
NpcFacePlayer(NPC_POSIE, 1);
sleep 10;
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0067));
SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0067));
} else {
SI_AREA_VAR(2) += 1;
match SI_AREA_VAR(2) {

View File

@ -36,7 +36,7 @@ typedef struct {
s16 unk_32C;
} N(UnkStruct);
ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
N(UnkStruct)* ptr;
s32 i;
@ -108,7 +108,8 @@ ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
#else
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_08/CAED40", flo_08_func_802401CC_CAEF0C, ScriptInstance *script, s32 isInitialCall);
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_08/CAED40", flo_08_func_802401CC_CAEF0C, ScriptInstance* script,
s32 isInitialCall);
#endif
ApiStatus N(func_8024041C_CAF15C)(ScriptInstance* script, s32 isInitialCall) {
@ -141,8 +142,8 @@ typedef struct {
s32 unk_64;
} N(UserData);
ApiStatus N(func_80240600_CAF340)(ScriptInstance *script, s32 isInitialCall) {
Bytecode *args = script->ptrReadPos;
ApiStatus N(func_80240600_CAF340)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Npc* npc = get_npc_safe(-4);
f32 sinTheta, cosTheta;
s32 i;
@ -160,7 +161,8 @@ ApiStatus N(func_80240600_CAF340)(ScriptInstance *script, s32 isInitialCall) {
scriptPtr->unk_5C = get_entity_by_index(get_variable(script, *args));
for (i = 0, userDataPtr = scriptPtr; i < 3; i++) {
userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1);
userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f,
scriptPtr->unk_5C->position.z, 1.0f, -1);
save = 0.0f;
userDataPtr->unk_2C[i] = save;
userDataPtr->unk_20[i] = save;

View File

@ -39,8 +39,7 @@ Script N(80241F40) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -268,7 +267,7 @@ Script N(main) = SCRIPT({
spawn {
SI_VAR(0) = 0;
SI_VAR(1) = 0;
0:
0:
SI_VAR(0) += 140;
if (SI_VAR(0) > 65536) {
SI_VAR(0) += -65536;
@ -431,7 +430,8 @@ Script N(interact_80243214) = SCRIPT({
SetCamSpeed(0, 4.0);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0042));
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0,
MESSAGE_ID(0x11, 0x0042));
SetPlayerAnimation(ANIM_THINKING);
N(func_80241BCC_CB090C)();
SI_VAR(0) = 0x80246430;
@ -441,8 +441,7 @@ Script N(interact_80243214) = SCRIPT({
<= 0 {
SetPlayerAnimation(ANIM_STAND_STILL);
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0043));
}
else {
} else {
SI_VAR(8) = SI_VAR(0);
N(func_80241B5C_CB089C)(SI_VAR(0));
MakeItemEntity(SI_VAR(8), -695, 20, -29, 1, 0);
@ -487,9 +486,9 @@ Script N(interact_80243214) = SCRIPT({
== 158 {
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0045));
SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_1));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0044));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0,
MESSAGE_ID(0x11, 0x0044));
SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_6));
PlaySoundAtNpc(NPC_SELF, 0x2096, 0);
MakeItemEntity(SI_VAR(8), 125, 20, 0, 1, 0);
@ -549,9 +548,11 @@ Script N(interact_80243214) = SCRIPT({
sleep 10;
} else {
if (STORY_PROGRESS < STORY_CH6_STAR_SPIRIT_RESCUED) {
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x0047));
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0,
MESSAGE_ID(0x11, 0x0047));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x0048));
SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0,
MESSAGE_ID(0x11, 0x0048));
}
}
DisablePlayerInput(FALSE);
@ -938,7 +939,7 @@ static s32 N(pad_4F3C) = {
0x00000000,
};
void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) {
void N(func_80240D80_CAFAC0)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -961,11 +962,12 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting
f32 subroutine_arg10;
npc->duration = npcAISettings->unk_20 / 2 + rand_int(npcAISettings->unk_20 / 2 + 1);
npc->currentAnim = enemy->animList[3];
npc->currentAnim.w = enemy->animList[3];
npc->moveSpeed = npcAISettings->chaseSpeed;
phi_s3 = FALSE;
temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f);
temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) + 180.0f);
temp_f0 = get_clamped_angle_diff(npc->yaw, temp_f20);
if (npcAISettings->unk_1C.s < fabsf(temp_f0)) {
temp_f20 = npc->yaw;
@ -982,19 +984,22 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting
subroutine_arg9 = npc->pos.y;
subroutine_argA = npc->pos.z;
temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f);
temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) + 180.0f);
phi_f22 = 0.0f;
phi_f24 = 0.0f;
phi_f26 = 0.0f;
if (func_800DDCEC(npc->unk_80, &subroutine_arg8, &subroutine_arg9, &subroutine_argA, npc->moveSpeed * 4.5, temp_f20, npc->collisionHeight, npc->collisionRadius) != 0) {
if (func_800DDCEC(npc->unk_80, &subroutine_arg8, &subroutine_arg9, &subroutine_argA, npc->moveSpeed * 4.5, temp_f20,
npc->collisionHeight, npc->collisionRadius) != 0) {
phi_f22 = dist2D(npc->pos.x, npc->pos.z, subroutine_arg8, subroutine_argA);
subroutine_argB = npc->pos.x;
subroutine_argC = npc->pos.y;
subroutine_argD = npc->pos.z;
if (func_800DDCEC(npc->unk_80, &subroutine_argB, &subroutine_argC, &subroutine_argD, npc->moveSpeed * 4.5, clamp_angle(temp_f20 + 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) {
if (func_800DDCEC(npc->unk_80, &subroutine_argB, &subroutine_argC, &subroutine_argD, npc->moveSpeed * 4.5,
clamp_angle(temp_f20 + 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) {
phi_f24 = dist2D(npc->pos.x, npc->pos.z, subroutine_argB, subroutine_argD);
}
@ -1002,7 +1007,8 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting
subroutine_argF = npc->pos.y;
subroutine_arg10 = npc->pos.z;
if (func_800DDCEC(npc->unk_80, &subroutine_argE, &subroutine_argF, &subroutine_arg10, npc->moveSpeed * 4.5, clamp_angle(temp_f20 - 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) {
if (func_800DDCEC(npc->unk_80, &subroutine_argE, &subroutine_argF, &subroutine_arg10, npc->moveSpeed * 4.5,
clamp_angle(temp_f20 - 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) {
phi_f26 = dist2D(npc->pos.x, npc->pos.z, subroutine_argE, subroutine_arg10);
}
@ -1042,23 +1048,23 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting
}
if (phi_s3) {
npc->duration = 0xA;
npc->currentAnim = enemy->animList[8];
npc->currentAnim.w = enemy->animList[8];
}
script->functionTemp[0].s = 0xD;
}
void N(func_80241364_CB00A4)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) {
void N(func_80241364_CB00A4)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
s32 var;
if (func_800490B4(territory, enemy, npcAISettings->chaseRadius, npcAISettings->unk_28.f, 1) == 0) {
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->duration = 25;
script->functionTemp[0].s = 14;
} else {
if (npc->currentAnim != enemy->animList[8]) {
if (npc->currentAnim.w != enemy->animList[8]) {
if (npc->moveSpeed < 4.0) {
func_8003D660(npc, 0);
} else {
@ -1075,9 +1081,9 @@ void N(func_80241364_CB00A4)(ScriptInstance *script, NpcAISettings *npcAISetting
}
}
void N(func_802414C8_CB0208)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) {
void N(func_802414C8_CB0208)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
npc->duration--;
if (npc->duration == 0) {
@ -1085,9 +1091,9 @@ void N(func_802414C8_CB0208)(ScriptInstance *script, NpcAISettings *npcAISetting
}
}
ApiStatus N(func_8024150C_CB024C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024150C_CB024C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
@ -1105,7 +1111,7 @@ ApiStatus N(func_8024150C_CB024C)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->unk_B0 & 4)) {
script->functionTemp[0].s = 0;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
if (!enemy->territory->wander.isFlying) {
npc->flags = (npc->flags | 0x200) & ~0x8;
@ -1197,7 +1203,7 @@ ApiStatus N(func_802419FC_CB073C)(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241A98_CB07D8)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241A98_CB07D8)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 itemIdx = get_variable(script, *args++);
s32 var1 = get_variable(script, *args++);
@ -1212,7 +1218,7 @@ ApiStatus N(func_80241A98_CB07D8)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241B5C_CB089C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241B5C_CB089C)(ScriptInstance* script, s32 isInitialCall) {
s32 itemId = get_variable(script, *script->ptrReadPos);
StaticItem* item = &gItemTable[itemId];
@ -1227,7 +1233,7 @@ ApiStatus N(func_80241B5C_CB089C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_80241BCC_CB090C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241BCC_CB090C)(ScriptInstance* script, s32 isInitialCall) {
s32 i;
for (i = 0; i <= 90; i++) {

View File

@ -27,8 +27,7 @@ Script N(80241880) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -423,8 +422,8 @@ NpcSettings N(npcSettings_80243600) = {
};
f32 N(D_8024362C_CB862C)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
NpcAISettings N(npcAISettings_80243644) = {

View File

@ -6,14 +6,14 @@ void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -25,7 +25,7 @@ void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings,
}
#ifdef NON_MATCHING
void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f24;
@ -139,9 +139,9 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -169,7 +169,8 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
#else
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_09/CB5320", flo_09_func_802404D0_CB54D0, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory);
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_09/CB5320", flo_09_func_802404D0_CB54D0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"
@ -196,10 +197,10 @@ void N(func_80240F74_CB5F74)(ScriptInstance* script, NpcAISettings* aiSettings,
#include "world/common/UnkFunc5.inc.c"
ApiStatus N(func_8024162C_CB662C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024162C_CB662C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Bytecode* args = script->ptrReadPos;
Npc *npc = get_npc_unsafe(enemy->npcID);
Npc* npc = get_npc_unsafe(enemy->npcID);
EnemyTerritoryThing territory;
EnemyTerritoryThing* territoryPtr = &territory;
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);

View File

@ -28,8 +28,7 @@ Script N(802414E0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -149,8 +148,7 @@ Script N(main) = SCRIPT({
== 2 {
spawn N(802427EC);
spawn N(80241988);
}
else {
} else {
ModifyColliderFlags(0, 1, 0x7FFFFE00);
SI_VAR(0) = N(80241988);
spawn EnterWalk;
@ -594,8 +592,7 @@ Script N(8024339C) = SCRIPT({
func_802D5830(0);
sleep 10;
SpeakToPlayer(NPC_LILY, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x0081));
}
else {
} else {
GetPlayerPos(SI_VAR(3), SI_VAR(4), SI_VAR(5));
PlayerMoveTo(-17, -17, 20);
func_802CF56C(2);
@ -637,7 +634,7 @@ Script N(80243628) = SCRIPT({
SI_VAR(1) -= SI_VAR(6);
SI_VAR(4) += SI_VAR(6);
match SI_VAR(3) {
SI_VAR(1)..SI_VAR(4) {
SI_VAR(1)..SI_VAR(4) {
spawn {
if (SI_VAR(3) < SI_VAR(0)) {
SI_VAR(0) -= 40;
@ -682,21 +679,25 @@ Script N(interact_802437C8) = SCRIPT({
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
sleep 10;
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, 0x0079));
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11,
0x0079));
NpcFacePlayer(NPC_SELF, 1);
SetNpcAnimation(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1));
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_262, 0);
ShowEmote(-1, EMOTE_EXCLAMATION, 0, 15, 1, 0, 0, 0, 0);
sleep 15;
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x007A));
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x007A));
EndSpeech(-1, NPC_ANIM(lily, Palette_00, Anim_5), NPC_ANIM(lily, Palette_00, Anim_1), 0);
GetPlayerTargetYaw(SI_VAR(0));
InterpNpcYaw(NPC_SELF, SI_VAR(0), 1);
sleep 20;
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, 0x007B));
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 5, MESSAGE_ID(0x11,
0x007B));
NpcFacePlayer(NPC_SELF, 1);
sleep 20;
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x007C));
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x007C));
ShowChoice(MESSAGE_ID(0x1E, 0x0011));
sleep 10;
match SI_VAR(0) {
@ -711,7 +712,8 @@ Script N(interact_802437C8) = SCRIPT({
SI_SAVE_FLAG(1375) = 1;
SetEnemyFlagBits(-1, 4194304, 0);
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, 0x007F));
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11,
0x007F));
}
}
< 49 {
@ -725,9 +727,9 @@ Script N(interact_802437C8) = SCRIPT({
}
< 60 {
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_3), NPC_ANIM(lily, Palette_00, Anim_7), 0, MESSAGE_ID(0x11, 0x0086));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0087));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x0087));
}
}
ResetCam(0, 4.0);

View File

@ -83,21 +83,23 @@ void N(func_802404B0_CB96B0)(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, phi_a2);
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(subroutine_arg6));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, phi_s5 * 4, (phi_s4 - 1) * 4, (phi_s5 - 1) * 4);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, phi_s4 - phi_s6, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, phi_s4 - phi_s6, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, phi_s6 * 4, phi_s5 * 4, (phi_s4 - 1) * 4, (phi_s5 - 1) * 4);
gSPTextureRectangle(gMasterGfxPos++,
(phi_s4 - 1) * 4, (phi_s5 - 1) * 4, phi_s6 * 4, phi_s5 * 4,
G_TX_RENDERTILE,
phi_s6, phi_s5,
0x0400, (sin_deg(N(D_80244070_CBD270) + (i * 30)) * 500.0f) - 0x1F4);
(phi_s4 - 1) * 4, (phi_s5 - 1) * 4, phi_s6 * 4, phi_s5 * 4,
G_TX_RENDERTILE,
phi_s6, phi_s5,
0x0400, (sin_deg(N(D_80244070_CBD270) + (i * 30)) * 500.0f) - 0x1F4);
}
}
@ -113,14 +115,19 @@ void N(func_802404B0_CB96B0)(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, phi_a2);
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(subroutine_arg6));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4, (phi_s4 - 1) * 4, (temp_s2_2 - 1) * 4);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4, (phi_s4 - 1) * 4,
(temp_s2_2 - 1) * 4);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, (phi_s4 - 1) * 4, (temp_s2_2 - subroutine_arg5) * 4, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4);
gSPTextureRectangle(gMasterGfxPos++, phi_s6 * 4, arg1 + (i * 6), phi_s4 * 4, ((arg1 + (i * 6)) + subroutine_arg5) * 4, G_TX_RENDERTILE, phi_s6, temp_s2_2, 0x0400, -0x0400);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, (phi_s4 - 1) * 4, (temp_s2_2 - subroutine_arg5) * 4, phi_s6 * 4,
(temp_s2_2 - subroutine_arg5) * 4);
gSPTextureRectangle(gMasterGfxPos++, phi_s6 * 4, arg1 + (i * 6), phi_s4 * 4, ((arg1 + (i * 6)) + subroutine_arg5) * 4,
G_TX_RENDERTILE, phi_s6, temp_s2_2, 0x0400, -0x0400);
}
}
}
@ -283,7 +290,8 @@ void N(func_80240A98_CB9C98)(void) {
temp_f22 += camera->viewportStartY;
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
gDPSetRenderMode(gMasterGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
gDPSetRenderMode(gMasterGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS,
Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(nuGfxZBuffer));
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 248, 240, 240, 0);

View File

@ -30,8 +30,7 @@ Script N(802403E0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -704,7 +703,7 @@ Script N(defeat_80242AC4) = SCRIPT({
GetBattleOutcome(SI_VAR(0));
match SI_VAR(0) {
== 0 {
0:
0:
if (SI_MAP_VAR(0) == 0) {
sleep 1;
goto 0;
@ -755,10 +754,10 @@ StaticNpc N(npcGroup_80242CF4)[] = {
.dropFlags = 0x80,
.itemDropChance = 25,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(3),
@ -792,10 +791,10 @@ StaticNpc N(npcGroup_80242CF4)[] = {
.dropFlags = 0x80,
.itemDropChance = 25,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(3),

View File

@ -30,8 +30,7 @@ Script N(80240750) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -301,16 +300,20 @@ Script N(interact_80241C8C) = SCRIPT({
== 0 {
if (SI_SAVE_FLAG(1375) == 1) {
spawn N(80241BE4);
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, 0x0090));
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11,
0x0090));
SetPlayerAnimation(0x60005);
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0091));
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11,
0x0091));
SetPlayerAnimation(ANIM_PRAY);
sleep 40;
SetPlayerAnimation(ANIM_10002);
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0092));
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11,
0x0092));
SI_SAVE_FLAG(1379) = 1;
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, 0x0090));
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11,
0x0090));
}
}
== 1 {
@ -335,9 +338,9 @@ Script N(interact_80241C8C) = SCRIPT({
match SI_VAR(0) {
<= 0 {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0093));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0095));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11,
0x0095));
RemoveItemEntity(SI_VAR(7));
MakeItemEntity(ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380);
SI_VAR(0) = 87;
@ -345,7 +348,8 @@ Script N(interact_80241C8C) = SCRIPT({
await N(802417F0);
AddKeyItem(ITEM_WATER_STONE);
sleep 10;
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0096));
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11,
0x0096));
SI_AREA_FLAG(22) = 1;
STORY_PROGRESS = STORY_CH6_GOT_WATER_STONE;
}
@ -363,9 +367,9 @@ Script N(interact_80241C8C) = SCRIPT({
}
< 60 {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0098));
}
else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0099));
} else {
SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11,
0x0099));
}
}
ResetCam(0, 4.0);
@ -393,8 +397,7 @@ Script N(init_802423D0) = SCRIPT({
SetNpcAnimation(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_2));
MakeItemEntity(ITEM_WATER_STONE, -33, 14, 19, 1, 1380);
SI_VAR(10) = SI_VAR(0);
}
else {
} else {
SetNpcFlagBits(NPC_ROSIE1, ((NPC_FLAG_100)), FALSE);
SetNpcAnimation(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_2));
MakeItemEntity(ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380);

View File

@ -41,8 +41,7 @@ Script N(802436D0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -57,8 +56,7 @@ Script N(802436D0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_SUN_TOWER_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_SUN_TOWER_SUNNY, 0, 8);
}
}
@ -216,8 +214,8 @@ NpcSettings N(npcSettings_80244100) = {
};
f32 N(D_8024412C_CC793C)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
NpcAISettings N(npcAISettings_80244144) = {
@ -301,21 +299,21 @@ NpcSettings N(npcSettings_8024437C) = {
};
Vec3f N(vectorList_802443A8)[] = {
{ -250.0, 130.0, 100.0 }, { -150.0, 90.0, 70.0 },
{ 50.0, 70.0, 10.0 }, { 200.0, 35.0, 30.0 },
{ 30.0, 10.0, 45.0 },
{ -250.0, 130.0, 100.0 }, { -150.0, 90.0, 70.0 },
{ 50.0, 70.0, 10.0 }, { 200.0, 35.0, 30.0 },
{ 30.0, 10.0, 45.0 },
};
Vec3f N(vectorList_802443E4)[] = {
{ -285.0, 130.0, 45.0 }, { -185.0, 90.0, 25.0 },
{ 15.0, 70.0, 10.0 }, { 165.0, 35.0, 30.0 },
{ -5.0, 10.0, 45.0 },
{ -285.0, 130.0, 45.0 }, { -185.0, 90.0, 25.0 },
{ 15.0, 70.0, 10.0 }, { 165.0, 35.0, 30.0 },
{ -5.0, 10.0, 45.0 },
};
Vec3f N(vectorList_80244420)[] = {
{ 10.0, 0.0, 45.0 }, { -90.0, 20.0, 45.0 },
{ -190.0, 60.0, 45.0 }, { -290.0, 140.0, 45.0 },
{ -390.0, 300.0, 45.0 },
{ 10.0, 0.0, 45.0 }, { -90.0, 20.0, 45.0 },
{ -190.0, 60.0, 45.0 }, { -290.0, 140.0, 45.0 },
{ -390.0, 300.0, 45.0 },
};
Script N(8024445C) = SCRIPT({
@ -649,7 +647,8 @@ Script N(80245444) = SCRIPT({
sleep 10;
goto 10;
} else {
ContinueSpeech(1, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x00A9));
ContinueSpeech(1, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11,
0x00A9));
SetNpcAnimation(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_1));
SetPlayerAnimation(ANIM_NOD_YES);
sleep 10;
@ -662,7 +661,8 @@ Script N(80245444) = SCRIPT({
SetCamSpeed(0, 90.0);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AA));
SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester,
Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AA));
SetNpcAnimation(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_1));
EndSpeech(0, NPC_ANIM(world_lakilester, Palette_00, Anim_9), NPC_ANIM(world_lakilester, Palette_00, Anim_1), 0);
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
@ -673,7 +673,8 @@ Script N(80245444) = SCRIPT({
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
sleep 10;
SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AB));
SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester,
Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AB));
sleep 10;
ShowChoice(MESSAGE_ID(0x1E, 0x0021));
match SI_VAR(0) {
@ -748,13 +749,16 @@ Script N(defeat_80246038) = SCRIPT({
Script N(interact_802461C0) = SCRIPT({
if (STORY_PROGRESS <= STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE) {
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032));
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0032));
} else {
GetCurrentPartnerID(SI_VAR(0));
if (SI_VAR(0) != 8) {
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0034));
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0034));
} else {
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032));
SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0,
MESSAGE_ID(0x11, 0x0032));
}
}
});
@ -1188,14 +1192,14 @@ void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -1207,7 +1211,7 @@ void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings,
}
#ifdef NON_MATCHING
void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 temp_f24;
@ -1321,9 +1325,9 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -1351,7 +1355,8 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_flo/flo_13/CC3850", flo_13_func_80240374_CC3B84, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory);
INCLUDE_ASM(void, "world/area_flo/flo_13/CC3850", flo_13_func_80240374_CC3B84, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"
@ -1450,7 +1455,7 @@ s32 N(func_802416BC_CC4ECC)(void) {
return -1;
}
void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241704_CC4F14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 x, y, z, w;
@ -1498,7 +1503,9 @@ void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings,
script->functionTemp[1].s--;
}
if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ) != 0) {
if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x,
enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX,
enemy->territory->wander.wanderSizeZ) != 0) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
}
@ -1534,7 +1541,7 @@ void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings,
}
}
void N(func_80241B68_CC5378)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80241B68_CC5378)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 x, y, z, w;
@ -1579,7 +1586,7 @@ void N(func_80241B68_CC5378)(ScriptInstance *script, NpcAISettings *aiSettings,
// enemy2 is being copied to a0
#ifdef NON_MATCHING
ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Bytecode* args = script->ptrReadPos;
Npc* npc = get_npc_unsafe(enemy->npcID);
@ -1636,7 +1643,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) {
enemy2->varTable[10] = 1;
enemy2->varTable[11] = enemy->npcID;
npc->duration = 15;
npc->currentAnim = 0x490014;
npc->currentAnim.w = 0x490014;
script->functionTemp[0].s = 30;
}
}
@ -1666,7 +1673,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) {
case 31:
npc->duration--;
if (npc->duration <= 0) {
npc->currentAnim = 0x490015;
npc->currentAnim.w = 0x490015;
get_enemy(enemy->varTable[4])->varTable[10] = 3;
npc->duration = 10;
script->functionTemp[0].s = 32;
@ -1690,7 +1697,8 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) {
if (((u32)script->functionTemp[0].s - 30) < 2) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z);
if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, territoryPtr->sizeX, territoryPtr->sizeZ)) {
if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z,
territoryPtr->sizeX, territoryPtr->sizeZ)) {
if ((dist > 30.0) && (npc->turnAroundYawAdjustment == 0)) {
temp_f4 = dist - 20.0;
if (temp_f4 < 0.0) {
@ -1708,23 +1716,25 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
#else
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_13/CC3850", flo_13_func_80241DB8_CC55C8, ScriptInstance *script, s32 isInitialCall);
INCLUDE_ASM(ApiStatus, "world/area_flo/flo_13/CC3850", flo_13_func_80241DB8_CC55C8, ScriptInstance* script,
s32 isInitialCall);
#endif
#include "world/common/set_script_owner_npc_anim.inc.c"
void N(func_80242314_CC5B24)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
void N(func_80242314_CC5B24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
if (npc->turnAroundYawAdjustment == 0) {
npc->currentAnim = enemy->animList[9];
npc->currentAnim.w = enemy->animList[9];
npc->moveSpeed = aiSettings->chaseSpeed;
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
npc->collisionHeight = enemy->varTable[6] / 2;
}
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
if (npc->duration < enemy->varTable[3]) {
npc->duration = enemy->varTable[3];
}
@ -1738,7 +1748,7 @@ void N(func_80242314_CC5B24)(ScriptInstance *script, NpcAISettings *aiSettings,
#include "world/common/set_script_owner_npc_col_height.inc.c"
ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1767,7 +1777,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
script->functionTemp[0].s = 0;
npc->duration = 0;
enemy->unk_07 = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
npc->collisionHeight = enemy->varTable[6];
enemy->varTable[9] = 0;
@ -1790,8 +1800,8 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->varTable[9] > 0) {
enemy->varTable[9]--;
if (enemy->varTable[9] == 0) {
if ((npc->currentAnim + 0xFFAAFFD2) < 2) {
npc->currentAnim = 0x55000C;
if ((npc->currentAnim.w + 0xFFAAFFD2) < 2) {
npc->currentAnim.w = 0x55000C;
}
} else {
return ApiStatus_BLOCK;
@ -1814,11 +1824,11 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
if (enemy->varTable[8] != 0) {
enemy->varTable[8] = 0;
enemy->unk_B5 = 0;
npc->currentAnim = 0x55002F;
npc->currentAnim.w = 0x55002F;
} else {
enemy->varTable[8] = 1;
enemy->unk_B5 = 1;
npc->currentAnim = 0x55002E;
npc->currentAnim.w = 0x55002E;
}
enemy->varTable[9] = 7;
return ApiStatus_BLOCK;
@ -1857,7 +1867,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
enemy->unk_B5 = 0;
}
if (enemy->varTable[8] != 0) {
switch (npc->currentAnim + 0xFFAAFFFC) {
switch (npc->currentAnim.w + 0xFFAAFFFC) {
case 0:
case 8:
case 10:
@ -1865,7 +1875,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
case 14:
case 18:
case 20:
npc->currentAnim++;
npc->currentAnim.w++;
break;
}
}
@ -1874,7 +1884,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
Bytecode* args = script->ptrReadPos;
@ -1903,7 +1913,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
if (isInitialCall || (enemy->varTable[10] == 100)) {
script->functionTemp[0].s = 100;
npc->duration = 0;
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
npc->flags &= ~0x800;
enemy->flags |= 0x200000;
npc->flags = (npc->flags & ~0x200) | 8;
@ -1919,14 +1929,14 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
npc->collisionHeight = enemy->varTable[6];
enemy->unk_B0 &= ~4;
if (npc->flags & 0x800) {
npc->currentAnim = 0x4A0018;
npc->currentAnim.w = 0x4A0018;
npc->moveSpeed = 0.0f;
npc->jumpVelocity = 0.0f;
npc->jumpScale = 1.0f;
script->functionTemp[0].s = 102;
} else {
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var);
npc->currentAnim = enemy->animList[0];
npc->currentAnim.w = enemy->animList[0];
script->functionTemp[1].s = 0;
script->functionTemp[0].s = 200;
}
@ -1994,7 +2004,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
npc->flags &= ~2;
npc->flags &= ~0x200;
npc->renderYaw = 0.0f;
npc->currentAnim = 0x4A0018;
npc->currentAnim.w = 0x4A0018;
script->functionTemp[0].s = 101;
case 101:
@ -2014,7 +2024,8 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
x2 = npc->pos.x;
y2 = npc->pos.y;
z2 = npc->pos.z;
if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionRadius) == 0) {
if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight,
npc->collisionRadius) == 0) {
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
} else {
npc->moveSpeed = 0.0f;
@ -2050,7 +2061,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
npc->flags = (npc->flags | 0x40000) & ~0x800;
npc->jumpVelocity = 0.0f;
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
npc->currentAnim = 0x4A001A;
npc->currentAnim.w = 0x4A001A;
npc->duration = 3;
script->functionTemp[0].s = 103;
break;
@ -2064,7 +2075,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
npc->duration--;
if (npc->duration <= 0) {
npc->flags &= 0xFFFBFFFF;
npc->currentAnim = 0x4A0001;
npc->currentAnim.w = 0x4A0001;
script->functionTemp[0].s = 0;
}
break;
@ -2095,8 +2106,8 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) {
#include "world/common/UnkFunc42.inc.c"
ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance *script, s32 isInitialCall) {
Npc *npc = get_npc_unsafe(1);
ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(1);
s16 param1;
s16 param2;
@ -2108,18 +2119,18 @@ ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance *script, s32 isInitialCall) {
if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) {
sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z,
&param1, &param2, 0x200002);
&param1, &param2, 0x200002);
sfx_play_sound_with_params(0x295, param1, param2,
update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, script->functionTemp[1].s));
update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, script->functionTemp[1].s));
}
script->functionTemp[0].s++;
return (script->functionTemp[1].s < script->functionTemp[0].s) * ApiStatus_DONE2;
}
ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance *script, s32 isInitialCall) {
Npc *npc = get_npc_unsafe(0);
ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(0);
s16 param1;
s16 param2;
@ -2129,10 +2140,10 @@ ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance *script, s32 isInitialCall) {
if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) {
sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z,
&param1, &param2, 0x200002);
&param1, &param2, 0x200002);
sfx_play_sound_with_params(0x295, param1, param2,
update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, 0x50));
update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, 0x50));
}
script->functionTemp[0].s++;

View File

@ -13,7 +13,7 @@ static s8 N(D_80247B00)[0x200];
static s8 N(D_80247D00)[0x3D90];
static N(Unk_bss_struct) N(D_8024BA90);
ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance* script, s32 isInitialCall) {
s32 var;
void* temp_s0 = load_asset_by_name("party_pokopi", &var);

View File

@ -18,8 +18,7 @@ Script N(802423F0) = SCRIPT({
match STORY_PROGRESS {
< STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE {
SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8);
}
else {
} else {
SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8);
}
}
@ -267,13 +266,13 @@ Script N(802432E8) = SCRIPT({
});
Vec3f N(vectorList_80243384)[] = {
{ 531.0, 75.0, 81.0 }, { 481.0, 80.0, 81.0 },
{ 431.0, 75.0, 81.0 }, { 381.0, 70.0, 81.0 },
{ 331.0, 75.0, 81.0 }, { 281.0, 80.0, 81.0 },
{ 231.0, 75.0, 81.0 }, { 181.0, 70.0, 81.0 },
{ 131.0, 75.0, 81.0 }, { 81.0, 80.0, 81.0 },
{ 31.0, 75.0, 81.0 }, { -19.0, 70.0, 81.0 },
{ -69.0, 75.0, 81.0 },
{ 531.0, 75.0, 81.0 }, { 481.0, 80.0, 81.0 },
{ 431.0, 75.0, 81.0 }, { 381.0, 70.0, 81.0 },
{ 331.0, 75.0, 81.0 }, { 281.0, 80.0, 81.0 },
{ 231.0, 75.0, 81.0 }, { 181.0, 70.0, 81.0 },
{ 131.0, 75.0, 81.0 }, { 81.0, 80.0, 81.0 },
{ 31.0, 75.0, 81.0 }, { -19.0, 70.0, 81.0 },
{ -69.0, 75.0, 81.0 },
};
Script N(80243420) = SCRIPT({
@ -557,14 +556,14 @@ Script N(80243E78) = SCRIPT({
void func_80072950();
ApiStatus N(func_8024030C_CCB61C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024030C_CCB61C)(ScriptInstance* script, s32 isInitialCall) {
func_80072950(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
#include "world/common/UnkFunc43.inc.c"
ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance* script, s32 isInitialCall) {
if (gPlayerData.currentPartner == PARTNER_NONE) {
script->varTable[14] = 0;
return ApiStatus_DONE2;
@ -575,14 +574,14 @@ ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance *script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(func_8024042C_CCB73C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024042C_CCB73C)(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(-4);
npc->flags = get_variable(NULL, SI_MAP_VAR(0));
return ApiStatus_DONE2;
}
ApiStatus N(func_8024046C_CCB77C)(ScriptInstance *script, s32 isInitialCall) {
ApiStatus N(func_8024046C_CCB77C)(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
script->functionTemp[0].s = get_variable(script, *args++);
@ -595,8 +594,8 @@ ApiStatus N(func_8024046C_CCB77C)(ScriptInstance *script, s32 isInitialCall) {
// graphics macros
#ifdef NON_MATCHING
s32 func_8011C2EC(s32);
void func_8011C2B0(s32, s32*,s32*, s32*);
void guMtxF2L(Matrix4f, Mtx *m);
void func_8011C2B0(s32, s32*, s32*, s32*);
void guMtxF2L(Matrix4f, Mtx* m);
void guMtxIdentF(Matrix4f);
void N(func_80240504_CCB814)(void) {

View File

@ -10,8 +10,8 @@ enum {
static s32 N(D_802453B0_EF79C0)[91];
f32 N(D_802444C0_CCF7D0)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
NpcAISettings N(npcAISettings_802444D8) = {
@ -137,7 +137,7 @@ Script N(interact_80244790) = SCRIPT({
sleep 40;
InterpPlayerYaw(315, 0);
}
10:
10:
if (SI_AREA_FLAG(37) == 0) {
sleep 1;
goto 10;
@ -281,7 +281,7 @@ Script N(80244F70) = SCRIPT({
ModifyColliderFlags(1, SI_VAR(9), 0x7FFFFE00);
}
}
50:
50:
if (SI_VAR(7) >= 90) {
SI_VAR(8) = -1;
SI_VAR(7) = 90;
@ -315,14 +315,14 @@ void N(func_80240B10_CCBE20)(ScriptInstance* script, NpcAISettings* aiSettings,
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
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];
npc->currentAnim.w = enemy->animList[1];
script->functionTemp[1].s = 0;
if (enemy->territory->wander.moveSpeedOverride < 0) {
npc->moveSpeed = aiSettings->moveSpeed;
@ -449,9 +449,9 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
if (is_point_within_region(enemy->territory->wander.wanderShape,
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
npc->pos.x, npc->pos.z,
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z);
if (npc->moveSpeed < posW) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
@ -479,7 +479,8 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings,
}
}
#else
INCLUDE_ASM(void, "world/area_flo/flo_14/CCBE20", flo_14_func_80240CC0_CCBFD0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
INCLUDE_ASM(void, "world/area_flo/flo_14/CCBE20", flo_14_func_80240CC0_CCBFD0, ScriptInstance* script,
NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
#endif
#include "world/common/UnkNpcAIFunc1.inc.c"

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