mirror of
https://github.com/pmret/papermario.git
synced 2024-09-08 02:29:49 +02:00
area_dgb (#254)
* area_arn/arn_02 * Signed StoryProgress enum * arn_03 * Update scripts * arn_04 * fix kmr * Broken for Ethan * Commiting before maybe breaking everything * Fix star rod * Add funcs * arn_05 * arn_07 * arn_08/arn_09 * Cleanup prototypes * arn_11/12/13 * Cleanup * Cleanup * Review * Add npc flag * Comments * dgb_01 * dgb_02 * dgb_03 * dgb_04 * Fixup commented functions * dgb_05 * dgb_06 * dgb_07 * dgb_08 * dgb_09 * dgb_10 * dgb_11 * dgb_12 * dgb_15 * dgb_13 * dgb_14 * dgb_16 * dgb_17 * dgb_18 * Dumb newlines * Replacing some funcs, scared I'll break everything to commit NOW! * More * More * More * a * b * c * d * e * f * remove asm * Move newlines
This commit is contained in:
parent
eefa9014e2
commit
8fbdc83055
@ -78,7 +78,7 @@ typedef struct CamPosSettings {
|
||||
|
||||
typedef struct PartnerData {
|
||||
/* 0x00 */ u8 enabled;
|
||||
/* 0x01 */ u8 level;
|
||||
/* 0x01 */ s8 level;
|
||||
/* 0x02 */ s16 unk_02[3];
|
||||
} PartnerData; // size = 0x08
|
||||
|
||||
|
@ -502,6 +502,7 @@ enum SoundIDs {
|
||||
SOUND_JR_TROOPA_SPLASH = 69,
|
||||
SOUND_JR_TROOPA_SWIM,
|
||||
SOUND_BOO_SPOOK,
|
||||
SOUND_UNKNOWN_B4 = 180,
|
||||
SOUND_BOO_VANISH = 193,
|
||||
SOUND_BOO_APPEAR = 195,
|
||||
SOUND_MENU_OPEN = 197,
|
||||
@ -517,6 +518,7 @@ enum SoundIDs {
|
||||
SOUND_LAND = 331,
|
||||
SOUND_HIT_BLOCK = 334,
|
||||
SOUND_SEARCH_BUSH = 339,
|
||||
SOUND_UNKNOWN_162 = 354,
|
||||
SOUND_BASIC_DOOR_OPEN = 449,
|
||||
SOUND_BASIC_DOOR_CLOSE,
|
||||
SOUND_METAL_DOOR_OPEN,
|
||||
@ -532,20 +534,25 @@ enum SoundIDs {
|
||||
SOUND_UNKNOWN_25A,
|
||||
SOUND_UNKNOWN_25C = 604,
|
||||
SOUND_UNKNOWN_25D,
|
||||
SOUND_UNKNOWN_262 = 610,
|
||||
SOUND_BOW_SPOOK = 657,
|
||||
SOUND_UNUSED_2C1 = 705,
|
||||
SOUND_SMOKE_BURST = 717,
|
||||
SOUND_DAYZEE_SONG = 727,
|
||||
SOUND_POWER_UP,
|
||||
SOUND_UNKNOWN_2F1 = 753,
|
||||
SOUND_UNKNOWN_2F7 = 759,
|
||||
SOUND_CLOSE_SHELL = 767,
|
||||
SOUND_SHY_GUY_SCREAMS1 = 780,
|
||||
SOUND_SHY_GUY_SCREAMS2,
|
||||
SOUND_SHY_GUY_SCREAMS3,
|
||||
SOUND_TOY_TANK_MOVE1,
|
||||
SOUND_TOY_TANK_MOVE2,
|
||||
SOUND_UNKNOWN_315 = 789,
|
||||
SOUND_MOLE_SURFACE = 801,
|
||||
SOUND_MOLE_DIG,
|
||||
SOUND_MOLE_POP,
|
||||
SOUND_UNKNOWN_32E = 814,
|
||||
SOUND_UNKNOWN_361 = 865,
|
||||
SOUND_UNKNOWN_362,
|
||||
SOUND_UNKNOWN_363,
|
||||
@ -579,6 +586,8 @@ enum SoundIDs {
|
||||
SOUND_UNKNOWN_202E,
|
||||
SOUND_UNKNOWN_202F,
|
||||
SOUND_UNKNOWN_2030,
|
||||
SOUND_UNKNOWN_2038 = 8248,
|
||||
SOUND_UNKNOWN_2039,
|
||||
SOUND_BOMB_BLAST = 8310,
|
||||
SOUND_JUMP_2081 = 8321,
|
||||
SOUND_UNKNOWN_208D = 8333,
|
||||
@ -589,6 +598,7 @@ enum SoundIDs {
|
||||
SOUND_SPELL_CAST3,
|
||||
SOUND_SPELL_CAST4,
|
||||
SOUND_SPELL_CAST5,
|
||||
SOUND_UNKNOWN_20F6 = 8438,
|
||||
};
|
||||
|
||||
typedef UNK_TYPE Cam;
|
||||
@ -1010,7 +1020,14 @@ enum PlayerAnims {
|
||||
ANIM_30004 = 0x30004,
|
||||
ANIM_30008 = 0x30008,
|
||||
ANIM_30009,
|
||||
ANIM_80003 = 0x80003,
|
||||
ANIM_80007 = 0x80007,
|
||||
ANIM_8000B = 0x8000B,
|
||||
ANIM_8000C,
|
||||
ANIM_80017 = 0x80017,
|
||||
ANIM_8001B = 0x8001B,
|
||||
ANIM_8001D = 0x8001D,
|
||||
ANIM_8001E,
|
||||
};
|
||||
|
||||
typedef UNK_TYPE AmbientSound;
|
||||
@ -1362,7 +1379,7 @@ enum ActionStates {
|
||||
typedef s32 NpcID;
|
||||
enum NpcIDs {
|
||||
NPC_SELF = -1,
|
||||
NPC_PLAYER,
|
||||
NPC_PLAYER = -2,
|
||||
NPC_PARTNER = -4,
|
||||
};
|
||||
|
||||
|
@ -2,12 +2,14 @@
|
||||
#define _FUNCTIONS_H_
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "common_structs.h"
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
#include "enums.h"
|
||||
|
||||
f32 fabsf(f32 f);
|
||||
f32 sqrtf(f32 f);
|
||||
f64 sqrt(f64 d);
|
||||
f32 cosine(s16 arg0);
|
||||
|
||||
void nuBoot(void);
|
||||
void boot_idle(void);
|
||||
@ -103,7 +105,7 @@ void func_8006FEF0(s32, f32, f32, f32, f32);
|
||||
void func_80070190(s32, f32, f32, f32, s32, f32, s32, s32);
|
||||
|
||||
void func_80071090(s32, f32, f32, f32, s32);
|
||||
void func_80071750(s32, f32, f32, f32, f32, s32);
|
||||
Effect* func_80071750(s32, f32, f32, f32, f32, s32);
|
||||
void func_800720B0(s32, f32, f32, f32, f32, s32);
|
||||
void func_80072950(s32, f32, f32, f32, f32, s32 time);
|
||||
|
||||
@ -203,6 +205,7 @@ s32 rand_int(s32);
|
||||
void sort_items(void);
|
||||
s32 is_ability_active(s32 arg0);
|
||||
f32 update_lerp(Easing easing, f32 start, f32 end, s32 elapsed, s32 duration);
|
||||
void sin_cos_deg(f32 rad, f32* outSinTheta, f32* outCosTheta);
|
||||
|
||||
s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 facingAngleSign,
|
||||
s32 pickupVar);
|
||||
@ -318,4 +321,18 @@ f32 dead_set_float_variable(ScriptInstance* script, Bytecode var, f32 value);
|
||||
f32 dead_cos_rad(f32 x);
|
||||
f32 dead_atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
|
||||
|
||||
void func_8004A784(Npc* npc, f32 arg1, f32* arg2, s32* arg3, s32* arg4, s32* arg5);
|
||||
void base_UnkNpcAIFunc1(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory);
|
||||
ApiStatus func_80045900(ScriptInstance* script);
|
||||
ApiStatus func_802D6420(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802D6954(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_80045838(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802D585C(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802CF56C(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802CDE68(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802D8248(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define STATIC_ASSERT(condition) enum { static_assert_fail = 1/(!!(condition)) } // Causes division by zero ("not integer constant") if false
|
||||
|
||||
#define CAM(id) (&gCameras[id])
|
||||
#define CAM2(id) ({ Camera* c = gCameras; &c[id]; })
|
||||
#define CURRENT_CAM (&gCameras[gCurrentCameraID])
|
||||
#define GET_MAP_ENTRY(cfg, idx) (&(*cfg->entryList)[idx])
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// TODO: consider moving Npc here
|
||||
|
||||
#define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f))
|
||||
|
||||
typedef s32 MessageID;
|
||||
typedef Vec4f EntryList[];
|
||||
|
||||
/// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads.
|
||||
@ -74,7 +74,7 @@ typedef struct NpcAISettings {
|
||||
/* 0x10 */ X32 unk_10;
|
||||
/* 0x14 */ s32 unk_14;
|
||||
/* 0x18 */ f32 chaseSpeed;
|
||||
/* 0x1C */ s32 unk_1C; // chase turn step?
|
||||
/* 0x1C */ X32 unk_1C; // chase turn step?
|
||||
/* 0x20 */ s32 unk_20;
|
||||
/* 0x24 */ f32 chaseRadius;
|
||||
/* 0x28 */ X32 unk_28;
|
||||
@ -301,7 +301,7 @@ typedef struct {
|
||||
Enemy* get_enemy(NpcID npcId);
|
||||
MapConfig* get_current_map_header(void);
|
||||
|
||||
s32 func_800490B4(EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
s32 func_800490B4(EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, f32 arg3, s32 arg4);
|
||||
|
||||
/// Zero-terminated.
|
||||
Area gAreas[29];
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef s32 MessageID;
|
||||
|
||||
// Prefer editing splat.yaml's msg ids section than using this directly!
|
||||
#define MESSAGE_ID(section, index) (((section << 16) + index))
|
||||
|
||||
|
@ -117,6 +117,7 @@ ApiStatus AdjustCam(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus ResetCam(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus LoadModelAnimation(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus PlayModelAnimation(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus SetAnimModelPosition(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus ChangeModelAnimation(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus DeleteNpc(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus GetNpcPointer(ScriptInstance* script, s32 isInitialCall);
|
||||
|
@ -106,7 +106,7 @@ s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 c
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_23680", func_800490B4, EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, s32 arg3, s32 arg4);
|
||||
INCLUDE_ASM(s32, "code_23680", func_800490B4, EnemyTerritoryThing* arg0, Enemy* arg1, f32 arg2, f32 arg3, s32 arg4);
|
||||
|
||||
s32 func_800493EC(Enemy* enemy, s32 arg1, f32 arg2, f32 arg3) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
|
@ -19,4 +19,4 @@ void func_8004A73C(ScriptInstance* script) {
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_25AF0", func_8004A784);
|
||||
INCLUDE_ASM(void, "code_25AF0", func_8004A784, Npc* npc, f32 arg1, f32* arg2, s32* arg3, s32* arg4, s32* arg5);
|
||||
|
@ -170,7 +170,7 @@ INCLUDE_ASM(s32, "code_4ac90_len_3910", func_80071690);
|
||||
|
||||
INCLUDE_ASM(s32, "code_4ac90_len_3910", func_800716F0);
|
||||
|
||||
INCLUDE_ASM(void, "code_4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
|
||||
INCLUDE_ASM(Effect*, "code_4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
|
||||
|
||||
INCLUDE_ASM(s32, "code_4ac90_len_3910", func_800717B0);
|
||||
|
||||
|
@ -89,7 +89,7 @@ void func_80127B70(s32 arg0) {
|
||||
|
||||
INCLUDE_ASM(s32, "code_B9D60", func_80127BA4);
|
||||
|
||||
INCLUDE_ASM(s32, "code_B9D60", func_80127D90);
|
||||
INCLUDE_ASM(s32, "code_B9D60", func_80127D90, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6);
|
||||
|
||||
|
||||
void func_8012C2E0(void) {
|
||||
|
@ -52,7 +52,7 @@ INCLUDE_ASM(s32, "code_EA0C10", func_80242608_EA2F08);
|
||||
INCLUDE_ASM(s32, "code_EA0C10", func_8024267C_EA2F7C);
|
||||
/*
|
||||
ApiStatus N(func_8024267C_EA2F7C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -66,11 +66,11 @@ ApiStatus N(func_8024267C_EA2F7C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -96,10 +96,10 @@ ApiStatus N(func_802429C0_EA32C0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -110,7 +110,7 @@ ApiStatus N(func_80242A14_EA3314)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -37,7 +37,7 @@ INCLUDE_ASM(s32, "code_EA8AE0", func_8024140C_EA9EEC);
|
||||
INCLUDE_ASM(s32, "code_EA8AE0", func_80241468_EA9F48);
|
||||
/*
|
||||
ApiStatus N(func_80241468_EA9F48)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -51,11 +51,11 @@ ApiStatus N(func_80241468_EA9F48)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -81,10 +81,10 @@ ApiStatus N(func_802417AC_EAA28C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -95,7 +95,7 @@ ApiStatus N(func_80241800_EAA2E0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
INCLUDE_ASM(s32, "code_EB1170", func_80240310_EB1170);
|
||||
/*
|
||||
ApiStatus N(func_80240310_EB1170)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,11 +17,11 @@ ApiStatus N(func_80240310_EB1170)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -47,10 +47,10 @@ ApiStatus N(func_80240654_EB14B4)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -61,7 +61,7 @@ ApiStatus N(func_802406A8_EB1508)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
INCLUDE_ASM(s32, "code_EB8E90", func_80240040_EB8E90);
|
||||
/*
|
||||
ApiStatus N(func_80240040_EB8E90)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_80240040_EB8E90)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 ret;
|
||||
@ -34,7 +34,7 @@ ApiStatus N(func_80240040_EB8E90)(ScriptInstance* script, s32 isInitialCall) {
|
||||
}
|
||||
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -49,7 +49,7 @@ void N(func_80240198_EB8FE8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -98,7 +98,7 @@ void N(func_80240500_EB9350)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -126,7 +126,7 @@ void N(func_80240500_EB9350)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
|
||||
INCLUDE_ASM(s32, "code_EB8E90", func_802406BC_EB950C);
|
||||
/*
|
||||
ApiStatus N(func_802406BC_EB950C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_802406BC_EB950C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
@ -141,7 +141,7 @@ ApiStatus N(func_802406BC_EB950C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
||||
}
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -153,12 +153,12 @@ INCLUDE_ASM(s32, "code_EB8E90", func_8024085C_EB96AC);
|
||||
|
||||
INCLUDE_ASM(s32, "code_EB8E90", func_8024098C_EB97DC);
|
||||
/*
|
||||
ApiStatus N(func_8024098C_EB97DC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_8024098C_EB97DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
|
@ -8,7 +8,7 @@ INCLUDE_ASM(s32, "code_EB9D90", func_802410E4_EB9F34);
|
||||
|
||||
INCLUDE_ASM(s32, "code_EB9D90", func_8024121C_EBA06C);
|
||||
/*
|
||||
A) {
|
||||
ApiStatus N(func_8024121C_EBA06C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 a1 = *args++;
|
||||
s32 var0 = get_variable(script, a1);
|
||||
|
@ -3,7 +3,7 @@
|
||||
INCLUDE_ASM(s32, "code_EC2240", func_80240040_EC2240);
|
||||
/*
|
||||
ApiStatus N(func_80240040_EC2240)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,11 +17,11 @@ ApiStatus N(func_80240040_EC2240)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -7,7 +7,7 @@ INCLUDE_ASM(s32, "code_EC7590", func_80240450_EC7600);
|
||||
INCLUDE_ASM(s32, "code_EC7590", func_8024061C_EC77CC);
|
||||
/*
|
||||
ApiStatus N(func_8024061C_EC77CC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -21,11 +21,11 @@ ApiStatus N(func_8024061C_EC77CC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -28,10 +28,10 @@ ApiStatus N(func_8024199C_ECB69C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -42,7 +42,7 @@ ApiStatus N(func_802419F0_ECB6F0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -72,7 +72,7 @@ void N(func_80240BB8_ED0BA8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -168,12 +168,12 @@ void N(func_80241178_ED1168)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
|
@ -3,7 +3,7 @@
|
||||
INCLUDE_ASM(s32, "code_ED42A0", func_80240080_ED42A0);
|
||||
/*
|
||||
ApiStatus N(func_80240080_ED42A0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,11 +17,11 @@ ApiStatus N(func_80240080_ED42A0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -324,7 +324,7 @@ INCLUDE_ASM(s32, "code_ED510", ResetFromLava, ScriptInstance* script, s32 isInit
|
||||
|
||||
INCLUDE_ASM(s32, "code_ED510", func_802C9FD4);
|
||||
|
||||
ApiStatus GetColliderCenter(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus GetColliderCenter(ScriptInstance* script, s32 isInitialCall) {
|
||||
f32 x, y, z;
|
||||
|
||||
get_collider_center(get_variable(script, *script->ptrReadPos), &x, &y, &z);
|
||||
@ -353,7 +353,7 @@ ApiStatus UpdateColliderTransform(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
INCLUDE_ASM(s32, "code_ED510", set_zone_enabled);
|
||||
|
||||
INCLUDE_ASM(s32, "code_ED510", SetZoneEnabled);
|
||||
INCLUDE_ASM(ApiStatus, "code_ED510", SetZoneEnabled, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_ED510", goto_map);
|
||||
|
||||
|
@ -7,7 +7,7 @@ INCLUDE_ASM(s32, "code_EDC020", func_802400B0_EDC090);
|
||||
INCLUDE_ASM(s32, "code_EDC020", func_8024027C_EDC25C);
|
||||
/*
|
||||
ApiStatus N(func_8024027C_EDC25C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80241C68_BE09F8);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -21,11 +21,11 @@ ApiStatus N(func_8024027C_EDC25C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80241C68_BE09F8);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -51,10 +51,10 @@ ApiStatus N(func_802405C0_EDC5A0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -65,7 +65,7 @@ ApiStatus N(func_80240614_EDC5F4)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -74,7 +74,7 @@ void N(func_80240A5C_EDF41C)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -170,12 +170,12 @@ void N(func_8024101C_EDF9DC)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
|
@ -72,7 +72,7 @@ void N(func_802413A8_EE7958)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -168,12 +168,12 @@ void N(func_80241968_EE7F18)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
@ -264,10 +264,10 @@ ApiStatus N(func_80242260_EE8810)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ptr = &D_80241CCC_BE0A5C;
|
||||
*ptr = 0;
|
||||
set_variable(script, *args, D_80241CD0_BE0A60);
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -278,7 +278,7 @@ ApiStatus N(func_802422B4_EE8864)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
D_80241CD0_BE0A60 = get_variable(script, *args);
|
||||
D_80241CCC_BE0A5C = 1;
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -72,7 +72,7 @@ void N(func_802416E8_EEE7E8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -168,12 +168,12 @@ void N(func_80241CA8_EEEDA8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
|
@ -72,7 +72,7 @@ void N(func_80240908_EF2F18)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -168,12 +168,12 @@ void N(func_80240EC8_EF34D8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
INCLUDE_ASM(s32, "code_EFEB00", func_80240340_EFEE40);
|
||||
/*
|
||||
A) {
|
||||
ApiStatus N(func_80240340_EFEE40)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 a1 = *args++;
|
||||
s32 var0 = get_variable(script, a1);
|
||||
@ -41,4 +41,4 @@ INCLUDE_ASM(s32, "code_EFEB00", func_80240660_EFF160);
|
||||
|
||||
INCLUDE_ASM(s32, "code_EFEB00", func_80240784_EFF284);
|
||||
|
||||
INCLUDE_ASM(s32, "code_EFEB00", func_802407B0_EFF2B0);
|
||||
INCLUDE_ASM(s32, "code_EFEB00", func_802407B0_EFF2B0);
|
||||
|
@ -173,16 +173,16 @@ INCLUDE_ASM(s32, "code_F5750", func_802D1380);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", player_jump);
|
||||
|
||||
void PlayerJump(ScriptInstance* script, s32 isInitialCall) {
|
||||
player_jump(script, isInitialCall, 0);
|
||||
ApiStatus PlayerJump(ScriptInstance* script, s32 isInitialCall) {
|
||||
return player_jump(script, isInitialCall, 0);
|
||||
}
|
||||
|
||||
void PlayerJump1(ScriptInstance* script, s32 isInitialCall) {
|
||||
player_jump(script, isInitialCall, 1);
|
||||
ApiStatus PlayerJump1(ScriptInstance* script, s32 isInitialCall) {
|
||||
return player_jump(script, isInitialCall, 1);
|
||||
}
|
||||
|
||||
void PlayerJump2(ScriptInstance* script, s32 isInitialCall) {
|
||||
player_jump(script, isInitialCall, 2);
|
||||
ApiStatus PlayerJump2(ScriptInstance* script, s32 isInitialCall) {
|
||||
return player_jump(script, isInitialCall, 2);
|
||||
}
|
||||
|
||||
ApiStatus InterpPlayerYaw(ScriptInstance* script, s32 isInitialCall) {
|
||||
@ -309,14 +309,14 @@ ApiStatus DisablePartner(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", UseEntryHeading);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", UseEntryHeading, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
ApiStatus func_802D2148(ScriptInstance* script, s32 isInitialCall) {
|
||||
gPlayerStatus.flags &= ~0x4000000;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", UseExitHeading);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", UseExitHeading, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D23F8);
|
||||
|
||||
@ -536,25 +536,25 @@ ApiStatus func_802D354C(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3624);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D3624, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3674);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D36E0);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D36E0, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D378C);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3840);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D3840, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D38EC);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D38EC, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3998);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D39FC);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D39FC, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3A60);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3C58);
|
||||
INCLUDE_ASM(ApiStatus, "code_F5750", func_802D3C58, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_F5750", func_802D3EB8);
|
||||
|
||||
|
@ -118,8 +118,8 @@ ApiStatus Spawn802D9D50(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
INCLUDE_ASM(s32, "code_FBE10", func_802D7E08);
|
||||
|
||||
INCLUDE_ASM(s32, "code_FBE10", ShowSleepBubble);
|
||||
INCLUDE_ASM(ApiStatus, "code_FBE10", ShowSleepBubble, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_FBE10", func_802D8248);
|
||||
INCLUDE_ASM(ApiStatus, "code_FBE10", func_802D8248, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_FBE10", PlayEffect);
|
||||
INCLUDE_ASM(ApiStatus, "code_FBE10", PlayEffect, ScriptInstance* script, s32 isInitialCall);
|
||||
|
@ -78,7 +78,7 @@ ApiStatus SetMessageImages(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D0C94(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D0C94(ScriptInstance* script, s32 isInitialCall) {
|
||||
if (get_variable(script, *script->ptrReadPos) == 0) {
|
||||
OVERRIDE_FLAG_SET(0x10);
|
||||
} else {
|
||||
@ -96,7 +96,7 @@ ApiStatus SetMessageString(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus SetMessageValue(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus SetMessageValue(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* ptrReadPos = script->ptrReadPos;
|
||||
s32 value = get_variable(script, *ptrReadPos++);
|
||||
s32 index = get_variable(script, *ptrReadPos);
|
||||
|
@ -188,12 +188,12 @@ ApiStatus AddVectorPolar(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D4BDC(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32* t0 = &script->functionTemp[0].s;
|
||||
s32* t1 = &script->functionTemp[1].s;
|
||||
s32 t1v;
|
||||
|
||||
if (initialCall) {
|
||||
if (isInitialCall) {
|
||||
*t0 = 0;
|
||||
*t1 = 0;
|
||||
}
|
||||
@ -216,12 +216,12 @@ ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_802D4C4C(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D4C4C(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32* t0 = &script->functionTemp[0].s;
|
||||
s32* t1 = &script->functionTemp[1].s;
|
||||
s32 t1v;
|
||||
|
||||
if (initialCall) {
|
||||
if (isInitialCall) {
|
||||
*t0 = 0;
|
||||
*t1 = 255;
|
||||
}
|
||||
@ -243,7 +243,7 @@ ApiStatus func_802D4C4C(ScriptInstance* script, s32 initialCall) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_802D4CC4(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D4CC4(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 value = get_variable(script, *script->ptrReadPos);
|
||||
if (value < 0) {
|
||||
set_transition_stencil_zoom_1(255, -1.0f);
|
||||
@ -254,7 +254,7 @@ ApiStatus func_802D4CC4(ScriptInstance* script, s32 initialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D4D14(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D4D14(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32 value = get_float_variable(script, *script->ptrReadPos);
|
||||
|
||||
set_transition_stencil_center(0, 0, 0xC, 0x14);
|
||||
@ -264,7 +264,7 @@ ApiStatus func_802D4D14(ScriptInstance* script, s32 initialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D4D88(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D4D88(ScriptInstance* script, s32 isInitialCall) {
|
||||
set_transition_stencil_zoom_0(0xC, 0);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
@ -389,12 +389,12 @@ ApiStatus GetDist2D(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D5830(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D5830(ScriptInstance* script, s32 isInitialCall) {
|
||||
func_80027088(get_variable(script, *script->ptrReadPos));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D585C(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D585C(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* ptrReadPos = script->ptrReadPos;
|
||||
s32 setMode = get_variable(script, *ptrReadPos++);
|
||||
s32 flags = get_variable(script, *ptrReadPos++);
|
||||
|
@ -105,7 +105,7 @@ ApiStatus PlaySound(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D617C(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D617C(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 soundID = get_variable(script, *args++);
|
||||
s32 value2 = get_variable(script, *args++);
|
||||
@ -133,7 +133,7 @@ ApiStatus StopSound(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D62E4(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D62E4(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
|
||||
func_80149A6C(get_variable(script, *args++), 1);
|
||||
@ -147,7 +147,7 @@ ApiStatus UseDoorSounds(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D6340(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D6340(ScriptInstance* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
|
||||
D_80151308 = get_variable(script, *args++);
|
||||
@ -166,7 +166,7 @@ ApiStatus PlaySoundAtF(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D6420);
|
||||
INCLUDE_ASM(ApiStatus, "code_fa4c0_len_3bf0", func_802D6420, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D663C);
|
||||
|
||||
@ -269,7 +269,7 @@ ApiStatus AddItem(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802D6AF0(ScriptInstance* script, s32 initialCall) {
|
||||
ApiStatus func_802D6AF0(ScriptInstance* script, s32 isInitialCall) {
|
||||
set_variable(script, *script->ptrReadPos, 0);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM(s32, "code_fe0b0_len_5a0", SetSpriteShading);
|
||||
INCLUDE_ASM(ApiStatus, "code_fe0b0_len_5a0", SetSpriteShading, ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
|
||||
if (get_variable(script, *script->ptrReadPos) != 0) {
|
||||
@ -11,7 +11,7 @@ ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
s32 GetDemoState(ScriptInstance* script) {
|
||||
ApiStatus GetDemoState(ScriptInstance* script, s32 isInitialCall) {
|
||||
set_variable(script, *script->ptrReadPos, gGameStatusPtr->demoState);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ NpcAISettings N(npcAISettings_802413D0) = {
|
||||
.alertRadius = 150.0f,
|
||||
.unk_14 = 2,
|
||||
.chaseSpeed = 3.3f,
|
||||
.unk_1C = 70,
|
||||
.unk_1C = { .s = 70 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 180.0f,
|
||||
.unk_2C = 1,
|
||||
@ -73,7 +73,7 @@ NpcAISettings N(npcAISettings_8024144C) = {
|
||||
.alertRadius = 120.0f,
|
||||
.unk_14 = 3,
|
||||
.chaseSpeed = 8.5f,
|
||||
.unk_1C = 60,
|
||||
.unk_1C = { .s = 60 },
|
||||
.unk_20 = 3,
|
||||
.chaseRadius = 100.0f,
|
||||
.unk_28 = { .f = 60.0f },
|
||||
@ -200,41 +200,37 @@ NpcGroupList N(npcGroupList_80241A9C) = {
|
||||
{},
|
||||
};
|
||||
|
||||
// gCameras loading after the offset calculation instead of before
|
||||
#ifdef NON_MATCHING
|
||||
s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
PlayerStatus** playerStatus;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM(D_8009A634);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
f32 phi_f20;
|
||||
s32 phi_s0 = 0;
|
||||
s32 ret = FALSE;
|
||||
|
||||
if (func_800493EC(enemy, 0, aiSettings->alertRadius, aiSettings->unk_10.f)) {
|
||||
phi_s0 = 1;
|
||||
ret = TRUE;
|
||||
}
|
||||
phi_f20 = 270.0f;
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20,
|
||||
atan2(npc->pos.x, npc->pos.z,
|
||||
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
return phi_s0;
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_02/BDD1B0", arn_02_func_80240000_BDD1B0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
|
||||
#endif
|
||||
|
||||
#include "world/common/UnkNpcAIFunc18.inc.c"
|
||||
|
||||
@ -245,7 +241,7 @@ void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
|
||||
npc->currentAnim = enemy->animList[9];
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -269,7 +265,7 @@ void N(func_802404D0_BDD680)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 12;
|
||||
@ -375,7 +371,7 @@ void N(func_80240A30_BDDBE0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 12;
|
||||
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
|
||||
|
@ -5,10 +5,6 @@
|
||||
|
||||
#define NAMESPACE arn_03
|
||||
|
||||
void func_802D6420(void);
|
||||
void func_802D6954(void);
|
||||
void func_802CF56C(void);
|
||||
|
||||
ApiStatus N(SomeXYZFuncTodoRename)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80241648_BE03D8)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80241680_BE0410)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
@ -684,22 +684,22 @@ Script N(idle_80243D28) = SCRIPT({
|
||||
|
||||
Script N(init_80243E90) = SCRIPT({
|
||||
BindNpcIdle(NPC_SELF, N(idle_80243D28));
|
||||
SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE);
|
||||
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
|
||||
});
|
||||
|
||||
Script N(init_80243ECC) = SCRIPT({
|
||||
BindNpcIdle(NPC_SELF, N(idle_80243D28));
|
||||
SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE);
|
||||
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
|
||||
});
|
||||
|
||||
Script N(init_80243F08) = SCRIPT({
|
||||
BindNpcIdle(NPC_SELF, N(idle_80243D28));
|
||||
SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE);
|
||||
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
|
||||
});
|
||||
|
||||
Script N(init_80243F44) = SCRIPT({
|
||||
BindNpcIdle(NPC_SELF, N(idle_80243D28));
|
||||
SetNpcFlagBits(NPC_SELF, 0x00000010, FALSE);
|
||||
SetNpcFlagBits(NPC_SELF, NPC_FLAG_10, FALSE);
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_80243F80)[] = {
|
||||
@ -893,7 +893,7 @@ void N(func_80240158_BDEEE8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -939,7 +939,7 @@ void N(func_802404C0_BDF250)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -992,7 +992,7 @@ void N(func_8024094C_BDF6DC)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
|
@ -37,7 +37,7 @@ NpcAISettings N(npcAISettings_80243660) = {
|
||||
.alertRadius = 130.0f,
|
||||
.unk_14 = 1,
|
||||
.chaseSpeed = 2.5f,
|
||||
.unk_1C = 180,
|
||||
.unk_1C = { .s = 180 },
|
||||
.unk_20 = 3,
|
||||
.chaseRadius = 150.0f,
|
||||
.unk_2C = 1,
|
||||
@ -68,7 +68,7 @@ NpcAISettings N(npcAISettings_802436F4) = {
|
||||
.alertRadius = 120.0f,
|
||||
.unk_14 = 3,
|
||||
.chaseSpeed = 4.0f,
|
||||
.unk_1C = 5,
|
||||
.unk_1C = { .s = 5 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 150.0f,
|
||||
.unk_2C = 1,
|
||||
@ -99,7 +99,7 @@ NpcAISettings N(npcAISettings_802437C0) = {
|
||||
.alertRadius = 120.0f,
|
||||
.unk_14 = 3,
|
||||
.chaseSpeed = 8.5f,
|
||||
.unk_1C = 60,
|
||||
.unk_1C = { .s = 60 },
|
||||
.unk_20 = 3,
|
||||
.chaseRadius = 100.0f,
|
||||
.unk_28 = { .f = 60.0f },
|
||||
@ -318,7 +318,7 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -364,7 +364,7 @@ void N(func_802404C0_BE3C70)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -417,7 +417,7 @@ void N(func_8024094C_BE40FC)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
@ -653,7 +653,7 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
|
||||
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -744,7 +744,7 @@ void N(func_80241728_BE4ED8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -834,12 +834,12 @@ void N(func_80241CE8_BE5498)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
@ -964,40 +964,37 @@ ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, EnemyTerritoryThing* territory) {
|
||||
PlayerStatus** playerStatus;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM(D_8009A634);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
f32 phi_f20;
|
||||
s32 phi_s0 = 0;
|
||||
s32 ret = FALSE;
|
||||
|
||||
if (func_800493EC(enemy, 0, aiSettings->alertRadius, aiSettings->unk_10.f)) {
|
||||
phi_s0 = 1;
|
||||
ret = TRUE;
|
||||
}
|
||||
phi_f20 = 270.0f;
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20,
|
||||
atan2(npc->pos.x, npc->pos.z,
|
||||
(*playerStatus)->position.x, (*playerStatus)->position.z))) > 75.0) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
if (fabsf(npc->pos.y - (*playerStatus)->position.y) >= 40.0f) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
phi_s0 = 0;
|
||||
ret = FALSE;
|
||||
}
|
||||
return phi_s0;
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "world/area_arn/arn_04/BE37B0", arn_04_func_80242388_BE5B38, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
|
||||
#endif
|
||||
|
||||
#include "world/common/UnkNpcAIFunc18.inc.c"
|
||||
|
||||
@ -1008,7 +1005,7 @@ void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) {
|
||||
npc->currentAnim = enemy->animList[9];
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -1032,7 +1029,7 @@ void N(func_80242858_BE6008)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
playerStatus = &gPlayerStatusPtr;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 12;
|
||||
@ -1138,7 +1135,7 @@ void N(func_80242DB8_BE6568)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z);
|
||||
script->functionTemp[0].s = 12;
|
||||
} else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) {
|
||||
|
@ -5,15 +5,14 @@
|
||||
#define NAMESPACE arn_05
|
||||
|
||||
ApiStatus func_802D2B50(void);
|
||||
ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802412C8_BE8EA8)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(makeEntities);
|
||||
Script N(main);
|
||||
Script N(80241360);
|
||||
NpcGroupList N(npcGroupList_80244FA4);
|
||||
NpcGroupList N(npcGroupList_80244FC8);
|
||||
Script N(makeEntities);
|
||||
Script N(802441FC);
|
||||
NpcGroupList N(npcGroupList_80244FC8);
|
||||
NpcGroupList N(npcGroupList_80244FA4);
|
||||
|
@ -3,6 +3,19 @@
|
||||
#include "sprite/npc/world_bow.h"
|
||||
#include "sprite/npc/world_tubba.h"
|
||||
|
||||
enum {
|
||||
NPC_BOO0,
|
||||
NPC_BOO1,
|
||||
NPC_BOO2,
|
||||
NPC_BOO3,
|
||||
NPC_BOO4,
|
||||
NPC_WORLD_TUBBA,
|
||||
NPC_BOO5,
|
||||
NPC_BOO6,
|
||||
NPC_BOO7,
|
||||
NPC_BOO8,
|
||||
};
|
||||
|
||||
Script N(exitWalk_80241430) = EXIT_WALK_SCRIPT(60, 0, "arn_03", 1);
|
||||
|
||||
Script N(exitWalk_8024148C) = EXIT_WALK_SCRIPT(60, 1, "arn_02", 0);
|
||||
@ -252,7 +265,7 @@ Script N(init_8024202C) = SCRIPT({
|
||||
BindNpcInteract(NPC_SELF, N(interact_80241AB4));
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_SAW_TUBBA_EAT_BOO {
|
||||
SetNpcFlagBits(NPC_SELF, 0x00000100, TRUE);
|
||||
SetNpcFlagBits(NPC_SELF, NPC_FLAG_100, TRUE);
|
||||
}
|
||||
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
|
||||
RemoveNpc(NPC_SELF);
|
||||
@ -301,7 +314,7 @@ Script N(init_802421EC) = SCRIPT({
|
||||
|
||||
StaticNpc N(npcGroup_8024223C)[] = {
|
||||
{
|
||||
.id = 0,
|
||||
.id = NPC_BOO0,
|
||||
.settings = &N(npcSettings_8024172C),
|
||||
.pos = { 55.0f, 195.0f, 160.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -332,7 +345,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00AE),
|
||||
},
|
||||
{
|
||||
.id = 1,
|
||||
.id = NPC_BOO1,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 160.0f, 191.0f, 250.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -362,7 +375,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00AF),
|
||||
},
|
||||
{
|
||||
.id = 2,
|
||||
.id = NPC_BOO2,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 390.0f, 190.0f, 255.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -392,7 +405,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00B0),
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.id = NPC_BOO3,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 503.0f, 206.0f, 210.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -422,7 +435,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00B1),
|
||||
},
|
||||
{
|
||||
.id = 4,
|
||||
.id = NPC_BOO4,
|
||||
.settings = &N(npcSettings_8024172C),
|
||||
.pos = { 350.0f, 185.0f, 197.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -456,7 +469,7 @@ StaticNpc N(npcGroup_8024223C)[] = {
|
||||
|
||||
Script N(80242BEC) = SCRIPT({
|
||||
loop SI_VAR(0) {
|
||||
PlaySoundAtNpc(0x5, 0x20F6, 0);
|
||||
PlaySoundAtNpc(NPC_WORLD_TUBBA, SOUND_UNKNOWN_20F6, 0);
|
||||
ShakeCam(0, 0, 10, 0.5);
|
||||
sleep 5;
|
||||
}
|
||||
@ -464,21 +477,21 @@ Script N(80242BEC) = SCRIPT({
|
||||
|
||||
Script N(80242C50) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
NpcFacePlayer(0x2, 1);
|
||||
PlaySoundAtNpc(0x2, 0x262, 0);
|
||||
NpcFacePlayer(NPC_BOO2, 1);
|
||||
PlaySoundAtNpc(NPC_BOO2, SOUND_UNKNOWN_262, 0);
|
||||
ShowEmote(2, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0);
|
||||
sleep 20;
|
||||
GetNpcPos(0x2, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetNpcPos(NPC_BOO2, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetPlayerPos(SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
SI_VAR(0) -= SI_VAR(3);
|
||||
SI_VAR(0) -= 50;
|
||||
SI_VAR(1) -= SI_VAR(4);
|
||||
SI_VAR(2) -= SI_VAR(5);
|
||||
GetNpcPos(0x2, SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
GetNpcPos(NPC_BOO2, SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
SI_VAR(3) -= SI_VAR(0);
|
||||
SI_VAR(4) -= SI_VAR(1);
|
||||
SI_VAR(5) -= SI_VAR(2);
|
||||
NpcMoveTo(0x2, SI_VAR(3), SI_VAR(5), 30);
|
||||
NpcMoveTo(NPC_BOO2, SI_VAR(3), SI_VAR(5), 30);
|
||||
SetCamType(0, 6, 1);
|
||||
SetCamSpeed(0, 5.0);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
@ -487,13 +500,13 @@ Script N(80242C50) = SCRIPT({
|
||||
SetCamDistance(0, 350);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00A0));
|
||||
PlaySoundAt(0x20F6, 0, 450, 200, 160);
|
||||
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00A0));
|
||||
PlaySoundAt(SOUND_UNKNOWN_20F6, 0, 450, 200, 160);
|
||||
ShakeCam(0, 0, 20, 0.80078125);
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x262, 0);
|
||||
PlaySoundAtNpc(0x1, 0x262, 0);
|
||||
PlaySoundAtNpc(0x2, 0x262, 0);
|
||||
PlaySoundAtNpc(0x4, 0x262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO0, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO1, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO2, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO4, SOUND_UNKNOWN_262, 0);
|
||||
ShowEmote(0, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(1, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(2, EMOTE_EXCLAMATION, -45, 20, 1, 0, 0, 0, 0);
|
||||
@ -501,33 +514,33 @@ Script N(80242C50) = SCRIPT({
|
||||
FadeOutMusic(0, 500);
|
||||
ClearAmbientSounds(250);
|
||||
sleep 20;
|
||||
InterpNpcYaw(0x2, 90, 1);
|
||||
InterpNpcYaw(0x4, 90, 1);
|
||||
InterpNpcYaw(NPC_BOO2, 90, 1);
|
||||
InterpNpcYaw(NPC_BOO4, 90, 1);
|
||||
sleep 20;
|
||||
PlaySound(SOUND_BOO_APPEAR);
|
||||
SI_VAR(0) = 240.0;
|
||||
loop 20 {
|
||||
SI_VAR(0) -= 12.0;
|
||||
func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO0, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO4, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
}
|
||||
SetNpcPos(NPC_PLAYER, 420, 300, 220);
|
||||
SetNpcPos(0x1, 460, 250, 210);
|
||||
SetNpcPos(0x4, 0, -1000, 0);
|
||||
EnableNpcShadow(NPC_PLAYER, FALSE);
|
||||
EnableNpcShadow(0x1, FALSE);
|
||||
EnableNpcShadow(0x4, FALSE);
|
||||
SetNpcPos(NPC_BOO0, 420, 300, 220);
|
||||
SetNpcPos(NPC_BOO1, 460, 250, 210);
|
||||
SetNpcPos(NPC_BOO4, 0, -1000, 0);
|
||||
EnableNpcShadow(NPC_BOO0, FALSE);
|
||||
EnableNpcShadow(NPC_BOO1, FALSE);
|
||||
EnableNpcShadow(NPC_BOO4, FALSE);
|
||||
PlaySound(SOUND_BOO_VANISH);
|
||||
SI_VAR(0) = 0.0;
|
||||
loop 20 {
|
||||
SI_VAR(0) += 12.0;
|
||||
func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO0, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO1, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
}
|
||||
SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A1));
|
||||
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A1));
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
if (SI_VAR(0) != 9) {
|
||||
N(func_802412C8_BE8EA8)(9);
|
||||
@ -567,14 +580,14 @@ Script N(80242C50) = SCRIPT({
|
||||
SetPanTarget(0, 426, 190, 194);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SetNpcFlagBits(0x5, 0x00000200, TRUE);
|
||||
SetNpcSpeed(0x5, 2.5);
|
||||
SetNpcPos(0x5, 675, 200, 180);
|
||||
NpcFaceNpc(NPC_PLAYER, 0x5, 1);
|
||||
NpcFaceNpc(0x1, 0x5, 1);
|
||||
SetNpcPos(0x2, 272, 190, 214);
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x262, 0);
|
||||
PlaySoundAtNpc(0x1, 0x262, 0);
|
||||
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_200, TRUE);
|
||||
SetNpcSpeed(NPC_WORLD_TUBBA, 2.5);
|
||||
SetNpcPos(NPC_WORLD_TUBBA, 675, 200, 180);
|
||||
NpcFaceNpc(NPC_BOO0, NPC_WORLD_TUBBA, 1);
|
||||
NpcFaceNpc(NPC_BOO1, NPC_WORLD_TUBBA, 1);
|
||||
SetNpcPos(NPC_BOO2, 272, 190, 214);
|
||||
PlaySoundAtNpc(NPC_BOO0, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO1, SOUND_UNKNOWN_262, 0);
|
||||
ShowEmote(0, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(1, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
spawn {
|
||||
@ -583,19 +596,19 @@ Script N(80242C50) = SCRIPT({
|
||||
SI_VAR(0) = 240.0;
|
||||
loop 20 {
|
||||
SI_VAR(0) -= 12.0;
|
||||
func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO0, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO1, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
}
|
||||
SetNpcPos(NPC_PLAYER, 0, -1000, 0);
|
||||
SetNpcPos(0x1, 0, -1000, 0);
|
||||
SetNpcPos(NPC_BOO0, 0, -1000, 0);
|
||||
SetNpcPos(NPC_BOO1, 0, -1000, 0);
|
||||
sleep 10;
|
||||
}
|
||||
SI_VAR(0) = 4;
|
||||
spawn N(80242BEC);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(0x5, 550, 196, 0);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(NPC_WORLD_TUBBA, 550, 196, 0);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetCamSpeed(0, 4.0);
|
||||
SetCamPitch(0, 17.0, -11.5);
|
||||
SetCamDistance(0, 375);
|
||||
@ -609,11 +622,11 @@ Script N(80242C50) = SCRIPT({
|
||||
spawn {
|
||||
SI_VAR(0) = 7;
|
||||
spawn N(80242BEC);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(0x5, 370, 220, 0);
|
||||
GetNpcPos(0x2, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
NpcMoveTo(0x5, 330, SI_VAR(2), 0);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(NPC_WORLD_TUBBA, 370, 220, 0);
|
||||
GetNpcPos(NPC_BOO2, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
NpcMoveTo(NPC_WORLD_TUBBA, 330, SI_VAR(2), 0);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SI_MAP_VAR(1) = 1;
|
||||
}
|
||||
SetCamSpeed(0, 90.0);
|
||||
@ -625,7 +638,7 @@ Script N(80242C50) = SCRIPT({
|
||||
SetPanTarget(0, 240, 169, 206);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A4));
|
||||
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A4));
|
||||
sleep 15;
|
||||
loop {
|
||||
sleep 1;
|
||||
@ -633,19 +646,19 @@ Script N(80242C50) = SCRIPT({
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
NpcFaceNpc(0x2, 0x5, 1);
|
||||
NpcFaceNpc(NPC_BOO2, NPC_WORLD_TUBBA, 1);
|
||||
sleep 30;
|
||||
SpeakToPlayer(0x2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A5));
|
||||
SetNpcAnimation(0x2, NPC_ANIM(boo, Palette_01, Anim_9));
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1E));
|
||||
SetNpcJumpscale(0x2, 0.0);
|
||||
NpcJump1(0x2, 265, 206, 212, 3);
|
||||
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A5));
|
||||
SetNpcAnimation(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_9));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_1E));
|
||||
SetNpcJumpscale(NPC_BOO2, 0.0);
|
||||
NpcJump1(NPC_BOO2, 265, 206, 212, 3);
|
||||
sleep 20;
|
||||
SpeakToPlayer(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1E), NPC_ANIM(world_tubba, Palette_00, Anim_1E), 5, MESSAGE_ID(0x0E, 0x00A6));
|
||||
SetNpcPos(0x2, 303, 237, 228);
|
||||
SetNpcAnimation(0x2, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
EnableNpcShadow(0x2, FALSE);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_1F));
|
||||
SpeakToPlayer(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_1E), NPC_ANIM(world_tubba, Palette_00, Anim_1E), 5, MESSAGE_ID(0x0E, 0x00A6));
|
||||
SetNpcPos(NPC_BOO2, 303, 237, 228);
|
||||
SetNpcAnimation(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
EnableNpcShadow(NPC_BOO2, FALSE);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_1F));
|
||||
SetCamSpeed(0, 5.0);
|
||||
SetCamPitch(0, 17.0, -17.0);
|
||||
SetCamDistance(0, 250);
|
||||
@ -656,11 +669,11 @@ Script N(80242C50) = SCRIPT({
|
||||
PanToTarget(0, 0, 1);
|
||||
spawn {
|
||||
sleep 50;
|
||||
PlaySoundAtNpc(0x5, 0x315, 0);
|
||||
PlaySoundAtNpc(NPC_WORLD_TUBBA, SOUND_UNKNOWN_315, 0);
|
||||
}
|
||||
sleep 40;
|
||||
SetNpcPos(0x2, 0, -1000, 0);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_20));
|
||||
SetNpcPos(NPC_BOO2, 0, -1000, 0);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_20));
|
||||
sleep 80;
|
||||
SetCamSpeed(0, 90.0);
|
||||
SetCamPitch(0, 17.0, -11.5);
|
||||
@ -671,46 +684,46 @@ Script N(80242C50) = SCRIPT({
|
||||
SetPanTarget(0, 240, 169, 206);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
sleep 15;
|
||||
SpeakToPlayer(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_21), NPC_ANIM(world_tubba, Palette_00, Anim_6), 5, MESSAGE_ID(0x0E, 0x00A7));
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_21));
|
||||
GetNpcPos(0x5, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SpeakToPlayer(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_21), NPC_ANIM(world_tubba, Palette_00, Anim_6), 5, MESSAGE_ID(0x0E, 0x00A7));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_21));
|
||||
GetNpcPos(NPC_WORLD_TUBBA, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += -50;
|
||||
SI_VAR(1) += 50;
|
||||
SI_VAR(2) += 10;
|
||||
PlayEffect(0x6, 1, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
sleep 20;
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
InterpNpcYaw(0x5, 90, 1);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
InterpNpcYaw(NPC_WORLD_TUBBA, 90, 1);
|
||||
sleep 30;
|
||||
SI_VAR(0) = 7;
|
||||
spawn N(80242BEC);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(0x5, 370, 220, 0);
|
||||
NpcMoveTo(0x5, 550, 196, 0);
|
||||
SetNpcAnimation(0x5, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcPos(0x5, 0, -1000, 0);
|
||||
SetNpcFlagBits(0x5, 0x00000200, FALSE);
|
||||
NpcFacePlayer(NPC_PLAYER, 3);
|
||||
SetNpcPos(NPC_PLAYER, 55, 195, 160);
|
||||
SetNpcPos(0x1, 160, 191, 250);
|
||||
SetNpcPos(0x4, 350, 185, 197);
|
||||
EnableNpcShadow(NPC_PLAYER, TRUE);
|
||||
EnableNpcShadow(0x1, TRUE);
|
||||
EnableNpcShadow(0x4, TRUE);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
NpcMoveTo(NPC_WORLD_TUBBA, 370, 220, 0);
|
||||
NpcMoveTo(NPC_WORLD_TUBBA, 550, 196, 0);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcPos(NPC_WORLD_TUBBA, 0, -1000, 0);
|
||||
SetNpcFlagBits(NPC_WORLD_TUBBA, NPC_FLAG_200, FALSE);
|
||||
NpcFacePlayer(NPC_BOO0, 3);
|
||||
SetNpcPos(NPC_BOO0, 55, 195, 160);
|
||||
SetNpcPos(NPC_BOO1, 160, 191, 250);
|
||||
SetNpcPos(NPC_BOO4, 350, 185, 197);
|
||||
EnableNpcShadow(NPC_BOO0, TRUE);
|
||||
EnableNpcShadow(NPC_BOO1, TRUE);
|
||||
EnableNpcShadow(NPC_BOO4, TRUE);
|
||||
PlaySound(SOUND_BOO_VANISH);
|
||||
SI_VAR(0) = 0.0;
|
||||
loop 20 {
|
||||
SI_VAR(0) += 12.5;
|
||||
func_802CFD30(NPC_PLAYER, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO0, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO1, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO4, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
}
|
||||
func_802CFD30(NPC_PLAYER, 0, 0, 0, 0, 0);
|
||||
func_802CFD30(0x1, 0, 0, 0, 0, 0);
|
||||
func_802CFD30(0x4, 0, 0, 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO0, 0, 0, 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO1, 0, 0, 0, 0, 0);
|
||||
func_802CFD30(NPC_BOO4, 0, 0, 0, 0, 0);
|
||||
sleep 10;
|
||||
SetCamType(0, 4, 0);
|
||||
SetCamSpeed(0, 3.0);
|
||||
@ -720,13 +733,13 @@ Script N(80242C50) = SCRIPT({
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
SpeakToPlayer(0x4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A8));
|
||||
SpeakToPlayer(NPC_BOO4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00A8));
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(802441FC) = SCRIPT({
|
||||
if (STORY_PROGRESS < STORY_CH3_SAW_TUBBA_EAT_BOO) {
|
||||
SetNpcPos(0x2, 330, 184, 240);
|
||||
SetNpcPos(NPC_BOO2, 330, 184, 240);
|
||||
loop {
|
||||
SI_VAR(10) = 0;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
@ -742,9 +755,9 @@ Script N(802441FC) = SCRIPT({
|
||||
}
|
||||
func_802D2B6C();
|
||||
await N(80242C50);
|
||||
BindNpcInteract(NPC_PLAYER, N(interact_802418F4));
|
||||
BindNpcInteract(0x1, N(interact_80241A84));
|
||||
BindNpcInteract(0x4, N(interact_80241F88));
|
||||
BindNpcInteract(NPC_BOO0, N(interact_802418F4));
|
||||
BindNpcInteract(NPC_BOO1, N(interact_80241A84));
|
||||
BindNpcInteract(NPC_BOO4, N(interact_80241F88));
|
||||
STORY_PROGRESS = STORY_CH3_SAW_TUBBA_EAT_BOO;
|
||||
spawn N(80241360);
|
||||
}
|
||||
@ -767,7 +780,7 @@ NpcAnimID N(extraAnimationList_80244390)[] = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802443AC) = {
|
||||
.id = 5,
|
||||
.id = NPC_WORLD_TUBBA,
|
||||
.settings = &N(npcSettings_802416B0),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -841,7 +854,7 @@ Script N(init_802447AC) = SCRIPT({
|
||||
|
||||
StaticNpc N(npcGroup_802447E4)[] = {
|
||||
{
|
||||
.id = 6,
|
||||
.id = NPC_BOO5,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 36.0f, 277.0f, 140.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
|
||||
@ -870,7 +883,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
|
||||
},
|
||||
},
|
||||
{
|
||||
.id = 7,
|
||||
.id = NPC_BOO6,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 200.0f, 275.0f, 182.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
|
||||
@ -899,7 +912,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
|
||||
},
|
||||
},
|
||||
{
|
||||
.id = 8,
|
||||
.id = NPC_BOO7,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 379.0f, 300.0f, 192.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
|
||||
@ -928,7 +941,7 @@ StaticNpc N(npcGroup_802447E4)[] = {
|
||||
},
|
||||
},
|
||||
{
|
||||
.id = 9,
|
||||
.id = NPC_BOO8,
|
||||
.settings = &N(npcSettings_80241758),
|
||||
.pos = { 525.0f, 286.0f, 178.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
|
||||
@ -1022,7 +1035,7 @@ void N(func_80240158_BE7D38)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -1068,7 +1081,7 @@ void N(func_802404C0_BE80A0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -1121,7 +1134,7 @@ void N(func_8024094C_BE852C)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
|
@ -413,21 +413,21 @@ Script N(80242A30) = SCRIPT({
|
||||
SetPanTarget(0, 5, 0, -147);
|
||||
PanToTarget(0, 0, 1);
|
||||
RotateModel(29, 80, 0, -1, 0);
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
SetNpcJumpscale(NPC_PLAYER, 2.5);
|
||||
NpcJump0(NPC_PLAYER, 0, 20, -120, 8);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 0, 20, -120, 8);
|
||||
sleep 1;
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 0, 10, -60, 12);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 0, 10, -60, 12);
|
||||
sleep 1;
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 0, 0, 0, 12);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 0, 0, 0, 12);
|
||||
sleep 1;
|
||||
SetNpcVar(0, 0, 0);
|
||||
spawn {
|
||||
loop {
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 0, 0, 0, 10);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 0, 0, 0, 10);
|
||||
sleep 1;
|
||||
GetNpcVar(0, 0, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
@ -448,8 +448,8 @@ Script N(80242A30) = SCRIPT({
|
||||
}
|
||||
PlaySoundAtCollider(10, 450, 0);
|
||||
}
|
||||
NpcFaceNpc(NPC_PLAYER, 0x1, 0);
|
||||
SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_A), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00C7));
|
||||
NpcFaceNpc(NPC_TUBBAS_HEART, NPC_WORLD_TUBBA, 0);
|
||||
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_A), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00C7));
|
||||
SetNpcVar(0, 0, 1);
|
||||
loop {
|
||||
GetNpcVar(0, 0, SI_VAR(0));
|
||||
@ -458,11 +458,11 @@ Script N(80242A30) = SCRIPT({
|
||||
}
|
||||
sleep 1;
|
||||
}
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 75, 0, 10, 12);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 75, 0, 10, 12);
|
||||
sleep 1;
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 150, 0, 20, 12);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 150, 0, 20, 12);
|
||||
sleep 1;
|
||||
spawn {
|
||||
sleep 4;
|
||||
@ -474,16 +474,16 @@ Script N(80242A30) = SCRIPT({
|
||||
SetCamPosC(0, 0, 0);
|
||||
SetPanTarget(0, 65, 0, -137);
|
||||
PanToTarget(0, 0, 1);
|
||||
SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_22));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_22));
|
||||
}
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, 298, 56, 31, 18);
|
||||
SetNpcPos(NPC_PLAYER, 0, -1000, 0);
|
||||
EnableNpcShadow(NPC_PLAYER, FALSE);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, 298, 56, 31, 18);
|
||||
SetNpcPos(NPC_TUBBAS_HEART, 0, -1000, 0);
|
||||
EnableNpcShadow(NPC_TUBBAS_HEART, FALSE);
|
||||
spawn {
|
||||
SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_23));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_23));
|
||||
sleep 20;
|
||||
SetNpcAnimation(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
}
|
||||
sleep 20;
|
||||
spawn {
|
||||
@ -527,7 +527,7 @@ Script N(80242A30) = SCRIPT({
|
||||
}
|
||||
PlayerMoveTo(200, 0, 35);
|
||||
sleep 5;
|
||||
SpeakToPlayer(0x1, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 0, MESSAGE_ID(0x0E, 0x00C8));
|
||||
SpeakToPlayer(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 0, MESSAGE_ID(0x0E, 0x00C8));
|
||||
SetNpcVar(1, 0, 1);
|
||||
sleep 30;
|
||||
DisablePlayerInput(FALSE);
|
||||
|
@ -4,32 +4,43 @@
|
||||
|
||||
#define NAMESPACE arn_07
|
||||
|
||||
void func_802D6420(void);
|
||||
void func_802D6954(void);
|
||||
void func_802CF56C(void);
|
||||
|
||||
ApiStatus N(func_80240000_BECDF0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024004C_BECE3C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802401AC_BECF9C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240000_BECDF0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802405BC_BED3AC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802405FC_BED3EC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240708_BED4F8)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240800_BED5F0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80241C5C_BEEA4C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus PostChapter3StatUpdate(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(main);
|
||||
Script N(80241F10);
|
||||
Script N(80243790);
|
||||
Script N(802439B0);
|
||||
NpcGroupList N(npcGroupList_802478B8);
|
||||
Script N(exitSingleDoor_802428D4);
|
||||
NpcGroupList N(npcGroupList_8024787C);
|
||||
NpcGroupList N(npcGroupList_802478E8);
|
||||
NpcGroupList N(npcGroupList_802478B8);
|
||||
Script N(makeEntities);
|
||||
NpcGroupList N(npcGroupList_802478E8);
|
||||
Script N(80243790);
|
||||
Script N(802437AC);
|
||||
Script N(exitSingleDoor_802428D4);
|
||||
Script N(802439B0);
|
||||
Script N(80242048);
|
||||
Script N(80241F10);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
||||
enum {
|
||||
NPC_TUBBAS_HEART,
|
||||
NPC_WORLD_TUBBA,
|
||||
NPC_BOO0,
|
||||
NPC_BOO1,
|
||||
NPC_BOO2,
|
||||
NPC_BOO3,
|
||||
NPC_BOO4,
|
||||
NPC_BOO5,
|
||||
NPC_WORLD_BOW,
|
||||
NPC_BOOTLER,
|
||||
NPC_PARAGOOMBA0,
|
||||
NPC_PARAGOOMBA1,
|
||||
NPC_PARAGOOMBA2,
|
||||
NPC_WORLD_SKOLAR,
|
||||
};
|
||||
|
@ -97,7 +97,7 @@ NpcAISettings N(npcAISettings_80243BD8) = {
|
||||
.alertRadius = 120.0f,
|
||||
.unk_14 = 3,
|
||||
.chaseSpeed = 4.0f,
|
||||
.unk_1C = 5,
|
||||
.unk_1C = { .s = 5 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 150.0f,
|
||||
.unk_2C = 1,
|
||||
@ -171,7 +171,7 @@ NpcSettings N(npcSettings_80243DA0) = {
|
||||
|
||||
Script N(80243DCC) = SCRIPT({
|
||||
loop {
|
||||
PlaySoundAtNpc(0x1, 0x20F6, 0);
|
||||
PlaySoundAtNpc(NPC_WORLD_TUBBA, SOUND_UNKNOWN_20F6, 0);
|
||||
ShakeCam(0, 0, 3, 0.80078125);
|
||||
}
|
||||
});
|
||||
@ -282,13 +282,13 @@ Script N(80243FE8) = SCRIPT({
|
||||
sleep 10;
|
||||
if (SI_VAR(6) != 9) {
|
||||
SI_VAR(5) = 8;
|
||||
SetNpcPos(0x8, 257, 25, 0);
|
||||
func_802CFD30(0x8, 7, 0, 0, 0, 0);
|
||||
NpcFacePlayer(0x8, 0);
|
||||
SetNpcPos(NPC_WORLD_BOW, 257, 25, 0);
|
||||
func_802CFD30(NPC_WORLD_BOW, 7, 0, 0, 0, 0);
|
||||
NpcFacePlayer(NPC_WORLD_BOW, 0);
|
||||
MakeLerp(0, 240, 20, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
func_802CFD30(0x8, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_WORLD_BOW, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
@ -301,7 +301,7 @@ Script N(80243FE8) = SCRIPT({
|
||||
if (SI_VAR(6) != 9) {
|
||||
DisablePartnerAI(0);
|
||||
sleep 1;
|
||||
NpcFaceNpc(NPC_PARTNER, 0x8, 0);
|
||||
NpcFaceNpc(NPC_PARTNER, NPC_WORLD_BOW, 0);
|
||||
sleep 5;
|
||||
}
|
||||
}
|
||||
@ -325,8 +325,8 @@ Script N(80243FE8) = SCRIPT({
|
||||
SetCamSpeed(0, 4.0);
|
||||
SetPanTarget(0, 175, 0, 0);
|
||||
WaitForCam(0, 1.0);
|
||||
SetNpcPos(0x9, 93, 160, -6);
|
||||
InterpNpcYaw(0x9, 90, 0);
|
||||
SetNpcPos(NPC_BOOTLER, 93, 160, -6);
|
||||
InterpNpcYaw(NPC_BOOTLER, 90, 0);
|
||||
spawn {
|
||||
sleep 10;
|
||||
InterpPlayerYaw(270, 0);
|
||||
@ -340,7 +340,7 @@ Script N(80243FE8) = SCRIPT({
|
||||
MakeLerp(160, 31, 70, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
SetNpcPos(0x9, 93, SI_VAR(0), -6);
|
||||
SetNpcPos(NPC_BOOTLER, 93, SI_VAR(0), -6);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
@ -367,13 +367,13 @@ Script N(80243FE8) = SCRIPT({
|
||||
MakeLerp(240, 0, 20, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
func_802CFD30(0x8, 7, SI_VAR(0), 0, 0, 0);
|
||||
func_802CFD30(NPC_WORLD_BOW, 7, SI_VAR(0), 0, 0, 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
SetNpcPos(0x8, 0, -1000, 0);
|
||||
SetNpcPos(NPC_WORLD_BOW, 0, -1000, 0);
|
||||
EnablePartnerAI();
|
||||
} else {
|
||||
sleep 20;
|
||||
@ -550,9 +550,9 @@ Script N(80245304) = SCRIPT({
|
||||
SI_VAR(3) += -50;
|
||||
SI_VAR(4) = SI_VAR(1);
|
||||
SI_VAR(4) += 26;
|
||||
SetNpcPos(0xD, SI_VAR(3), SI_VAR(4), SI_VAR(2));
|
||||
SetNpcPos(NPC_WORLD_SKOLAR, SI_VAR(3), SI_VAR(4), SI_VAR(2));
|
||||
PlayerFaceNpc(13, 0);
|
||||
NpcFaceNpc(NPC_PARTNER, 0xD, 0);
|
||||
NpcFaceNpc(NPC_PARTNER, NPC_WORLD_SKOLAR, 0);
|
||||
SI_VAR(0) += -25;
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
@ -564,7 +564,7 @@ Script N(80245304) = SCRIPT({
|
||||
WaitForPlayerInputEnabled();
|
||||
DisablePlayerInput(TRUE);
|
||||
sleep 40;
|
||||
SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D3));
|
||||
SpeakToPlayer(NPC_WORLD_SKOLAR, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D3));
|
||||
SetCamDistance(0, 300.0);
|
||||
SetCamPitch(0, 18, -9);
|
||||
SetCamSpeed(0, 4.0);
|
||||
@ -573,14 +573,14 @@ Script N(80245304) = SCRIPT({
|
||||
MakeLerp(0, 360, 10, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
SetNpcRotation(0xD, 0, SI_VAR(0), 0);
|
||||
SetNpcRotation(NPC_WORLD_SKOLAR, 0, SI_VAR(0), 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
EnableNpcAI(13, 0);
|
||||
SetNpcAnimation(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_3));
|
||||
SetNpcAnimation(NPC_WORLD_SKOLAR, NPC_ANIM(world_skolar, Palette_00, Anim_3));
|
||||
sleep 20;
|
||||
SetPlayerAnimation(ANIM_GOT_ITEM);
|
||||
PlaySoundAtPlayer(313, 0);
|
||||
@ -602,18 +602,18 @@ Script N(80245304) = SCRIPT({
|
||||
PlayEffect(0x52, 4, SI_VAR(0), SI_VAR(1), SI_VAR(2), 1, 30, 0, 0, 0, 0, 0, 0, 0);
|
||||
sleep 30;
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
SetNpcAnimation(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_1));
|
||||
SetNpcAnimation(NPC_WORLD_SKOLAR, NPC_ANIM(world_skolar, Palette_00, Anim_1));
|
||||
EnableNpcAI(13, 1);
|
||||
PostChapter3StatUpdate();
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0193), 160, 40);
|
||||
sleep 10;
|
||||
GetNpcPos(0xD, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetNpcPos(NPC_WORLD_SKOLAR, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamDistance(0, 250.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
sleep 10;
|
||||
SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D4));
|
||||
SpeakToPlayer(NPC_WORLD_SKOLAR, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D4));
|
||||
sleep 10;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += -25;
|
||||
@ -623,11 +623,11 @@ Script N(80245304) = SCRIPT({
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
sleep 10;
|
||||
SpeakToPlayer(0xD, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D5));
|
||||
SetNpcFlagBits(0xD, 0x00040000, TRUE);
|
||||
SpeakToPlayer(NPC_WORLD_SKOLAR, NPC_ANIM(world_skolar, Palette_00, Anim_2), NPC_ANIM(world_skolar, Palette_00, Anim_1), 512, MESSAGE_ID(0x0E, 0x00D5));
|
||||
SetNpcFlagBits(NPC_WORLD_SKOLAR, NPC_FLAG_40000, TRUE);
|
||||
spawn {
|
||||
loop 25 {
|
||||
GetNpcPos(0xD, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetNpcPos(NPC_WORLD_SKOLAR, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PlayEffect(0x11, 4, SI_VAR(0), SI_VAR(1), SI_VAR(2), 20, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
sleep 4;
|
||||
}
|
||||
@ -638,7 +638,7 @@ Script N(80245304) = SCRIPT({
|
||||
MakeLerp(SI_VAR(2), SI_VAR(3), 100, 2);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
SetNpcRotation(0xD, 0, SI_VAR(0), 0);
|
||||
SetNpcRotation(NPC_WORLD_SKOLAR, 0, SI_VAR(0), 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
@ -646,23 +646,23 @@ Script N(80245304) = SCRIPT({
|
||||
}
|
||||
}
|
||||
spawn {
|
||||
GetNpcPos(0xD, SI_VAR(2), SI_VAR(3), SI_VAR(4));
|
||||
GetNpcPos(NPC_WORLD_SKOLAR, SI_VAR(2), SI_VAR(3), SI_VAR(4));
|
||||
SI_VAR(5) = SI_VAR(3);
|
||||
SI_VAR(5) += 180;
|
||||
MakeLerp(SI_VAR(3), SI_VAR(5), 100, 2);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
SetNpcPos(0xD, SI_VAR(2), SI_VAR(0), SI_VAR(4));
|
||||
SetNpcPos(NPC_WORLD_SKOLAR, SI_VAR(2), SI_VAR(0), SI_VAR(4));
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
SetNpcPos(0xD, 0, -1000, 0);
|
||||
SetNpcPos(NPC_WORLD_SKOLAR, 0, -1000, 0);
|
||||
}
|
||||
spawn {
|
||||
sleep 15;
|
||||
PlaySoundAtNpc(0xD, 0x2045, 0);
|
||||
PlaySoundAtNpc(NPC_WORLD_SKOLAR, 0x2045, 0);
|
||||
}
|
||||
sleep 10;
|
||||
SetPlayerAnimation(0x1002A);
|
||||
@ -688,7 +688,7 @@ Script N(init_80245C9C) = SCRIPT({
|
||||
|
||||
StaticNpc N(npcGroup_80245D0C)[] = {
|
||||
{
|
||||
.id = 1,
|
||||
.id = NPC_WORLD_TUBBA,
|
||||
.settings = &N(npcSettings_80243CF0),
|
||||
.pos = { 309.0f, 0.0f, 11.0f },
|
||||
.flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000,
|
||||
@ -718,7 +718,7 @@ StaticNpc N(npcGroup_80245D0C)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_802451D4),
|
||||
},
|
||||
{
|
||||
.id = 0,
|
||||
.id = NPC_TUBBAS_HEART,
|
||||
.settings = &N(npcSettings_80243CC4),
|
||||
.pos = { -10.0f, 50.0f, -170.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000,
|
||||
@ -750,7 +750,7 @@ StaticNpc N(npcGroup_80245D0C)[] = {
|
||||
|
||||
StaticNpc N(npcGroup_802460EC)[] = {
|
||||
{
|
||||
.id = 2,
|
||||
.id = NPC_BOO0,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -780,7 +780,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_80245200),
|
||||
},
|
||||
{
|
||||
.id = 3,
|
||||
.id = NPC_BOO1,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -810,7 +810,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_80245200),
|
||||
},
|
||||
{
|
||||
.id = 4,
|
||||
.id = NPC_BOO2,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -840,7 +840,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_80245200),
|
||||
},
|
||||
{
|
||||
.id = 5,
|
||||
.id = NPC_BOO3,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -870,7 +870,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_80245200),
|
||||
},
|
||||
{
|
||||
.id = 6,
|
||||
.id = NPC_BOO4,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -900,7 +900,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
.extraAnimations = &N(extraAnimationList_802451F8),
|
||||
},
|
||||
{
|
||||
.id = 7,
|
||||
.id = NPC_BOO5,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -932,7 +932,7 @@ StaticNpc N(npcGroup_802460EC)[] = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80246C8C) = {
|
||||
.id = 8,
|
||||
.id = NPC_WORLD_BOW,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -962,7 +962,7 @@ StaticNpc N(npcGroup_80246C8C) = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80246E7C) = {
|
||||
.id = 9,
|
||||
.id = NPC_BOOTLER,
|
||||
.settings = &N(npcSettings_80243D1C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_200000,
|
||||
@ -1001,7 +1001,7 @@ Script N(init_8024706C) = SCRIPT({
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_802470BC) = {
|
||||
.id = 10,
|
||||
.id = NPC_PARAGOOMBA0,
|
||||
.settings = &N(npcSettings_80243C78),
|
||||
.pos = { -216.0f, 60.0f, -10.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -1009,7 +1009,9 @@ StaticNpc N(npcGroup_802470BC) = {
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 20,
|
||||
.itemDrops = {
|
||||
{ ITEM_DRIED_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(2),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.maxCoinBonus = 2,
|
||||
@ -1036,7 +1038,7 @@ StaticNpc N(npcGroup_802470BC) = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802472AC) = {
|
||||
.id = 11,
|
||||
.id = NPC_PARAGOOMBA1,
|
||||
.settings = &N(npcSettings_80243C78),
|
||||
.pos = { 0.0f, 60.0f, 150.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -1044,7 +1046,9 @@ StaticNpc N(npcGroup_802472AC) = {
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 20,
|
||||
.itemDrops = {
|
||||
{ ITEM_DRIED_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(2),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.maxCoinBonus = 2,
|
||||
@ -1071,7 +1075,7 @@ StaticNpc N(npcGroup_802472AC) = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_8024749C) = {
|
||||
.id = 12,
|
||||
.id = NPC_PARAGOOMBA2,
|
||||
.settings = &N(npcSettings_80243C78),
|
||||
.pos = { 260.0f, 60.0f, 30.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -1079,7 +1083,9 @@ StaticNpc N(npcGroup_8024749C) = {
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 20,
|
||||
.itemDrops = {
|
||||
{ ITEM_DRIED_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(2),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.maxCoinBonus = 2,
|
||||
@ -1106,7 +1112,7 @@ StaticNpc N(npcGroup_8024749C) = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_8024768C) = {
|
||||
.id = 13,
|
||||
.id = NPC_WORLD_SKOLAR,
|
||||
.settings = &N(npcSettings_80243D48),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -1270,7 +1276,7 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) &&
|
||||
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -1361,7 +1367,7 @@ void N(func_802411E8_BEDFD8)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
|
||||
if (enemy->varTable[9] <= 0) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var);
|
||||
npc->moveToPos.y = npc->pos.y;
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -1451,12 +1457,12 @@ void N(func_802417A8_BEE598)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
npc->duration = 0;
|
||||
phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
temp_f0_2 = get_clamped_angle_diff(npc->yaw, phi_f20);
|
||||
if (aiSettings->unk_1C < fabsf(temp_f0_2)) {
|
||||
if (aiSettings->unk_1C.s < fabsf(temp_f0_2)) {
|
||||
phi_f20 = npc->yaw;
|
||||
if (temp_f0_2 < 0.0f) {
|
||||
phi_f20 += -aiSettings->unk_1C;
|
||||
phi_f20 += -aiSettings->unk_1C.s;
|
||||
} else {
|
||||
phi_f20 += aiSettings->unk_1C;
|
||||
phi_f20 += aiSettings->unk_1C.s;
|
||||
}
|
||||
}
|
||||
npc->yaw = clamp_angle(phi_f20);
|
||||
|
@ -7,17 +7,17 @@
|
||||
f32 func_800E3514(f32, f32*);
|
||||
f32 func_800E34D8(void);
|
||||
|
||||
ApiStatus N(func_8024008C_BF482C)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400C0_BF4860)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400D4_BF4874)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024019C_BF493C)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240000_BF47A0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024008C_BF482C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400C0_BF4860)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400D4_BF4874)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400F4_BF4894)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024019C_BF493C)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(main);
|
||||
Script N(80240300);
|
||||
NpcGroupList N(npcGroupList_80241828);
|
||||
Script N(makeEntities);
|
||||
Script N(80240B50);
|
||||
Script N(80240BA0);
|
||||
Script N(8024118C);
|
||||
Script N(80240B50);
|
||||
Script N(80240300);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -6,6 +6,11 @@ extern Npc* wPartnerNpc;
|
||||
void func_800EF3C0(s32, s32);
|
||||
void func_800EF3D4(s16);
|
||||
|
||||
enum {
|
||||
NPC_TUBBAS_HEART,
|
||||
NPC_YAKKEY,
|
||||
};
|
||||
|
||||
Script N(802403B0) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
@ -50,21 +55,21 @@ Script N(8024049C) = SCRIPT({
|
||||
SetNpcPos(NPC_PARTNER, 1000, 1000, 0);
|
||||
RotateModel(0, 80, 0, -1, 0);
|
||||
RotateModel(1, 80, 0, -1, 0);
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
SetNpcJumpscale(NPC_PLAYER, 2.5);
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, -50, 0, 50, 10);
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, -50, 0, 50, 10);
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
sleep 1;
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, -110, 0, 110, 10);
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, -110, 0, 110, 10);
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
sleep 1;
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, -180, 0, 180, 10);
|
||||
SetNpcAnimation(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_6));
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, -180, 0, 180, 10);
|
||||
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_7));
|
||||
sleep 1;
|
||||
MakeLerp(80, 0, 10, 0);
|
||||
loop {
|
||||
@ -117,7 +122,7 @@ Script N(main) = SCRIPT({
|
||||
spawn N(80240300);
|
||||
});
|
||||
|
||||
static s32 N(pad_A6C)[] = {
|
||||
static s32 N(pad_A6C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
@ -269,7 +274,7 @@ Script N(8024118C) = SCRIPT({
|
||||
spawn N(80240CC0);
|
||||
});
|
||||
|
||||
static s32 N(pad_11FC)[] = {
|
||||
static s32 N(pad_11FC) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
@ -336,7 +341,7 @@ Script N(init_802413E8) = SCRIPT({
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_80241448) = {
|
||||
.id = 0,
|
||||
.id = NPC_TUBBAS_HEART,
|
||||
.settings = &N(npcSettings_80241220),
|
||||
.pos = { -23.0f, 75.0f, 31.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -366,7 +371,7 @@ StaticNpc N(npcGroup_80241448) = {
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80241638) = {
|
||||
.id = 1,
|
||||
.id = NPC_YAKKEY,
|
||||
.settings = &N(npcSettings_8024124C),
|
||||
.pos = { 38.0f, 0.0f, 97.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_IGNORE_HEIGHT,
|
||||
@ -402,7 +407,7 @@ NpcGroupList N(npcGroupList_80241828) = {
|
||||
{},
|
||||
};
|
||||
|
||||
static s32 N(pad_184C)[] = {
|
||||
static s32 N(pad_184C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
|
@ -92,7 +92,7 @@ NpcAISettings N(npcAISettings_8024047C) = {
|
||||
.alertRadius = 150.0f,
|
||||
.unk_14 = 2,
|
||||
.chaseSpeed = 3.3f,
|
||||
.unk_1C = 70,
|
||||
.unk_1C = { .s = 70 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 180.0f,
|
||||
.unk_2C = 1,
|
||||
|
@ -1,6 +1,10 @@
|
||||
#include "arn_11.h"
|
||||
#include "sprite/npc/tubbas_heart.h"
|
||||
|
||||
enum {
|
||||
NPC_TUBBAS_HEART,
|
||||
};
|
||||
|
||||
Script N(802400F0) = SCRIPT({
|
||||
SetCamType(0, 6, 1);
|
||||
SetCamSpeed(0, 3.0);
|
||||
@ -17,30 +21,30 @@ Script N(802401BC) = SCRIPT({
|
||||
sleep 30;
|
||||
SetPlayerSpeed(3.0);
|
||||
PlayerMoveTo(6, 0, 0);
|
||||
SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BF));
|
||||
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00BF));
|
||||
sleep 10;
|
||||
SetPlayerAnimation(0x80007);
|
||||
SetPlayerAnimation(ANIM_80007);
|
||||
sleep 40;
|
||||
SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C0));
|
||||
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C0));
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
sleep 10;
|
||||
SetPlayerAnimation(0x90000);
|
||||
sleep 30;
|
||||
SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C1));
|
||||
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C1));
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
sleep 20;
|
||||
SetPlayerAnimation(0x90000);
|
||||
spawn {
|
||||
SetNpcJumpscale(NPC_PLAYER, 2.5);
|
||||
GetNpcPos(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
|
||||
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
|
||||
GetNpcPos(NPC_TUBBAS_HEART, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
|
||||
sleep 1;
|
||||
PlaySoundAtNpc(NPC_PLAYER, 0x20C8, 0);
|
||||
NpcJump0(NPC_PLAYER, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
|
||||
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
|
||||
NpcJump0(NPC_TUBBAS_HEART, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
|
||||
}
|
||||
sleep 40;
|
||||
SpeakToPlayer(NPC_PLAYER, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C2));
|
||||
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM(tubbas_heart, Palette_00, Anim_B), NPC_ANIM(tubbas_heart, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00C2));
|
||||
SetPlayerAnimation(0x90000);
|
||||
sleep 10;
|
||||
SetNpcVar(0, 0, 1);
|
||||
@ -248,7 +252,7 @@ Script N(init_80240E70) = SCRIPT({
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_80240EEC) = {
|
||||
.id = 0,
|
||||
.id = NPC_TUBBAS_HEART,
|
||||
.settings = &N(npcSettings_802406A0),
|
||||
.pos = { 119.0f, 60.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000,
|
||||
|
@ -91,7 +91,7 @@ NpcAISettings N(npcAISettings_8024046C) = {
|
||||
.alertRadius = 150.0f,
|
||||
.unk_14 = 2,
|
||||
.chaseSpeed = 3.3f,
|
||||
.unk_1C = 70,
|
||||
.unk_1C = { .s = 70 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 180.0f,
|
||||
.unk_2C = 1,
|
||||
|
@ -92,7 +92,7 @@ NpcAISettings N(npcAISettings_8024047C) = {
|
||||
.alertRadius = 150.0f,
|
||||
.unk_14 = 2,
|
||||
.chaseSpeed = 3.3f,
|
||||
.unk_1C = 70,
|
||||
.unk_1C = { .s = 70 },
|
||||
.unk_20 = 1,
|
||||
.chaseRadius = 180.0f,
|
||||
.unk_2C = 1,
|
||||
|
@ -1,3 +1,131 @@
|
||||
#include "dgb_00.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_00/BFA0A0", func_80240000_BFA0A0);
|
||||
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");
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -733.0f, 0.0f, -8.0f, 90.0f },
|
||||
{ 250.0f, 10.0f, -100.0f, 225.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.background = &gBackgroundImage,
|
||||
.tattle = MSG_dgb_00_tattle,
|
||||
};
|
||||
|
||||
Script N(80240110) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
|
||||
}
|
||||
}
|
||||
ClearAmbientSounds(250);
|
||||
});
|
||||
|
||||
static s32 N(pad_1B8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitWalk_802401C0) = EXIT_WALK_SCRIPT(60, 0, "arn_04", 1);
|
||||
|
||||
Script N(exitDoubleDoor_8024021C) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 1;
|
||||
SI_VAR(1) = 18;
|
||||
SI_VAR(2) = 5;
|
||||
SI_VAR(3) = 7;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_01", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(802402D0) = SCRIPT({
|
||||
bind N(exitWalk_802401C0) to TRIGGER_FLOOR_ABOVE 15;
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_SMASHED_THE_BRIDGES {
|
||||
bind N(exitDoubleDoor_8024021C) to TRIGGER_WALL_PRESS_A 18;
|
||||
}
|
||||
< STORY_CH3_ESCAPED_TUBBAS_MANOR {}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
spawn N(80240F50);
|
||||
await N(80241AA0);
|
||||
}
|
||||
else {
|
||||
bind N(exitDoubleDoor_8024021C) to TRIGGER_WALL_PRESS_A 18;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(enterDoubleDoor_8024038C) = SCRIPT({
|
||||
GetLoadType(SI_VAR(1));
|
||||
if (SI_VAR(1) == 1) {
|
||||
spawn EnterSavePoint;
|
||||
spawn N(802402D0);
|
||||
return;
|
||||
}
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(0) = N(802402D0);
|
||||
spawn EnterWalk;
|
||||
sleep 1;
|
||||
}
|
||||
== 1 {
|
||||
if (STORY_PROGRESS >= STORY_CH3_TUBBA_SMASHED_THE_BRIDGES) {
|
||||
if (STORY_PROGRESS < STORY_CH3_ESCAPED_TUBBAS_MANOR) {
|
||||
spawn N(802402D0);
|
||||
spawn {
|
||||
await N(8024103C);
|
||||
await N(802413F4);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(2) = 5;
|
||||
SI_VAR(3) = 7;
|
||||
await EnterDoubleDoor;
|
||||
spawn N(802402D0);
|
||||
}
|
||||
== 2 {
|
||||
spawn N(802402D0);
|
||||
spawn N(80242B84);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SI_SAVE_FLAG(1978) = 1;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
GetEntryID(SI_VAR(0));
|
||||
if (SI_VAR(0) == 2) {
|
||||
MakeNpcs(0, N(npcGroupList_80243740));
|
||||
} else {
|
||||
MakeNpcs(0, N(npcGroupList_802436EC));
|
||||
}
|
||||
await N(makeEntities);
|
||||
spawn N(80240110);
|
||||
spawn N(enterDoubleDoor_8024038C);
|
||||
});
|
||||
|
@ -1,6 +1,803 @@
|
||||
#include "dgb_00.h"
|
||||
#include "sprite/npc/boo.h"
|
||||
#include "sprite/npc/sentinel.h"
|
||||
#include "sprite/npc/world_bombette.h"
|
||||
#include "sprite/npc/world_bow.h"
|
||||
#include "sprite/npc/world_goombario.h"
|
||||
#include "sprite/npc/world_kooper.h"
|
||||
#include "sprite/npc/world_parakarry.h"
|
||||
|
||||
ApiStatus func_80240060_BFA100(ScriptInstance* script, s32 isInitialCall) {
|
||||
enum {
|
||||
NPC_BOO0,
|
||||
NPC_BOO1,
|
||||
NPC_BOO2,
|
||||
NPC_BOO3,
|
||||
NPC_BOO4,
|
||||
NPC_BOO5,
|
||||
NPC_SENTINEL,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_80240640) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_8024066C) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
Script N(80240698) = SCRIPT({
|
||||
SI_VAR(3) = 0;
|
||||
SI_VAR(3) -= SI_VAR(2);
|
||||
ModifyColliderFlags(0, 18, 0x7FFFFE00);
|
||||
PlaySoundAtCollider(18, 455, 0);
|
||||
MakeLerp(0, 80, 30, 0);
|
||||
10:
|
||||
UpdateLerp();
|
||||
RotateModel(7, SI_VAR(0), 0, SI_VAR(2), 0);
|
||||
RotateModel(5, SI_VAR(0), 0, SI_VAR(3), 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) != 0) {
|
||||
goto 10;
|
||||
}
|
||||
});
|
||||
|
||||
Script N(8024079C) = SCRIPT({
|
||||
SI_VAR(3) = 0;
|
||||
SI_VAR(3) -= SI_VAR(2);
|
||||
MakeLerp(80, 0, 12, 0);
|
||||
10:
|
||||
UpdateLerp();
|
||||
RotateModel(7, SI_VAR(0), 0, SI_VAR(2), 0);
|
||||
RotateModel(5, SI_VAR(0), 0, SI_VAR(3), 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) != 0) {
|
||||
goto 10;
|
||||
}
|
||||
ModifyColliderFlags(1, 18, 0x7FFFFE00);
|
||||
PlaySoundAtCollider(18, 456, 0);
|
||||
});
|
||||
|
||||
Script N(802408A0) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO0, SI_VAR(0), SI_VAR(2), 46);
|
||||
});
|
||||
|
||||
Script N(802408F8) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO1, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO1, SI_VAR(0), SI_VAR(2), 50);
|
||||
});
|
||||
|
||||
Script N(80240950) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO2, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO2, SI_VAR(0), SI_VAR(2), 53);
|
||||
});
|
||||
|
||||
Script N(802409A8) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO3, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO3, SI_VAR(0), SI_VAR(2), 46);
|
||||
});
|
||||
|
||||
Script N(80240A00) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO4, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO4, SI_VAR(0), SI_VAR(2), 50);
|
||||
});
|
||||
|
||||
Script N(80240A58) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO5, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) += 200;
|
||||
NpcMoveTo(NPC_BOO5, SI_VAR(0), SI_VAR(2), 53);
|
||||
});
|
||||
|
||||
Script N(80240AB0) = SCRIPT({
|
||||
spawn N(802408A0);
|
||||
spawn N(802408F8);
|
||||
spawn N(80240950);
|
||||
spawn N(802409A8);
|
||||
spawn N(80240A00);
|
||||
spawn N(80240A58);
|
||||
});
|
||||
|
||||
Script N(80240B08) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO0, -0.19921875);
|
||||
NpcJump0(NPC_BOO0, 257, 30, -90, 5);
|
||||
EnableNpcShadow(NPC_BOO0, FALSE);
|
||||
SetNpcAnimation(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240B74) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO1, -0.2998046875);
|
||||
NpcJump0(NPC_BOO1, 272, 112, -81, 12);
|
||||
EnableNpcShadow(NPC_BOO1, FALSE);
|
||||
SetNpcAnimation(NPC_BOO1, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240BE0) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO2, -0.3994140625);
|
||||
NpcJump0(NPC_BOO2, 237, 120, -118, 10);
|
||||
EnableNpcShadow(NPC_BOO2, FALSE);
|
||||
SetNpcAnimation(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240C4C) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO3, -0.2998046875);
|
||||
NpcJump0(NPC_BOO3, 280, 60, -79, 8);
|
||||
EnableNpcShadow(NPC_BOO3, FALSE);
|
||||
SetNpcAnimation(NPC_BOO3, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240CB8) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO4, -0.3994140625);
|
||||
NpcJump0(NPC_BOO4, 250, 81, -97, 9);
|
||||
EnableNpcShadow(NPC_BOO4, FALSE);
|
||||
SetNpcAnimation(NPC_BOO4, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240D24) = SCRIPT({
|
||||
SetNpcJumpscale(NPC_BOO5, -0.5);
|
||||
NpcJump0(NPC_BOO5, 227, 43, -123, 15);
|
||||
EnableNpcShadow(NPC_BOO5, FALSE);
|
||||
SetNpcAnimation(NPC_BOO5, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
});
|
||||
|
||||
Script N(80240D90) = SCRIPT({
|
||||
spawn N(80240B74);
|
||||
spawn N(80240BE0);
|
||||
spawn N(80240C4C);
|
||||
spawn N(80240CB8);
|
||||
spawn N(80240D24);
|
||||
});
|
||||
|
||||
Script N(80240DDC) = SCRIPT({
|
||||
GetNpcPos(NPC_BOO0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
loop {
|
||||
RandInt(5, SI_VAR(10));
|
||||
SI_VAR(10) += 2;
|
||||
SI_VAR(11) = 0;
|
||||
10:
|
||||
SI_VAR(3) = SI_VAR(0);
|
||||
SI_VAR(3) += 1;
|
||||
SetNpcPos(NPC_BOO0, SI_VAR(3), SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
SI_VAR(3) = SI_VAR(0);
|
||||
SI_VAR(3) += -1;
|
||||
SetNpcPos(NPC_BOO0, SI_VAR(3), SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
SI_VAR(11) += 1;
|
||||
if (SI_VAR(11) < SI_VAR(10)) {
|
||||
goto 10;
|
||||
}
|
||||
RandInt(10, SI_VAR(10));
|
||||
SI_VAR(10) += 10;
|
||||
sleep SI_VAR(10);
|
||||
}
|
||||
});
|
||||
|
||||
Script N(80240F50) = SCRIPT({
|
||||
group 239;
|
||||
loop {
|
||||
RandInt(50, SI_VAR(0));
|
||||
SI_VAR(0) += 80;
|
||||
sleep SI_VAR(0);
|
||||
if (SI_MAP_VAR(0) == 0) {
|
||||
DisablePlayerInput(TRUE);
|
||||
PlaySoundAt(SOUND_UNKNOWN_B4, 0, 240, 10, -125);
|
||||
ShakeCam(0, 0, 20, 2.0);
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00EF), 160, 40);
|
||||
DisablePlayerInput(FALSE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(8024103C) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
DisablePartnerAI(0);
|
||||
SetPlayerPos(350, 10, -150);
|
||||
InterpPlayerYaw(270, 1);
|
||||
SetNpcPos(NPC_PARTNER, 350, 10, -150);
|
||||
EnablePartnerAI();
|
||||
SetCamType(0, 4, 0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) = 175;
|
||||
SI_VAR(1) = 0;
|
||||
SI_VAR(2) = -75;
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
sleep 40;
|
||||
SetNpcPos(NPC_BOO0, -60, 10, -70);
|
||||
SetNpcPos(NPC_BOO1, -100, 10, -110);
|
||||
SetNpcPos(NPC_BOO2, -140, 10, -150);
|
||||
SetNpcPos(NPC_BOO3, -100, 10, -30);
|
||||
SetNpcPos(NPC_BOO4, -140, 10, -70);
|
||||
SetNpcPos(NPC_BOO5, -180, 10, -100);
|
||||
await N(80240AB0);
|
||||
sleep 60;
|
||||
InterpNpcYaw(NPC_BOO0, 270, 1);
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00DB));
|
||||
SpeakToPlayer(NPC_BOO4, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00DC));
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 5, MESSAGE_ID(0x0E, 0x00DD));
|
||||
PlaySoundAt(SOUND_UNKNOWN_B4, 0, 240, 10, -125);
|
||||
ShakeCam(0, 0, 20, 2.0);
|
||||
sleep 10;
|
||||
PlaySoundAt(SOUND_UNKNOWN_B4, 0, 240, 10, -125);
|
||||
ShakeCam(0, 0, 20, 2.0);
|
||||
InterpNpcYaw(NPC_BOO0, 90, 1);
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00DE), 160, 40);
|
||||
SetPlayerPos(350, 10, -150);
|
||||
InterpPlayerYaw(270, 1);
|
||||
SetNpcPos(NPC_PARTNER, 350, 10, -150);
|
||||
SI_VAR(2) = 1;
|
||||
await N(80240698);
|
||||
});
|
||||
|
||||
Script N(802413F4) = SCRIPT({
|
||||
SetPlayerSpeed(8.0);
|
||||
PlayerMoveTo(184, -44, 0);
|
||||
PlaySoundAtNpc(NPC_BOO0, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO1, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO2, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO3, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO4, SOUND_UNKNOWN_262, 0);
|
||||
PlaySoundAtNpc(NPC_BOO5, SOUND_UNKNOWN_262, 0);
|
||||
ShowEmote(0, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(1, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(2, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(3, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(4, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
ShowEmote(5, EMOTE_EXCLAMATION, 45, 20, 1, 0, 0, 0, 0);
|
||||
sleep 50;
|
||||
SI_VAR(2) = 1;
|
||||
spawn N(8024079C);
|
||||
spawn N(80240D90);
|
||||
sleep 20;
|
||||
SetCamType(0, 6, 1);
|
||||
SetCamSpeed(0, 6.0);
|
||||
SetCamPitch(0, 15.0, -15.0);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamDistance(0, 300);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SI_VAR(10) = spawn N(80240DDC);
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00DF));
|
||||
kill SI_VAR(10);
|
||||
SetPlayerAnimation(ANIM_80007);
|
||||
sleep 20;
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00E0));
|
||||
sleep 20;
|
||||
SetPlayerAnimation(ANIM_NOD_YES);
|
||||
sleep 20;
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00E1));
|
||||
DisablePartnerAI(0);
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 1 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_goombario, normal, talk), NPC_ANIM(world_goombario, normal, idle), 0, MESSAGE_ID(0x0E, 0x00E2));
|
||||
}
|
||||
== 2 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_kooper, normal, talk), NPC_ANIM(world_kooper, normal, idle), 0, MESSAGE_ID(0x0E, 0x00E3));
|
||||
}
|
||||
== 3 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bombette, normal, idle_fast), NPC_ANIM(world_bombette, normal, idle), 0, MESSAGE_ID(0x0E, 0x00E4));
|
||||
}
|
||||
== 4 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00E5));
|
||||
}
|
||||
== 9 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00E6));
|
||||
}
|
||||
}
|
||||
EnablePartnerAI();
|
||||
SetCamType(0, 4, 0);
|
||||
SetCamSpeed(0, 6.0);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
PlaySoundAt(SOUND_UNKNOWN_B4, 0, 240, 10, -125);
|
||||
ShakeCam(0, 0, 20, 2.0);
|
||||
sleep 5;
|
||||
PlaySoundAt(SOUND_UNKNOWN_B4, 0, 240, 10, -125);
|
||||
ShakeCam(0, 0, 20, 2.0);
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00E7), 160, 40);
|
||||
await N(80240B08);
|
||||
sleep 10;
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 5, MESSAGE_ID(0x0E, 0x00E8));
|
||||
SetNpcAnimation(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
spawn N(80240F50);
|
||||
STORY_PROGRESS = STORY_CH3_ESCAPED_TUBBAS_MANOR;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(80241AA0) = SCRIPT({
|
||||
SetNpcPos(NPC_BOO0, 246, 30, -110);
|
||||
SetNpcPos(NPC_BOO1, 276, 120, -80);
|
||||
SetNpcPos(NPC_BOO2, 216, 120, -140);
|
||||
SetNpcPos(NPC_BOO3, 276, 60, -80);
|
||||
SetNpcPos(NPC_BOO4, 246, 90, -110);
|
||||
SetNpcPos(NPC_BOO5, 216, 60, -130);
|
||||
InterpNpcYaw(NPC_BOO0, 70, 1);
|
||||
InterpNpcYaw(NPC_BOO1, 99, 1);
|
||||
InterpNpcYaw(NPC_BOO2, 93, 1);
|
||||
InterpNpcYaw(NPC_BOO3, 74, 1);
|
||||
InterpNpcYaw(NPC_BOO4, 78, 1);
|
||||
InterpNpcYaw(NPC_BOO5, 81, 1);
|
||||
SetNpcAnimation(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
SetNpcAnimation(NPC_BOO1, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
SetNpcAnimation(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
SetNpcAnimation(NPC_BOO3, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
SetNpcAnimation(NPC_BOO4, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
SetNpcAnimation(NPC_BOO5, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
EnableNpcShadow(NPC_BOO0, FALSE);
|
||||
EnableNpcShadow(NPC_BOO1, FALSE);
|
||||
EnableNpcShadow(NPC_BOO2, FALSE);
|
||||
EnableNpcShadow(NPC_BOO3, FALSE);
|
||||
EnableNpcShadow(NPC_BOO4, FALSE);
|
||||
EnableNpcShadow(NPC_BOO5, FALSE);
|
||||
});
|
||||
|
||||
Script N(interact_80241CD8) = SCRIPT({
|
||||
SI_MAP_VAR(0) = 1;
|
||||
SpeakToPlayer(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 5, MESSAGE_ID(0x0E, 0x00E9));
|
||||
SetNpcAnimation(NPC_BOO0, NPC_ANIM(boo, Palette_01, Anim_6));
|
||||
DisablePartnerAI(0);
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 1 {
|
||||
AdjustCam(0, 6.0, 0, -275.0, 15.0, -6.0);
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_goombario, normal, talk), NPC_ANIM(world_goombario, normal, idle), 0, MESSAGE_ID(0x0E, 0x00EA));
|
||||
ResetCam(0, 6.0);
|
||||
}
|
||||
== 2 {
|
||||
AdjustCam(0, 6.0, 0, -275.0, 15.0, -6.0);
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_kooper, normal, talk), NPC_ANIM(world_kooper, normal, idle), 0, MESSAGE_ID(0x0E, 0x00EB));
|
||||
ResetCam(0, 6.0);
|
||||
}
|
||||
== 3 {
|
||||
AdjustCam(0, 6.0, 0, -275.0, 15.0, -6.0);
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bombette, normal, idle_fast), NPC_ANIM(world_bombette, normal, idle), 0, MESSAGE_ID(0x0E, 0x00EC));
|
||||
ResetCam(0, 6.0);
|
||||
}
|
||||
== 4 {
|
||||
AdjustCam(0, 6.0, 0, -275.0, 15.0, -6.0);
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00ED));
|
||||
ResetCam(0, 6.0);
|
||||
}
|
||||
== 9 {
|
||||
AdjustCam(0, 6.0, 0, -275.0, 15.0, -6.0);
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00EE));
|
||||
ResetCam(0, 6.0);
|
||||
}
|
||||
}
|
||||
EnablePartnerAI();
|
||||
SI_MAP_VAR(0) = 0;
|
||||
});
|
||||
|
||||
Script N(init_80241F70) = SCRIPT({
|
||||
BindNpcInteract(NPC_SELF, N(interact_80241CD8));
|
||||
});
|
||||
|
||||
Script N(init_80241F94) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
Script N(init_80241FA4) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
Script N(init_80241FB4) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
Script N(init_80241FC4) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
Script N(init_80241FD4) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_80241FE4) = {
|
||||
.id = NPC_BOO0,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_400000,
|
||||
.init = &N(init_80241F70),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00B5),
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802421D4) = {
|
||||
.id = NPC_BOO1,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_80241F94),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802423C4) = {
|
||||
.id = NPC_BOO2,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_80241FA4),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802425B4) = {
|
||||
.id = NPC_BOO3,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_80241FB4),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802427A4) = {
|
||||
.id = NPC_BOO4,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_80241FC4),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80242994) = {
|
||||
.id = NPC_BOO5,
|
||||
.settings = &N(npcSettings_80240640),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_80241FD4),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
};
|
||||
|
||||
Script N(80242B84) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
DisablePlayerPhysics(TRUE);
|
||||
DisablePartnerAI(0);
|
||||
SetNpcPos(NPC_PARTNER, 320, 10, -160);
|
||||
PlaySound(SOUND_UNKNOWN_32E);
|
||||
spawn {
|
||||
loop 180 {
|
||||
GetNpcPos(NPC_SENTINEL, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
N(func_80240060_BFA100)();
|
||||
sleep 1;
|
||||
}
|
||||
}
|
||||
SetPlayerPos(320, 50, -160);
|
||||
InterpPlayerYaw(270, 0);
|
||||
SetPlayerAnimation(ANIM_80017);
|
||||
SetNpcPos(NPC_SENTINEL, 320, 70, -158);
|
||||
InterpNpcYaw(NPC_SENTINEL, 270, 0);
|
||||
SetNpcAnimation(NPC_SENTINEL, NPC_ANIM(sentinel, Palette_00, Anim_8));
|
||||
UseSettingsFrom(0, 175, 0, -35);
|
||||
SetPanTarget(0, 175, 0, -35);
|
||||
SetCamDistance(0, 540.0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
sleep 20;
|
||||
spawn {
|
||||
SI_VAR(2) = 1;
|
||||
spawn N(80240698);
|
||||
}
|
||||
sleep 15;
|
||||
spawn {
|
||||
SetPlayerJumpscale(0);
|
||||
PlayerJump1(175, 50, -35, 40);
|
||||
}
|
||||
spawn {
|
||||
DisablePartnerAI(0);
|
||||
sleep 1;
|
||||
InterpNpcYaw(NPC_PARTNER, 270, 0);
|
||||
SetNpcAnimation(NPC_PARTNER, 0x107);
|
||||
sleep 85;
|
||||
func_802CF56C(2);
|
||||
sleep 1;
|
||||
EnablePartnerAI();
|
||||
}
|
||||
NpcMoveTo(NPC_SENTINEL, 175, -33, 40);
|
||||
sleep 20;
|
||||
SetNpcPos(NPC_SENTINEL, 175, 85, -33);
|
||||
SetNpcAnimation(NPC_SENTINEL, NPC_ANIM(sentinel, Palette_00, Anim_9));
|
||||
sleep 20;
|
||||
PlaySoundAtNpc(NPC_SENTINEL, SOUND_UNKNOWN_2F7, 0);
|
||||
SetNpcAnimation(NPC_SENTINEL, NPC_ANIM(sentinel, Palette_00, Anim_2));
|
||||
SetNpcPos(NPC_SENTINEL, 175, 70, -33);
|
||||
spawn {
|
||||
sleep 40;
|
||||
SetNpcAnimation(NPC_SENTINEL, NPC_ANIM(sentinel, Palette_00, Anim_3));
|
||||
NpcMoveTo(NPC_SENTINEL, 270, -120, 30);
|
||||
StopSound(814);
|
||||
SetNpcPos(NPC_SENTINEL, 0, -1000, 0);
|
||||
}
|
||||
spawn {
|
||||
sleep 60;
|
||||
SI_VAR(2) = 1;
|
||||
spawn N(8024079C);
|
||||
}
|
||||
SetPlayerJumpscale(0);
|
||||
PlayerJump1(175, 0, -35, 10);
|
||||
PlaySoundAtNpc(NPC_SENTINEL, SOUND_UNKNOWN_162, 0);
|
||||
SetPlayerAnimation(ANIM_80003);
|
||||
spawn {
|
||||
sleep 2;
|
||||
PlayEffect(0x10, 3, 0, 175, 0, -35, 20, -20, 30, 0, 0, 0, 0, 0);
|
||||
}
|
||||
spawn {
|
||||
SetCamDistance(0, 320.0);
|
||||
SetCamPitch(0, 15.0, -7.5);
|
||||
SetCamSpeed(0, 2.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
}
|
||||
sleep 65;
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 1 {
|
||||
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
|
||||
}
|
||||
== 2 {
|
||||
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
|
||||
}
|
||||
== 3 {
|
||||
SetNpcFlagBits(NPC_PARTNER, NPC_FLAG_200, TRUE);
|
||||
}
|
||||
}
|
||||
DisablePartnerAI(0);
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 1 {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D6));
|
||||
}
|
||||
== 2 {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D7));
|
||||
}
|
||||
== 3 {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D8));
|
||||
}
|
||||
== 4 {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D9));
|
||||
}
|
||||
== 9 {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00DA));
|
||||
}
|
||||
else {
|
||||
SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D6));
|
||||
}
|
||||
}
|
||||
EnablePartnerAI();
|
||||
sleep 5;
|
||||
SetPlayerAnimation(ANIM_GET_UP);
|
||||
sleep 20;
|
||||
SetPlayerAnimation(ANIM_DUST_OFF);
|
||||
sleep 7;
|
||||
PlaySoundAtPlayer(370, 0);
|
||||
sleep 8;
|
||||
PlaySoundAtPlayer(370, 0);
|
||||
sleep 15;
|
||||
SetPlayerAnimation(ANIM_8001B);
|
||||
sleep 25;
|
||||
InterpPlayerYaw(90, 0);
|
||||
sleep 1;
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
InterpPlayerYaw(45, 0);
|
||||
sleep 10;
|
||||
SetPlayerAnimation(ANIM_MIDAIR_STILL);
|
||||
SetPlayerJumpscale(1);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PlayerJump1(SI_VAR(0), 0, SI_VAR(2), 10);
|
||||
PlayerJump1(SI_VAR(0), 0, SI_VAR(2), 10);
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamSpeed(0, 4.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
EnablePartnerAI();
|
||||
DisablePlayerPhysics(FALSE);
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(init_802434EC) = SCRIPT({
|
||||
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_802434FC) = {
|
||||
.id = NPC_SENTINEL,
|
||||
.settings = &N(npcSettings_8024066C),
|
||||
.pos = { 0.0f, 0.0f, -1000.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_200 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_400000,
|
||||
.init = &N(init_802434EC),
|
||||
.yaw = 90,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_2),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_3),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_3),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_5),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_8),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
NPC_ANIM(sentinel, Palette_00, Anim_1),
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_802436EC) = {
|
||||
NPC_GROUP(N(npcGroup_80241FE4), BATTLE_ID(0, 0, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_802421D4), BATTLE_ID(0, 0, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_802423C4), BATTLE_ID(0, 0, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_802425B4), BATTLE_ID(0, 0, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_802427A4), BATTLE_ID(0, 0, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_80242994), BATTLE_ID(0, 0, 0, 0)),
|
||||
{},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_80243740) = {
|
||||
NPC_GROUP(N(npcGroup_802434FC), BATTLE_ID(0, 0, 0, 0)),
|
||||
{},
|
||||
};
|
||||
|
||||
static s32 N(pad_3758)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802E9A18, -65, 60, -240, 0, MAKE_ENTITY_END);
|
||||
});
|
||||
|
||||
ApiStatus N(func_80240060_BFA100)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Npc* npc = get_npc_unsafe(get_enemy(6)->npcID);
|
||||
|
||||
sfx_adjust_env_sound_pos(0x32E, 0, npc->pos.x, npc->pos.y, npc->pos.z);
|
||||
|
@ -2,3 +2,14 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_00
|
||||
|
||||
ApiStatus N(func_80240060_BFA100)(ScriptInstance* script, s32 isInitialCall);
|
||||
NpcGroupList N(npcGroupList_802436EC);
|
||||
NpcGroupList N(npcGroupList_80243740);
|
||||
Script N(80240F50);
|
||||
Script N(8024103C);
|
||||
Script N(802413F4);
|
||||
Script N(80241AA0);
|
||||
Script N(80242B84);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "dgb_01.h"
|
||||
#include "ld_addrs.h"
|
||||
|
||||
ApiStatus func_80240000_BFD880(void) {
|
||||
ApiStatus N(func_80240000_BFD880)(void) {
|
||||
dma_copy(&code_code_C20F40_ROM_START, &code_code_C20F40_ROM_END, &gBackgroundImage);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -3,3 +3,5 @@
|
||||
#include "world/common/SetEntityFlags100000.inc.c"
|
||||
|
||||
#include "world/common/GetEntityPosition.inc.c"
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
6143
src/world/area_dgb/dgb_01/data.c
Normal file
6143
src/world/area_dgb/dgb_01/data.c
Normal file
File diff suppressed because it is too large
Load Diff
13
src/world/area_dgb/dgb_01/data0.c
Normal file
13
src/world/area_dgb/dgb_01/data0.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C057F0_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x80246F70, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 6, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data1.c
Normal file
13
src/world/area_dgb/dgb_01/data1.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C06870_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x80247FF0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data2.c
Normal file
13
src/world/area_dgb/dgb_01/data2.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C070F0_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x80249070, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data3.c
Normal file
13
src/world/area_dgb/dgb_01/data3.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C07570_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x802498F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data4.c
Normal file
13
src/world/area_dgb/dgb_01/data4.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C079F0_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x80249D70, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data5.c
Normal file
13
src/world/area_dgb/dgb_01/data5.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C07E70_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x8024A1F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data6.c
Normal file
13
src/world/area_dgb/dgb_01/data6.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_00C07E70_11[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x8024A670, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
13
src/world/area_dgb/dgb_01/data7.c
Normal file
13
src/world/area_dgb/dgb_01/data7.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "dgb_01.h"
|
||||
|
||||
Gfx D_8024B6F0_1[] = {
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsDPSetTextureDetail(G_TD_CLAMP),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPLoadTextureBlock(0x8024AEF0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetTexturePersp(G_TP_PERSP),
|
||||
gsDPSetTextureFilter(G_TF_BILERP),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
@ -2,3 +2,35 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_01
|
||||
|
||||
enum {
|
||||
NPC_SENTINEL0,
|
||||
NPC_SENTINEL1,
|
||||
NPC_SENTINEL2,
|
||||
NPC_SENTINEL3,
|
||||
NPC_WORLD_TUBBA,
|
||||
};
|
||||
|
||||
ApiStatus func_802CCCB0(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802D2B6C(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802CD348(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_802CD3C0(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus func_80045838(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
ApiStatus N(func_80240000_BFD880)(void);
|
||||
ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(UnkFunc1)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(802449C4);
|
||||
Script N(80244AD0);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
Script N(D_80252F4C_C107CC);
|
||||
Script N(D_802539A0_C11220);
|
||||
NpcGroupList N(npcGroupList_80246E50);
|
||||
NpcGroupList N(npcGroupList_80246ED4);
|
||||
NpcGroupList N(npcGroupList_80246E8C);
|
||||
NpcGroupList N(npcGroupList_80246F1C);
|
||||
|
@ -1,4 +1,417 @@
|
||||
#include "dgb_02.h"
|
||||
#include "sprite/npc/world_clubba.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
extern s16 D_8009A634;
|
||||
extern Npc* wPartnerNpc;
|
||||
|
||||
enum {
|
||||
NPC_WORLD_CLUBBA0 = 10,
|
||||
NPC_WORLD_CLUBBA1,
|
||||
NPC_WORLD_CLUBBA2 = 30,
|
||||
NPC_WORLD_CLUBBA3,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -567.0f, 0.0f, 180.0f, 90.0f },
|
||||
{ 567.0f, 0.0f, 180.0f, 270.0f },
|
||||
{ -450.0f, 0.0f, 88.0f, 180.0f },
|
||||
{ 450.0f, 0.0f, 88.0f, 180.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = 0x1900C2,
|
||||
};
|
||||
|
||||
Script N(802414B0) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_1548)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitDoubleDoor_80241550) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 5;
|
||||
SI_VAR(2) = 11;
|
||||
SI_VAR(3) = 13;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_03", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitDoubleDoor_80241604) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 1;
|
||||
SI_VAR(1) = 17;
|
||||
SI_VAR(2) = 18;
|
||||
SI_VAR(3) = 16;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_01", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitSingleDoor_802416B8) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 2;
|
||||
SI_VAR(1) = 9;
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = 1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_07", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitSingleDoor_8024176C) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 3;
|
||||
SI_VAR(1) = 13;
|
||||
SI_VAR(2) = 23;
|
||||
SI_VAR(3) = 1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_11", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_80241820) = SCRIPT({
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(2) = 11;
|
||||
SI_VAR(3) = 13;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 1 {
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(2) = 18;
|
||||
SI_VAR(3) = 16;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 2 {
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = 1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
== 3 {
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(2) = 23;
|
||||
SI_VAR(3) = 1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
if (STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
|
||||
MakeNpcs(1, N(npcGroupList_802425C8));
|
||||
}
|
||||
bind N(exitDoubleDoor_80241550) to TRIGGER_WALL_PRESS_A 5;
|
||||
bind N(exitDoubleDoor_80241604) to TRIGGER_WALL_PRESS_A 17;
|
||||
bind N(exitSingleDoor_802416B8) to TRIGGER_WALL_PRESS_A 9;
|
||||
bind N(exitSingleDoor_8024176C) to TRIGGER_WALL_PRESS_A 13;
|
||||
spawn N(802414B0);
|
||||
spawn N(enterSingleDoor_80241820);
|
||||
});
|
||||
|
||||
static s32 N(pad_1AA8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(80241AB0) = SCRIPT({
|
||||
GetBattleOutcome(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
== 2 {
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
func_80045900(1);
|
||||
}
|
||||
== 3 {
|
||||
SetEnemyFlagBits(-1, 16, 1);
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
NpcAnimID N(extraAnimationList_80241B6C)[] = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
ANIM_END,
|
||||
};
|
||||
|
||||
NpcAnimID N(extraAnimationList_80241B94)[] = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_0),
|
||||
ANIM_END,
|
||||
};
|
||||
|
||||
NpcAISettings N(npcAISettings_80241B9C) = {
|
||||
.moveSpeed = 1.5f,
|
||||
.moveTime = 120,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 85.0f,
|
||||
.unk_10 = { .f = 65.0f },
|
||||
.unk_14 = 5,
|
||||
.chaseSpeed = 3.5f,
|
||||
.unk_1C = { .s = 90 },
|
||||
.unk_20 = 12,
|
||||
.chaseRadius = 110.0f,
|
||||
.unk_28 = { .f = 90.0f },
|
||||
.unk_2C = 3,
|
||||
};
|
||||
|
||||
Script N(npcAI_80241BCC) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
SetSelfVar(1, 5);
|
||||
SetSelfVar(2, 8);
|
||||
SetSelfVar(3, 12);
|
||||
N(func_8024061C_C2F1BC)(N(npcAISettings_80241B9C));
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241C3C) = {
|
||||
.height = 36,
|
||||
.radius = 34,
|
||||
.ai = &N(npcAI_80241BCC),
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
NpcAISettings N(npcAISettings_80241C68) = {
|
||||
.moveSpeed = 1.0f,
|
||||
.moveTime = 120,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 100.0f,
|
||||
.unk_10 = { .f = 40.0f },
|
||||
.unk_14 = 10,
|
||||
.chaseSpeed = 3.5f,
|
||||
.unk_1C = { .s = 90 },
|
||||
.unk_20 = 15,
|
||||
.chaseRadius = 200.0f,
|
||||
.unk_28 = { .f = 160.0f },
|
||||
.unk_2C = 1,
|
||||
};
|
||||
|
||||
Script N(npcAI_80241C98) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
SetSelfVar(1, 10);
|
||||
SetSelfVar(2, 14);
|
||||
SetSelfVar(3, 18);
|
||||
N(func_802410D4_C2FC74)(N(npcAISettings_80241C68));
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241D08) = {
|
||||
.height = 36,
|
||||
.radius = 34,
|
||||
.ai = &N(npcAI_80241C98),
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
Script N(npcAI_80241D34) = SCRIPT({
|
||||
EnableNpcShadow(NPC_SELF, FALSE);
|
||||
SetSelfVar(0, 4);
|
||||
SetSelfVar(1, 32);
|
||||
SetSelfVar(2, 50);
|
||||
SetSelfVar(3, 32);
|
||||
SetSelfVar(4, 3);
|
||||
SetSelfVar(15, 8389);
|
||||
N(update_starpoints_display_C2EF5C)();
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241DDC) = {
|
||||
.height = 14,
|
||||
.radius = 18,
|
||||
.ai = &N(npcAI_80241D34),
|
||||
.onDefeat = &N(80241AB0),
|
||||
.level = 13,
|
||||
.unk_2A = 8,
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80241E08)[] = {
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA0,
|
||||
.settings = &N(npcSettings_80241C3C),
|
||||
.pos = { -200.0f, 0.0f, 180.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { -200, 0, 180, 40, 0, -32767, 0, -200, 0, 175, 250, 90, 1, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 02, 00, 00, 00, 00},
|
||||
.extraAnimations = &N(extraAnimationList_80241B6C),
|
||||
},
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA1,
|
||||
.settings = &N(npcSettings_80241DDC),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
|
||||
.yaw = 0,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.extraAnimations = &N(extraAnimationList_80241B94),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802421E8)[] = {
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA2,
|
||||
.settings = &N(npcSettings_80241D08),
|
||||
.pos = { 375.0f, 0.0f, 100.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT,
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { 375, 0, 100, 40, 0, -32767, 0, 320, 0, 175, 250, 90, 0, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 02, 00, 00, 00, 00},
|
||||
},
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA3,
|
||||
.settings = &N(npcSettings_80241DDC),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
|
||||
.yaw = 0,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.extraAnimations = &N(extraAnimationList_80241B94),
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_802425C8) = {
|
||||
NPC_GROUP(N(npcGroup_80241E08), BATTLE_ID(15, 2, 0, 1)),
|
||||
NPC_GROUP(N(npcGroup_802421E8), BATTLE_ID(15, 1, 0, 1)),
|
||||
{},
|
||||
};
|
||||
|
||||
#include "world/common/UnkNpcAIFunc6.inc.c"
|
||||
|
||||
@ -8,24 +421,327 @@
|
||||
|
||||
#include "world/common/UnkNpcAIFunc5.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240208_C2EDA8);
|
||||
s32 N(func_80240208_C2EDA8)(ScriptInstance *script) {
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
|
||||
f32 phi_f20;
|
||||
s32 ret = TRUE;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", update_starpoints_display_C2EF5C);
|
||||
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_8024061C_C2F1BC);
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_802408D0_C2F470);
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240958_C2F4F8);
|
||||
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240C10_C2F7B0);
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240C74_C2F814);
|
||||
if (D_8010EBB0.unk_03 == 7) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240D1C_C2F8BC);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ApiStatus N(update_starpoints_display_C2EF5C)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Enemy* enemy2;
|
||||
Npc* npc2;
|
||||
f32 posX, posZ;
|
||||
s32 func;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags |= 0x102;
|
||||
enemy->flags |= 0x1F300000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
if (enemy->unk_B0 & 4) {
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
}
|
||||
|
||||
func = script->functionTemp[0].s;
|
||||
switch (func) {
|
||||
case 0:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
npc2 = get_npc_unsafe(enemy2->npcID);
|
||||
enemy->unk_07 = 1;
|
||||
if (enemy2->varTable[0] == 3) {
|
||||
if (enemy->varTable[15] != 0) {
|
||||
func_800494C0(npc2, enemy->varTable[15], 0);
|
||||
}
|
||||
posX = npc2->pos.x;
|
||||
posZ = npc2->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
|
||||
|
||||
npc->pos.x = posX;
|
||||
enemy->unk_10.x = npc->pos.x;
|
||||
|
||||
npc->pos.y = npc2->pos.y + enemy->varTable[0];
|
||||
enemy->unk_10.y = npc->pos.y;
|
||||
|
||||
npc->pos.z = posZ;
|
||||
enemy->unk_10.z = npc->pos.z;
|
||||
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
enemy->flags &= 0xE0EFFFFF;
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
get_npc_unsafe(enemy2->npcID);
|
||||
npc->duration++;
|
||||
if (npc->duration >= enemy->varTable[4]) {
|
||||
enemy->unk_07 = 0;
|
||||
}
|
||||
if (enemy2->varTable[0] == 4) {
|
||||
enemy->flags |= 0x1F100000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
enemy->unk_07 = func;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
enemy->varTable[0] = 0;
|
||||
}
|
||||
|
||||
if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
func_800495A0(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
func_800496B8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
base_UnkNpcAIFunc1(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
func_80049C04(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
func_80049E3C(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
func_80049ECC(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
if (script->functionTemp[0].s != 33) {
|
||||
break;
|
||||
}
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
void N(func_802408D0_C2F470)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
if (npc->duration > 0) {
|
||||
npc->duration--;
|
||||
}
|
||||
|
||||
if (npc->duration == 1) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration <= 0) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerData* playerData = get_player_data();
|
||||
s32 phi_s2 = FALSE;
|
||||
s32 var;
|
||||
f32 posX, posZ;
|
||||
|
||||
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
|
||||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
|
||||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
|
||||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
|
||||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
|
||||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
|
||||
if (playerData->currentPartner == 2) {
|
||||
if (D_8010EBB0.unk_00 == playerData->currentPartner) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
|
||||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
|
||||
if (dist2D(posX, posZ, wPartnerNpc->pos.x, wPartnerNpc->pos.z) <= 80.0f) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (phi_s2) {
|
||||
func_800494C0(npc, 0xB000000E, 0);
|
||||
npc->currentAnim = 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);
|
||||
script->functionTemp[0].s = 2;
|
||||
}
|
||||
|
||||
npc->duration++;
|
||||
if (npc->duration == 27) {
|
||||
func_800494C0(npc, 0xB000000C, 0);
|
||||
} else if (npc->duration == 57) {
|
||||
func_800494C0(npc, 0xB000000D, 0);
|
||||
} else if (npc->duration == 59) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration == 60) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80240C10_C2F7B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 1;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80240C74_C2F814)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
|
||||
npc->currentAnim = 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) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 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;
|
||||
return;
|
||||
}
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
script->functionTemp[1].s--;
|
||||
if (script->functionTemp[1].s > 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
var = enemy->varTable[7];
|
||||
if (var == 40) {
|
||||
npc->duration = 20;
|
||||
script->functionTemp[0].s = var;
|
||||
} else if (var == 50) {
|
||||
npc->duration = 25;
|
||||
script->functionTemp[0].s = var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240E54_C2F9F4);
|
||||
/*
|
||||
void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -41,10 +757,141 @@ void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
script->functionTemp[0].s = 0x29;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80240F00_C2FAA0);
|
||||
void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 var;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_80241078_C2FC18);
|
||||
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];
|
||||
npc->duration = 15;
|
||||
enemy->varTable[7] = 50;
|
||||
script->functionTemp[0].s = 3;
|
||||
} else if (npc->unk_8C == 0) {
|
||||
var = npc->yaw;
|
||||
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
|
||||
npc->yaw = var;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_02/C2EBA0", func_802410D4_C2FC74);
|
||||
void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
if (npc->unk_8C == 0) {
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 40.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 30;
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->flags &= ~0x800;
|
||||
enemy->varTable[0] = 0;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 40;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
}
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
|
||||
if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C2EDA8)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(func_802408D0_C2F470)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 1:
|
||||
N(func_80240958_C2F4F8)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(func_80240C10_C2F7B0)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 3:
|
||||
N(func_80240C74_C2F814)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(func_80240D1C_C2F8BC)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 13) {
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
npc->duration = 15;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
if (script->functionTemp[0].s != 31) {
|
||||
break;
|
||||
}
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
break;
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 40:
|
||||
N(func_80240E54_C2F9F4)(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 41) {
|
||||
break;
|
||||
}
|
||||
case 41:
|
||||
N(func_80240F00_C2FAA0)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 50:
|
||||
N(func_80241078_C2FC18)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -2,3 +2,10 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_02
|
||||
|
||||
ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(update_starpoints_display_C2EF5C)(ScriptInstance *script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_802425C8);
|
||||
Script N(main);
|
||||
|
@ -1,8 +1,52 @@
|
||||
#include "dgb_03.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C314E0", func_80240000_C314E0);
|
||||
ApiStatus N(func_80240000_C314E0)(ScriptInstance *script, s32 isInitialCall) {
|
||||
s32 var = get_variable(script, *script->ptrReadPos);
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
CollisionStatus* collisionStatus = &gCollisionStatus;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_03/C314E0", func_802400BC_C3159C);
|
||||
if (((collisionStatus->pushingAgainstWall != var) && (playerStatus->actionState == 20)) ||
|
||||
playerStatus->enableCollisionOverlapsCheck || playerStatus->statusMenuCounterinputEnabledCounter) {
|
||||
set_action_state(0);
|
||||
script->varTable[0] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
if (collisionStatus->pushingAgainstWall != var) {
|
||||
script->varTable[0] = 0;
|
||||
} else if ((playerStatus->actionState != 20) && (playerStatus->actionState != 1) &&
|
||||
(playerStatus->actionState != 2)) {
|
||||
script->varTable[0] = 0;
|
||||
} else if (playerStatus->animFlags & 1) {
|
||||
script->varTable[0] = 0;
|
||||
} else {
|
||||
script->varTable[0] = 1;
|
||||
}
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus N(func_802400BC_C3159C)(ScriptInstance *script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
f32 posX, posY, posZ, posW;
|
||||
|
||||
if (script->varTable[5] == 0) {
|
||||
playerStatus->position.x = script->varTable[0];
|
||||
} else {
|
||||
playerStatus->position.z = script->varTable[0];
|
||||
}
|
||||
|
||||
posX = playerStatus->position.x;
|
||||
posY = playerStatus->position.y + 10.0f;
|
||||
posZ = playerStatus->position.z;
|
||||
posW = 40.0f;
|
||||
func_800DCB7C(0, &posX, &posY, &posZ, &posW);
|
||||
playerStatus->position.x = posX;
|
||||
playerStatus->position.y = posY;
|
||||
playerStatus->position.z = posZ;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/SetEntityFlags100000.inc.c"
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,3 +2,18 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_03
|
||||
|
||||
ApiStatus N(func_80240000_C314E0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400BC_C3159C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024060C_C31AEC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_80244988);
|
||||
Script N(80243608);
|
||||
Script N(80243740);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,3 +2,26 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_04
|
||||
|
||||
ApiStatus N(SetOverrideFlags_40)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(UnkPartnerPosFunc)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(UnkPartnerPosFunc2)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802423EC_C3891C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024240C_C3893C)(ScriptInstance *script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242438_C38968)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802424F0_C38A20)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802427EC_C38D1C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242818_C38D48)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242850_C38D80)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802428E0_C38E10)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242914_C38E44)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242978_C38EA8)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802429D0_C38F00)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80242F08_C39438)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802430D8_C39608)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_80243D18);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,8 +1,352 @@
|
||||
#include "dgb_05.h"
|
||||
#include "sprite/npc/world_clubba.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240000_C3AA10);
|
||||
extern s16 D_8009A634;
|
||||
extern Npc* wPartnerNpc;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240030_C3AA40);
|
||||
enum {
|
||||
NPC_WORLD_CLUBBA0,
|
||||
NPC_WORLD_CLUBBA1,
|
||||
NPC_WORLD_CLUBBA2 = 3,
|
||||
NPC_WORLD_CLUBBA3,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ 515.0f, 0.0f, 310.0f, 0.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_05_tattle,
|
||||
};
|
||||
|
||||
Script N(802414E0) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_1578)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitSingleDoor_80241580) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 16;
|
||||
SI_VAR(2) = 30;
|
||||
SI_VAR(3) = -1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_03", 2);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_80241634) = SCRIPT({
|
||||
UseDoorSounds(0);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 30;
|
||||
SI_VAR(3) = -1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
if (STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
|
||||
MakeNpcs(1, N(npcGroupList_8024230C));
|
||||
}
|
||||
await N(makeEntities);
|
||||
spawn N(802417F0);
|
||||
ModifyColliderFlags(0, 18, 0x7FFFFE00);
|
||||
EnableModel(20, 0);
|
||||
bind N(exitSingleDoor_80241580) to TRIGGER_WALL_PRESS_A 16;
|
||||
spawn N(802414E0);
|
||||
spawn N(enterSingleDoor_80241634);
|
||||
});
|
||||
|
||||
static s32 N(pad_17E8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(802417F0) = SCRIPT({
|
||||
N(func_80240000_C3AA10)();
|
||||
func_802CA988(0, SI_VAR(2), SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
N(func_80240030_C3AA40)();
|
||||
SI_SAVE_FLAG(1047) = 1;
|
||||
GotoMap("dgb_06", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
static s32 N(pad_1868)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
if (SI_SAVE_FLAG(1047) == 0) {
|
||||
MakeEntity(0x802BCE84, 510, -210, 100, 0, MAKE_ENTITY_END);
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_18BC) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(802418C0) = SCRIPT({
|
||||
GetBattleOutcome(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
== 2 {
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
func_80045900(1);
|
||||
}
|
||||
== 3 {
|
||||
SetEnemyFlagBits(-1, 16, 1);
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
s32 N(unk_missing_8024197C)[] = {
|
||||
0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x0039000C, 0x00390007, 0x00390008, 0x00390011,
|
||||
0x00390012, 0xFFFFFFFF,
|
||||
};
|
||||
|
||||
NpcAnimID N(extraAnimationList_802419A4)[] = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_0),
|
||||
ANIM_END,
|
||||
};
|
||||
|
||||
NpcAISettings N(npcAISettings_802419AC) = {
|
||||
.moveSpeed = 1.0f,
|
||||
.moveTime = 120,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 100.0f,
|
||||
.unk_10 = { .f = 40.0f },
|
||||
.unk_14 = 10,
|
||||
.chaseSpeed = 3.5f,
|
||||
.unk_1C = { .s = 90 },
|
||||
.unk_20 = 15,
|
||||
.chaseRadius = 200.0f,
|
||||
.unk_28 = { .f = 160.0f },
|
||||
.unk_2C = 1,
|
||||
};
|
||||
|
||||
Script N(npcAI_802419DC) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
SetSelfVar(1, 10);
|
||||
SetSelfVar(2, 14);
|
||||
SetSelfVar(3, 18);
|
||||
N(func_80240E80_C3B890)(N(npcAISettings_802419AC));
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241A4C) = {
|
||||
.height = 36,
|
||||
.radius = 34,
|
||||
.ai = &N(npcAI_802419DC),
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
Script N(npcAI_80241A78) = SCRIPT({
|
||||
EnableNpcShadow(NPC_SELF, FALSE);
|
||||
SetSelfVar(0, 4);
|
||||
SetSelfVar(1, 32);
|
||||
SetSelfVar(2, 50);
|
||||
SetSelfVar(3, 32);
|
||||
SetSelfVar(4, 3);
|
||||
SetSelfVar(15, 8389);
|
||||
N(func_8024041C_C3AE2C)();
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241B20) = {
|
||||
.height = 14,
|
||||
.radius = 18,
|
||||
.ai = &N(npcAI_80241A78),
|
||||
.onDefeat = &N(802418C0),
|
||||
.level = 13,
|
||||
.unk_2A = 8,
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80241B4C)[] = {
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA0,
|
||||
.settings = &N(npcSettings_80241A4C),
|
||||
.pos = { 132.0f, -110.0f, 238.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS,
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { 132, -110, 238, 0, 0, -32767, 0, 325, 0, 185, 200 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 03, 00, 00, 00, 00},
|
||||
},
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA1,
|
||||
.settings = &N(npcSettings_80241B20),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
|
||||
.yaw = 0,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.extraAnimations = &N(extraAnimationList_802419A4),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80241F2C)[] = {
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA2,
|
||||
.settings = &N(npcSettings_80241A4C),
|
||||
.pos = { 503.0f, -210.0f, 225.0f },
|
||||
.flags = NPC_FLAG_LOCK_ANIMS,
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { 503, -210, 225, 0, 0, -32767, 0, 503, -210, 290, 200, 150, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 03, 00, 00, 00, 00},
|
||||
},
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA3,
|
||||
.settings = &N(npcSettings_80241B20),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
|
||||
.yaw = 0,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.extraAnimations = &N(extraAnimationList_802419A4),
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_8024230C) = {
|
||||
NPC_GROUP(N(npcGroup_80241B4C), BATTLE_ID(15, 1, 0, 3)),
|
||||
NPC_GROUP(N(npcGroup_80241F2C), BATTLE_ID(15, 2, 0, 3)),
|
||||
{},
|
||||
};
|
||||
|
||||
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) {
|
||||
if (gPlayerStatus.position.y > -270.0f) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/UnkNpcAIFunc6.inc.c"
|
||||
|
||||
@ -12,22 +356,242 @@ INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240030_C3AA40);
|
||||
|
||||
#include "world/common/UnkNpcAIFunc5.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240268_C3AC78);
|
||||
s32 N(func_80240268_C3AC78)(ScriptInstance *script) {
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
|
||||
f32 phi_f20;
|
||||
s32 ret = TRUE;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_8024041C_C3AE2C);
|
||||
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_8024067C_C3B08C);
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240704_C3B114);
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_802409BC_C3B3CC);
|
||||
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240A20_C3B430);
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240AC8_C3B4D8);
|
||||
if (D_8010EBB0.unk_03 == 7) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024041C_C3AE2C)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Enemy* enemy2;
|
||||
Npc* npc2;
|
||||
f32 posX, posZ;
|
||||
s32 func;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags |= 0x102;
|
||||
enemy->flags |= 0x1F300000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
if (enemy->unk_B0 & 4) {
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
}
|
||||
|
||||
func = script->functionTemp[0].s;
|
||||
switch (func) {
|
||||
case 0:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
npc2 = get_npc_unsafe(enemy2->npcID);
|
||||
enemy->unk_07 = 1;
|
||||
if (enemy2->varTable[0] == 3) {
|
||||
if (enemy->varTable[15] != 0) {
|
||||
func_800494C0(npc2, enemy->varTable[15], 0);
|
||||
}
|
||||
posX = npc2->pos.x;
|
||||
posZ = npc2->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
|
||||
|
||||
npc->pos.x = posX;
|
||||
enemy->unk_10.x = npc->pos.x;
|
||||
|
||||
npc->pos.y = npc2->pos.y + enemy->varTable[0];
|
||||
enemy->unk_10.y = npc->pos.y;
|
||||
|
||||
npc->pos.z = posZ;
|
||||
enemy->unk_10.z = npc->pos.z;
|
||||
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
enemy->flags &= 0xE0EFFFFF;
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
get_npc_unsafe(enemy2->npcID);
|
||||
npc->duration++;
|
||||
if (npc->duration >= enemy->varTable[4]) {
|
||||
enemy->unk_07 = 0;
|
||||
}
|
||||
if (enemy2->varTable[0] == 4) {
|
||||
enemy->flags |= 0x1F100000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
enemy->unk_07 = func;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
void N(func_8024067C_C3B08C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
if (npc->duration > 0) {
|
||||
npc->duration--;
|
||||
}
|
||||
|
||||
if (npc->duration == 1) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration <= 0) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerData* playerData = get_player_data();
|
||||
s32 phi_s2 = FALSE;
|
||||
s32 var;
|
||||
f32 posX, posZ;
|
||||
|
||||
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
|
||||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
|
||||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
|
||||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
|
||||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
|
||||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
|
||||
if (playerData->currentPartner == 2) {
|
||||
if (D_8010EBB0.unk_00 == playerData->currentPartner) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
|
||||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
|
||||
if (dist2D(posX, posZ, wPartnerNpc->pos.x, wPartnerNpc->pos.z) <= 80.0f) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (phi_s2) {
|
||||
func_800494C0(npc, 0xB000000E, 0);
|
||||
npc->currentAnim = 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);
|
||||
script->functionTemp[0].s = 2;
|
||||
}
|
||||
|
||||
npc->duration++;
|
||||
if (npc->duration == 27) {
|
||||
func_800494C0(npc, 0xB000000C, 0);
|
||||
} else if (npc->duration == 57) {
|
||||
func_800494C0(npc, 0xB000000D, 0);
|
||||
} else if (npc->duration == 59) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration == 60) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_802409BC_C3B3CC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 1;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_80240A20_C3B430)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
|
||||
npc->currentAnim = 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) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 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;
|
||||
return;
|
||||
}
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
script->functionTemp[1].s--;
|
||||
if (script->functionTemp[1].s > 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
var = enemy->varTable[7];
|
||||
if (var == 40) {
|
||||
npc->duration = 20;
|
||||
script->functionTemp[0].s = var;
|
||||
} else if (var == 50) {
|
||||
npc->duration = 25;
|
||||
script->functionTemp[0].s = var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240C00_C3B610);
|
||||
/*
|
||||
void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -43,12 +607,227 @@ void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
script->functionTemp[0].s = 0x29;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240CAC_C3B6BC);
|
||||
void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 var;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240E24_C3B834);
|
||||
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];
|
||||
npc->duration = 15;
|
||||
enemy->varTable[7] = 50;
|
||||
script->functionTemp[0].s = 3;
|
||||
} else if (npc->unk_8C == 0) {
|
||||
var = npc->yaw;
|
||||
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
|
||||
npc->yaw = var;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_80240E80_C3B890);
|
||||
void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_05/C3AA10", func_802411D0_C3BBE0);
|
||||
if (npc->unk_8C == 0) {
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 40.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 30;
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->flags &= ~0x800;
|
||||
enemy->varTable[0] = 0;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 40;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
}
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
|
||||
if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(func_8024067C_C3B08C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 1:
|
||||
N(func_80240704_C3B114)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(func_802409BC_C3B3CC)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 3:
|
||||
N(func_80240A20_C3B430)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(func_80240AC8_C3B4D8)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 13) {
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
npc->duration = 0xF;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
if (script->functionTemp[0].s != 31) {
|
||||
break;
|
||||
}
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
break;
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 40:
|
||||
N(func_80240C00_C3B610)(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 41) {
|
||||
break;
|
||||
}
|
||||
case 41:
|
||||
N(func_80240CAC_C3B6BC)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 50:
|
||||
N(func_80240E24_C3B834)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
enemy->varTable[0] = 0;
|
||||
}
|
||||
|
||||
if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240268_C3AC78)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
func_800495A0(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
func_800496B8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
base_UnkNpcAIFunc1(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
func_80049C04(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
func_80049E3C(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
func_80049ECC(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
if (script->functionTemp[0].s != 33) {
|
||||
break;
|
||||
}
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
@ -2,3 +2,13 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_05
|
||||
|
||||
ApiStatus N(func_80240000_C3AA10)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240030_C3AA40)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024041C_C3AE2C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_8024230C);
|
||||
Script N(802417F0);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,9 +1,199 @@
|
||||
#include "dgb_06.h"
|
||||
#include "sprite/npc/boo.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
enum {
|
||||
NPC_BOO,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -575.0f, 0.0f, 175.0f, 90.0f },
|
||||
{ -150.0f, 100.0f, -250.0f, 0.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_06_tattle,
|
||||
};
|
||||
|
||||
Script N(80240320) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_3B8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitSingleDoor_802403C0) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 12;
|
||||
SI_VAR(2) = 5;
|
||||
SI_VAR(3) = -1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_04", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_80240474) = SCRIPT({
|
||||
UseDoorSounds(0);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 5;
|
||||
SI_VAR(3) = -1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(589824);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
MakeNpcs(1, N(npcGroupList_80240B44));
|
||||
await N(makeEntities);
|
||||
if (SI_SAVE_FLAG(1047) == 0) {
|
||||
EnableGroup(28, 0);
|
||||
} else {
|
||||
EnableGroup(25, 0);
|
||||
}
|
||||
bind N(exitSingleDoor_802403C0) to TRIGGER_WALL_PRESS_A 12;
|
||||
spawn N(80240320);
|
||||
spawn N(enterSingleDoor_80240474);
|
||||
});
|
||||
|
||||
s32 N(D_80240620_C3D6A0) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240624) = SCRIPT({
|
||||
group 0;
|
||||
func_802D5830(2);
|
||||
sleep 40;
|
||||
ShowGotItem(SI_VAR(0), 0, 0);
|
||||
func_802D5830(0);
|
||||
return;
|
||||
});
|
||||
|
||||
Script N(8024068C) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
SI_VAR(0) = SI_VAR(10);
|
||||
if (SI_VAR(10) != 0) {
|
||||
await N(80240624);
|
||||
}
|
||||
match SI_VAR(11) {
|
||||
== 0 {
|
||||
AddItem(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
== 1 {
|
||||
AddKeyItem(SI_VAR(10));
|
||||
}
|
||||
== 2 {
|
||||
AddBadge(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
}
|
||||
sleep 15;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(8024076C) = SCRIPT({
|
||||
SI_VAR(10) = 19;
|
||||
SI_VAR(11) = 1;
|
||||
SI_SAVE_FLAG(1048) = 1;
|
||||
await N(8024068C);
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802EAE30, -300, 50, -200, 0, ITEM_NONE, MAKE_ENTITY_END);
|
||||
AssignFlag(SI_SAVE_FLAG(1048));
|
||||
AssignScript(N(8024076C));
|
||||
MakeEntity(0x802EA7E0, -125, 60, 175, 0, MAKE_ENTITY_END);
|
||||
});
|
||||
|
||||
static s32 N(pad_834)[] = {
|
||||
0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_80240840) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
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));
|
||||
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));
|
||||
SI_AREA_FLAG(4) = 0;
|
||||
}
|
||||
});
|
||||
|
||||
Script N(init_802408FC) = SCRIPT({
|
||||
if (STORY_PROGRESS >= STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER) {
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
}
|
||||
BindNpcInteract(NPC_SELF, N(interact_8024086C));
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_80240954) = {
|
||||
.id = NPC_BOO,
|
||||
.settings = &N(npcSettings_80240840),
|
||||
.pos = { -300.0f, 10.0f, 150.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_LOCK_ANIMS,
|
||||
.init = &N(init_802408FC),
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_2),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_1),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_0),
|
||||
NPC_ANIM(boo, Palette_01, Anim_A),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
NPC_ANIM(boo, Palette_01, Anim_3),
|
||||
},
|
||||
.tattle = MESSAGE_ID(0x1A, 0x00B3),
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_80240B44) = {
|
||||
NPC_GROUP(N(npcGroup_80240954), BATTLE_ID(0, 0, 0, 0)),
|
||||
{},
|
||||
};
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_06/C3D080", func_80240000_C3D080);
|
||||
/*
|
||||
ApiStatus N(func_80240000_C3D080)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80240620_C3D6A0);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,13 +207,12 @@ ApiStatus N(func_80240000_C3D080)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80240620_C3D6A0);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
|
@ -2,3 +2,7 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_06
|
||||
|
||||
NpcGroupList N(npcGroupList_80240B44);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,4 +1,261 @@
|
||||
#include "dgb_07.h"
|
||||
#include "message_ids.h"
|
||||
#include "sprite/npc/world_clubba.h"
|
||||
|
||||
extern s16 D_8009A634;
|
||||
extern Npc* wPartnerNpc;
|
||||
|
||||
enum {
|
||||
NPC_WORLD_CLUBBA0,
|
||||
NPC_WORLD_CLUBBA1,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -450.0f, 0.0f, -40.0f, 0.0f },
|
||||
{ 250.0f, 190.0f, -250.0f, 180.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_07_tattle,
|
||||
};
|
||||
|
||||
Script N(80241490) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_1528)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitSingleDoor_80241530) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 6;
|
||||
SI_VAR(2) = 22;
|
||||
SI_VAR(3) = -1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_02", 2);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_802415E4) = SCRIPT({
|
||||
UseDoorSounds(0);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 22;
|
||||
SI_VAR(3) = -1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
if (STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
|
||||
MakeNpcs(1, N(npcGroupList_80241E5C));
|
||||
}
|
||||
await N(makeEntities);
|
||||
bind N(exitSingleDoor_80241530) to TRIGGER_WALL_PRESS_A 6;
|
||||
spawn N(80241490);
|
||||
spawn N(enterSingleDoor_802415E4);
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeItemEntity(ITEM_STAR_PIECE, -220, 75, -210, 17, SI_SAVE_FLAG(1050));
|
||||
MakeEntity(0x802EAED4, -370, 0, -200, 0, -1, MAKE_ENTITY_END);
|
||||
MakeEntity(0x802EAED4, -410, 0, -200, 0, -1, MAKE_ENTITY_END);
|
||||
});
|
||||
|
||||
static s32 N(pad_17E4)[] = {
|
||||
0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(802417F0) = SCRIPT({
|
||||
GetBattleOutcome(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
== 2 {
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
func_80045900(1);
|
||||
}
|
||||
== 3 {
|
||||
SetEnemyFlagBits(-1, 16, 1);
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
NpcAnimID N(extraAnimationList_802418AC)[] = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
ANIM_END,
|
||||
};
|
||||
|
||||
NpcAnimID N(extraAnimationList_802418D4)[] = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_0),
|
||||
ANIM_END,
|
||||
};
|
||||
|
||||
NpcAISettings N(npcAISettings_802418DC) = {
|
||||
.moveSpeed = 1.0f,
|
||||
.moveTime = 120,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 100.0f,
|
||||
.unk_10 = { .f = 40.0f },
|
||||
.unk_14 = 10,
|
||||
.chaseSpeed = 3.5f,
|
||||
.unk_1C = { .s = 90 },
|
||||
.unk_20 = 15,
|
||||
.chaseRadius = 200.0f,
|
||||
.unk_28 = { .f = 160.0f },
|
||||
.unk_2C = 1,
|
||||
};
|
||||
|
||||
Script N(npcAI_8024190C) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
SetSelfVar(1, 10);
|
||||
SetSelfVar(2, 14);
|
||||
SetSelfVar(3, 18);
|
||||
N(func_80240E20_C3EA10)(N(npcAISettings_802418DC));
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_8024197C) = {
|
||||
.height = 36,
|
||||
.radius = 34,
|
||||
.ai = &N(npcAI_8024190C),
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
Script N(npcAI_802419A8) = SCRIPT({
|
||||
EnableNpcShadow(NPC_SELF, FALSE);
|
||||
SetSelfVar(0, 4);
|
||||
SetSelfVar(1, 32);
|
||||
SetSelfVar(2, 50);
|
||||
SetSelfVar(3, 32);
|
||||
SetSelfVar(4, 3);
|
||||
SetSelfVar(15, 8389);
|
||||
N(update_starpoints_display_C3DFAC)();
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_80241A50) = {
|
||||
.height = 14,
|
||||
.radius = 18,
|
||||
.ai = &N(npcAI_802419A8),
|
||||
.onDefeat = &N(802417F0),
|
||||
.level = 13,
|
||||
.unk_2A = 8,
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_80241A7C)[] = {
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA0,
|
||||
.settings = &N(npcSettings_8024197C),
|
||||
.pos = { -500.0f, 0.0f, -240.0f },
|
||||
.flags = NPC_FLAG_IGNORE_HEIGHT,
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { -500, 0, -240, 40, 0, -32767, 0, -500, 0, -240, 200, 0, 0, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 02, 00, 00, 00, 00},
|
||||
.extraAnimations = &N(extraAnimationList_802418AC),
|
||||
},
|
||||
{
|
||||
.id = NPC_WORLD_CLUBBA1,
|
||||
.settings = &N(npcSettings_80241A50),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_NO_DROPS,
|
||||
.yaw = 0,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_3),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_4),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_11),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_12),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_8),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_1),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
NPC_ANIM(world_clubba, Palette_00, Anim_2),
|
||||
},
|
||||
.extraAnimations = &N(extraAnimationList_802418D4),
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_80241E5C) = {
|
||||
NPC_GROUP(N(npcGroup_80241A7C), BATTLE_ID(15, 1, 0, 3)),
|
||||
{},
|
||||
};
|
||||
|
||||
static const s32 N(pad_1E74)[] = {
|
||||
0x00000000, 0x00000000
|
||||
};
|
||||
|
||||
#include "world/common/UnkNpcAIFunc6.inc.c"
|
||||
|
||||
@ -8,22 +265,242 @@
|
||||
|
||||
#include "world/common/UnkNpcAIFunc5.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240208_C3DDF8);
|
||||
s32 N(func_80240208_C3DDF8)(ScriptInstance *script) {
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
|
||||
f32 phi_f20;
|
||||
s32 ret = TRUE;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", update_starpoints_display_C3DFAC);
|
||||
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_8024061C_C3E20C);
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_802406A4_C3E294);
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_8024095C_C3E54C);
|
||||
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_802409C0_C3E5B0);
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240A68_C3E658);
|
||||
if (D_8010EBB0.unk_03 == 7) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ApiStatus N(update_starpoints_display_C3DFAC)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Enemy* enemy2;
|
||||
Npc* npc2;
|
||||
f32 posX, posZ;
|
||||
s32 func;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags |= 0x102;
|
||||
enemy->flags |= 0x1F300000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
if (enemy->unk_B0 & 4) {
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
}
|
||||
|
||||
func = script->functionTemp[0].s;
|
||||
switch (func) {
|
||||
case 0:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
npc2 = get_npc_unsafe(enemy2->npcID);
|
||||
enemy->unk_07 = 1;
|
||||
if (enemy2->varTable[0] == 3) {
|
||||
if (enemy->varTable[15] != 0) {
|
||||
func_800494C0(npc2, enemy->varTable[15], 0);
|
||||
}
|
||||
posX = npc2->pos.x;
|
||||
posZ = npc2->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
|
||||
|
||||
npc->pos.x = posX;
|
||||
enemy->unk_10.x = npc->pos.x;
|
||||
|
||||
npc->pos.y = npc2->pos.y + enemy->varTable[0];
|
||||
enemy->unk_10.y = npc->pos.y;
|
||||
|
||||
npc->pos.z = posZ;
|
||||
enemy->unk_10.z = npc->pos.z;
|
||||
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
enemy->flags &= 0xE0EFFFFF;
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
get_npc_unsafe(enemy2->npcID);
|
||||
npc->duration++;
|
||||
if (npc->duration >= enemy->varTable[4]) {
|
||||
enemy->unk_07 = 0;
|
||||
}
|
||||
if (enemy2->varTable[0] == 4) {
|
||||
enemy->flags |= 0x1F100000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
enemy->unk_07 = func;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
void N(func_8024061C_C3E20C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
if (npc->duration > 0) {
|
||||
npc->duration--;
|
||||
}
|
||||
|
||||
if (npc->duration == 1) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration <= 0) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
PlayerData* playerData = get_player_data();
|
||||
s32 phi_s2 = FALSE;
|
||||
s32 var;
|
||||
f32 posX, posZ;
|
||||
|
||||
if (func_800490B4(territory, enemy, 80.0f, 0.0f, 0)) {
|
||||
if ((gPlayerStatusPtr->actionState == 2) || (gPlayerStatusPtr->actionState == 26) ||
|
||||
(gPlayerStatusPtr->actionState == 3) || (gPlayerStatusPtr->actionState == 14) ||
|
||||
(gPlayerStatusPtr->actionState == 16) || (gPlayerStatusPtr->actionState == 11) ||
|
||||
(gPlayerStatusPtr->actionState == 10) || (gPlayerStatusPtr->actionState == 18) ||
|
||||
(gPlayerStatusPtr->actionState == 19) || (gPlayerStatusPtr->actionState == 37)) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
|
||||
if (playerData->currentPartner == 2) {
|
||||
if (D_8010EBB0.unk_00 == playerData->currentPartner) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((playerData->currentPartner == 1) && (D_8010EBB0.unk_00 != 0)) ||
|
||||
((playerData->currentPartner == 3) && (D_8010EBB0.unk_00 == 2))) {
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw);
|
||||
if (dist2D(posX, posZ, wPartnerNpc->pos.x, wPartnerNpc->pos.z) <= 80.0f) {
|
||||
phi_s2 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (phi_s2) {
|
||||
func_800494C0(npc, 0xB000000E, 0);
|
||||
npc->currentAnim = 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);
|
||||
script->functionTemp[0].s = 2;
|
||||
}
|
||||
|
||||
npc->duration++;
|
||||
if (npc->duration == 27) {
|
||||
func_800494C0(npc, 0xB000000C, 0);
|
||||
} else if (npc->duration == 57) {
|
||||
func_800494C0(npc, 0xB000000D, 0);
|
||||
} else if (npc->duration == 59) {
|
||||
npc->currentAnim = enemy->animList[12];
|
||||
} else if (npc->duration == 60) {
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->duration = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_8024095C_C3E54C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 1;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
}
|
||||
}
|
||||
|
||||
void N(func_802409C0_C3E5B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f);
|
||||
npc->currentAnim = 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) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 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;
|
||||
return;
|
||||
}
|
||||
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
script->functionTemp[1].s--;
|
||||
if (script->functionTemp[1].s > 0) {
|
||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
var = enemy->varTable[7];
|
||||
if (var == 40) {
|
||||
npc->duration = 20;
|
||||
script->functionTemp[0].s = var;
|
||||
} else if (var == 50) {
|
||||
npc->duration = 25;
|
||||
script->functionTemp[0].s = var;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240BA0_C3E790);
|
||||
/*
|
||||
void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -39,12 +516,227 @@ void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
script->functionTemp[0].s = 0x29;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240C4C_C3E83C);
|
||||
void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 var;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240DC4_C3E9B4);
|
||||
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];
|
||||
npc->duration = 15;
|
||||
enemy->varTable[7] = 50;
|
||||
script->functionTemp[0].s = 3;
|
||||
} else if (npc->unk_8C == 0) {
|
||||
var = npc->yaw;
|
||||
func_8004A784(npc, 5.0f, &var, 0, 0, 0);
|
||||
npc->yaw = var;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80240E20_C3EA10);
|
||||
void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_07/C3DBF0", func_80241170_C3ED60);
|
||||
if (npc->unk_8C == 0) {
|
||||
npc->duration--;
|
||||
if (npc->duration <= 0) {
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 40.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 30;
|
||||
npc->currentAnim = enemy->animList[10];
|
||||
npc->flags &= ~0x800;
|
||||
enemy->varTable[0] = 0;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 40;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
}
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
|
||||
if (((u32)script->functionTemp[0].s - 10 < 20) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(func_8024061C_C3E20C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 1:
|
||||
N(func_802406A4_C3E294)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(func_8024095C_C3E54C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 3:
|
||||
N(func_802409C0_C3E5B0)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(func_80240A68_C3E658)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 13) {
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
npc->duration = 15;
|
||||
enemy->varTable[7] = 40;
|
||||
script->functionTemp[0].s = 3;
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
if (script->functionTemp[0].s != 31) {
|
||||
break;
|
||||
}
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
break;
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 40:
|
||||
N(func_80240BA0_C3E790)(script, npcAISettings, territoryPtr);
|
||||
if (script->functionTemp[0].s != 41) {
|
||||
break;
|
||||
}
|
||||
case 41:
|
||||
N(func_80240C4C_C3E83C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 50:
|
||||
N(func_80240DC4_C3E9B4)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
enemy->varTable[0] = 0;
|
||||
}
|
||||
|
||||
if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C3DDF8)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
func_800495A0(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
func_800496B8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
base_UnkNpcAIFunc1(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
func_80049C04(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
func_80049E3C(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
func_80049ECC(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
if (script->functionTemp[0].s != 33) {
|
||||
break;
|
||||
}
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
@ -2,3 +2,10 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_07
|
||||
|
||||
ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(update_starpoints_display_C3DFAC)(ScriptInstance *script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_80241E5C);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,3 +2,20 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_08
|
||||
|
||||
ApiStatus N(UnkFunc1)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024124C_C40FFC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80243B98_C43948)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80243C10_C439C0)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80243C50_C43A00)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_80246958);
|
||||
NpcGroupList N(npcGroupList_802469AC);
|
||||
NpcGroupList N(npcGroupList_802469C4);
|
||||
Script N(802469E0);
|
||||
Script N(main);
|
||||
Script N(npcAI_80244D7C);
|
||||
Script N(unk_80244100);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,3 +2,12 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_09
|
||||
|
||||
ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(update_starpoints_display_C46F9C)(ScriptInstance *script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_8024533C);
|
||||
Script N(80243F6C);
|
||||
Script N(main);
|
||||
|
@ -1,9 +1,354 @@
|
||||
#include "dgb_10.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_10/C4C390", func_80240000_C4C390);
|
||||
EntryList N(entryList) = {
|
||||
{ 300.0f, 0.0f, -50.0f, 0.0f },
|
||||
{ 375.0f, 0.0f, -240.0f, 0.0f },
|
||||
};
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_10/C4C390", func_802400A0_C4C430);
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_10_tattle,
|
||||
};
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_10/C4C390", func_8024013C_C4C4CC);
|
||||
Script N(80240250) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_10/C4C390", func_802401C0_C4C550);
|
||||
static s32 N(pad_2E8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitWalk_802402F0) = EXIT_WALK_SCRIPT(40, 0, "dgb_09", 3);
|
||||
|
||||
Script N(8024034C) = SCRIPT({
|
||||
bind N(exitWalk_802402F0) to TRIGGER_FLOOR_ABOVE 8;
|
||||
});
|
||||
|
||||
Script N(enterWalk_80240378) = SCRIPT({
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(0) = N(8024034C);
|
||||
spawn EnterWalk;
|
||||
sleep 1;
|
||||
}
|
||||
== 1 {
|
||||
UseSettingsFrom(0, 375, 0, -188);
|
||||
SetPanTarget(0, 375, 0, -188);
|
||||
SetCamSpeed(0, 90.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
DisablePlayerInput(TRUE);
|
||||
DisablePlayerPhysics(TRUE);
|
||||
SetPlayerActionState(3);
|
||||
sleep 1;
|
||||
SetPlayerJumpscale(0.7001953125);
|
||||
PlayerJump(375, 0, -188, 20);
|
||||
PanToTarget(0, 0, 0);
|
||||
DisablePlayerPhysics(FALSE);
|
||||
DisablePlayerInput(FALSE);
|
||||
SetPlayerActionState(0);
|
||||
spawn N(8024034C);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(makeEntities);
|
||||
spawn N(80240E68);
|
||||
spawn N(80240250);
|
||||
ModifyColliderFlags(0, 9, 0x7FFFFE00);
|
||||
EnableModel(6, 0);
|
||||
EnableModel(12, 0);
|
||||
EnableModel(18, 0);
|
||||
ModifyColliderFlags(0, 12, 0x7FFFFE00);
|
||||
ModifyColliderFlags(0, 13, 0x7FFFFE00);
|
||||
ModifyColliderFlags(0, 14, 0x7FFFFE00);
|
||||
spawn N(enterWalk_80240378);
|
||||
});
|
||||
|
||||
static s32 N(pad_66C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240670) = {
|
||||
SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_NEW_ARRAY, 6, SI_VAR(10)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(0), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(1), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(2), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(3), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(4), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(5), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_VAR(0), SI_VAR(10)),
|
||||
SI_CMD(ScriptOpcode_BIND_TRIGGER, N(80240770), TRIGGER_FLOOR_TOUCH, SI_ARRAY(0), 1, 0),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
|
||||
// *INDENT-OFF*
|
||||
Script N(80240770) = {
|
||||
SI_CMD(ScriptOpcode_USE_ARRAY, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_CALL, N(func_80240000_C4C390)),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), 0),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_LOOP, 5),
|
||||
SI_CMD(ScriptOpcode_CALL, ModifyColliderFlags, 1, SI_ARRAY(0), 2147483136),
|
||||
SI_CMD(ScriptOpcode_CALL, EnableModel, SI_ARRAY(1), 1),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_CALL, ModifyColliderFlags, 0, SI_ARRAY(0), 2147483136),
|
||||
SI_CMD(ScriptOpcode_CALL, EnableModel, SI_ARRAY(1), 0),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_END_LOOP),
|
||||
SI_CMD(ScriptOpcode_IF_NE, SI_ARRAY(5), 0),
|
||||
SI_CMD(ScriptOpcode_AWAIT_SCRIPT, 0xF4ACD485),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
// *INDENT-OFF*
|
||||
Script N(80240860) = {
|
||||
SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_NEW_ARRAY, 6, SI_VAR(9)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(0), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(1), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(2), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(3), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(4), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_SET, SI_ARRAY(5), SI_VAR(1)),
|
||||
SI_CMD(ScriptOpcode_CALL, ParentColliderToModel, SI_ARRAY(1), SI_ARRAY(0)),
|
||||
SI_CMD(ScriptOpcode_LABEL, 0),
|
||||
SI_CMD(ScriptOpcode_LABEL, 1),
|
||||
SI_CMD(ScriptOpcode_CALL, GetPlayerActionState, SI_VAR(10)),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(10), 13),
|
||||
SI_CMD(ScriptOpcode_GOTO, 2),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(10), 15),
|
||||
SI_CMD(ScriptOpcode_GOTO, 2),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_GOTO, 0),
|
||||
SI_CMD(ScriptOpcode_LABEL, 2),
|
||||
SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(1), SI_VAR(2), SI_VAR(3)),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_NE, SI_VAR(2), SI_ARRAY(3)),
|
||||
SI_CMD(ScriptOpcode_GOTO, 2),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_CALL, N(func_802400A0_C4C430)),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), 1),
|
||||
SI_CMD(ScriptOpcode_AWAIT_SCRIPT, N(80240AF4)),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), 2),
|
||||
SI_CMD(ScriptOpcode_AWAIT_SCRIPT, N(80240CB8)),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_LABEL, 3),
|
||||
SI_CMD(ScriptOpcode_CALL, GetPlayerActionState, SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), 13),
|
||||
SI_CMD(ScriptOpcode_GOTO, 3),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(0), 15),
|
||||
SI_CMD(ScriptOpcode_GOTO, 3),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_GOTO, 0),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
// *INDENT-OFF*
|
||||
Script N(80240AF4) = {
|
||||
SI_CMD(ScriptOpcode_USE_ARRAY, SI_VAR(9)),
|
||||
SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(2), SI_VAR(3), SI_VAR(4)),
|
||||
SI_CMD(ScriptOpcode_CALL, MakeLerp, 0, 5, 3, 1),
|
||||
SI_CMD(ScriptOpcode_LABEL, 2),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateLerp),
|
||||
SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_ARRAY(0), 0, SI_VAR(0), 0),
|
||||
SI_CMD(ScriptOpcode_SET, SI_VAR(5), SI_VAR(3)),
|
||||
SI_CMD(ScriptOpcode_ADD, SI_VAR(5), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_CALL, SetPlayerPos, SI_VAR(2), SI_VAR(5), SI_VAR(4)),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateColliderTransform, SI_ARRAY(1)),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(1), 1),
|
||||
SI_CMD(ScriptOpcode_GOTO, 2),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_CALL, MakeLerp, 5, 0, 3, 1),
|
||||
SI_CMD(ScriptOpcode_LABEL, 3),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateLerp),
|
||||
SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_ARRAY(0), 0, SI_VAR(0), 0),
|
||||
SI_CMD(ScriptOpcode_SET, SI_VAR(5), SI_VAR(3)),
|
||||
SI_CMD(ScriptOpcode_ADD, SI_VAR(5), SI_VAR(0)),
|
||||
SI_CMD(ScriptOpcode_CALL, SetPlayerPos, SI_VAR(2), SI_VAR(5), SI_VAR(4)),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateColliderTransform, SI_ARRAY(1)),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(1), 1),
|
||||
SI_CMD(ScriptOpcode_GOTO, 3),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
// *INDENT-OFF*
|
||||
Script N(80240CB8) = {
|
||||
SI_CMD(ScriptOpcode_USE_ARRAY, SI_VAR(9)),
|
||||
SI_CMD(ScriptOpcode_CALL, MakeItemEntity, SI_ARRAY(5), SI_ARRAY(2), SI_ARRAY(3), SI_ARRAY(4), 3, 0),
|
||||
SI_CMD(ScriptOpcode_SET, SI_VAR(2), 0),
|
||||
SI_CMD(ScriptOpcode_CALL, MakeLerp, 0, 150, 19, 4),
|
||||
SI_CMD(ScriptOpcode_LABEL, 2),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateLerp),
|
||||
SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_ARRAY(0), 0, SI_VAR(0), 0),
|
||||
SI_CMD(ScriptOpcode_ADD, SI_VAR(2), 45),
|
||||
SI_CMD(ScriptOpcode_CALL, RotateModel, SI_ARRAY(0), SI_VAR(2), 1, 0, 0),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(1), 1),
|
||||
SI_CMD(ScriptOpcode_GOTO, 2),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_CALL, MakeLerp, 150, 0, 19, 4),
|
||||
SI_CMD(ScriptOpcode_LABEL, 3),
|
||||
SI_CMD(ScriptOpcode_CALL, UpdateLerp),
|
||||
SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_ARRAY(0), 0, SI_VAR(0), 0),
|
||||
SI_CMD(ScriptOpcode_ADD, SI_VAR(2), 45),
|
||||
SI_CMD(ScriptOpcode_CALL, RotateModel, SI_ARRAY(0), SI_VAR(2), 1, 0, 0),
|
||||
SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(1), 1),
|
||||
SI_CMD(ScriptOpcode_GOTO, 3),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
Script N(80240E68) = SCRIPT({
|
||||
N(func_8024013C_C4C4CC)();
|
||||
func_802CA988(0, SI_VAR(2), SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
N(func_802401C0_C4C550)();
|
||||
func_802D2B6C();
|
||||
GotoMap("dgb_11", SI_VAR(0));
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
static s32 N(pad_EDC) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240EE0) = SCRIPT({
|
||||
SI_SAVE_FLAG(1052) = 1;
|
||||
});
|
||||
|
||||
Script N(80240F00) = SCRIPT({
|
||||
SI_SAVE_FLAG(1053) = 1;
|
||||
});
|
||||
|
||||
Script N(80240F20) = SCRIPT({
|
||||
SI_SAVE_FLAG(1054) = 1;
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
if (SI_SAVE_FLAG(1052) == 0) {
|
||||
MakeEntity(0x802BCE84, 500, 0, -100, 0, MAKE_ENTITY_END);
|
||||
AssignScript(N(80240EE0));
|
||||
}
|
||||
if (SI_SAVE_FLAG(1053) == 0) {
|
||||
MakeEntity(0x802BCE84, 500, 0, -250, 0, MAKE_ENTITY_END);
|
||||
AssignScript(N(80240F00));
|
||||
}
|
||||
if (SI_SAVE_FLAG(1054) == 0) {
|
||||
MakeEntity(0x802BCE84, 375, 0, -250, 0, MAKE_ENTITY_END);
|
||||
AssignScript(N(80240F20));
|
||||
}
|
||||
});
|
||||
|
||||
ApiStatus N(func_80240000_C4C390)(ScriptInstance *script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
s32 *array = script->array;
|
||||
f32 distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[3]);
|
||||
|
||||
script->varTable[0] = 1;
|
||||
if ((playerStatus->actionState != 14) && (playerStatus->actionState != 16)) {
|
||||
script->varTable[0] = 0;
|
||||
}
|
||||
if (script->array[4] <= distance) {
|
||||
script->varTable[0] = 0;
|
||||
}
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
f32 distance;
|
||||
s32 *array = script->array;
|
||||
|
||||
distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[4]);
|
||||
script->varTable[0] = 0;
|
||||
if (distance < 112.5f) {
|
||||
script->varTable[0] = 2;
|
||||
}
|
||||
if (distance < 37.5f) {
|
||||
script->varTable[0] = 1;
|
||||
}
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
PlayerStatus* playerStatus2 = playerStatus;
|
||||
s32 var;
|
||||
|
||||
if (playerStatus->position.y >= 0.0f) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (playerStatus2->position.x < 440.0f) {
|
||||
var = 3;
|
||||
} else if (playerStatus2->position.z < -170.0f) {
|
||||
var = 2;
|
||||
} else {
|
||||
var = 1;
|
||||
}
|
||||
script->varTable[0] = var;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus N(func_802401C0_C4C550)(ScriptInstance *script, s32 isInitialCall) {
|
||||
if (gPlayerStatus.position.y > -60.0f) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -2,3 +2,15 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_10
|
||||
|
||||
ApiStatus N(func_80240000_C4C390)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802400A0_C4C430)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_802401C0_C4C550)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(80240770);
|
||||
Script N(80240AF4);
|
||||
Script N(80240CB8);
|
||||
Script N(80240E68);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,3 +1,218 @@
|
||||
#include "dgb_11.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_11/C4D3E0", func_80240000_C4D3E0);
|
||||
extern s32 D_000001E4;
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ 450.0f, 0.0f, -40.0f, 0.0f },
|
||||
{ 500.0f, 180.0f, -100.0f, 180.0f },
|
||||
{ 500.0f, 180.0f, -250.0f, 180.0f },
|
||||
{ 375.0f, 180.0f, -250.0f, 180.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_11_tattle,
|
||||
};
|
||||
|
||||
Script N(802400D0) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_168)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitSingleDoor_80240170) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 11;
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = -1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_02", 3);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_80240224) = SCRIPT({
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = -1;
|
||||
await EnterSingleDoor;
|
||||
return;
|
||||
}
|
||||
== 1 {
|
||||
UseSettingsFrom(0, 500, 0, -100);
|
||||
SetPanTarget(0, 500, 0, -100);
|
||||
SI_VAR(3) = 1;
|
||||
}
|
||||
== 2 {
|
||||
UseSettingsFrom(0, 500, 75, -250);
|
||||
SetPanTarget(0, 500, 75, -250);
|
||||
SI_VAR(3) = 75;
|
||||
}
|
||||
== 3 {
|
||||
SetZoneEnabled(5, 0);
|
||||
UseSettingsFrom(0, 375, 0, -175);
|
||||
SetPanTarget(0, 375, 0, -175);
|
||||
SI_AREA_FLAG(2) = 1;
|
||||
SI_VAR(3) = 1;
|
||||
}
|
||||
}
|
||||
DisablePlayerInput(TRUE);
|
||||
InterpPlayerYaw(180, 0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
PanToTarget(0, 0, 1);
|
||||
loop {
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
if (SI_VAR(1) <= SI_VAR(3)) {
|
||||
break loop;
|
||||
}
|
||||
sleep 1;
|
||||
}
|
||||
PanToTarget(0, 0, 0);
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(makeEntities);
|
||||
spawn N(802400D0);
|
||||
bind N(exitSingleDoor_80240170) to TRIGGER_WALL_PRESS_A 11;
|
||||
spawn N(enterSingleDoor_80240224);
|
||||
});
|
||||
|
||||
static s32 N(pad_56C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240570) = SCRIPT({
|
||||
0:
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
if (SI_VAR(1) >= SI_VAR(3)) {
|
||||
SI_VAR(1) = SI_VAR(3);
|
||||
}
|
||||
SetCamTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
goto 0;
|
||||
});
|
||||
|
||||
Script N(80240600) = SCRIPT({
|
||||
PlayerJump(375, 270, -250, 20);
|
||||
});
|
||||
|
||||
Script N(8024062C) = SCRIPT({
|
||||
if (SI_AREA_FLAG(3) == 1) {
|
||||
return;
|
||||
}
|
||||
SI_AREA_FLAG(3) = 1;
|
||||
DisablePlayerInput(TRUE);
|
||||
SetZoneEnabled(5, 0);
|
||||
if (SI_AREA_FLAG(2) == 0) {
|
||||
if (SI_SAVE_FLAG(1054) == 0) {
|
||||
DisablePlayerPhysics(TRUE);
|
||||
SetPlayerActionState(3);
|
||||
sleep 1;
|
||||
SI_VAR(3) = 500;
|
||||
SI_VAR(10) = spawn N(80240570);
|
||||
SetPlayerJumpscale(0.7001953125);
|
||||
SI_VAR(11) = spawn N(80240600);
|
||||
loop {
|
||||
sleep 1;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
if (SI_VAR(1) >= 165) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPlayerPos(SI_VAR(0), 165, SI_VAR(2));
|
||||
kill SI_VAR(11);
|
||||
SetPlayerAnimation(0x80015);
|
||||
ShakeCam(0, 0, 20, 1.0);
|
||||
sleep 10;
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
SetPlayerJumpscale(0.0);
|
||||
PlayerJump1(375, 25, -250, 10);
|
||||
N(func_80240000_C4D3E0)();
|
||||
PlaySoundAtPlayer(8326, 0);
|
||||
SetPlayerJumpscale(0.7001953125);
|
||||
PlayerJump(375, 0, -175, 15);
|
||||
kill SI_VAR(10);
|
||||
SetPlayerActionState(0);
|
||||
sleep 2;
|
||||
SetZoneEnabled(5, 1);
|
||||
DisablePlayerPhysics(FALSE);
|
||||
DisablePlayerInput(FALSE);
|
||||
SI_AREA_FLAG(3) = 0;
|
||||
} else {
|
||||
DisablePlayerPhysics(TRUE);
|
||||
SetPlayerActionState(3);
|
||||
sleep 1;
|
||||
spawn {
|
||||
sleep 8;
|
||||
GotoMap("dgb_10", 1);
|
||||
sleep 100;
|
||||
}
|
||||
SI_VAR(3) = 500;
|
||||
SI_VAR(10) = spawn N(80240570);
|
||||
SetPlayerJumpscale(0.7001953125);
|
||||
PlayerJump(375, 270, -250, 20);
|
||||
SI_AREA_FLAG(3) = 0;
|
||||
}
|
||||
} else {
|
||||
SetPlayerActionState(3);
|
||||
sleep 1;
|
||||
SI_VAR(3) = 25;
|
||||
SetPlayerJumpscale(0.7001953125);
|
||||
PlayerJump(375, 0, -175, 15);
|
||||
SI_AREA_FLAG(2) = 0;
|
||||
kill SI_VAR(10);
|
||||
SetPlayerActionState(0);
|
||||
sleep 2;
|
||||
SetZoneEnabled(5, 1);
|
||||
DisablePlayerInput(FALSE);
|
||||
SI_AREA_FLAG(3) = 0;
|
||||
}
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeItemEntity(ITEM_D_DOWN_JUMP, 250, 75, -100, 17, SI_SAVE_FLAG(1055));
|
||||
MakeEntity(0x802EAA30, 375, 0, -250, 0, MAKE_ENTITY_END);
|
||||
AssignScript(N(8024062C));
|
||||
SI_MAP_VAR(0) = SI_VAR(0);
|
||||
});
|
||||
|
||||
ApiStatus N(func_80240000_C4D3E0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Entity* entity = get_entity_by_index(get_variable(NULL, 0xFD050F80));
|
||||
|
||||
if (entity == NULL) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
play_model_animation(entity->virtualModelIndex, &D_000001E4);
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -2,3 +2,8 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_11
|
||||
|
||||
ApiStatus N(func_80240000_C4D3E0)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
@ -1,9 +1,177 @@
|
||||
#include "dgb_12.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -500.0f, 0.0f, -40.0f, 0.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_12_tattle,
|
||||
};
|
||||
|
||||
Script N(80240310) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_3A8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitSingleDoor_802403B0) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 8;
|
||||
SI_VAR(2) = 14;
|
||||
SI_VAR(3) = -1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_09", 2);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterSingleDoor_80240464) = SCRIPT({
|
||||
UseDoorSounds(0);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 14;
|
||||
SI_VAR(3) = -1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(makeEntities);
|
||||
spawn N(802405E0);
|
||||
spawn N(80240310);
|
||||
bind N(exitSingleDoor_802403B0) to TRIGGER_WALL_PRESS_A 8;
|
||||
spawn N(enterSingleDoor_80240464);
|
||||
});
|
||||
|
||||
s32 N(lavaResetList_802405C0)[] = {
|
||||
0x00000005, 0xC3FB8000, 0x00000000, 0xC27C0000, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(802405E0) = SCRIPT({
|
||||
group 239;
|
||||
ModifyColliderFlags(3, 12, 0x00000002);
|
||||
ModifyColliderFlags(3, 0, 0x00000002);
|
||||
ModifyColliderFlags(3, 14, 0x00000002);
|
||||
spawn {
|
||||
ResetFromLava(N(lavaResetList_802405C0));
|
||||
}
|
||||
sleep 50;
|
||||
TranslateModel(19, 0, 0, 0);
|
||||
ParentColliderToModel(12, 19);
|
||||
loop {
|
||||
spawn {
|
||||
sleep 2;
|
||||
ModifyColliderFlags(0, 0, 0x7FFFFE00);
|
||||
}
|
||||
MakeLerp(0, -35, 15, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateModel(19, 0, SI_VAR(0), 0);
|
||||
UpdateColliderTransform(12);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
sleep 60;
|
||||
PlaySoundAtCollider(0, 8339, 0);
|
||||
spawn {
|
||||
ModifyColliderFlags(1, 0, 0x7FFFFE00);
|
||||
}
|
||||
MakeLerp(-35, 0, 4, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateModel(19, 0, SI_VAR(0), 0);
|
||||
UpdateColliderTransform(12);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
sleep 35;
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_868)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32 N(D_80240870_C4E760) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240874) = SCRIPT({
|
||||
group 0;
|
||||
func_802D5830(2);
|
||||
sleep 40;
|
||||
ShowGotItem(SI_VAR(0), 0, 0);
|
||||
func_802D5830(0);
|
||||
return;
|
||||
});
|
||||
|
||||
Script N(802408DC) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
SI_VAR(0) = SI_VAR(10);
|
||||
if (SI_VAR(10) != 0) {
|
||||
await N(80240874);
|
||||
}
|
||||
match SI_VAR(11) {
|
||||
== 0 {
|
||||
AddItem(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
== 1 {
|
||||
AddKeyItem(SI_VAR(10));
|
||||
}
|
||||
== 2 {
|
||||
AddBadge(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
}
|
||||
sleep 15;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(802409BC) = SCRIPT({
|
||||
SI_VAR(10) = 19;
|
||||
SI_VAR(11) = 1;
|
||||
SI_SAVE_FLAG(1057) = 1;
|
||||
await N(802408DC);
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802EAE30, -225, 0, -245, 0, ITEM_NONE, MAKE_ENTITY_END);
|
||||
AssignFlag(SI_SAVE_FLAG(1057));
|
||||
AssignScript(N(802409BC));
|
||||
});
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_12/C4DEF0", func_80240000_C4DEF0);
|
||||
/*
|
||||
ApiStatus N(func_80240000_C4DEF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_80240870_C4E760);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,13 +185,12 @@ ApiStatus N(func_80240000_C4DEF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_80240870_C4E760);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
|
@ -2,3 +2,7 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_12
|
||||
|
||||
Script N(802405E0);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
|
135
src/world/area_dgb/dgb_13/C4E960.c
Normal file
135
src/world/area_dgb/dgb_13/C4E960.c
Normal file
@ -0,0 +1,135 @@
|
||||
#include "dgb_13.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -450.0f, 0.0f, -40.0f, 0.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_13_tattle,
|
||||
};
|
||||
|
||||
Script N(80240050) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_E8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitWalk_802400F0) = EXIT_WALK_SCRIPT(26, 0, "dgb_03", 5);
|
||||
|
||||
Script N(8024014C) = SCRIPT({
|
||||
bind N(exitWalk_802400F0) to TRIGGER_FLOOR_ABOVE 5;
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(80240270);
|
||||
ModifyColliderFlags(0, 6, 0x7FFFFE00);
|
||||
await N(80240680);
|
||||
spawn N(80240050);
|
||||
SI_VAR(0) = N(8024014C);
|
||||
spawn EnterWalk;
|
||||
sleep 1;
|
||||
});
|
||||
|
||||
Script N(80240270) = SCRIPT({
|
||||
MakeItemEntity(ITEM_MEGA_RUSH, -910, 50, -206, 17, SI_SAVE_FLAG(1058));
|
||||
MakeItemEntity(ITEM_COIN, -530, 55, -190, 17, SI_SAVE_FLAG(1059));
|
||||
MakeItemEntity(ITEM_COIN, -510, 55, -175, 17, SI_SAVE_FLAG(1060));
|
||||
MakeItemEntity(ITEM_COIN, -510, 55, -205, 17, SI_SAVE_FLAG(1061));
|
||||
MakeItemEntity(ITEM_COIN, -490, 55, -160, 17, SI_SAVE_FLAG(1062));
|
||||
MakeItemEntity(ITEM_COIN, -490, 55, -190, 17, SI_SAVE_FLAG(1063));
|
||||
MakeItemEntity(ITEM_COIN, -490, 55, -220, 17, SI_SAVE_FLAG(1064));
|
||||
});
|
||||
|
||||
static s32 N(pad_37C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(80240380) = SCRIPT({
|
||||
MakeLerp(0, 30, 15, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateGroup(47, 0, 0, SI_VAR(0));
|
||||
UpdateColliderTransform(13);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(80240424) = SCRIPT({
|
||||
MakeLerp(30, 0, 15, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateGroup(47, 0, 0, SI_VAR(0));
|
||||
UpdateColliderTransform(13);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(802404C8) = SCRIPT({
|
||||
MakeLerp(0, 30, 15, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateGroup(53, 0, 0, SI_VAR(0));
|
||||
UpdateColliderTransform(17);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(8024056C) = SCRIPT({
|
||||
MakeLerp(30, 0, 15, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
TranslateGroup(53, 0, 0, SI_VAR(0));
|
||||
UpdateColliderTransform(17);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(80240610) = SCRIPT({
|
||||
if (SI_MAP_VAR(0) == 0) {
|
||||
await N(80240380);
|
||||
SI_MAP_VAR(0) = 1;
|
||||
} else {
|
||||
await N(80240424);
|
||||
SI_MAP_VAR(0) = 0;
|
||||
}
|
||||
unbind;
|
||||
});
|
||||
|
||||
Script N(80240680) = SCRIPT({
|
||||
ParentColliderToModel(13, 44);
|
||||
bind N(80240610) to TRIGGER_WALL_PRESS_A 13;
|
||||
});
|
8
src/world/area_dgb/dgb_13/dgb_13.h
Normal file
8
src/world/area_dgb/dgb_13/dgb_13.h
Normal file
@ -0,0 +1,8 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_13
|
||||
|
||||
Script N(80240270);
|
||||
Script N(80240680);
|
||||
Script N(main);
|
108
src/world/area_dgb/dgb_14/C4F030.c
Normal file
108
src/world/area_dgb/dgb_14/C4F030.c
Normal file
@ -0,0 +1,108 @@
|
||||
#include "dgb_14.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ 575.0f, 0.0f, 180.0f, 270.0f },
|
||||
{ 575.0f, 210.0f, 180.0f, 270.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_14_tattle,
|
||||
};
|
||||
|
||||
Script N(80240060) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_F8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitDoubleDoor_80240100) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 1;
|
||||
SI_VAR(1) = 14;
|
||||
SI_VAR(2) = 24;
|
||||
SI_VAR(3) = 22;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_03", 3);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitDoubleDoor_802401B4) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 18;
|
||||
SI_VAR(2) = 19;
|
||||
SI_VAR(3) = 17;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_15", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterDoubleDoor_80240268) = SCRIPT({
|
||||
UseDoorSounds(3);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 24;
|
||||
SI_VAR(3) = 22;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 1 {
|
||||
DisablePlayerInput(TRUE);
|
||||
SI_VAR(2) = 19;
|
||||
SI_VAR(3) = 17;
|
||||
await EnterDoubleDoor;
|
||||
if (SI_AREA_FLAG(1) == 1) {
|
||||
sleep 5;
|
||||
SetPlayerAnimation(ANIM_8001D);
|
||||
sleep 20;
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
}
|
||||
DisablePlayerInput(FALSE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(makeEntities);
|
||||
spawn N(80240060);
|
||||
bind N(exitDoubleDoor_80240100) to TRIGGER_WALL_PRESS_A 14;
|
||||
bind N(exitDoubleDoor_802401B4) to TRIGGER_WALL_PRESS_A 18;
|
||||
spawn N(enterDoubleDoor_80240268);
|
||||
});
|
||||
|
||||
static s32 N(pad_47C) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802EA564, 500, 60, 75, 0, ITEM_MAPLE_SYRUP, MAKE_ENTITY_END);
|
||||
AssignBlockFlag(SI_SAVE_FLAG(1065));
|
||||
});
|
7
src/world/area_dgb/dgb_14/dgb_14.h
Normal file
7
src/world/area_dgb/dgb_14/dgb_14.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_14
|
||||
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
@ -1,4 +1,448 @@
|
||||
#include "dgb_15.h"
|
||||
#include "message_ids.h"
|
||||
#include "sprite/npc/world_tubba.h"
|
||||
|
||||
extern s16 D_8009A634;
|
||||
|
||||
enum {
|
||||
NPC_WORLD_TUBBA,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -1290.0f, 0.0f, 180.0f, 90.0f },
|
||||
{ 125.0f, 0.0f, 180.0f, 270.0f },
|
||||
{ 0.0f, 0.0f, 88.0f, 180.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_15_tattle,
|
||||
};
|
||||
|
||||
Script N(802418E0) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
if (SI_SAVE_VAR(203) == 15) {
|
||||
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
|
||||
} else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_19B4)[] = {
|
||||
0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32 N(itemList_802419C0)[] = {
|
||||
ITEM_CASTLE_KEY1,
|
||||
ITEM_NONE,
|
||||
};
|
||||
|
||||
Script N(exitDoubleDoor_802419C8) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 19;
|
||||
SI_VAR(2) = 12;
|
||||
SI_VAR(3) = 14;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_14", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitDoubleDoor_80241A7C) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 1;
|
||||
SI_VAR(1) = 10;
|
||||
SI_VAR(2) = 19;
|
||||
SI_VAR(3) = 17;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_17", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitSingleDoor_80241B30) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(0) = 2;
|
||||
SI_VAR(1) = 6;
|
||||
SI_VAR(2) = 22;
|
||||
SI_VAR(3) = 1;
|
||||
spawn ExitSingleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_16", 0);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
const N(pad_XXXX)[] = { 0, 0 };
|
||||
|
||||
// *INDENT-OFF*
|
||||
Script N(80241BE4) = {
|
||||
SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitDoubleDoor_802419C8), TRIGGER_WALL_PRESS_A, 19, 1, 0),
|
||||
SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitSingleDoor_80241B30), TRIGGER_WALL_PRESS_A, 6, 1, 0),
|
||||
SI_CMD(ScriptOpcode_IF_EQ, SI_SAVE_FLAG(1066), 0),
|
||||
SI_CMD(ScriptOpcode_BIND_PADLOCK, N(80242AD0), TRIGGER_WALL_PRESS_A, 16384, N(itemList_802419C0), 0, 1),
|
||||
SI_CMD(ScriptOpcode_ELSE),
|
||||
SI_CMD(ScriptOpcode_BIND_TRIGGER, N(exitDoubleDoor_80241A7C), TRIGGER_WALL_PRESS_A, 10, 1, 0),
|
||||
SI_CMD(ScriptOpcode_END_IF),
|
||||
SI_CMD(ScriptOpcode_RETURN),
|
||||
SI_CMD(ScriptOpcode_END)
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
Script N(enterSingleDoor_80241C88) = SCRIPT({
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(2) = 12;
|
||||
SI_VAR(3) = 14;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 1 {
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(2) = 19;
|
||||
SI_VAR(3) = 17;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 2 {
|
||||
UseDoorSounds(0);
|
||||
SI_VAR(2) = 22;
|
||||
SI_VAR(3) = 1;
|
||||
await EnterSingleDoor;
|
||||
}
|
||||
}
|
||||
spawn N(80241BE4);
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SI_AREA_FLAG(1) = 0;
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
if (SI_SAVE_FLAG(1068) == 0) {
|
||||
MakeNpcs(1, N(npcGroupList_80242AB0));
|
||||
}
|
||||
await N(makeEntities);
|
||||
spawn N(802418E0);
|
||||
spawn N(enterSingleDoor_80241C88);
|
||||
});
|
||||
|
||||
static s32 N(pad_1E94)[] = {
|
||||
0x00000000, 0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(80241EA0) = SCRIPT({
|
||||
GetBattleOutcome(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
== 2 {
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
func_80045900(1);
|
||||
}
|
||||
== 3 {
|
||||
SetEnemyFlagBits(-1, 16, 1);
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
s32 N(unk_missing_80241F5C)[] = {
|
||||
0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x0039000C, 0x00390007, 0x00390008, 0x00390011,
|
||||
0x00390012, 0xFFFFFFFF, 0x00390000, 0xFFFFFFFF,
|
||||
};
|
||||
|
||||
s32 N(D_80241F8C_C5149C)[] = {
|
||||
0x3FC00000, 0x00000078, 0x0000001E, 0x42AA0000, 0x42820000, 0x00000005, 0x40600000, 0x0000005A,
|
||||
0x0000000C, 0x42DC0000, 0x42B40000, 0x00000003,
|
||||
};
|
||||
|
||||
Script N(80241FBC) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
SetSelfVar(1, 5);
|
||||
SetSelfVar(2, 8);
|
||||
SetSelfVar(3, 12);
|
||||
N(func_8024061C_C4FB2C)(N(D_80241F8C_C5149C));
|
||||
});
|
||||
|
||||
s32 N(unk_missing_8024202C)[] = {
|
||||
0x00000000, 0x00240022, 0x00000000, 0x00000000, N(80241FBC), 0x80077F70, 0x00000000, 0x8007809C,
|
||||
0x00000000, 0x00000000, 0x000D0000,
|
||||
};
|
||||
|
||||
Script N(80242058) = SCRIPT({
|
||||
EnableNpcShadow(NPC_SELF, FALSE);
|
||||
SetSelfVar(0, 4);
|
||||
SetSelfVar(1, 32);
|
||||
SetSelfVar(2, 50);
|
||||
SetSelfVar(3, 32);
|
||||
SetSelfVar(4, 3);
|
||||
SetSelfVar(15, 8389);
|
||||
N(update_starpoints_display_C4F8CC)();
|
||||
});
|
||||
|
||||
s32 N(unk_missing_80242100)[] = {
|
||||
0x00000000, 0x000E0012, 0x00000000, 0x00000000, N(80242058), 0x00000000, 0x00000000, N(80241EA0),
|
||||
0x00000000, 0x00000000, 0x000D0008,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_8024212C) = {
|
||||
.height = 90,
|
||||
.radius = 65,
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
s32 N(unk_missing_80242158)[] = {
|
||||
0x00000000, 0x00180018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x000D0000,
|
||||
};
|
||||
|
||||
Script N(80242184) = SCRIPT({
|
||||
loop {
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetNpcPos(NPC_WORLD_TUBBA, SI_VAR(1), SI_VAR(2), SI_VAR(3));
|
||||
SI_VAR(1) -= SI_VAR(0);
|
||||
if (SI_VAR(1) < 150) {
|
||||
break loop;
|
||||
}
|
||||
sleep 1;
|
||||
}
|
||||
SI_SAVE_FLAG(1067) = 1;
|
||||
SI_AREA_FLAG(1) = 1;
|
||||
});
|
||||
|
||||
Script N(idle_80242238) = SCRIPT({
|
||||
loop {
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
if (SI_VAR(0) >= -1150) {
|
||||
break loop;
|
||||
}
|
||||
sleep 1;
|
||||
}
|
||||
DisablePlayerInput(TRUE);
|
||||
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
|
||||
sleep 15;
|
||||
spawn {
|
||||
UseSettingsFrom(0, -50, 0, 180);
|
||||
SetCamSpeed(0, 2.0);
|
||||
SetPanTarget(0, -50, 0, 180);
|
||||
PanToTarget(0, 0, 1);
|
||||
}
|
||||
SI_SAVE_VAR(203) = 15;
|
||||
SetNpcPos(NPC_SELF, 0, 0, 88);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
SetNpcYaw(NPC_SELF, 270);
|
||||
NpcMoveTo(NPC_SELF, -53, 180, 60);
|
||||
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
sleep 15;
|
||||
SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 0, MESSAGE_ID(0x0E, 0x00F3));
|
||||
sleep 15;
|
||||
spawn {
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamSpeed(0, 2.0);
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
DisablePlayerInput(FALSE);
|
||||
}
|
||||
BindNpcAI(NPC_SELF, N(npcAI_8024274C));
|
||||
});
|
||||
|
||||
Script N(802424E8) = SCRIPT({
|
||||
GetNpcPos(NPC_SELF, SI_VAR(6), SI_VAR(7), SI_VAR(8));
|
||||
loop {
|
||||
sleep 1;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
GetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
if (SI_VAR(3) != SI_VAR(6)) {
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_20F6, 65538);
|
||||
GetDist2D(SI_VAR(10), SI_VAR(0), SI_VAR(2), SI_VAR(3), SI_VAR(5));
|
||||
match SI_VAR(10) {
|
||||
< 200 {
|
||||
spawn {
|
||||
ShakeCam(0, 0, 5, 1.6005859375);
|
||||
sleep 5;
|
||||
ShakeCam(0, 0, 2, 0.80078125);
|
||||
}
|
||||
}
|
||||
< 300 {
|
||||
spawn {
|
||||
ShakeCam(0, 0, 5, 0.6005859375);
|
||||
sleep 5;
|
||||
ShakeCam(0, 0, 2, 0.30078125);
|
||||
}
|
||||
}
|
||||
>= 300 {
|
||||
spawn {
|
||||
ShakeCam(0, 0, 5, 0.1005859375);
|
||||
sleep 5;
|
||||
ShakeCam(0, 0, 2, 0.05078125);
|
||||
}
|
||||
}
|
||||
}
|
||||
sleep 12;
|
||||
} else {
|
||||
}
|
||||
GetNpcPos(NPC_SELF, SI_VAR(6), SI_VAR(7), SI_VAR(8));
|
||||
}
|
||||
});
|
||||
|
||||
NpcAISettings N(npcAISettings_8024271C) = {
|
||||
.moveSpeed = 3.0f,
|
||||
.moveTime = 30,
|
||||
.waitTime = 30,
|
||||
.alertRadius = 150.0f,
|
||||
.unk_10 = { .f = 80.0f },
|
||||
.unk_14 = 1,
|
||||
.chaseSpeed = 3.5f,
|
||||
.unk_1C = { .s = 180 },
|
||||
.unk_20 = 2,
|
||||
.chaseRadius = 160.0f,
|
||||
.unk_28 = { .f = 80.0f },
|
||||
.unk_2C = 1,
|
||||
};
|
||||
|
||||
Script N(npcAI_8024274C) = SCRIPT({
|
||||
spawn N(80242184);
|
||||
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_200)), TRUE);
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_C));
|
||||
spawn N(802424E8);
|
||||
N(func_80241464_C50974)(N(npcAISettings_8024271C));
|
||||
});
|
||||
|
||||
const char N(dgb_14_name_hack)[];
|
||||
|
||||
Script N(defeat_802427B0) = SCRIPT({
|
||||
N(UnkFunc1)();
|
||||
GotoMap(N(dgb_14_name_hack), 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(init_802427EC) = SCRIPT({
|
||||
if (STORY_PROGRESS != STORY_CH3_ARRIVED_AT_TUBBAS_MANOR) {
|
||||
RemoveNpc(NPC_SELF);
|
||||
return;
|
||||
}
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.25, 1.25);
|
||||
if (SI_SAVE_VAR(203) != 15) {
|
||||
BindNpcIdle(NPC_SELF, N(idle_80242238));
|
||||
} else {
|
||||
SetNpcPos(NPC_SELF, -310, 0, 180);
|
||||
BindNpcIdle(NPC_SELF, N(npcAI_8024274C));
|
||||
}
|
||||
BindNpcDefeat(NPC_SELF, N(defeat_802427B0));
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_802428C0) = {
|
||||
.id = NPC_WORLD_TUBBA,
|
||||
.settings = &N(npcSettings_8024212C),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_100 | NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
|
||||
.init = &N(init_802427EC),
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.itemDropChance = 5,
|
||||
.itemDrops = {
|
||||
{ ITEM_SUPER_SHROOM, 10, 0 },
|
||||
},
|
||||
.heartDrops = STANDARD_HEART_DROPS(3),
|
||||
.flowerDrops = STANDARD_FLOWER_DROPS(2),
|
||||
.minCoinBonus = 2,
|
||||
.maxCoinBonus = 3,
|
||||
.movement = { 7, -500, 0, 200, -700, 0, 200, -900, 0, 200, -1000, 0, 200, -800, 0, 200, -600, 0, 200, -400, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, -500, 0, 200, 1000, 250, 1, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_6),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_9),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_C),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_0),
|
||||
},
|
||||
.unk_1E0 = { 00, 00, 00, 02, 00, 00, 00, 00},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_80242AB0) = {
|
||||
NPC_GROUP(N(npcGroup_802428C0), BATTLE_ID(15, 4, 0, 1)),
|
||||
{},
|
||||
};
|
||||
|
||||
static s32 N(pad_2AC8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(80242AD0) = SCRIPT({
|
||||
group 0;
|
||||
suspend group 1;
|
||||
func_802D6420();
|
||||
if (SI_VAR(0) == 0) {
|
||||
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00D8), 160, 40);
|
||||
func_802D6954();
|
||||
resume group 1;
|
||||
return;
|
||||
}
|
||||
if (SI_VAR(0) == -1) {
|
||||
func_802D6954();
|
||||
resume group 1;
|
||||
return;
|
||||
}
|
||||
FindKeyItem(19, SI_VAR(0));
|
||||
RemoveKeyItemAt(SI_VAR(0));
|
||||
func_802D6954();
|
||||
SI_SAVE_FLAG(1066) = 1;
|
||||
N(GetEntityPosition)(SI_MAP_VAR(0), SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PlaySoundAt(0x269, 0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SI_VAR(0) = SI_MAP_VAR(0);
|
||||
N(SetEntityFlags100000)();
|
||||
resume group 1;
|
||||
unbind;
|
||||
});
|
||||
|
||||
Script N(80242C38) = SCRIPT({
|
||||
bind N(exitDoubleDoor_80241A7C) to TRIGGER_WALL_PRESS_A 10;
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
if (SI_SAVE_FLAG(1066) == 0) {
|
||||
MakeEntity(0x802BCD68, 130, 8, 175, -80, MAKE_ENTITY_END);
|
||||
AssignScript(N(80242C38));
|
||||
SI_MAP_VAR(0) = SI_VAR(0);
|
||||
}
|
||||
});
|
||||
|
||||
#include "world/common/UnkNpcAIFunc6.inc.c"
|
||||
|
||||
@ -8,15 +452,202 @@
|
||||
|
||||
#include "world/common/UnkNpcAIFunc5.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240208_C4F718);
|
||||
s32 N(func_80240208_C4F718)(ScriptInstance *script) {
|
||||
PlayerStatus** playerStatus = &gPlayerStatusPtr;
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Camera* camera = CAM2(D_8009A634);
|
||||
Enemy* enemy2 = get_enemy(enemy->npcID + 1);
|
||||
f32 phi_f20;
|
||||
s32 ret = TRUE;
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", update_starpoints_display_C4F8CC);
|
||||
if (dist2D(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z) > enemy2->varTable[2]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_8024061C_C4FB2C);
|
||||
if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) {
|
||||
phi_f20 = 90.0f;
|
||||
} else {
|
||||
phi_f20 = 270.0f;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_802408D0_C4FDE0);
|
||||
/*
|
||||
ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, (*playerStatus)->position.x, (*playerStatus)->position.z))) > enemy2->varTable[3]) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - (*playerStatus)->position.y)) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
if (D_8010EBB0.unk_03 == 9) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
if (D_8010EBB0.unk_03 == 7) {
|
||||
ret = FALSE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ApiStatus N(update_starpoints_display_C4F8CC)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Enemy* enemy2;
|
||||
Npc* npc2;
|
||||
f32 posX, posZ;
|
||||
s32 func;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->flags |= 0x102;
|
||||
enemy->flags |= 0x1F300000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
if (enemy->unk_B0 & 4) {
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
}
|
||||
|
||||
func = script->functionTemp[0].s;
|
||||
switch (func) {
|
||||
case 0:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
npc2 = get_npc_unsafe(enemy2->npcID);
|
||||
enemy->unk_07 = 1;
|
||||
if (enemy2->varTable[0] == 3) {
|
||||
if (enemy->varTable[15] != 0) {
|
||||
func_800494C0(npc2, enemy->varTable[15], 0);
|
||||
}
|
||||
posX = npc2->pos.x;
|
||||
posZ = npc2->pos.z;
|
||||
add_vec2D_polar(&posX, &posZ, enemy->varTable[1], 270.0f - npc2->unk_34);
|
||||
|
||||
npc->pos.x = posX;
|
||||
enemy->unk_10.x = npc->pos.x;
|
||||
|
||||
npc->pos.y = npc2->pos.y + enemy->varTable[0];
|
||||
enemy->unk_10.y = npc->pos.y;
|
||||
|
||||
npc->pos.z = posZ;
|
||||
enemy->unk_10.z = npc->pos.z;
|
||||
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
enemy->flags &= 0xE0EFFFFF;
|
||||
npc->duration = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
enemy2 = get_enemy(enemy->npcID - 1);
|
||||
get_npc_unsafe(enemy2->npcID);
|
||||
npc->duration++;
|
||||
if (npc->duration >= enemy->varTable[4]) {
|
||||
enemy->unk_07 = 0;
|
||||
}
|
||||
if (enemy2->varTable[0] == 4) {
|
||||
enemy->flags |= 0x1F100000;
|
||||
npc->pos.x = 0.0f;
|
||||
npc->pos.y = -1000.0f;
|
||||
npc->pos.z = 0.0f;
|
||||
enemy->unk_07 = func;
|
||||
script->functionTemp[0].s = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->wander.detectShape;
|
||||
territory.pointX = enemy->territory->wander.detect.x;
|
||||
territory.pointZ = enemy->territory->wander.detect.z;
|
||||
territory.sizeX = enemy->territory->wander.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->wander.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || (enemy->unk_B0 & 4)) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->wander.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~0x8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 0x8;
|
||||
}
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
}
|
||||
enemy->varTable[0] = 0;
|
||||
}
|
||||
|
||||
if ((script->functionTemp[0].s < 30) && (enemy->varTable[0] == 0) && N(func_80240208_C4F718)(script)) {
|
||||
script->functionTemp[0].s = 30;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
func_800495A0(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
func_800496B8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
base_UnkNpcAIFunc1(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
func_80049C04(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
func_80049E3C(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
func_80049ECC(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
func_80049F7C(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
func_8004A124(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
func_8004A3E8(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 30:
|
||||
N(UnkNpcAIFunc6)(script);
|
||||
case 31:
|
||||
N(UnkNpcAIFunc7)(script);
|
||||
if (script->functionTemp[0].s != 32) {
|
||||
break;
|
||||
}
|
||||
case 32:
|
||||
N(UnkNpcAIFunc8)(script);
|
||||
if (script->functionTemp[0].s != 33) {
|
||||
break;
|
||||
}
|
||||
case 33:
|
||||
N(UnkNpcAIFunc5)(script);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 ret;
|
||||
@ -48,12 +679,9 @@ ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
}
|
||||
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240A28_C4FF38);
|
||||
/*
|
||||
void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -63,7 +691,7 @@ void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -101,18 +729,15 @@ void N(func_80240A28_C4FF38)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240D90_C502A0);
|
||||
/*
|
||||
void N(func_80240D90_C502A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -136,11 +761,8 @@ void N(func_80240D90_C502A0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80240F4C_C5045C);
|
||||
/*
|
||||
ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
@ -155,9 +777,8 @@ ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
||||
}
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/NpcJumpFunc2.inc.c"
|
||||
|
||||
@ -165,14 +786,12 @@ ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
#include "world/common/UnkNpcAIFunc13.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_8024121C_C5072C);
|
||||
/*
|
||||
ApiStatus N(func_8024121C_C5072C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_8024121C_C5072C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
@ -187,12 +806,9 @@ ApiStatus N(func_8024121C_C5072C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/UnkNpcDurationFlagFunc.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_802413A4_C508B4);
|
||||
/*
|
||||
void N(func_802413A4_C508B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -210,8 +826,91 @@ void N(func_802413A4_C508B4)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
script->functionTemp[1].s = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_15/C4F510", func_80241464_C50974);
|
||||
ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
f32 posX, posY, posZ, posW;
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->patrol.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 8;
|
||||
}
|
||||
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
} else if (enemy->flags & 0x40000000) {
|
||||
script->functionTemp[0].s = 12;
|
||||
enemy->flags &= 0xBFFFFFFF;
|
||||
}
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + npc->collisionHeight;
|
||||
posZ = npc->pos.z;
|
||||
posW = 100.0f;
|
||||
|
||||
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(func_802408D0_C4FDE0)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(func_80240A28_C4FF38)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(func_80240D90_C502A0)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(func_80240F4C_C5045C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
N(NpcJumpFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
N(func_8024121C_C5072C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 15:
|
||||
N(func_802413A4_C508B4)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
#include "world/common/UnkFunc1.inc.c"
|
||||
|
||||
const char N(dgb_14_name_hack)[] = "dgb_14";
|
||||
|
@ -2,3 +2,17 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_15
|
||||
|
||||
ApiStatus N(GetEntityPosition)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(SetEntityFlags100000)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(UnkFunc1)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(update_starpoints_display_C4F8CC)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_80242AB0);
|
||||
Script N(80242AD0);
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
||||
Script N(npcAI_8024274C);
|
||||
Script N(unk_80241F8C);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,3 +2,10 @@
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_16
|
||||
|
||||
ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall);
|
||||
ApiStatus N(update_starpoints_display_C528FC)(ScriptInstance* script, s32 isInitialCall);
|
||||
|
||||
NpcGroupList N(npcGroupList_8024318C);
|
||||
Script N(80241780);
|
||||
Script N(main);
|
||||
|
106
src/world/area_dgb/dgb_17/C55A60.c
Normal file
106
src/world/area_dgb/dgb_17/C55A60.c
Normal file
@ -0,0 +1,106 @@
|
||||
#include "dgb_17.h"
|
||||
#include "message_ids.h"
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -570.0f, 0.0f, 180.0f, 90.0f },
|
||||
{ -180.0f, 0.0f, 180.0f, 270.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = MSG_dgb_17_tattle,
|
||||
};
|
||||
|
||||
Script N(80240060) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_F8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitDoubleDoor_80240100) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 7;
|
||||
SI_VAR(2) = 14;
|
||||
SI_VAR(3) = 16;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_15", 1);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(exitDoubleDoor_802401B4) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 1;
|
||||
SI_VAR(1) = 11;
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = 19;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_01", 5);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(80240268) = SCRIPT({
|
||||
bind N(exitDoubleDoor_80240100) to TRIGGER_WALL_PRESS_A 7;
|
||||
bind N(exitDoubleDoor_802401B4) to TRIGGER_WALL_PRESS_A 11;
|
||||
});
|
||||
|
||||
Script N(enterDoubleDoor_802402B0) = SCRIPT({
|
||||
GetLoadType(SI_VAR(1));
|
||||
if (SI_VAR(1) == 1) {
|
||||
spawn EnterSavePoint;
|
||||
spawn N(80240268);
|
||||
return;
|
||||
}
|
||||
UseDoorSounds(3);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 14;
|
||||
SI_VAR(3) = 16;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
== 1 {
|
||||
SI_VAR(2) = 21;
|
||||
SI_VAR(3) = 19;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
}
|
||||
spawn N(80240268);
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
await N(makeEntities);
|
||||
spawn N(80240060);
|
||||
spawn N(enterDoubleDoor_802402B0);
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802E9A18, -300, 60, 75, 0, MAKE_ENTITY_END);
|
||||
MakeEntity(0x802EA7E0, -450, 60, 75, 0, MAKE_ENTITY_END);
|
||||
});
|
7
src/world/area_dgb/dgb_17/dgb_17.h
Normal file
7
src/world/area_dgb/dgb_17/dgb_17.h
Normal file
@ -0,0 +1,7 @@
|
||||
#include "common.h"
|
||||
#include "map.h"
|
||||
|
||||
#define NAMESPACE dgb_17
|
||||
|
||||
Script N(main);
|
||||
Script N(makeEntities);
|
@ -1,8 +1,690 @@
|
||||
#include "dgb_18.h"
|
||||
#include "message_ids.h"
|
||||
#include "sprite/npc/world_bombette.h"
|
||||
#include "sprite/npc/world_bow.h"
|
||||
#include "sprite/npc/world_goombario.h"
|
||||
#include "sprite/npc/world_kooper.h"
|
||||
#include "sprite/npc/world_parakarry.h"
|
||||
#include "sprite/npc/world_tubba.h"
|
||||
#include "sprite/npc/yakkey.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240000_C55F40);
|
||||
/*
|
||||
ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, s32 isInitialCall) {
|
||||
enum {
|
||||
NPC_WORLD_TUBBA,
|
||||
NPC_YAKKEY,
|
||||
};
|
||||
|
||||
EntryList N(entryList) = {
|
||||
{ -120.0f, 0.0f, 180.0f, 90.0f },
|
||||
};
|
||||
|
||||
MapConfig N(config) = {
|
||||
.main = N(main),
|
||||
.entryList = N(entryList),
|
||||
.entryCount = ENTRY_COUNT(N(entryList)),
|
||||
.tattle = 0x1900D2,
|
||||
};
|
||||
|
||||
Script N(802412C0) = SCRIPT({
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
}
|
||||
else {
|
||||
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static s32 N(pad_1358)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
Script N(exitDoubleDoor_80241360) = SCRIPT({
|
||||
group 27;
|
||||
DisablePlayerInput(TRUE);
|
||||
UseDoorSounds(3);
|
||||
SI_VAR(0) = 0;
|
||||
SI_VAR(1) = 17;
|
||||
SI_VAR(2) = 8;
|
||||
SI_VAR(3) = 10;
|
||||
spawn ExitDoubleDoor;
|
||||
sleep 17;
|
||||
GotoMap("dgb_01", 6);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
Script N(enterDoubleDoor_80241414) = SCRIPT({
|
||||
UseDoorSounds(3);
|
||||
GetEntryID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 0 {
|
||||
SI_VAR(2) = 8;
|
||||
SI_VAR(3) = 10;
|
||||
await EnterDoubleDoor;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(main) = SCRIPT({
|
||||
WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
|
||||
SetSpriteShading(-1);
|
||||
SetCamPerspective(0, 3, 25, 16, 4096);
|
||||
SetCamBGColor(0, 0, 0, 0);
|
||||
SetCamEnabled(0, 1);
|
||||
SetCamLeadPlayer(0, 0);
|
||||
MakeNpcs(1, N(npcGroupList_802436B4));
|
||||
await N(makeEntities);
|
||||
spawn N(802412C0);
|
||||
bind N(exitDoubleDoor_80241360) to TRIGGER_WALL_PRESS_A 17;
|
||||
spawn N(enterDoubleDoor_80241414);
|
||||
});
|
||||
|
||||
static s32 N(pad_1578)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
NpcAISettings N(npcAISettings_80241580) = {
|
||||
.moveSpeed = 4.5f,
|
||||
.alertRadius = 170.0f,
|
||||
.unk_10 = { .f = 90.0f },
|
||||
.unk_14 = 1,
|
||||
.chaseSpeed = 3.9f,
|
||||
.unk_1C = { .s = 180 },
|
||||
.unk_20 = 2,
|
||||
.chaseRadius = 170.0f,
|
||||
.unk_28 = { .f = 90.0f },
|
||||
.unk_2C = 1,
|
||||
};
|
||||
|
||||
Script N(802415B0) = SCRIPT({
|
||||
N(func_80240B94_C56AD4)(N(npcAISettings_80241580));
|
||||
});
|
||||
|
||||
NpcSettings N(npcSettings_802415D0) = {
|
||||
.height = 90,
|
||||
.radius = 65,
|
||||
.ai = &N(802415B0),
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_802415FC) = {
|
||||
.height = 90,
|
||||
.radius = 65,
|
||||
.onHit = EnemyNpcHit,
|
||||
.onDefeat = EnemyNpcDefeat,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
NpcSettings N(npcSettings_80241628) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 13,
|
||||
};
|
||||
|
||||
Script N(idle_80241654) = SCRIPT({
|
||||
10:
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
if (SI_VAR(0) < 700) {
|
||||
goto 10;
|
||||
}
|
||||
if (SI_VAR(2) > 185) {
|
||||
goto 10;
|
||||
}
|
||||
DisablePlayerInput(TRUE);
|
||||
sleep 10;
|
||||
spawn {
|
||||
sleep 10;
|
||||
InterpPlayerYaw(270, 0);
|
||||
}
|
||||
FadeOutMusic(0, 500);
|
||||
loop 3 {
|
||||
SetPlayerAnimation(ANIM_8001E);
|
||||
PlaySoundAt(SOUND_UNKNOWN_20F6, 0, 382, 0, 218);
|
||||
ShakeCam(0, 0, 5, 1.0);
|
||||
sleep 20;
|
||||
SetPlayerAnimation(ANIM_10002);
|
||||
sleep 10;
|
||||
}
|
||||
loop 2 {
|
||||
InterpPlayerYaw(270, 0);
|
||||
sleep 10;
|
||||
InterpPlayerYaw(90, 0);
|
||||
sleep 10;
|
||||
}
|
||||
UseSettingsFrom(0, -40, 0, 180);
|
||||
SetCamSpeed(0, 90.0);
|
||||
SetPanTarget(0, -40, 0, 180);
|
||||
PanToTarget(0, 0, 1);
|
||||
WaitForCam(0, 1.0);
|
||||
SetPlayerPos(740, 0, 180);
|
||||
SetNpcPos(NPC_PARTNER, 765, 0, 180);
|
||||
InterpPlayerYaw(270, 0);
|
||||
InterpNpcYaw(NPC_PARTNER, 270, 0);
|
||||
SetPlayerAnimation(ANIM_8000C);
|
||||
PlaySoundAtCollider(17, 455, 0);
|
||||
MakeLerp(0, 80, 10, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
RotateModel(8, SI_VAR(0), 0, -1, 0);
|
||||
RotateModel(10, SI_VAR(0), 0, 1, 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
spawn {
|
||||
loop 3 {
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_20F6, 0);
|
||||
ShakeCam(0, 0, 5, 0.30078125);
|
||||
sleep 5;
|
||||
}
|
||||
}
|
||||
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
SetNpcPos(NPC_SELF, -210, 0, 180);
|
||||
NpcMoveTo(NPC_SELF, -60, 180, 30);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
spawn {
|
||||
MakeLerp(80, 0, 10, 0);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
RotateModel(8, SI_VAR(0), 0, -1, 0);
|
||||
RotateModel(10, SI_VAR(0), 0, 1, 0);
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
PlaySoundAtCollider(17, 456, 0);
|
||||
}
|
||||
sleep 20;
|
||||
SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 5, MESSAGE_ID(0x0E, 0x00F4));
|
||||
sleep 20;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_9));
|
||||
SetSelfVar(0, 0);
|
||||
spawn {
|
||||
loop {
|
||||
GetSelfVar(0, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_20F6, 0);
|
||||
ShakeCam(0, 0, 5, 0.30078125);
|
||||
sleep 9;
|
||||
GetSelfVar(0, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_20F6, 0);
|
||||
ShakeCam(0, 0, 2, 0.150390625);
|
||||
sleep 12;
|
||||
}
|
||||
}
|
||||
spawn {
|
||||
loop {
|
||||
GetNpcPos(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
GetSelfVar(0, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetNpcSpeed(NPC_SELF, 4.0);
|
||||
NpcMoveTo(NPC_SELF, 45, 215, 0);
|
||||
NpcMoveTo(NPC_SELF, 140, 245, 0);
|
||||
NpcMoveTo(NPC_SELF, 615, 245, 0);
|
||||
SetSelfVar(0, 1);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_6));
|
||||
sleep 15;
|
||||
sleep 20;
|
||||
SpeakToPlayer(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_10), NPC_ANIM(world_tubba, Palette_00, Anim_6), 5, MESSAGE_ID(0x0E, 0x00F5));
|
||||
sleep 20;
|
||||
spawn {
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_14));
|
||||
sleep 5;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_15));
|
||||
sleep 5;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_16));
|
||||
sleep 5;
|
||||
}
|
||||
sleep 5;
|
||||
SetNpcJumpscale(NPC_SELF, 0.7001953125);
|
||||
NpcJump0(NPC_SELF, 600, 50, 115, 20);
|
||||
spawn {
|
||||
ShakeCam(0, 0, 5, 0.30078125);
|
||||
}
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_5));
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.2001953125, 1.25);
|
||||
sleep 1;
|
||||
SetNpcScale(NPC_SELF, 1.3505859375, 1.150390625, 1.25);
|
||||
sleep 1;
|
||||
SetNpcScale(NPC_SELF, 1.4501953125, 1.05078125, 1.25);
|
||||
sleep 1;
|
||||
SetNpcScale(NPC_SELF, 1.3505859375, 1.150390625, 1.25);
|
||||
sleep 1;
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.2001953125, 1.25);
|
||||
sleep 1;
|
||||
GetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
spawn {
|
||||
SetNpcJumpscale(NPC_SELF, 0.5);
|
||||
NpcJump0(NPC_SELF, SI_VAR(3), 30, SI_VAR(5), 23);
|
||||
}
|
||||
sleep 2;
|
||||
spawn {
|
||||
MakeLerp(0, 50, 18, 1);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
func_802CDE68(-1, SI_VAR(0));
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
}
|
||||
MakeLerp(0, -90, 18, 1);
|
||||
loop {
|
||||
UpdateLerp();
|
||||
SetNpcRotation(NPC_SELF, 0, 0, SI_VAR(0));
|
||||
sleep 1;
|
||||
if (SI_VAR(1) == 0) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
spawn {
|
||||
ShakeCam(0, 0, 10, 0.400390625);
|
||||
}
|
||||
sleep 5;
|
||||
FadeOutMusic(0, 1000);
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.25, 1.25);
|
||||
SetNpcPos(NPC_SELF, SI_VAR(3), SI_VAR(4), SI_VAR(5));
|
||||
func_802CDE68(-1, 0);
|
||||
SetNpcRotation(NPC_SELF, 0, 0, 0);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_2));
|
||||
sleep 15;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_24));
|
||||
sleep 30;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2038, 0);
|
||||
sleep 30;
|
||||
spawn {
|
||||
SetSelfVar(1, 0);
|
||||
loop {
|
||||
GetSelfVar(1, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2039, 0);
|
||||
RandInt(10, SI_VAR(1));
|
||||
SI_VAR(1) += 15;
|
||||
ShowSleepBubble(0, 0, 0, 2, 628, 121, 127, SI_VAR(1), SI_VAR(0));
|
||||
sleep 48;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2038, 0);
|
||||
RandInt(10, SI_VAR(1));
|
||||
SI_VAR(1) += 10;
|
||||
func_802D8248(SI_VAR(0), SI_VAR(1));
|
||||
sleep 30;
|
||||
}
|
||||
}
|
||||
sleep 30;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamSpeed(0, 2.0);
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
STORY_PROGRESS = STORY_CH3_TUBBA_BEGAN_NAPPING;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(idle_80242494) = SCRIPT({
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.25, 1.25);
|
||||
SetNpcPos(NPC_SELF, 600, 50, 115);
|
||||
func_802CDE68(-1, 0);
|
||||
SetNpcRotation(NPC_SELF, 0, 0, 0);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_2));
|
||||
sleep 15;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_24));
|
||||
sleep 30;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2038, 0);
|
||||
sleep 30;
|
||||
spawn {
|
||||
SetSelfVar(1, 0);
|
||||
loop {
|
||||
GetSelfVar(1, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2039, 0);
|
||||
RandInt(10, SI_VAR(1));
|
||||
SI_VAR(1) += 15;
|
||||
ShowSleepBubble(0, 0, 0, 2, 628, 121, 127, SI_VAR(1), SI_VAR(0));
|
||||
sleep 48;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2038, 0);
|
||||
RandInt(10, SI_VAR(1));
|
||||
SI_VAR(1) += 10;
|
||||
func_802D8248(SI_VAR(0), SI_VAR(1));
|
||||
sleep 30;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(npcAI_802426B0) = SCRIPT({
|
||||
group 11;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2039, 0);
|
||||
ShowSleepBubble(0, 0, 50, 2, 552, 111, 128, 30, SI_VAR(0));
|
||||
sleep 360;
|
||||
func_802D8248(SI_VAR(0), 20);
|
||||
SetNpcVar(-1, 1, 2);
|
||||
sleep 20;
|
||||
PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_2F1, 0);
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_19));
|
||||
sleep 30;
|
||||
spawn {
|
||||
NpcJump0(NPC_SELF, 650, 0, 250, 25);
|
||||
}
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_1A));
|
||||
sleep 10;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_1B));
|
||||
sleep 12;
|
||||
SetNpcAnimation(NPC_SELF, NPC_ANIM(world_tubba, Palette_00, Anim_1C));
|
||||
sleep 5;
|
||||
BindNpcAI(NPC_WORLD_TUBBA, N(npcAI_80242834));
|
||||
});
|
||||
|
||||
Script N(npcAI_80242834) = SCRIPT({
|
||||
group 11;
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_D));
|
||||
spawn {
|
||||
loop {
|
||||
ShakeCam(0, 0, 5, 2.0);
|
||||
sleep 5;
|
||||
ShakeCam(0, 0, 2, 1.0);
|
||||
sleep 8;
|
||||
}
|
||||
}
|
||||
N(func_80240B94_C56AD4)(N(npcAISettings_80241580));
|
||||
});
|
||||
|
||||
const char N(dgb_01_name_hack)[];
|
||||
|
||||
Script N(defeat_802428E8) = SCRIPT({
|
||||
N(UnkFunc1)();
|
||||
GotoMap(N(dgb_01_name_hack), 6);
|
||||
sleep 100;
|
||||
});
|
||||
|
||||
const char N(pad_XXX)[] = { 0, 0 };
|
||||
|
||||
Script N(init_80242924) = SCRIPT({
|
||||
SetNpcScale(NPC_SELF, 1.25, 1.25, 1.25);
|
||||
BindNpcDefeat(NPC_SELF, N(defeat_802428E8));
|
||||
match STORY_PROGRESS {
|
||||
< STORY_CH3_TUBBA_BEGAN_NAPPING {
|
||||
BindNpcIdle(NPC_SELF, N(idle_80241654));
|
||||
}
|
||||
< STORY_CH3_TUBBA_WOKE_UP {
|
||||
BindNpcIdle(NPC_SELF, N(idle_80242494));
|
||||
}
|
||||
< STORY_CH3_TUBBA_SMASHED_THE_BRIDGES {
|
||||
SetNpcPos(NPC_SELF, 245, 0, 250);
|
||||
SetNpcYaw(NPC_SELF, 270);
|
||||
BindNpcIdle(NPC_SELF, N(npcAI_80242834));
|
||||
}
|
||||
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
|
||||
RemoveNpc(NPC_SELF);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Script N(idle_80242A24) = SCRIPT({
|
||||
loop {
|
||||
GetSelfVar(0, SI_VAR(0));
|
||||
if (SI_VAR(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
sleep 1;
|
||||
}
|
||||
DisablePlayerInput(TRUE);
|
||||
sleep 40;
|
||||
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100)), TRUE);
|
||||
SetNpcPos(NPC_SELF, 845, 0, 140);
|
||||
SetNpcJumpscale(NPC_SELF, 0.80078125);
|
||||
NpcJump1(NPC_SELF, 845, 35, 145, 15);
|
||||
PlayerFaceNpc(-1, 0);
|
||||
sleep 15;
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamSpeed(0, 90.0);
|
||||
SetCamDistance(0, 300);
|
||||
SetCamPosB(0, 800, 245);
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
PanToTarget(0, 0, 1);
|
||||
SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00F6));
|
||||
sleep 15;
|
||||
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));
|
||||
} else {
|
||||
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);
|
||||
UseSettingsFrom(0, 740, SI_VAR(1), SI_VAR(2));
|
||||
SetCamDistance(0, 600);
|
||||
SetCamPosB(0, 800, 245);
|
||||
SetPanTarget(0, 740, SI_VAR(1), SI_VAR(2));
|
||||
WaitForCam(0, 1.0);
|
||||
spawn {
|
||||
SI_MAP_FLAG(0) = 0;
|
||||
SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 517, MESSAGE_ID(0x0E, 0x00FA));
|
||||
SI_MAP_FLAG(0) = 1;
|
||||
}
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
loop {
|
||||
SetCamDistance(0, 550.0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
SetPanTarget(0, 740, SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
SetCamDistance(0, 600.0);
|
||||
SetCamSpeed(0, 90.0);
|
||||
SetPanTarget(0, 740, SI_VAR(1), SI_VAR(2));
|
||||
sleep 1;
|
||||
if (SI_MAP_FLAG(0) == 1) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
|
||||
SetNpcVar(0, 1, 1);
|
||||
sleep 15;
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_25));
|
||||
spawn {
|
||||
loop {
|
||||
GetNpcVar(0, 1, SI_VAR(0));
|
||||
if (SI_VAR(0) == 2) {
|
||||
break loop;
|
||||
}
|
||||
RandInt(40, SI_VAR(0));
|
||||
RandInt(40, SI_VAR(1));
|
||||
SI_VAR(0) += 537;
|
||||
SI_VAR(1) += 110;
|
||||
PlayEffect(0x27, 2, SI_VAR(0), SI_VAR(1), 128, 0.30078125, 24, 0, 0, 0, 0, 0, 0, 0);
|
||||
sleep 5;
|
||||
}
|
||||
}
|
||||
sleep 15;
|
||||
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_5));
|
||||
SpeakToPlayer(NPC_WORLD_TUBBA, NPC_ANIM(world_tubba, Palette_00, Anim_13), NPC_ANIM(world_tubba, Palette_00, Anim_5), 5, MESSAGE_ID(0x0E, 0x00FB));
|
||||
sleep 15;
|
||||
DisablePartnerAI(0);
|
||||
GetCurrentPartnerID(SI_VAR(0));
|
||||
match SI_VAR(0) {
|
||||
== 1 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_goombario, normal, talk), NPC_ANIM(world_goombario, normal, idle), 0, MESSAGE_ID(0x0E, 0x00FC));
|
||||
}
|
||||
== 2 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_kooper, normal, talk), NPC_ANIM(world_kooper, normal, idle), 0, MESSAGE_ID(0x0E, 0x00FD));
|
||||
}
|
||||
== 3 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bombette, normal, idle_fast), NPC_ANIM(world_bombette, normal, idle), 0, MESSAGE_ID(0x0E, 0x00FE));
|
||||
}
|
||||
== 4 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00FF));
|
||||
}
|
||||
== 9 {
|
||||
SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x0100));
|
||||
}
|
||||
}
|
||||
EnablePartnerAI();
|
||||
sleep 15;
|
||||
BindNpcAI(NPC_WORLD_TUBBA, N(npcAI_802426B0));
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
UseSettingsFrom(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetCamSpeed(0, 4.0);
|
||||
SetPanTarget(0, SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
WaitForCam(0, 1.0);
|
||||
PanToTarget(0, 0, 0);
|
||||
GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2));
|
||||
SetNpcJumpscale(NPC_SELF, 1.0);
|
||||
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100)), TRUE);
|
||||
SI_VAR(1) -= 10;
|
||||
NpcJump0(NPC_SELF, SI_VAR(0), SI_VAR(1), SI_VAR(2), 10);
|
||||
SetNpcPos(NPC_SELF, 0, -1000, 0);
|
||||
STORY_PROGRESS = STORY_CH3_TUBBA_WOKE_UP;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(init_8024329C) = SCRIPT({
|
||||
SetSelfVar(0, 0);
|
||||
BindNpcIdle(NPC_SELF, N(idle_80242A24));
|
||||
});
|
||||
|
||||
StaticNpc N(npcGroup_802432D4) = {
|
||||
.id = NPC_WORLD_TUBBA,
|
||||
.settings = &N(npcSettings_802415FC),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_IGNORE_HEIGHT | NPC_FLAG_40000 | NPC_FLAG_200000 | NPC_FLAG_NO_DROPS,
|
||||
.init = &N(init_80242924),
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.movement = { 5, 0, 0, 240, 175, 0, 240, 350, 0, 240, 525, 0, 240, 700, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 300, 0, 240, 1000, 250, 1, 1 },
|
||||
.animations = {
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_A),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_D),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_D),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_19),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
NPC_ANIM(world_tubba, Palette_00, Anim_7),
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(npcGroup_802434C4) = {
|
||||
.id = NPC_YAKKEY,
|
||||
.settings = &N(npcSettings_80241628),
|
||||
.pos = { 0.0f, -1000.0f, 0.0f },
|
||||
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_IGNORE_HEIGHT,
|
||||
.init = &N(init_8024329C),
|
||||
.yaw = 270,
|
||||
.dropFlags = 0x80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
.animations = {
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
NPC_ANIM(yakkey, Palette_00, Anim_1),
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(npcGroupList_802436B4) = {
|
||||
NPC_GROUP(N(npcGroup_802432D4), BATTLE_ID(15, 4, 0, 0)),
|
||||
NPC_GROUP(N(npcGroup_802434C4), BATTLE_ID(0, 0, 0, 0)),
|
||||
{},
|
||||
};
|
||||
|
||||
static s32 N(pad_36D8)[] = {
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
s32 N(D_802436E0_C59620) = {
|
||||
0x00000000,
|
||||
};
|
||||
|
||||
Script N(802436E4) = SCRIPT({
|
||||
group 0;
|
||||
func_802D5830(2);
|
||||
sleep 40;
|
||||
ShowGotItem(SI_VAR(0), 0, 0);
|
||||
func_802D5830(0);
|
||||
return;
|
||||
});
|
||||
|
||||
Script N(8024374C) = SCRIPT({
|
||||
DisablePlayerInput(TRUE);
|
||||
SI_VAR(0) = SI_VAR(10);
|
||||
if (SI_VAR(10) != 0) {
|
||||
await N(802436E4);
|
||||
}
|
||||
match SI_VAR(11) {
|
||||
== 0 {
|
||||
AddItem(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
== 1 {
|
||||
AddKeyItem(SI_VAR(10));
|
||||
}
|
||||
== 2 {
|
||||
AddBadge(SI_VAR(10), SI_VAR(0));
|
||||
}
|
||||
}
|
||||
sleep 15;
|
||||
DisablePlayerInput(FALSE);
|
||||
});
|
||||
|
||||
Script N(8024382C) = SCRIPT({
|
||||
SI_SAVE_FLAG(1071) = 1;
|
||||
AddKeyItem(ITEM_MYSTICAL_KEY);
|
||||
SetNpcVar(1, 0, 1);
|
||||
});
|
||||
|
||||
Script N(makeEntities) = SCRIPT({
|
||||
MakeEntity(0x802EAE30, 845, 0, 145, -35, ITEM_NONE, MAKE_ENTITY_END);
|
||||
AssignFlag(SI_SAVE_FLAG(1071));
|
||||
AssignScript(N(8024382C));
|
||||
});
|
||||
|
||||
ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
||||
f32 ret;
|
||||
@ -34,12 +716,9 @@ ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, s32 isInitialCall) {
|
||||
}
|
||||
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240158_C56098);
|
||||
/*
|
||||
void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -49,7 +728,7 @@ void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
if (aiSettings->unk_14 >= 0) {
|
||||
if (script->functionTemp[1].s <= 0) {
|
||||
script->functionTemp[1].s = aiSettings->unk_14;
|
||||
if (func_800490B4(shape, enemy, aiSettings->alertRadius, aiSettings->unk_10.s, 0)) {
|
||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
if (enemy->npcSettings->unk_2A & 1) {
|
||||
@ -87,18 +766,15 @@ void N(func_80240158_C56098)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_802404C0_C56400);
|
||||
/*
|
||||
void N(func_802404C0_C56400)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 0)) {
|
||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
||||
func_800494C0(npc, 0x2F4, 0x200000);
|
||||
@ -122,11 +798,8 @@ void N(func_802404C0_C56400)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_8024067C_C565BC);
|
||||
/*
|
||||
ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
|
||||
@ -141,9 +814,8 @@ ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
||||
}
|
||||
script->functionTemp[0].s = 1;
|
||||
return 1;
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/NpcJumpFunc2.inc.c"
|
||||
|
||||
@ -151,14 +823,12 @@ ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
#include "world/common/UnkNpcAIFunc13.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_8024094C_C5688C);
|
||||
/*
|
||||
ApiStatus N(func_8024094C_C5688C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
ApiStatus N(func_8024094C_C5688C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
s32 var;
|
||||
|
||||
if (!func_800490B4(shape, enemy, aiSettings->chaseRadius, aiSettings->unk_28.s, 1)) {
|
||||
if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) {
|
||||
fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->duration = 25;
|
||||
@ -173,12 +843,9 @@ ApiStatus N(func_8024094C_C5688C)(ScriptInstance* script, s32 isInitialCall) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/UnkNpcDurationFlagFunc.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240AD4_C56A14);
|
||||
/*
|
||||
void N(func_80240AD4_C56A14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
@ -196,10 +863,119 @@ void N(func_80240AD4_C56A14)(ScriptInstance* script, NpcAISettings* aiSettings,
|
||||
script->functionTemp[1].s = 0;
|
||||
script->functionTemp[0].s = 1;
|
||||
}
|
||||
*/
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240B94_C56AD4);
|
||||
ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
|
||||
Enemy* enemy = script->owner1.enemy;
|
||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
EnemyTerritoryThing territory;
|
||||
EnemyTerritoryThing* territoryPtr = &territory;
|
||||
NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++);
|
||||
f32 posX, posY, posZ, posW;
|
||||
|
||||
territory.unk_00 = 0;
|
||||
territory.shape = enemy->territory->patrol.detectShape;
|
||||
territory.pointX = enemy->territory->patrol.detect.x;
|
||||
territory.pointZ = enemy->territory->patrol.detect.z;
|
||||
territory.sizeX = enemy->territory->patrol.detectSizeX;
|
||||
territory.sizeZ = enemy->territory->patrol.detectSizeZ;
|
||||
territory.unk_34 = 65.0f;
|
||||
territory.unk_1C = 0;
|
||||
|
||||
if (isInitialCall || enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 0;
|
||||
npc->duration = 0;
|
||||
npc->currentAnim = enemy->animList[0];
|
||||
npc->flags &= ~0x800;
|
||||
if (!enemy->territory->patrol.isFlying) {
|
||||
npc->flags = (npc->flags | 0x200) & ~8;
|
||||
} else {
|
||||
npc->flags = (npc->flags & ~0x200) | 8;
|
||||
}
|
||||
|
||||
if (enemy->unk_B0 & 4) {
|
||||
script->functionTemp[0].s = 99;
|
||||
script->functionTemp[1].s = 0;
|
||||
enemy->unk_B0 &= ~4;
|
||||
} else if (enemy->flags & 0x40000000) {
|
||||
script->functionTemp[0].s = 12;
|
||||
enemy->flags &= 0xBFFFFFFF;
|
||||
}
|
||||
|
||||
posX = npc->pos.x;
|
||||
posY = npc->pos.y + npc->collisionHeight;
|
||||
posZ = npc->pos.z;
|
||||
posW = 100.0f;
|
||||
|
||||
if (func_800DCB7C(npc->unk_80, &posX, &posY, &posZ, &posW)) {
|
||||
npc->pos.y = posY;
|
||||
}
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0].s) {
|
||||
case 0:
|
||||
N(func_80240000_C55F40)(script, npcAISettings, territoryPtr);
|
||||
case 1:
|
||||
N(func_80240158_C56098)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 2:
|
||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||
case 3:
|
||||
N(func_802404C0_C56400)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 4:
|
||||
N(func_8024067C_C565BC)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 10:
|
||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||
case 11:
|
||||
N(NpcJumpFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 12:
|
||||
N(UnkNpcAIFunc13)(script, npcAISettings, territoryPtr);
|
||||
case 13:
|
||||
N(func_8024094C_C5688C)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 14:
|
||||
N(UnkNpcDurationFlagFunc)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 15:
|
||||
N(func_80240AD4_C56A14)(script, npcAISettings, territoryPtr);
|
||||
break;
|
||||
case 99:
|
||||
func_8004A73C(script);
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
#include "world/common/UnkFunc1.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C55F40", func_80240EBC_C56DFC);
|
||||
ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance *script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
PlayerStatus* playerStatus2 = playerStatus;
|
||||
Npc *npc = get_npc_unsafe(0);
|
||||
f32 posX, posZ;
|
||||
|
||||
if (isInitialCall) {
|
||||
posX = npc->pos.x;
|
||||
posZ = npc->pos.z;
|
||||
npc->moveSpeed = 3.7f;
|
||||
npc->yaw = atan2(posX, posZ, playerStatus->position.x, playerStatus->position.z);
|
||||
script->functionTemp[1].s = 0;
|
||||
npc->duration = 15;
|
||||
}
|
||||
|
||||
if (script->functionTemp[1].s == 0) {
|
||||
if (npc->duration == 0) {
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus2->position.x, playerStatus2->position.z);
|
||||
npc->duration = 15;
|
||||
}
|
||||
npc->duration--;
|
||||
}
|
||||
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
const char N(dgb_01_name_hack)[] = "dgb_01";
|
||||
|
@ -1,9 +1,7 @@
|
||||
#include "dgb_18.h"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_dgb/dgb_18/C56EF0", func_80240FB0_C56EF0);
|
||||
/*
|
||||
ApiStatus N(func_80240FB0_C56EF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
s32** ptr = &D_80241C68_BE09F8;
|
||||
s32** ptr = &N(D_802436E0_C59620);
|
||||
s32 i;
|
||||
s32* test;
|
||||
|
||||
@ -17,13 +15,12 @@ ApiStatus N(func_80240FB0_C56EF0)(ScriptInstance* script, s32 isInitialCall) {
|
||||
for (i = 0, test = *ptr; i < 16; i++) {
|
||||
script->varTable[i] = *test++;
|
||||
}
|
||||
ptr = &D_80241C68_BE09F8;
|
||||
ptr = &N(D_802436E0_C59620);
|
||||
heap_free(*ptr);
|
||||
*ptr = NULL;
|
||||
}
|
||||
return 2;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
*/
|
||||
|
||||
#include "world/common/GetItemName.inc.c"
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user