* hos_06 ok

* hos_06

* hos_01

* hos_01

* hos_04

* hos 10/20

* hos_05 builds

* hos_05 data ok

* hos_05 ok

* hos_05 cleanup pt1

* hos_05 cleanup done

* small fix

* a couple more

* fix little thing

* finish sam_01

---------

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2023-01-31 21:31:09 -05:00 committed by GitHub
parent bc618160ed
commit 2d3a608ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
330 changed files with 14770 additions and 5813 deletions

View File

@ -975,11 +975,11 @@ typedef struct RadialShimmerFXData {
} RadialShimmerFXData; // size = 0x70
typedef struct EndingDecalsFXData {
/* 0x00 */ s32 unk_00;
/* 0x00 */ s32 type;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x10 */ f32 scale;
/* 0x14 */ f32 unk_14;
/* 0x18 */ s32 unk_18;
/* 0x18 */ s32 haloAlpha;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ u8 unk_24;
@ -992,16 +992,14 @@ typedef struct EndingDecalsFXData {
} EndingDecalsFXData; // size = 0x2C
typedef struct LightRaysFXData {
/* 0x00 */ s32 unk_00;
/* 0x00 */ s32 type;
/* 0x04 */ char unk_04[0xC];
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x10 */ Vec3f pos;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ s32 unk_24;
/* 0x28 */ s32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x24 */ s32 alpha;
/* 0x28 */ s32 timeLeft;
/* 0x2C */ s32 lifetime;
/* 0x30 */ char unk_30[4];
/* 0x34 */ f32 unk_34;
/* 0x38 */ f32 unk_38;
@ -1013,14 +1011,10 @@ typedef struct LightRaysFXData {
/* 0x50 */ f32 unk_50;
/* 0x54 */ f32 unk_54;
/* 0x58 */ f32 unk_58;
/* 0x5C */ f32 unk_5C;
/* 0x60 */ f32 unk_60;
/* 0x64 */ f32 unk_64;
/* 0x5C */ Vec3f rotation;
/* 0x68 */ f32 unk_68;
/* 0x6C */ f32 unk_6C;
/* 0x70 */ f32 unk_70;
/* 0x74 */ f32 unk_74;
/* 0x78 */ f32 unk_78;
/* 0x70 */ Vec3f initialRot;
/* 0x7C */ s32 unk_7C;
/* 0x80 */ f32 unk_80;
/* 0x84 */ f32 unk_84;

View File

@ -1669,8 +1669,8 @@ enum ItemIDs {
ITEM_LETTER02 = 0x00000037,
ITEM_LETTER03 = 0x00000038,
ITEM_LETTER04 = 0x00000039,
ITEM_LETTER05 = 0x0000003A,
ITEM_LETTER06 = 0x0000003B,
ITEM_LETTER_TO_MAYOR_PENGUIN = 0x0000003A,
ITEM_LETTER_TO_MERLOW = 0x0000003B,
ITEM_LETTER07 = 0x0000003C,
ITEM_LETTER08 = 0x0000003D,
ITEM_LETTER_TO_MINHT = 0x0000003E,
@ -5627,7 +5627,7 @@ typedef enum FoldType {
FOLD_TYPE_A = 0xA,
FOLD_TYPE_B = 0xB,
FOLD_TYPE_C = 0xC,
FOLD_TYPE_D = 0xD,
FOLD_TYPE_D = 0xD, // noisy star spirit
FOLD_TYPE_E = 0xE,
FOLD_TYPE_F = 0xF,
FOLD_TYPE_10 = 0x10,

View File

@ -119,6 +119,12 @@ typedef s32 ApiStatus;
#define ApiStatus_REPEAT 3 /* Call again immediately */
#define ApiStatus_FINISH 255 /* Corresponds to EVT_FINISH */
enum EventCommandResults {
EVT_CMD_RESULT_YIELD = -1,
EVT_CMD_RESULT_CONTINUE = 0,
EVT_CMD_RESULT_ERROR = 1,
};
enum EventGroupFlags {
EVT_GROUP_00 = 0x00,
EVT_GROUP_0A = 0x0A, // 8 | 2

View File

@ -174,7 +174,7 @@ ApiStatus ShowChoice(Evt* script, s32 isInitialCall);
ApiStatus CloseChoice(Evt* script, s32 isInitialCall);
ApiStatus CancelMessage(Evt* script, s32 isInitialCall);
ApiStatus SetMessageImages(Evt* script, s32 isInitialCall);
ApiStatus SetMessageMsg(Evt* script, s32 isInitialCall);
ApiStatus SetMessageText(Evt* script, s32 isInitialCall);
ApiStatus SetMessageValue(Evt* script, s32 isInitialCall);
ApiStatus HidePlayerShadow(Evt* script, s32 isInitialCall);
ApiStatus DisablePlayerPhysics(Evt* script, s32 isInitialCall);
@ -333,6 +333,7 @@ ApiStatus SetCustomGfx(Evt* script, s32 isInitialCall);
ApiStatus SetCustomGfxBuilders(Evt* script, s32 isInitialCall);
ApiStatus SetModelCustomGfx(Evt* script, s32 isInitialCall);
ApiStatus SetNpcPaletteSwapMode(Evt* script, s32 isInitialCall);
ApiStatus SetNpcPaletteSwapLower(Evt* script, s32 isInitialCall);
ApiStatus SetNpcPaletteSwapping(Evt* script, s32 isInitialCall);
ApiStatus MakeTransformGroup(Evt* script, s32 isInitialCall);

View File

@ -649,6 +649,17 @@
EVT_END \
}
// alternate version of EVT_EXIT_WALK used on Pleasant Path which does not join EVT_GROUP_1B
#define EVT_EXIT_WALK_NOK(walkDistance, exitIdx, map, entryIdx) \
{ \
EVT_CALL(UseExitHeading, walkDistance, exitIdx) \
EVT_EXEC(ExitWalk) \
EVT_CALL(GotoMap, EVT_PTR(map), entryIdx) \
EVT_WAIT(100) \
EVT_RETURN \
EVT_END \
}
// alternate version of EVT_EXIT_WALK which includes a call to DisablePlayerInput
#define EVT_EXIT_WALK_FIXED(walkDistance, exitIdx, map, entryIdx) \
{ \

View File

@ -1406,7 +1406,7 @@ void appendGfx_player_actor(void* arg0) {
effect->data.endingDecals->pos.x = playerPosX;
effect->data.endingDecals->pos.y = playerPosY;
effect->data.endingDecals->pos.z = playerPosZ;
effect->data.endingDecals->unk_10 = player->scalingFactor;
effect->data.endingDecals->scale = player->scalingFactor;
} else {
effect = battleStatus->cloudNineEffect;
effect->data.endingDecals->pos.x = playerPosX;

View File

@ -14,40 +14,42 @@ void* effectFuncs[] = {
};
s32 D_E0200734[128] = {
0x100B2AF5, 0x45B59924, 0x35094B45, 0x4ABFA67A, 0x164F5371, 0x7B195845, 0x58562A56, 0x25733D41, 0x48008107,
0x0E004F28, 0x6963B8AD, 0x5B82AB71, 0x6BC1F51B, 0x3D947816, 0x39705175, 0x44409A59, 0x0ED99067, 0x5F70B6F8,
0x3225AEEE, 0x08B5E97C, 0x2CDE7594, 0x5E9E5B7D, 0x5B2A2888, 0x107F0F50, 0x58FBC53B, 0x65F69F19, 0x3AF6CEF3,
0x15C3894F, 0x4C931A2C, 0x39A897E9, 0x5945BB8C, 0x5C9E4521, 0x7F5E310D, 0x0E4F06D2, 0x275DEB9C, 0x15AD847F,
0x09685F17, 0x7FB415F2, 0x3B20C1C0, 0x5168E01E, 0x0DB4651A, 0x24847A6D, 0x2CEB8B8F, 0x79765A35, 0x6218F283,
0x665BDD04, 0x3DB6F48F, 0x70F282EB, 0x45CC93FC, 0x6FDCA37D, 0x79A86C67, 0x72AB0990, 0x4E7AFEFA, 0x54D294F0,
0x032A18E0, 0x2776C435, 0x3AC93409, 0x3E20E7D4, 0x3D3A4D85, 0x075C4E35, 0x77C97FBD, 0x16800911, 0x63FA9357,
0x7727B0CB, 0x24CF0FE3, 0x0B587EF3, 0x0CD5354A, 0x2E376EFA, 0x0B0C94E5, 0x47F5F70A, 0x7FA04F19, 0x18C0FA00,
0x6C7A7178, 0x2C8BDAA8, 0x12375435, 0x4E9363FB, 0x12E7B7AD, 0x4FEE48C4, 0x3F85E6E6, 0x58B44BA9, 0x3FCAEC41,
0x392E534E, 0x4B5F553A, 0x0E45EB3C, 0x0E00E83E, 0x4E896E1A, 0x35BCAF71, 0x48CA1C47, 0x0CAA55EE, 0x72F6FCF6,
0x50266A7D, 0x0473D5AC, 0x09770608, 0x3420FDD4, 0x7B9B8677, 0x2E4615EB, 0x3F797CC7, 0x0870BBC1, 0x5C7D84E6,
0x4A8611AC, 0x5066B2CB, 0x5C1DD3FF, 0x63470BAC, 0x3CE12443, 0x08A9AEA7, 0x757E5FE2, 0x0B74883F, 0x1B916654,
0x456CA8A6, 0x4AFA6F25, 0x7445B1FE, 0x053794E8, 0x0428C273, 0x3FA50738, 0x137D8024, 0x1229AAB1, 0x0E2E7552,
0x493A2F95, 0x5AF3C6F9, 0x1AD8CB41, 0x3C312C8C, 0x2B1A3176, 0x1F4CA0ED, 0x45A83294, 0x5F3B2F4A, 0x1AE82764,
0x73EE487F, 0x1EB4AC11
0x100B2AF5, 0x45B59924, 0x35094B45, 0x4ABFA67A, 0x164F5371, 0x7B195845, 0x58562A56, 0x25733D41,
0x48008107, 0x0E004F28, 0x6963B8AD, 0x5B82AB71, 0x6BC1F51B, 0x3D947816, 0x39705175, 0x44409A59,
0x0ED99067, 0x5F70B6F8, 0x3225AEEE, 0x08B5E97C, 0x2CDE7594, 0x5E9E5B7D, 0x5B2A2888, 0x107F0F50,
0x58FBC53B, 0x65F69F19, 0x3AF6CEF3, 0x15C3894F, 0x4C931A2C, 0x39A897E9, 0x5945BB8C, 0x5C9E4521,
0x7F5E310D, 0x0E4F06D2, 0x275DEB9C, 0x15AD847F, 0x09685F17, 0x7FB415F2, 0x3B20C1C0, 0x5168E01E,
0x0DB4651A, 0x24847A6D, 0x2CEB8B8F, 0x79765A35, 0x6218F283, 0x665BDD04, 0x3DB6F48F, 0x70F282EB,
0x45CC93FC, 0x6FDCA37D, 0x79A86C67, 0x72AB0990, 0x4E7AFEFA, 0x54D294F0, 0x032A18E0, 0x2776C435,
0x3AC93409, 0x3E20E7D4, 0x3D3A4D85, 0x075C4E35, 0x77C97FBD, 0x16800911, 0x63FA9357, 0x7727B0CB,
0x24CF0FE3, 0x0B587EF3, 0x0CD5354A, 0x2E376EFA, 0x0B0C94E5, 0x47F5F70A, 0x7FA04F19, 0x18C0FA00,
0x6C7A7178, 0x2C8BDAA8, 0x12375435, 0x4E9363FB, 0x12E7B7AD, 0x4FEE48C4, 0x3F85E6E6, 0x58B44BA9,
0x3FCAEC41, 0x392E534E, 0x4B5F553A, 0x0E45EB3C, 0x0E00E83E, 0x4E896E1A, 0x35BCAF71, 0x48CA1C47,
0x0CAA55EE, 0x72F6FCF6, 0x50266A7D, 0x0473D5AC, 0x09770608, 0x3420FDD4, 0x7B9B8677, 0x2E4615EB,
0x3F797CC7, 0x0870BBC1, 0x5C7D84E6, 0x4A8611AC, 0x5066B2CB, 0x5C1DD3FF, 0x63470BAC, 0x3CE12443,
0x08A9AEA7, 0x757E5FE2, 0x0B74883F, 0x1B916654, 0x456CA8A6, 0x4AFA6F25, 0x7445B1FE, 0x053794E8,
0x0428C273, 0x3FA50738, 0x137D8024, 0x1229AAB1, 0x0E2E7552, 0x493A2F95, 0x5AF3C6F9, 0x1AD8CB41,
0x3C312C8C, 0x2B1A3176, 0x1F4CA0ED, 0x45A83294, 0x5F3B2F4A, 0x1AE82764, 0x73EE487F, 0x1EB4AC11,
};
u32 func_E0200000(s32 arg0) {
// very simple 'random' number generator that mutates a single value in memory
u32 func_E0200000(s32 max) {
s32 temp_v0 = D_E0200690 * 4;
D_E0200690 = (u32)((temp_v0 + 2) * (temp_v0 + 3)) / 4;
return D_E0200690 % (arg0 + 1);
return D_E0200690 % (max + 1);
}
s32 func_E0200044(s32 arg0, s32 arg1) {
s32 temp_v0 = D_E0200734[arg1 % ARRAY_COUNT(D_E0200734)];
// very simple 'random' number generator using a LUT
s32 func_E0200044(s32 max, s32 idx) {
s32 lookupVal = D_E0200734[idx % ARRAY_COUNT(D_E0200734)];
if (temp_v0 < 0) {
temp_v0 = -temp_v0;
if (lookupVal < 0) {
lookupVal = -lookupVal;
}
return temp_v0 % (arg0 + 1);
return lookupVal % (max + 1);
}

View File

@ -5161,7 +5161,7 @@ void btl_state_draw_select_target(void) {
target = &actor->targetData[targetIndexList[selectedTargetIndex]];
anotherActor = get_actor(target->actorID);
msgID = get_actor_part(anotherActor, target->partID)->staticData->unk_20;
if (msgID == 0) {
if (msgID == MSG_NONE) {
msgID = bActorNames[anotherActor->actorType];
}
msgWidth = get_msg_width(msgID, 0) + 10;
@ -5193,7 +5193,7 @@ void btl_state_draw_select_target(void) {
target = &actor->targetData[targetIndexList[selectedTargetIndex]];
anotherActor = get_actor(target->actorID);
msgID = get_actor_part(anotherActor, target->partID)->staticData->unk_20;
if (msgID == 0) {
if (msgID == MSG_NONE) {
msgID = bActorNames[anotherActor->actorType];
}
draw_msg(msgID, screenX + *tmpPtr, screenY, 255, MSG_PAL_36, 0); // TODO required to match

View File

@ -695,7 +695,7 @@ ApiStatus N(CloudNineFX)(Evt* script, s32 isInitialCall) {
if (sCounter >= 1.0) {
return ApiStatus_DONE2;
}
battleStatus->cloudNineEffect->data.endingDecals->unk_10 += 0.2;
battleStatus->cloudNineEffect->data.endingDecals->scale += 0.2;
sCounter += 0.2;
break;
}

View File

@ -28,7 +28,7 @@ void ending_decals_update(EffectInstance* effect);
void ending_decals_render(EffectInstance* effect);
void ending_decals_appendGfx(void* effect);
void ending_decals_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance** outEffect) {
void ending_decals_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 arg4, EffectInstance** outEffect) {
EffectBlueprint bp;
EffectInstance* effect;
EndingDecalsFXData* data;
@ -46,17 +46,17 @@ void ending_decals_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, Effect
data = effect->data.endingDecals = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.endingDecals != NULL);
data->unk_00 = arg0;
data->pos.x = arg1;
data->pos.y = arg2;
data->pos.z = arg3;
data->unk_18 = 255;
data->type = type;
data->pos.x = posX;
data->pos.y = posY;
data->pos.z = posZ;
data->haloAlpha = 255;
data->unk_14 = arg4;
data->unk_10 = arg4;
data->scale = arg4;
data->unk_1C = 100;
data->unk_20 = 0;
switch (arg0) {
switch (type) {
case 0:
case 1:
data->unk_24 = 0;
@ -103,9 +103,9 @@ void ending_decals_update(EffectInstance* effect) {
}
if (data->unk_1C < 10) {
data->unk_18 -= 25;
if (data->unk_18 < 0) {
data->unk_18 = 0;
data->haloAlpha -= 25;
if (data->haloAlpha < 0) {
data->haloAlpha = 0;
}
}
}
@ -119,7 +119,7 @@ void ending_decals_render(EffectInstance* effect) {
renderTask.appendGfxArg = effect;
renderTask.appendGfx = ending_decals_appendGfx;
renderTask.distance = 10;
if (data->unk_00 == 0) {
if (data->type == 0) {
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_OPA;
} else {
renderTaskPtr->renderMode = RENDER_MODE_2D;
@ -139,18 +139,18 @@ void ending_decals_appendGfx(void* effect) {
Matrix4f sp20;
unk_20 = data->unk_20;
dlist1 = D_E00685F4[data->unk_00];
dlist2 = D_E00685B0[data->unk_00];
dlist1 = D_E00685F4[data->type];
dlist2 = D_E00685B0[data->type];
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
temp_f64 = data->unk_18;
temp_f64 = data->haloAlpha;
if (unk_20 % 2 == 0) {
alpha = temp_f64 * 0.97;
} else {

View File

@ -15,11 +15,22 @@ Gfx* D_E006AE00[] = {
};
s32 D_E006AE10[] = {
0, -20, 0, 1, 18, -10, -60, 45, -1, 4, -20, -20, 90, 1, 1, -10,
-60, 135, 1, -4, 0, -20, 180, -8, 1, -10, -60, 225, -1, -1, -20, -20,
270, 1, -9, -10, -60, 315, 4, 4, 0, 10, 22, 4, 1, -10, 20, 67,
1, -1, -20, 10, 112, -1, -1, -10, 20, 157, -8, 1, 0, 10, 202, 1,
-4, -10, 20, 247, 1, -18, -20, 10, 292, -1, 9, -10, 20, 337, 1, 1
0, -20, 0, 1, 18,
-10, -60, 45, -1, 4,
-20, -20, 90, 1, 1,
-10, -60, 135, 1, -4,
0, -20, 180, -8, 1,
-10, -60, 225, -1, -1,
-20, -20, 270, 1, -9,
-10, -60, 315, 4, 4,
0, 10, 22, 4, 1,
-10, 20, 67, 1, -1,
-20, 10, 112, -1, -1,
-10, 20, 157, -8, 1,
0, 10, 202, 1, -4,
-10, 20, 247, 1, -18,
-20, 10, 292, -1, 9,
-10, 20, 337, 1, 1
};
void light_rays_init(EffectInstance* effect);
@ -27,32 +38,32 @@ void light_rays_update(EffectInstance* effect);
void light_rays_render(EffectInstance* effect);
void light_rays_appendGfx(void* effect);
void func_E006A000(LightRaysFXData* part, s32 arg1) {
s32 temp = arg1 * 3;
void func_E006A000(LightRaysFXData* part, s32 beamIdx) {
s32 temp = beamIdx * 3;
part->unk_70 = func_E0200044(180, temp);
part->unk_74 = func_E0200044(180, temp + 1);
part->unk_78 = func_E0200044(180, temp + 2);
part->unk_24 = 0;
part->unk_2C = 0;
part->initialRot.x = func_E0200044(180, temp);
part->initialRot.y = func_E0200044(180, temp + 1);
part->initialRot.z = func_E0200044(180, temp + 2);
part->alpha = 0;
part->lifetime = 0;
part->unk_58 = part->unk_68;
part->unk_28 = part->unk_7C;
part->timeLeft = part->unk_7C;
part->unk_8C = part->unk_6C;
part->unk_5C = part->unk_70;
part->unk_60 = part->unk_74;
part->unk_64 = part->unk_78;
part->rotation.x = part->initialRot.x;
part->rotation.y = part->initialRot.y;
part->rotation.z = part->initialRot.z;
}
void func_E006A0BC(LightRaysFXData* part, s32 arg1) {
s32 idx = (arg1 - 1) * 5;
void func_E006A0BC(LightRaysFXData* part, s32 beamIdx) {
s32 idx = (beamIdx - 1) * 5;
part->unk_58 = 0;
part->unk_28 = arg1 * 2 + 30;
part->unk_5C = D_E006AE10[idx++];
part->unk_60 = D_E006AE10[idx++];
part->unk_64 = D_E006AE10[idx++];
part->unk_24 = 0;
part->unk_2C = 0;
part->timeLeft = beamIdx * 2 + 30;
part->rotation.x = D_E006AE10[idx++];
part->rotation.y = D_E006AE10[idx++];
part->rotation.z = D_E006AE10[idx++];
part->alpha = 0;
part->lifetime = 0;
part->unk_34 = part->unk_38 = 0.0f;
part->unk_48 = 0.0f;
part->unk_4C = -0.6f;
@ -67,11 +78,11 @@ void func_E006A0BC(LightRaysFXData* part, s32 arg1) {
}
void light_rays_main(
s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
s32 type,
f32 posX,
f32 posY,
f32 posZ,
f32 scale,
EffectInstance** outEffect
) {
EffectBlueprint bp;
@ -83,7 +94,7 @@ void light_rays_main(
s32 temp1;
s32 i;
if (arg0 < 2) {
if (type < 2) {
numParts = 9;
} else {
numParts = 17;
@ -101,16 +112,15 @@ void light_rays_main(
part = effect->data.lightRays = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.lightRays != NULL);
part->unk_00 = arg0;
part->unk_28 = 100;
part->unk_2C = 0;
part->unk_10 = arg1;
part->unk_14 = arg2;
part->unk_18 = arg3;
part->unk_20 = arg4;
part->unk_1C = arg4;
part->type = type;
part->timeLeft = 100;
part->lifetime = 0;
part->pos.x = posX;
part->pos.y = posY;
part->pos.z = posZ;
part->unk_1C = part->unk_20 = scale;
switch (arg0) {
switch (type) {
case 0:
case 1:
part++;
@ -174,46 +184,46 @@ void func_E006A464(LightRaysFXData* part) {
void light_rays_update(EffectInstance* effect) {
LightRaysFXData* part = effect->data.lightRays;
s32 unk_00 = part->unk_00;
s32 unk_28;
s32 unk_2C;
s32 type = part->type;
s32 timeLeft;
s32 lifetime;
s32 i;
if (part->unk_28 < 11) {
part->unk_28--;
if (part->timeLeft < 11) {
part->timeLeft--;
}
part->unk_2C++;
part->lifetime++;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
part->unk_28 = 10;
if (effect->flags & EFFECT_INSTANCE_FLAG_10) {
effect->flags &= ~EFFECT_INSTANCE_FLAG_10;
part->timeLeft = 10;
}
if (part->unk_28 < 0) {
if (part->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
unk_28 = part->unk_28;
unk_2C = part->unk_2C;
timeLeft = part->timeLeft;
lifetime = part->lifetime;
switch (unk_00) {
switch (type) {
case 0:
case 1:
part++;
for (i = 1; i < effect->numParts; i++, part++) {
part->unk_28--;
part->unk_2C++;
if (part->unk_2C < 10) {
part->unk_24 = part->unk_2C * 12;
part->timeLeft--;
part->lifetime++;
if (part->lifetime < 10) {
part->alpha = part->lifetime * 12;
}
if (part->unk_28 < 5) {
part->unk_24 = part->unk_28 * 25;
if (part->timeLeft < 5) {
part->alpha = part->timeLeft * 25;
}
part->unk_58 += part->unk_8C;
if (part->unk_28 <= 0) {
func_E006A000(part, unk_2C * 10 + 1);
if (part->timeLeft <= 0) {
func_E006A000(part, lifetime * 10 + 1);
}
}
break;
@ -221,24 +231,24 @@ void light_rays_update(EffectInstance* effect) {
part++;
for (i = 1; i < effect->numParts; i++, part++) {
func_E006A464(part);
part->unk_28--;
part->unk_2C++;
if (part->unk_2C < 5) {
part->unk_24 = part->unk_2C * 50;
part->timeLeft--;
part->lifetime++;
if (part->lifetime < 5) {
part->alpha = part->lifetime * 50;
}
if (part->unk_28 < 5) {
part->unk_24 = part->unk_28 * 50;
if (part->timeLeft < 5) {
part->alpha = part->timeLeft * 50;
}
if (unk_28 < 10) {
part->unk_24 = (part->unk_24 * unk_28) / 10;
if (timeLeft < 10) {
part->alpha = (part->alpha * timeLeft) / 10;
}
if (part->unk_28 <= 0) {
if (part->timeLeft <= 0) {
func_E006A0BC(part, i);
}
if (part->unk_90 <= 0 || --part->unk_90 <= 0) {
part->unk_5C += part->unk_80;
part->unk_60 += part->unk_84;
part->unk_64 += part->unk_88;
part->rotation.x += part->unk_80;
part->rotation.y += part->unk_84;
part->rotation.z += part->unk_88;
}
}
}
@ -269,50 +279,50 @@ void func_E006A85C(LightRaysFXData* part) {
void light_rays_appendGfx(void* effect) {
LightRaysFXData* part = ((EffectInstance*)effect)->data.lightRays;
s32 unk_00 = part->unk_00;
Gfx* dlist = D_E006ADF0[unk_00];
Gfx* dlist2 = D_E006AE00[unk_00];
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;
s32 type = part->type;
Gfx* dlist = D_E006ADF0[type];
Gfx* dlist2 = D_E006AE00[type];
Matrix4f mtxTransform;
Matrix4f mtxTemp;
Matrix4f mtxTranslate;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMasterGfxPos++, dlist2);
shim_guTranslateF(sp98, part->unk_10, part->unk_14, part->unk_18);
shim_guTranslateF(mtxTranslate, part->pos.x, part->pos.y, part->pos.z);
part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
f32 temp = part->unk_24 / 255.0f;
f32 rotateA;
f32 temp = part->alpha / 255.0f;
f32 angleZ;
f32 scaleX;
f32 scaleY;
f32 scaleZ;
f32 unk_64;
if (unk_00 >= 2) {
if (type >= 2) {
func_E006A85C(part);
}
shim_guRotateF(sp58, part->unk_5C, 1.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp18);
shim_guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTranslate, mtxTransform);
if (unk_00 >= 2) {
unk_64 = part->unk_64;
if (unk_00 == 3) {
rotateA = unk_64 + 45.0f;
if (type >= 2) {
unk_64 = part->rotation.z;
if (type == 3) {
angleZ = unk_64 + 45.0f;
} else {
rotateA = unk_64 + 0.0f;
angleZ = unk_64 + 0.0f;
}
shim_guRotateF(sp58, rotateA, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_60, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
scaleX = scaleZ = (temp + 3.0f) * 0.25;
switch (i & 3) {
@ -331,22 +341,22 @@ void light_rays_appendGfx(void* effect) {
break;
}
shim_guScaleF(sp58, scaleX, scaleY, scaleZ);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(mtxTemp, scaleX, scaleY, scaleZ);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 240, part->unk_24);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 240, part->alpha);
} else {
shim_guRotateF(sp58, part->unk_60, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_64, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 181, part->unk_24);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 181, part->alpha);
}
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, dlist);

View File

@ -144,8 +144,8 @@ void something_rotating_update(EffectInstance* effect) {
f32 angle1;
s32 i;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
if (effect->flags & EFFECT_INSTANCE_FLAG_10) {
effect->flags &= ~EFFECT_INSTANCE_FLAG_10;
part->unk_10 = 32;
}

View File

@ -418,14 +418,14 @@ ApiStatus RestartNpcAI(Evt* script, s32 isInitialCall) {
ApiStatus EnableNpcAI(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
if (var2 != 0) {
if (npc->aiScript != NULL) {
@ -486,14 +486,14 @@ ApiStatus SetNpcAux(Evt* script, s32 isInitialCall) {
ApiStatus BindNpcAux(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
EvtScript* auxBytecode = (EvtScript*)evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
npc->auxBytecode = auxBytecode;
return ApiStatus_DONE2;
@ -535,14 +535,14 @@ ApiStatus RestartNpcAux(Evt* script, s32 isInitialCall) {
ApiStatus EnableNpcAux(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
if (var2 != 0) {
if (npc->auxScript != NULL) {
@ -558,14 +558,14 @@ ApiStatus EnableNpcAux(Evt* script, s32 isInitialCall) {
ApiStatus BindNpcInteract(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
EvtScript* interactBytecode = (EvtScript*)evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
if (npc->interactScript != NULL) {
kill_script_by_ID(npc->interactScriptID);
@ -578,14 +578,14 @@ ApiStatus BindNpcInteract(Evt* script, s32 isInitialCall) {
ApiStatus BindNpcHit(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
EvtScript* hitBytecode = (EvtScript*)evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
if (npc->hitScript != NULL) {
kill_script_by_ID(npc->hitScriptID);
@ -598,14 +598,14 @@ ApiStatus BindNpcHit(Evt* script, s32 isInitialCall) {
ApiStatus BindNpcDefeat(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
EvtScript* defeatBytecode = (EvtScript*)evt_get_variable(script, *args);
if (npcId == -1) {
npcId = npc->npcID;
if (npcID == -1) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
npc->defeatBytecode = defeatBytecode;
return ApiStatus_DONE2;
@ -631,15 +631,15 @@ ApiStatus GetSelfVar(Evt* script, s32 isInitialCall) {
ApiStatus SetNpcVar(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
s32 varIdx = evt_get_variable(script, *args++);
s32 val = evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
npc->varTable[varIdx] = val;
return ApiStatus_DONE2;
@ -728,15 +728,15 @@ ApiStatus ClearDefeatedEnemies(Evt* script, s32 isInitialCall) {
ApiStatus SetEnemyFlagBits(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Enemy* npc = script->owner1.enemy;
s32 npcId = evt_get_variable(script, *args++);
s32 npcID = evt_get_variable(script, *args++);
s32 bits = *args++;
s32 var2 = evt_get_variable(script, *args);
if (npcId == NPC_SELF) {
npcId = npc->npcID;
if (npcID == NPC_SELF) {
npcID = npc->npcID;
}
npc = get_enemy(npcId);
npc = get_enemy(npcID);
if (var2 != NULL) {
npc->flags |= bits;

View File

@ -1,10 +1,9 @@
#include "common.h"
// TODO: not sure where these go
u8 D_802D9D70 = 0xFE;
u8 D_802D9D71 = 0xFE;
u8 D_802D9D72 = 0x00;
u8 D_802D9D73 = 0xFF;
u8 D_802D9D70 = 254;
u8 D_802D9D71 = 254;
u16 StarShrineLightBeamAlpha = 255;
extern s32 D_802DBB60;
extern s32 D_802DBB64; // unused?

View File

@ -963,7 +963,7 @@ ApiStatus evt_handle_exec_wait(Evt* script) {
Bytecode* args = script->ptrReadPos;
start_child_script(script, (EvtScript*) evt_get_variable(script, *args++), 0);
script->currentOpcode = 0;
script->currentOpcode = EVT_OP_INTERNAL_FETCH;
return ApiStatus_FINISH;
}
@ -1660,21 +1660,21 @@ s32 evt_execute_next_command(Evt* script) {
}
if (status == ApiStatus_FINISH) {
return -1;
return EVT_CMD_RESULT_YIELD;
}
if (status < 0) {
return 1;
return EVT_CMD_RESULT_ERROR;
}
// TODO: this may be able to be a switch but I couldn't get it
if (status == ApiStatus_BLOCK) {
// return 0
} else if (status == ApiStatus_DONE1) {
script->currentOpcode = 0;
script->currentOpcode = EVT_OP_INTERNAL_FETCH;
// return 0
} else if (status == ApiStatus_DONE2) {
script->currentOpcode = 0;
script->currentOpcode = EVT_OP_INTERNAL_FETCH;
if (gGameStatusPtr->disableScripts != status) {
continue;
}
@ -1682,7 +1682,7 @@ s32 evt_execute_next_command(Evt* script) {
} else {
continue;
}
return 0;
return EVT_CMD_RESULT_CONTINUE;
}
}
@ -2027,14 +2027,14 @@ Bytecode* evt_find_label(Evt* script, s32 arg1) {
return (Bytecode*) arg1;
}
for (i = 0; i < 0x10; i++) {
for (i = 0; i < 16; i++) {
if (script->labelIndices[i] == arg1) {
ret = script->labelPositions[i];
break;
}
}
ASSERT(i < 0x10);
ASSERT(i < 16);
return ret;
}

View File

@ -332,7 +332,7 @@ ApiStatus func_802D0C94(Evt* script, s32 initialCall) {
return ApiStatus_DONE2;
}
ApiStatus SetMessageMsg(Evt* script, s32 isInitialCall) {
ApiStatus SetMessageText(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 msg = evt_get_variable(script, *args++);
s32 index = evt_get_variable(script, *args++);

View File

@ -251,7 +251,7 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) {
ASSERT(newScript != NULL);
newScript->stateFlags = flags | EVT_FLAG_ACTIVE;
newScript->currentOpcode = 0;
newScript->currentOpcode = EVT_OP_INTERNAL_FETCH;
newScript->priority = priority;
newScript->ptrNextLine = (Bytecode*)source;
newScript->ptrFirstLine = (Bytecode*)source;
@ -323,7 +323,7 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla
// Some of this function is surely macros. I think we'll learn more as we do others in this file. -Ethan
do {
newScript->stateFlags = flags | EVT_FLAG_ACTIVE;
newScript->currentOpcode = 0;
newScript->currentOpcode = EVT_OP_INTERNAL_FETCH;
newScript->priority = priority;
newScript->id = gStaticScriptCounter++;
newScript->ptrNextLine = (Bytecode*)source;
@ -395,7 +395,7 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) {
child->ptrCurrentLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source;
child->currentOpcode = 0;
child->currentOpcode = EVT_OP_INTERNAL_FETCH;
child->userData = NULL;
child->blockingParent = parentScript;
child->childScript = NULL;
@ -463,7 +463,7 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) {
child->ptrNextLine = nextLine;
child->ptrFirstLine = nextLine;
child->ptrCurrentLine = nextLine;
child->currentOpcode = 0;
child->currentOpcode = EVT_OP_INTERNAL_FETCH;
child->userData = NULL;
child->blockingParent = NULL;
child->parentScript = parentScript;
@ -514,7 +514,7 @@ Evt* func_802C3C10(Evt* script, Bytecode* line, s32 arg2) {
script->ptrNextLine = line;
script->ptrFirstLine = line;
script->ptrCurrentLine = line;
script->currentOpcode = 0;
script->currentOpcode = EVT_OP_INTERNAL_FETCH;
script->frameCounter = 0;
script->stateFlags |= arg2;
script->timeScale = 1.0f;
@ -555,7 +555,7 @@ Evt* restart_script(Evt* script) {
script->loopDepth = -1;
script->switchDepth = -1;
script->frameCounter = 0;
script->currentOpcode = 0;
script->currentOpcode = EVT_OP_INTERNAL_FETCH;
script->ptrNextLine = ptrFirstLine;
script->ptrCurrentLine = ptrFirstLine;
@ -600,11 +600,11 @@ void update_scripts(void) {
script->frameCounter -= 1.0;
status = evt_execute_next_command(script);
if (status == 1) {
if (status == EVT_CMD_RESULT_ERROR) {
stop = TRUE;
break;
}
} while (status != -1);
} while (status != EVT_CMD_RESULT_YIELD);
if (stop) {
break;

View File

@ -281,6 +281,7 @@ void filemenu_yesno_handle_input(MenuPanel* menu) {
case 2:
clear_player_data();
clear_saved_variables();
//TODO hardcoded area/map IDs
gGameStatusPtr->areaID = 0;
gGameStatusPtr->mapID = 11;
gGameStatusPtr->entryID = 0;

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "ld_addrs.h"
#include "message_ids.h"
#include "sprite.h"
enum RewindArrowStates {
@ -25,7 +26,13 @@ u8 MessageSingular[] = { MSG_CHAR_READ_ENDL, MSG_CHAR_READ_END };
s16 gNextMessageBuffer = 0;
s32 gRewindArrowQuad[] = { 0xFFF00009, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00100009, 0x00000000, 0x04000000, 0xFFFFFFFF, 0xFFF0FFF7, 0x00000000, 0x00000240, 0xFFFFFFFF, 0x0010FFF7, 0x00000000, 0x04000240, 0xFFFFFFFF, };
//TODO Vtx
s32 gRewindArrowQuad[] = {
0xFFF00009, 0x00000000, 0x00000000, 0xFFFFFFFF,
0x00100009, 0x00000000, 0x04000000, 0xFFFFFFFF,
0xFFF0FFF7, 0x00000000, 0x00000240, 0xFFFFFFFF,
0x0010FFF7, 0x00000000, 0x04000240, 0xFFFFFFFF,
};
Gfx D_8014C2D8[] = {
gsDPSetCycleType(G_CYC_2CYCLE),
@ -1388,7 +1395,7 @@ MessagePrintState* _msg_get_printer_for_msg(s32 msgID, s32* donePrintingWritebac
s32 maxLinesPerPage;
s32 i;
if (msgID == 0) {
if (msgID == MSG_NONE) {
return NULL;
}
@ -1647,7 +1654,7 @@ void get_msg_properties(s32 msgID, s32* height, s32* width, s32* maxLineChars, s
maxLinesOnPage = 0;
spaceCount = 0;
if (msgID == 0) {
if (msgID == MSG_NONE) {
return;
}

View File

@ -2061,8 +2061,8 @@ void func_8003D3BC(Npc* npc) {
}
}
void func_8003D624(Npc* npc, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
npc->unk_98 = arg1;
void func_8003D624(Npc* npc, s32 foldType, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
npc->unk_98 = foldType;
npc->unk_9A = arg2;
npc->unk_9C = arg3;
npc->unk_9E = arg4;

View File

@ -1,4 +1,5 @@
#include "ld_addrs.h"
#include "message_ids.h"
#include "sprite.h"
#include "pause_common.h"
#include "sprite/npc/Goombaria.h"
@ -456,8 +457,9 @@ void pause_main_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width,
void pause_textbox_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
s32 msgID = gPauseShownDescMsg;
if (msgID == 0)
if (msgID == MSG_NONE) {
return;
}
if (gPauseDescTextPos != 0) {
hud_element_set_render_pos(gPauseCommonIconIDs[1], baseX + width - 4, baseY + 4);

View File

@ -1272,6 +1272,8 @@ s32 func_802DE8DC(s32 spriteIdx, s32 compListIdx, s32* outX, s32* outY, s32* out
animID = sprite->currentAnimID;
if (animID != 255) {
// following 3 lines equivalent to:
// animCompList = sprite->spriteData->animListStart[animID];
spriteData = (u32*)sprite->spriteData;
spriteData += 4 + animID;
animCompList = (SpriteAnimComponent**)*spriteData;

View File

@ -21,9 +21,9 @@ void state_init_intro(void) {
D_800A0956 = 0x10;
D_800A0958 = 4;
D_800A0960 = 0;
D_800A095A = 0xD0;
D_800A095C = 0xD0;
D_800A095E = 0xD0;
D_800A095A = 208;
D_800A095C = 208;
D_800A095E = 208;
D_800A0964 = 0;
// hos_05 (Star Sanctuary)

View File

@ -243,7 +243,7 @@ EvtScript N(80242B0C) = {
EVT_END_IF
EVT_END_THREAD
EVT_CALL(NpcMoveTo, NPC_Boo_05, LVar0, LVar2, 40)
EVT_CALL(SetNpcPos, NPC_Boo_05, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Boo_05, NPC_DISPOSE_LOCATION)
EVT_RETURN
EVT_END
};
@ -370,7 +370,7 @@ EvtScript N(EVS_NpcInit_Boo_04) = {
};
EvtScript N(EVS_NpcInit_Boo_05) = {
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_RETURN
EVT_END
};

View File

@ -189,10 +189,10 @@ EvtScript N(EVS_NpcInit_Boo_03) = {
EVT_CASE_LT(STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_CASE_LT(STORY_CH3_DEFEATED_TUBBA_BLUBBA)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_CASE_LT(STORY_CH3_BEGAN_PEACH_MISSION)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_CASE_LT(STORY_CH5_STAR_SPRIT_DEPARTED)
EVT_CASE_GE(STORY_CH5_STAR_SPRIT_DEPARTED)
@ -377,7 +377,7 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_Boo_01, 420, 300, 220)
EVT_CALL(SetNpcPos, NPC_Boo_02, 460, 250, 210)
EVT_CALL(SetNpcPos, NPC_Boo_05, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Boo_05, NPC_DISPOSE_LOCATION)
EVT_CALL(EnableNpcShadow, NPC_Boo_01, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Boo_02, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Boo_05, FALSE)
@ -449,8 +449,8 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(func_802CFD30, 1, FOLD_TYPE_7, LVar0, 0, 0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_Boo_01, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Boo_02, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Boo_01, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Boo_02, NPC_DISPOSE_LOCATION)
EVT_WAIT(10)
EVT_END_THREAD
EVT_SET(LVar0, 4)
@ -521,7 +521,7 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(PlaySoundAtNpc, NPC_Tubba, SOUND_315, 0)
EVT_END_THREAD
EVT_WAIT(40)
EVT_CALL(SetNpcPos, NPC_Boo_03, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Boo_03, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcAnimation, NPC_Tubba, ANIM_WorldTubba_Anim20)
EVT_WAIT(80)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
@ -552,7 +552,7 @@ EvtScript N(EVS_Scene_TubbaRaid) = {
EVT_CALL(NpcMoveTo, NPC_Tubba, 370, 220, 0)
EVT_CALL(NpcMoveTo, NPC_Tubba, 550, 196, 0)
EVT_CALL(SetNpcAnimation, NPC_Tubba, ANIM_WorldTubba_Anim06)
EVT_CALL(SetNpcPos, NPC_Tubba, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_Tubba, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcFlagBits, NPC_Tubba, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(NpcFacePlayer, NPC_Boo_01, 3)
EVT_CALL(SetNpcPos, NPC_Boo_01, 55, 195, 160)

View File

@ -125,18 +125,18 @@ EvtScript N(EVS_8024116C) = {
EVT_END
};
s32 N(DemoSceneState) = 0;
s32 N(DemoInitState) = 0;
API_CALLABLE(N(SetupDemoScene)) {
PlayerStatus* playerStatus = &gPlayerStatus;
switch (N(DemoSceneState)) {
switch (N(DemoInitState)) {
case 0:
N(DemoSceneState) = 1;
N(DemoInitState) = 1;
break;
case 1:
case 2:
N(DemoSceneState)++;
N(DemoInitState)++;
break;
case 3: {
partner_clear_player_tracking(wPartnerNpc);

View File

@ -25,7 +25,7 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_SET(GB_StoryProgress, STORY_CH3_HEART_FLED_SECOND_TUNNEL)
EVT_RETURN
EVT_END

View File

@ -25,7 +25,7 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_SET(GB_StoryProgress, STORY_UNUSED_FFFFFFEC)
EVT_RETURN
EVT_END

View File

@ -25,7 +25,7 @@ EvtScript N(EVS_NpcIdle_TubbasHeart) = {
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 0, LVar2, 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_SET(GB_StoryProgress, STORY_CH3_HEART_FLED_SECOND_TUNNEL)
EVT_RETURN
EVT_END

View File

@ -16,7 +16,7 @@ EvtScript N(EVS_NpcInteract_Boo) = {
EvtScript N(EVS_NpcInit_Boo) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Boo)))
EVT_RETURN

View File

@ -24,7 +24,7 @@ s32 N(LetterList)[] = {
ITEM_NONE
};
EvtScript N(EVS_ShopOwner_LetterDelivery) = {
EvtScript N(EVS_LetterPrompt_ShopOwner) = {
EVT_CALL(N(LetterDelivery_Init),
NPC_Mouser_ShopOwner, ANIM_Mouser_Purple_Talk, ANIM_Mouser_Purple_Idle,
ITEM_LETTER19, ITEM_LETTER_TO_FRANKY,

View File

@ -96,16 +96,16 @@ EvtScript N(EVS_NpcInteract_ShopOwner) = {
EVT_IF_EQ(AB_DRO_SHOP_PREV1, 4)
EVT_IF_EQ(AB_DRO_SHOP_PREV2, 1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Mouser_Purple_Talk, ANIM_Mouser_Purple_Idle, 0, MSG_CH2_0088)
EVT_EXEC_WAIT(N(EVS_ShopOwner_LetterDelivery))
EVT_IF_NE(LVarC, 0)
EVT_EXEC_WAIT(N(EVS_LetterPrompt_ShopOwner))
EVT_IF_NE(LVarC, DELIVERY_NOT_POSSIBLE)
EVT_RETURN
EVT_END_IF
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_EXEC_WAIT(ItemShopInteract)
EVT_EXEC_WAIT(N(EVS_ShopOwner_LetterDelivery))
EVT_IF_NE(LVarC, 0)
EVT_EXEC_WAIT(N(EVS_LetterPrompt_ShopOwner))
EVT_IF_NE(LVarC, DELIVERY_NOT_POSSIBLE)
EVT_RETURN
EVT_END_IF
EVT_RETURN

View File

@ -66,7 +66,7 @@ s32 N(LetterList)[] = {
ITEM_NONE
};
EvtScript N(EVS_MrE_LetterPrompt) = {
EvtScript N(EVS_LetterPrompt_MrE) = {
EVT_CALL(N(LetterDelivery_Init),
NPC_Dryite_01, ANIM_Dryite_Blue_Talk, ANIM_Dryite_Blue_Idle,
ITEM_LETTER17, ITEM_LETTER18,
@ -124,7 +124,7 @@ EvtScript N(EVS_NpcInteract_MrE) = {
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Dryite_Blue_Talk, ANIM_Dryite_Blue_Idle, 0, MSG_CH2_0094)
EVT_END_SWITCH
EVT_EXEC_WAIT(N(EVS_MrE_LetterPrompt))
EVT_EXEC_WAIT(N(EVS_LetterPrompt_MrE))
EVT_IF_NE(LVarC, 0)
EVT_RETURN
EVT_END_IF

View File

@ -798,13 +798,13 @@ void N(init_credits)(void) {
}
}
ApiStatus N(InitCredits)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(InitCredits)) {
N(init_credits)();
load_font(1);
return ApiStatus_DONE2;
}
ApiStatus N(ShowCreditList)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(ShowCreditList)) {
CreditsEntry* creditList = (CreditsEntry*) evt_get_variable(script, *script->ptrReadPos);
if (isInitialCall) {

View File

@ -1,6 +1,6 @@
#include "common.h"
ApiStatus N(FlowerGuard_SetItemEntityPosition)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(FlowerGuard_SetItemEntityPosition)) {
Bytecode* args = script->ptrReadPos;
s32 itemIdx = evt_get_variable(script, *args++);
s32 x = evt_get_variable(script, *args++);
@ -15,7 +15,7 @@ ApiStatus N(FlowerGuard_SetItemEntityPosition)(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(FlowerGuard_JudgeItemTastiness)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(FlowerGuard_JudgeItemTastiness)) {
s32 itemId = evt_get_variable(script, *script->ptrReadPos);
ItemData* item = &gItemTable[itemId];
@ -30,7 +30,7 @@ ApiStatus N(FlowerGuard_JudgeItemTastiness)(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus N(FlowerGuard_MakeItemList)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(FlowerGuard_MakeItemList)) {
s32 i;
for (i = 0; i < ITEM_NUM_CONSUMABLES; i++) {

View File

@ -13,7 +13,7 @@ EvtScript N(EVS_SpawnBzzap) = {
EVT_END
};
EvtScript N(Tree1_CallbackScript) = {
EvtScript N(EVS_OnShakeTree1) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_IF_EQ(AB_FLO_TreePuzzle_SecondCorrect, 1)
EVT_CALL(MakeItemEntity, ITEM_HAPPY_FLOWER_B, -250, 100, 0, ITEM_SPAWN_MODE_FALL_NEVER_VANISH, GF_FLO09_Item_HappyFlowerB)
@ -28,7 +28,7 @@ EvtScript N(Tree1_CallbackScript) = {
EVT_END
};
EvtScript N(Tree2_CallbackScript) = {
EvtScript N(EVS_OnShakeTree2) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 1)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
@ -37,7 +37,7 @@ EvtScript N(Tree2_CallbackScript) = {
EVT_END
};
EvtScript N(Tree3_CallbackScript) = {
EvtScript N(EVS_OnShakeTree3) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_IF_EQ(AB_FLO_TreePuzzle_FirstCorrect, 1)
EVT_IF_EQ(AB_FLO_TreePuzzle_SecondCorrect, 0)
@ -60,7 +60,7 @@ FoliageModelList N(Tree1_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_o10);
ShakeTreeConfig N(ShakeTree_Tree1) = {
.leaves = &N(Tree1_LeafModels),
.trunk = &N(Tree1_TrunkModels),
.callback = &N(Tree1_CallbackScript),
.callback = &N(EVS_OnShakeTree1),
};
BombTrigger N(BombPos_Tree1) = {
@ -74,7 +74,7 @@ FoliageModelList N(Tree2_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_o3);
ShakeTreeConfig N(ShakeTree_Tree2) = {
.leaves = &N(Tree2_LeafModels),
.trunk = &N(Tree2_TrunkModels),
.callback = &N(Tree2_CallbackScript),
.callback = &N(EVS_OnShakeTree2),
};
BombTrigger N(BombPos_Tree2) = {
@ -88,7 +88,7 @@ FoliageModelList N(Tree3_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_o13);
ShakeTreeConfig N(ShakeTree_Tree3) = {
.leaves = &N(Tree3_LeafModels),
.trunk = &N(Tree3_TrunkModels),
.callback = &N(Tree3_CallbackScript),
.callback = &N(EVS_OnShakeTree3),
};
BombTrigger N(BombPos_Tree3) = {

View File

@ -129,7 +129,7 @@ EvtScript N(EVS_Main) = {
EVT_END
};
ApiStatus N(FadeToTitleScreen)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(FadeToTitleScreen)) {
if (isInitialCall) {
script->functionTemp[0] = 0;
set_curtain_scale_goal(1.0);
@ -147,7 +147,7 @@ ApiStatus N(FadeToTitleScreen)(Evt* script, s32 isInitialCall) {
return script->functionTemp[0] == 255;
}
ApiStatus N(ChangeStateToTitleScreen)(Evt* script, s32 isInitialCall) {
API_CALLABLE(N(ChangeStateToTitleScreen)) {
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->unk_76 = 0;
gGameStatusPtr->disableScripts = 0;

View File

@ -1,4 +1,4 @@
#include "battle/battle.h"
#include "common.h"
#include "effects.h"
ApiStatus N(UnkEffect0FFunc2)(Evt* script, s32 isInitialCall) {
@ -117,3 +117,90 @@ ApiStatus N(UnkEffect0FFunc4)(Evt* script, s32 isInitialCall) {
fx_star(2, var1, var2, var3, var4, var5, var6, rand_int(4) + 10);
return ApiStatus_DONE2;
}
EvtScript N(EVS_Starfall_Directed) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarD, 0)
EVT_SET(LVarE, 0)
EVT_LABEL(0)
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_IF_LT(LVar1, -50)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_SET(LVar8, 1000)
EVT_SUB(LVar8, LVar1)
EVT_DIV(LVar8, 10)
EVT_IF_LT(LVar8, 20)
EVT_SET(LVar8, 20)
EVT_END_IF
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_CALL(RandInt, 400, LVarA)
EVT_SET(LVarB, 200)
EVT_CALL(RandInt, 400, LVarC)
EVT_SUB(LVarC, 200)
EVT_ADD(LVar1, LVarA)
EVT_ADD(LVar2, LVarB)
EVT_ADD(LVar3, LVarC)
EVT_SET(LVar4, LVar1)
EVT_CALL(RandInt, 100, LVarA)
EVT_ADD(LVarA, 50)
EVT_SUB(LVar4, LVarA)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, LVar3)
EVT_CALL(RandInt, 4, LVar7)
EVT_ADD(LVar7, 10)
EVT_SWITCH(LVar3)
EVT_CASE_LT(-290)
EVT_SET(LVar0, 0)
EVT_CASE_LT(40)
EVT_SET(LVar0, 2)
EVT_CASE_GE(40)
EVT_SET(LVar0, 1)
EVT_END_SWITCH
EVT_IF_LT(LVarE, 2)
EVT_CALL(PlaySoundAt, SOUND_B0000015, 0, LVar1, LVar2, LVar3)
EVT_ADD(LVarE, 1)
EVT_END_IF
EVT_ADD(LVarD, LVar8)
EVT_IF_GT(LVarD, 30)
EVT_SET(LVarD, 0)
EVT_SET(LVarE, 0)
EVT_END_IF
EVT_CALL(N(UnkEffect0FFunc2), LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, LVar6, LVar7)
EVT_WAIT(LVar8)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Starfall_Random) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_THREAD
EVT_LABEL(0)
EVT_CALL(RandInt, 50, LVar0)
EVT_ADD(LVar0, 10)
EVT_CALL(N(UnkEffect0FFunc))
EVT_WAIT(LVar0)
EVT_GOTO(0)
EVT_END_THREAD
EVT_THREAD
EVT_LABEL(1)
EVT_CALL(RandInt, 50, LVar0)
EVT_ADD(LVar0, 20)
EVT_CALL(N(UnkEffect0FFunc3))
EVT_WAIT(LVar0)
EVT_GOTO(1)
EVT_END_THREAD
EVT_THREAD
EVT_LABEL(2)
EVT_CALL(RandInt, 50, LVar0)
EVT_ADD(LVar0, 20)
EVT_CALL(N(UnkEffect0FFunc4))
EVT_CALL(PlaySoundAt, SOUND_B0000015, 0, LVar1, LVar2, LVar3)
EVT_WAIT(LVar0)
EVT_GOTO(2)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,68 @@
#include "common.h"
enum {
INTRO_MATH_EASING_LINEAR = 0,
INTRO_MATH_EASING_SIN_OUT = 1,
INTRO_MATH_EASING_SIN_OUT_DELAYED = 2,
INTRO_MATH_EASING_COS_IN_OUT = 3,
INTRO_MATH_EASING_4 = 4,
#ifdef INTRO_MATH_EXTENDED
INTRO_MATH_EASING_5 = 5,
#endif
};
void N(lerp_value_with_max_step)(f32 start, f32 end, f32 current, f32 maximum, f32* out) {
f32 remaining = end - current;
if (end - start > 0.0f) {
if (remaining < 0.0f) {
*out = end;
} else if (maximum < remaining) {
*out += maximum;
} else {
*out += remaining;
}
} else if (remaining > 0.0f) {
*out = end;
} else if (remaining < -maximum) {
*out -= maximum;
} else {
*out += remaining;
}
}
void N(interp_value_with_easing)(s32 easingMode, f32 start, f32 end, f32 curent, f32 max, f32* out) {
f32 alpha;
if (curent > max) {
curent = max;
}
switch (easingMode) {
case INTRO_MATH_EASING_SIN_OUT:
alpha = sin_deg((curent / max) * 90.0f);
break;
case INTRO_MATH_EASING_SIN_OUT_DELAYED:
if (curent < 30.0f) {
alpha = 0.0f;
} else {
alpha = sin_deg((((curent - 30.0f) / (max - 30.0f)) * 90.0f) + -90.0f) + 1.0f;
}
break;
case INTRO_MATH_EASING_COS_IN_OUT:
alpha = (sin_deg(((curent / max) * 180.0f) - 90.0f) + 1.0f) * 0.5;
break;
case INTRO_MATH_EASING_4:
alpha = sin_deg(((curent / max) * 90.0f) - 90.0f) + 1.0f;
break;
#ifdef INTRO_MATH_EXTENDED
case INTRO_MATH_EASING_5:
alpha = (2.0 * (sin_deg(((curent / max) * 60.0f) - 60.0f) + 0.8660254f)) / 1.7320507764816284;
break;
#endif
default:
alpha = curent / max;
break;
}
*out = start + ((end - start) * alpha);
}

View File

@ -0,0 +1,103 @@
#include "common.h"
#define INTRO_MSG_BLANK -1
enum {
INTRO_MSG_STATE_APPEAR = 0,
INTRO_MSG_STATE_SHOWING = 1,
INTRO_MSG_STATE_VANISH = 2,
INTRO_MSG_STATE_DONE = 3,
INTRO_MSG_STATE_BLANK = 4,
};
typedef struct IntroMessage {
/* 00 */ s32 messageID;
/* 04 */ s32 duration;
} IntroMessage; // size: 0x8
u32 N(IntroMessageState) = 0; // mode
s32 N(IntroMessageAlpha) = 0; // alpha related
IntroMessage* N(CurMessageList) = NULL;
void N(UpdateIntroMessages)(IntroMessage** introMessageLists) {
u8 type;
f32 zoom1;
f32 zoom2;
s32 messageID;
s32 opacity;
s32 yOffset;
static s32 N(IntroMessageDelay);
if (N(CurMessageList) == NULL) {
N(CurMessageList) = introMessageLists[D_800779B0];
}
switch (N(IntroMessageState)) {
case INTRO_MSG_STATE_APPEAR:
if (N(CurMessageList)->messageID == INTRO_MSG_BLANK) {
N(IntroMessageState) = INTRO_MSG_STATE_BLANK;
N(IntroMessageDelay) = N(CurMessageList)->duration;
} else {
N(IntroMessageAlpha) += 10;
if (N(IntroMessageAlpha) > 255) {
N(IntroMessageAlpha) = 255;
N(IntroMessageState) = INTRO_MSG_STATE_SHOWING;
N(IntroMessageDelay) = N(CurMessageList)->duration;
}
}
break;
case INTRO_MSG_STATE_SHOWING:
if (N(IntroMessageDelay) == 0) {
N(IntroMessageState) = INTRO_MSG_STATE_VANISH;
} else {
N(IntroMessageDelay)--;
}
break;
case INTRO_MSG_STATE_VANISH:
N(IntroMessageAlpha) -= 10;
if (N(IntroMessageAlpha) < 0) {
N(IntroMessageAlpha) = 0;
N(CurMessageList)++;
if (N(CurMessageList)->messageID == MSG_NONE) {
N(IntroMessageState) = INTRO_MSG_STATE_DONE;
} else {
N(IntroMessageState) = INTRO_MSG_STATE_APPEAR;
}
}
break;
case INTRO_MSG_STATE_DONE:
break;
case INTRO_MSG_STATE_BLANK:
if (N(IntroMessageDelay) != 0) {
N(IntroMessageDelay)--;
break;
}
N(CurMessageList)++;
if (N(CurMessageList)->messageID == MSG_NONE) {
N(IntroMessageState) = INTRO_MSG_STATE_DONE;
} else {
N(IntroMessageState) = INTRO_MSG_STATE_APPEAR;
}
break;
}
get_screen_overlay_params(1, &type, &zoom1);
get_screen_overlay_params(0, &type, &zoom2);
opacity = ((N(IntroMessageAlpha) * (255.0f - zoom1) * (255.0f - zoom2)) / 255.0f) / 255.0f;
if (opacity > 0) {
messageID = N(CurMessageList)->messageID;
if (messageID != 0) {
yOffset = 0;
if (get_msg_lines(messageID) >= 2) {
yOffset = -7;
}
draw_msg(N(CurMessageList)->messageID, 0, yOffset + 196, opacity, -1, 0);
}
}
}
API_CALLABLE(N(SetCurtainCallback)) {
Bytecode* args = script->ptrReadPos;
set_curtain_draw_callback((void (*)) evt_get_variable(script, *args++));
return ApiStatus_DONE2;
}

View File

@ -2,13 +2,13 @@
#define _WORLD_AREA_HOS_HOS_H_
enum {
AB_HOS_Unused_0 = AreaByte(0),
AB_HOS_Unused_1 = AreaByte(1),
AB_HOS_Unused_2 = AreaByte(2),
AB_HOS_Unused_3 = AreaByte(3),
AB_HOS_Unused_4 = AreaByte(4),
AB_HOS_Unused_5 = AreaByte(5),
AB_HOS_Unused_6 = AreaByte(6),
AB_HOS_StatcAmt_Eldstar = AreaByte(0),
AB_HOS_StatcAmt_Mamar = AreaByte(1),
AB_HOS_StatcAmt_Skolar = AreaByte(2),
AB_HOS_StatcAmt_Muskular = AreaByte(3),
AB_HOS_StatcAmt_Misstar = AreaByte(4),
AB_HOS_StatcAmt_Klevar = AreaByte(5),
AB_HOS_StatcAmt_Kalmar = AreaByte(6),
AB_HOS_Unused_7 = AreaByte(7),
AB_HOS_Unused_8 = AreaByte(8),
AB_HOS_Unused_9 = AreaByte(9),
@ -20,6 +20,15 @@ enum {
AB_HOS_Unused_F = AreaByte(15),
};
enum {
AF_HOS06_BadgeHints = AreaFlag(3),
AF_HOS06_SuperBlocksHints = AreaFlag(100),
AF_HOS06_StarPieceHints = AreaFlag(116),
AF_HOS_B4 = AreaFlag(180),
AF_HOS_B5 = AreaFlag(181),
AF_HOS06_SpokeWithMerluvlee = AreaFlag(182),
};
extern MapSettings hos_00_settings;
extern MapSettings hos_01_settings;
extern MapSettings hos_02_settings;
@ -30,4 +39,7 @@ extern MapSettings hos_06_settings;
extern MapSettings hos_10_settings;
extern MapSettings hos_20_settings;
s32 hos_00_map_init(void);
s32 hos_10_map_init(void);
#endif

View File

@ -1,8 +0,0 @@
#include "hos_00.h"
ApiStatus func_80240000_A0BCF0(Evt* script, s32 isInitialCall) {
if (gGameStatusPtr->entryID == 3) {
sprintf(wMapBgName, "hos_bg\0\0\0\0\0\0\0\0\0");
}
return ApiStatus_BLOCK;
}

View File

@ -1,10 +0,0 @@
#include "hos_00.h"
#include "effects.h"
#include "common/UnkEffect0FFuncs.inc.c"
static char* N(exit_str_0) = "osr_00";
static char* N(exit_str_1) = "osr_01";
static char* N(exit_str_2) = "hos_01";
static char* N(exit_str_3) = "hos_06";
static char* N(exit_str_4) = "\0\0\0\0";

View File

@ -1,10 +0,0 @@
#include "hos_00.h"
static char* N(exit_str_4) = "osr_01";
ApiStatus func_802407C0_A0C4B0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
gPlayerData.currentPartner = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}

View File

@ -1,65 +0,0 @@
#include "hos_00.h"
extern f32 D_80242B9C_A0E88C;
extern f32 D_80242BA0_A0E890;
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
ApiStatus N(EnableActionCommands)(Evt* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
playerData->hasActionCommands = TRUE;
return ApiStatus_DONE2;
}
ApiStatus func_8024091C_A0C60C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32 f1 = evt_get_float_variable(script, *args++);
f32 f2 = evt_get_float_variable(script, *args++);
evt_set_float_variable(script, *args++, f1 * sin_deg(f2));
return ApiStatus_DONE2;
}
ApiStatus func_80240994_A0C684(Evt* script, s32 isInitialCall) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
Npc* npc = get_npc_unsafe(0);
partner->yaw = atan2(partner->pos.x, partner->pos.z, npc->pos.x, npc->pos.z);
gPlayerStatus.targetYaw = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, npc->pos.x, npc->pos.z);
npc->yaw = atan2(D_80242B9C_A0E88C, D_80242BA0_A0E890, npc->pos.x, npc->pos.z);
D_80242B9C_A0E88C = npc->pos.x;
D_80242BA0_A0E890 = npc->pos.z;
return ApiStatus_DONE2;
}
ApiStatus func_80240A54_A0C744(Evt* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(1);
if (npc->yaw < 180.0f) {
script->varTable[0] = npc->pos.x - 40.0f;
script->varTable[1] = npc->pos.y + 10.0f;
script->varTable[2] = npc->pos.z;
} else {
script->varTable[0] = npc->pos.x + 40.0f;
script->varTable[1] = npc->pos.y + 10.0f;
script->varTable[2] = npc->pos.z;
}
npc->yaw = atan2(script->varTable[6], script->varTable[8], npc->pos.x, npc->pos.z);
return ApiStatus_DONE2;
}
#include "world/common/todo/SetCamera0Flag1000.inc.c"
ApiStatus func_80240B3C_A0C82C(Evt* script, s32 isInitialCall) {
s32 temp_s1 = script->varTable[0];
s32 temp_s2 = script->varTable[2];
script->varTable[0] = temp_s1 + (sin_deg(310.0f) * 100.0f);
script->varTable[1] = temp_s2 - (cos_deg(310.0f) * 100.0f);
script->varTable[2] = temp_s1 + (sin_deg(130.0f) * 100.0f);
script->varTable[3] = temp_s2 - (cos_deg(130.0f) * 100.0f);
return ApiStatus_DONE2;
}

View File

@ -2,8 +2,39 @@
/// @brief Shooting Star Summit - Shooting Star Path
#include "common.h"
#include "../hos.h"
#include "message_ids.h"
#include "map.h"
#include "../hos.h"
#include "mapfs/hos_00_shape.h"
#include "mapfs/hos_00_hit.h"
#include "sprite/npc/ToadKid.h"
#include "sprite/npc/Toadette.h"
#include "sprite/npc/Twink.h"
#include "sprite/npc/FlyingMagikoopa.h"
#include "sprite/npc/WorldGoombario.h"
enum {
NPC_Twink = 0,
NPC_FlyingMagikoopa = 1,
NPC_Toadette = 2,
NPC_ToadKid = 3,
};
enum {
MV_LuckyStarItem = MapVar(10),
};
#define NAMESPACE hos_00
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_PlayKammyKoopaSong);
extern EvtScript N(EVS_Scene_MeetingTwink);
extern EvtScript N(EVS_Scene_TwinkDeparts);
extern EvtScript N(EVS_Scene_Wishing);
extern EvtScript N(EVS_MakeEntities);
extern EvtScript N(EVS_SetupBackgroundShade);
extern NpcGroupList N(DefaultNPCs);
extern NpcGroupList N(WishingNPCs);

View File

@ -0,0 +1,25 @@
#include "hos_00.h"
s32 N(map_init)(void) {
if (gGameStatusPtr->entryID == hos_00_ENTRY_3) {
sprintf(wMapBgName, "hos_bg");
}
return FALSE;
}
MAP_RODATA_PAD(1, init);
EntryList N(Entrances) = {
[hos_00_ENTRY_0] { -610.0, 0.0, -45.0, 90.0 },
[hos_00_ENTRY_1] { 870.0, 60.0, -130.0, 270.0 },
[hos_00_ENTRY_2] { 870.0, -10.0, 30.0, 270.0 },
[hos_00_ENTRY_3] { 870.0, -10.0, 30.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_hos_00 },
};

View File

@ -0,0 +1,72 @@
#include "hos_00.h"
EvtScript N(EVS_PlayToadTownSong) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_RANGE(STORY_CH3_STAR_SPRIT_DEPARTED, STORY_CH4_STAR_SPIRIT_RESCUED)
EVT_CALL(SetMusicTrack, 0, SONG_SHY_GUY_INVASION, 0, 6)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_TOAD_TOWN, 0, 6)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PlayMusicByPosition) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_00_ENTRY_0)
EVT_EXEC(N(EVS_PlayToadTownSong))
EVT_END_CASE_GROUP
EVT_CASE_OR_EQ(hos_00_ENTRY_1)
EVT_CASE_OR_EQ(hos_00_ENTRY_2)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_IF_NE(LVar0, 0)
EVT_GOTO(20)
EVT_END_IF
EVT_LABEL(10)
EVT_WAIT(1)
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_IF_GT(LVar1, 210)
EVT_CALL(FadeOutMusic, 0, 833)
EVT_WAIT(25)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_WAIT(30)
EVT_GOTO(20)
EVT_END_IF
EVT_GOTO(10)
EVT_LABEL(20)
EVT_WAIT(1)
EVT_IF_EQ(GB_StoryProgress, STORY_CH0_BEGAN_PEACH_MISSION)
EVT_GOTO(20)
EVT_END_IF
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_IF_LT(LVar1, -55)
EVT_CALL(FadeOutMusic, 0, 833)
EVT_WAIT(25)
EVT_EXEC(N(EVS_PlayToadTownSong))
EVT_WAIT(30)
EVT_GOTO(10)
EVT_END_IF
EVT_GOTO(20)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_00_ENTRY_3)
EVT_CALL(SetMusicTrack, 0, SONG_STARSHIP_THEME, 0, 8)
EVT_ELSE
EVT_EXEC(N(EVS_PlayMusicByPosition))
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PlayKammyKoopaSong) = {
EVT_CALL(SetMusicTrack, 0, SONG_KAMMY_KOOPA_THEME, 0, 8)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,95 @@
#include "hos_00.h"
#include "../common/FallingStars.inc.c"
EvtScript N(EVS_ExitWalk_osr) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(UseExitHeading, 60, hos_00_ENTRY_0)
EVT_EXEC(ExitWalk)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_RANGE(STORY_CH0_WAKE_UP, STORY_CH8_REACHED_PEACHS_CASTLE)
EVT_CALL(GotoMap, EVT_PTR("osr_01"), osr_01_ENTRY_1)
EVT_CASE_DEFAULT
EVT_CALL(GotoMap, EVT_PTR("osr_00"), osr_00_ENTRY_1)
EVT_END_SWITCH
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ExitWalk_hos_01_0) = EVT_EXIT_WALK(60, hos_00_ENTRY_1, "hos_01", hos_01_ENTRY_0);
EvtScript N(EVS_ExitWalk_hos_06_0) = EVT_EXIT_WALK(60, hos_00_ENTRY_2, "hos_06", hos_06_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_osr)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_01_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiline, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_06_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilise, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TexPan_Unknown) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_SET(LVar0, 0)
EVT_LOOP(0)
EVT_CALL(SetTexPanOffset, TEX_PANNER_D, TEX_PANNER_MAIN, LVar0, 0)
EVT_ADD(LVar0, 0x4000)
EVT_WAIT(15)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetLoadType, LVar1)
EVT_IF_EQ(LVar1, LOAD_FROM_FILE_SELECT)
EVT_EXEC(N(EVS_SetupBackgroundShade))
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_RETURN
EVT_END_IF
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_00_ENTRY_3)
EVT_CALL(SetGroupEnabled, MODEL_g107, 0)
EVT_EXEC(N(EVS_Scene_Wishing))
EVT_RETURN
EVT_ELSE
EVT_EXEC(N(EVS_SetupBackgroundShade))
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_SHOOTING_STAR_SUMMIT)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_SET(GF_MAP_ShootingStarSummit, TRUE)
EVT_SET(GF_MAC01_RowfBadgesChosen, FALSE)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_00_ENTRY_3)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(WishingNPCs)))
EVT_ELSE
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_CALL(GetEntryID, LVar0)
EVT_IF_NE(LVar0, hos_00_ENTRY_3)
EVT_EXEC(N(EVS_Starfall_Directed))
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_EQ(GB_StoryProgress, STORY_CH0_BEGAN_PEACH_MISSION)
EVT_IF_EQ(AF_HOS_B4, FALSE)
EVT_WAIT(50)
EVT_SET(AF_HOS_B4, TRUE)
EVT_END_IF
EVT_EXEC(N(EVS_Scene_MeetingTwink))
EVT_END_IF
EVT_EXEC(N(EVS_EnterMap))
EVT_EXEC(N(EVS_TexPan_Unknown))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,12 @@
#include "hos_00.h"
EvtScript N(EVS_TexPan_ToggleUnused) = {
EVT_LABEL(0)
EVT_CALL(SetTexPanOffset, TEX_PANNER_D, TEX_PANNER_MAIN, 0, 0)
EVT_WAIT(10)
EVT_CALL(SetTexPanOffset, TEX_PANNER_D, TEX_PANNER_MAIN, 0x4000, 0)
EVT_WAIT(10)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,178 @@
#include "hos_00.h"
#include "world/common/npc/Twink.inc.c"
#include "world/common/npc/Toad_Stationary.inc.c"
#include "world/common/enemy/complete/FlyingMagikoopa.h"
NpcSettings N(NpcSettings_FlyingMagikoopa) = {
.height = 34,
.radius = 24,
.level = 26,
.onHit = &EnemyNpcHit,
.onDefeat = &EnemyNpcDefeat,
};
EvtScript N(EVS_Scene_Wishing) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 305, -10, -50)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 305, -10, -50)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(400.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(9.0), EVT_FLOAT(-10.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_CALL(SpeakToPlayer, NPC_ToadKid, ANIM_ToadKid_Red_Talk, ANIM_ToadKid_Red_Disappointed, 0, MSG_HOS_006C)
EVT_WAIT(10)
EVT_CALL(SetNpcAnimation, NPC_ToadKid, ANIM_ToadKid_Red_Idle)
EVT_CALL(SpeakToPlayer, NPC_Toadette, ANIM_Toadette_Pink_Talk, ANIM_Toadette_Pink_Idle, 0, MSG_HOS_006D)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_ToadKid, ANIM_ToadKid_Red_Talk, ANIM_ToadKid_Red_Idle, 0, MSG_HOS_006E)
EVT_WAIT(50)
EVT_CALL(GotoMap, EVT_PTR("osr_01"), osr_01_ENTRY_3)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_FlyingMagikoopa) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_CALL(GetPlayerPos, LVar3, LVar1, LVar2)
EVT_CALL(SetPlayerPos, LVar3, LVar1, -45)
EVT_ADD(LVar3, 40)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar3, LVar1, -45)
EVT_CALL(GetNpcPos, NPC_Twink, LVar3, LVar1, LVar2)
EVT_ADD(LVar3, -25)
EVT_CALL(SetNpcPos, NPC_Twink, LVar3, LVar1, -45)
EVT_EXEC(N(EVS_Scene_TwinkDeparts))
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_FlyingMagikoopa) = {
EVT_LABEL(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CASE_EQ(1)
EVT_CALL(StartBossBattle, SONG_SPECIAL_BATTLE)
EVT_END_SWITCH
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_FlyingMagikoopa) = {
EVT_IF_LT(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_FlyingMagikoopa)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_FlyingMagikoopa)))
EVT_ELSE
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_IF
EVT_RETURN
EVT_END
};
API_CALLABLE(N(SetCurrentPartner)) {
gPlayerData.currentPartner = evt_get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2;
}
EvtScript N(EVS_NpcIdle_Twink) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(EnablePartner, PARTNER_TWINK)
EVT_CALL(N(SetCurrentPartner), PARTNER_TWINK)
EVT_CALL(StartBattle)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Twink) = {
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Twink) = {
EVT_CALL(SetSelfVar, 0, 2)
EVT_CALL(DisablePartner, PARTNER_TWINK)
EVT_CALL(N(SetCurrentPartner), PARTNER_GOOMBARIO)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Twink) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Twink)))
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Twink)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Twink)))
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Twink) = {
.id = NPC_Twink,
.settings = &N(NpcSettings_Twink),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_4 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_Twink),
.drops = NPC_NO_DROPS,
.animations = TWINK_ANIMS,
};
StaticNpc N(NpcData_FlyingMagikoopa) = {
.id = NPC_FlyingMagikoopa,
.settings = &N(NpcSettings_FlyingMagikoopa),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_40000 | ENEMY_FLAG_800000,
.init = &N(EVS_NpcInit_FlyingMagikoopa),
.drops = NPC_NO_DROPS,
.animations = FLYING_MAGIKOOPA_ANIMS,
};
StaticNpc N(NpcData_Wishing)[] = {
{
.id = NPC_Toadette,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { 280.0f, -10.0f, -50.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1,
.drops = NPC_NO_DROPS,
.animations = TOADETTE_PINK_ANIMS,
},
{
.id = NPC_ToadKid,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { 330.0f, -10.0f, -40.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1,
.drops = NPC_NO_DROPS,
.animations = TOAD_KID_RED_ANIMS,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Twink), BTL_HOS_FORMATION_00),
NPC_GROUP(N(NpcData_FlyingMagikoopa), BTL_HOS_FORMATION_03),
{}
};
NpcGroupList N(WishingNPCs) = {
NPC_GROUP(N(NpcData_Wishing)),
{}
};

View File

@ -0,0 +1,29 @@
#include "hos_00.h"
#include "entity.h"
EvtScript N(EVS_ReadSign_ToSummit) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_016E, 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ReadSign_ToMerluvlee) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_016D, 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_Signpost), 450, 10, -185, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(EVS_ReadSign_ToSummit)))
EVT_CALL(MakeEntity, EVT_PTR(Entity_Signpost), 855, -10, -40, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(EVS_ReadSign_ToMerluvlee)))
EVT_CALL(MakeEntity, EVT_PTR(Entity_HiddenPanel), 380, -10, 25, 0, MODEL_o239, MAKE_ENTITY_END)
EVT_CALL(AssignPanelFlag, GF_HOS00_HiddenPanel)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,581 @@
#include "hos_00.h"
#include "world/common/complete/GiveReward.inc.c"
Vec3f N(TwinkArrivePath)[] = {
{ 0.0, 0.0, 2.0 },
{ 73.0, -6.0, 2.0 },
{ 106.0, 32.0, 2.0 },
{ 70.0, 43.0, 2.0 },
{ 30.0, 12.0, 2.0 },
{ -17.0, -19.0, 2.0 },
{ -35.0, 29.0, 2.0 },
{ -20.0, 43.0, 2.0 },
{ -11.0, 39.0, 2.0 },
{ 0.0, -1.0, 0.0 },
};
Vec3f N(FlightPath_Magikoopa)[] = {
{ 15.0, 174.0, -45.0 },
{ -157.0, 92.0, -44.0 },
{ -371.0, 103.0, -45.0 },
{ -350.0, 75.0, -45.0 },
{ -250.0, 40.0, -45.0 },
};
Vec3f N(TwinkDepartPath1)[] = {
{ 0.0, 0.0, 0.0 },
{ -60.0, 3.0, -11.0 },
{ -55.0, 13.0, 0.0 },
{ 4.0, 40.0, -5.0 },
{ 23.0, 35.0, -10.0 },
{ 63.0, 25.0, -20.0 },
{ 94.0, 30.0, -40.0 },
{ 134.0, 250.0, -80.0 },
};
Vec3f N(TwinkReturnPath)[] = {
{ -72.0, 318.0, -80.0 },
{ -127.0, 153.0, -60.0 },
{ -174.0, 114.0, -44.0 },
{ -243.0, 90.0, -45.0 },
{ -268.0, 50.0, -46.0 },
{ -174.0, 10.0, -43.0 },
};
Vec3f N(TwinkDepartPath2)[] = {
{ 0.0, 0.0, 0.0 },
{ -30.0, 3.0, -11.0 },
{ -55.0, 13.0, 0.0 },
{ -73.0, 20.0, -5.0 },
{ -103.0, 40.0, 0.0 },
{ -143.0, 60.0, 0.0 },
{ -173.0, 50.0, 26.0 },
{ -126.0, 35.0, 16.0 },
{ 1111.0, 570.0, -527.0 },
};
API_CALLABLE(N(EnableActionCommands)) {
gPlayerData.hasActionCommands = TRUE;
return ApiStatus_DONE2;
}
API_CALLABLE(N(UnusedTrigFunc)) {
Bytecode* args = script->ptrReadPos;
f32 magnitude = evt_get_float_variable(script, *args++);
f32 angle = evt_get_float_variable(script, *args++);
evt_set_float_variable(script, *args++, magnitude * sin_deg(angle));
return ApiStatus_DONE2;
}
f32 N(LastTwinkPosX) = 0;
f32 N(LastTwinkPosZ) = 0;
API_CALLABLE(N(HavePartyFaceTwink)) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
Npc* npc = get_npc_unsafe(NPC_Twink);
partner->yaw = atan2(partner->pos.x, partner->pos.z, npc->pos.x, npc->pos.z);
gPlayerStatus.targetYaw = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, npc->pos.x, npc->pos.z);
npc->yaw = atan2(N(LastTwinkPosX), N(LastTwinkPosZ), npc->pos.x, npc->pos.z);
N(LastTwinkPosX) = npc->pos.x;
N(LastTwinkPosZ) = npc->pos.z;
return ApiStatus_DONE2;
}
API_CALLABLE(N(UpdateMagikoopaAngles)) {
Npc* npc = get_npc_unsafe(NPC_FlyingMagikoopa);
if (npc->yaw < 180.0f) {
script->varTable[0] = npc->pos.x - 40.0f;
script->varTable[1] = npc->pos.y + 10.0f;
script->varTable[2] = npc->pos.z;
} else {
script->varTable[0] = npc->pos.x + 40.0f;
script->varTable[1] = npc->pos.y + 10.0f;
script->varTable[2] = npc->pos.z;
}
npc->yaw = atan2(script->varTable[6], script->varTable[8], npc->pos.x, npc->pos.z);
return ApiStatus_DONE2;
}
#include "world/common/todo/SetCamera0Flag1000.inc.c"
API_CALLABLE(N(AddOffsetForCamPos)) {
s32 baseX = script->varTable[0];
s32 baseZ = script->varTable[2];
script->varTable[0] = baseX + (sin_deg(310.0f) * 100.0f);
script->varTable[1] = baseZ - (cos_deg(310.0f) * 100.0f);
script->varTable[2] = baseX + (sin_deg(130.0f) * 100.0f);
script->varTable[3] = baseZ - (cos_deg(130.0f) * 100.0f);
return ApiStatus_DONE2;
}
EvtScript N(EVS_UpdateFacingMagikoopa) = {
EVT_CALL(GetNpcPos, NPC_FlyingMagikoopa, LVar6, LVar7, LVar8)
EVT_LABEL(0)
EVT_CALL(GetNpcPos, NPC_FlyingMagikoopa, LVar3, LVar4, LVar5)
EVT_SET(LVar9, LVar3)
EVT_SET(LVarA, LVar4)
EVT_SET(LVarB, LVar5)
EVT_SUB(LVar3, LVar6)
EVT_SUB(LVar4, LVar7)
EVT_SUB(LVar5, LVar8)
EVT_CALL(N(UpdateMagikoopaAngles))
EVT_SET(LVar6, LVar9)
EVT_SET(LVar7, LVarA)
EVT_SET(LVar8, LVarB)
EVT_CALL(PlayerFaceNpc, NPC_FlyingMagikoopa, FALSE)
EVT_CALL(GetAngleBetweenNPCs, NPC_Twink, NPC_FlyingMagikoopa, LVar0)
EVT_CALL(InterpNpcYaw, NPC_Twink, LVar0, 0)
EVT_CALL(GetAngleBetweenNPCs, NPC_PARTNER, NPC_FlyingMagikoopa, LVar0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, LVar0, 0)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ConfusedTwinkLookingAround) = {
EVT_LOOP(0)
EVT_CALL(InterpNpcYaw, NPC_Twink, 270, 0)
EVT_WAIT(10)
EVT_CALL(InterpNpcYaw, NPC_Twink, 90, 0)
EVT_WAIT(10)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
// add an offset to Twink's position to counter the one from his sprite
EvtScript N(EVS_Twink_CancelHoverOffset) = {
EVT_LOOP(0)
EVT_LOOP(5)
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 1)
EVT_CALL(SetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_WAIT(3)
EVT_END_LOOP
EVT_WAIT(3)
EVT_LOOP(5)
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, -1)
EVT_CALL(SetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_WAIT(3)
EVT_END_LOOP
EVT_WAIT(3)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Twink_CarryItem) = {
EVT_LOOP(0)
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_ADD(LVar2, 2)
EVT_CALL(SetItemPos, MV_LuckyStarItem, LVar0, LVar1, LVar2)
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_MeetingTwink) = {
EVT_LOOP(0)
EVT_WAIT(1)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar0, -100)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(func_802CF56C, 2)
EVT_THREAD
EVT_ADD(LVar0, -20)
EVT_CALL(PlayerMoveTo, LVar0, LVar2, 10)
EVT_END_THREAD
EVT_CALL(SetNpcPos, NPC_Twink, 50, 180, 0)
EVT_CALL(SetNpcJumpscale, NPC_Twink, 0)
EVT_ADD(LVar0, -10)
EVT_CALL(NpcJump0, NPC_Twink, LVar0, 20, LVar2, 15)
EVT_CALL(PlaySoundAtPlayer, SOUND_HIT_PLAYER_NORMAL, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_ShockStill)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Cringe)
EVT_THREAD
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Disappointed)
EVT_CALL(SetNpcJumpscale, NPC_Twink, EVT_FLOAT(0.6))
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -100)
EVT_CALL(NpcJump0, NPC_Twink, LVar0, 10, LVar2, 20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 5, EVT_FLOAT(2.0))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar3, 360)
EVT_LOOP(3)
EVT_LABEL(22)
EVT_WAIT(1)
EVT_SUB(LVar3, 45)
EVT_IF_GT(LVar3, 0)
EVT_CALL(SetNpcRotation, NPC_Twink, 0, LVar3, 0)
EVT_IF_EQ(LVar3, 270)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Back)
EVT_END_IF
EVT_IF_EQ(LVar3, 90)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Disappointed)
EVT_END_IF
EVT_GOTO(22)
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcRotation, NPC_Twink, 0, 0, 0)
EVT_END_THREAD
EVT_CALL(ShowMessageAtScreenPos, MSG_HOS_000D, 160, 40)
EVT_CALL(SetMusicTrack, 0, SONG_TWINK_THEME, 0, 8)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Idle)
EVT_CALL(NpcFacePlayer, NPC_Twink, 0)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Shout, ANIM_Twink_Idle, 0, MSG_HOS_000E)
EVT_CALL(N(SetCamera0Flag1000))
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -20)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 275)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(16.0), EVT_FLOAT(-8.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetNpcSpeed, NPC_Twink, EVT_FLOAT(3.0))
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 40)
EVT_CALL(NpcMoveTo, NPC_Twink, LVar0, LVar2, 0)
EVT_CALL(ShowEmote, NPC_Twink, EMOTE_SHOCK, 45, 20, TRUE, 0, 0, 0, 0)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_ShoutJoy)
EVT_CALL(SetNpcJumpscale, NPC_Twink, EVT_FLOAT(1.0))
EVT_LOOP(2)
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Twink, LVar0, LVar1, LVar2, 15)
EVT_END_LOOP
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 25)
EVT_CALL(NpcJump0, NPC_PARTNER, LVar0, LVar1, LVar2, 10)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_000F)
EVT_WAIT(5)
EVT_CALL(GetNpcPos, NPC_Twink, LVar4, LVar5, LVar6)
EVT_CALL(LoadPath, 70, EVT_PTR(N(TwinkArrivePath)), ARRAY_COUNT(N(TwinkArrivePath)), EASING_LINEAR)
EVT_LABEL(1)
EVT_CALL(GetNextPathPos)
EVT_ADDF(LVar1, LVar4)
EVT_ADDF(LVar2, LVar5)
EVT_ADDF(LVar3, LVar6)
EVT_CALL(SetNpcPos, NPC_Twink, LVar1, LVar2, LVar3)
EVT_CALL(N(HavePartyFaceTwink))
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(1)
EVT_END_IF
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Idle)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0010)
EVT_CALL(SetNpcYaw, NPC_Twink, 270)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Back)
EVT_CALL(SpeakToPlayer, NPC_Twink, -1, -1, 5, MSG_HOS_0011)
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(MakeItemEntity, ITEM_LUCKY_STAR, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(MV_LuckyStarItem, LVar0)
EVT_EXEC_GET_TID(N(EVS_Twink_CancelHoverOffset), LVar8)
EVT_EXEC_GET_TID(N(EVS_Twink_CarryItem), LVar9)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Wink)
EVT_CALL(ContinueSpeech, NPC_Twink, -1, -1, 512, MSG_HOS_0012)
EVT_CALL(GetPlayerPos, LVar5, LVar3, LVar4)
EVT_ADD(LVar5, -30)
EVT_CALL(NpcMoveTo, NPC_Twink, LVar5, LVar4, 15)
EVT_KILL_THREAD(LVar9)
EVT_KILL_THREAD(LVar8)
EVT_THREAD
EVT_CALL(GetNpcPos, NPC_Twink, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_SET(LVar4, LVar1)
EVT_ADD(LVar4, 30)
EVT_SET(LVar3, LVar0)
EVT_CALL(MakeLerp, LVar1, LVar4, 7, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetItemPos, MV_LuckyStarItem, LVar3, LVar0, LVar2)
EVT_WAIT(1)
EVT_ADD(LVar3, 2)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(GetPlayerPos, LVar5, LVar6, LVar7)
EVT_ADD(LVar6, 38)
EVT_CALL(MakeLerp, LVar0, LVar6, 7, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetItemPos, MV_LuckyStarItem, LVar3, LVar0, LVar2)
EVT_WAIT(1)
EVT_ADD(LVar3, 2)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(RemoveItemEntity, MV_LuckyStarItem)
EVT_END_THREAD
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_TossItem)
EVT_WAIT(11)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Pleased)
EVT_SET(LVar0, 7)
EVT_SET(LVar1, 4)
EVT_CALL(ShowGotItem, LVar0, TRUE, 0)
EVT_CALL(AddKeyItem, LVar0)
EVT_CALL(N(EnableActionCommands))
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Idle)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0013)
EVT_CALL(ShowChoice, MSG_Choice_0013)
EVT_IF_EQ(LVar0, 1)
EVT_CALL(ContinueSpeech, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0014)
EVT_CALL(ShowChoice, MSG_Choice_0013)
EVT_IF_NE(LVar0, 0)
EVT_CALL(ContinueSpeech, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0015)
EVT_ELSE
EVT_GOTO(15)
EVT_END_IF
EVT_ELSE
EVT_LABEL(15)
EVT_CALL(ContinueSpeech, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0016)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_HOS_0017)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0018)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80007)
EVT_CALL(SetNpcVar, NPC_Twink, 0, 1)
EVT_LOOP(0)
EVT_CALL(GetNpcVar, NPC_Twink, 0, LVar0)
EVT_IF_EQ(LVar0, 2)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_IF
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_IDLE)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_002F)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_HOS_0030)
EVT_WAIT(20)
EVT_EXEC(N(EVS_PlayKammyKoopaSong))
EVT_CALL(ShowMessageAtScreenPos, MSG_HOS_0031, 320, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_THREAD
EVT_WAIT(20)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -250)
EVT_DIV(LVar0, 2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -250, 53, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.4))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_END_THREAD
EVT_EXEC_GET_TID(N(EVS_UpdateFacingMagikoopa), LVarA)
EVT_CALL(LoadPath, 67, EVT_PTR(N(FlightPath_Magikoopa)), ARRAY_COUNT(N(FlightPath_Magikoopa)), EASING_LINEAR)
EVT_LABEL(2)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_FlyingMagikoopa, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(2)
EVT_END_IF
EVT_KILL_THREAD(LVarA)
EVT_CHILD_THREAD
EVT_LOOP(0)
EVT_LOOP(10)
EVT_CALL(GetNpcPos, NPC_FlyingMagikoopa, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 1)
EVT_CALL(SetNpcPos, NPC_FlyingMagikoopa, LVar0, LVar1, LVar2)
EVT_WAIT(2)
EVT_END_LOOP
EVT_WAIT(3)
EVT_LOOP(10)
EVT_CALL(GetNpcPos, NPC_FlyingMagikoopa, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, -1)
EVT_CALL(SetNpcPos, NPC_FlyingMagikoopa, LVar0, LVar1, LVar2)
EVT_WAIT(2)
EVT_END_LOOP
EVT_WAIT(3)
EVT_END_LOOP
EVT_END_CHILD_THREAD
EVT_CALL(SetNpcAnimation, NPC_FlyingMagikoopa, ANIM_FlyingMagikoopa_Anim00)
EVT_LOOP(3)
EVT_CALL(SetNpcRotation, NPC_FlyingMagikoopa, 0, 0, 10)
EVT_WAIT(1)
EVT_CALL(SetNpcRotation, NPC_FlyingMagikoopa, 0, 0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(20)
EVT_EXEC_GET_TID(N(EVS_ConfusedTwinkLookingAround), LVarA)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Still, 5, MSG_HOS_0032)
EVT_KILL_THREAD(LVarA)
EVT_WAIT(10)
EVT_CALL(GetNpcPos, NPC_FlyingMagikoopa, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, 0, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(260.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-8.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_CALL(SpeakToPlayer, NPC_FlyingMagikoopa, ANIM_FlyingMagikoopa_Anim09, ANIM_FlyingMagikoopa_Anim00, 512, MSG_HOS_0033)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -250)
EVT_DIV(LVar0, 2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetNpcVar, NPC_FlyingMagikoopa, 0, 1)
EVT_CALL(EnablePartnerAI)
EVT_UNBIND
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_TwinkDeparts) = {
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_CALL(SetMusicTrack, 0, SONG_TWINK_THEME, 0, 8)
EVT_WAIT(60)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, TRUE)
EVT_CALL(GetNpcPos, NPC_Twink, LVar3, LVar1, LVar2)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, LVar3)
EVT_DIV(LVar0, 2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(275.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(16.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_CALL(InterpNpcYaw, NPC_Twink, 90, 0)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0034)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.5))
EVT_CALL(PlayerJump, LVar0, LVar1, LVar2, 15)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0035)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(700.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.3))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(GetNpcPos, NPC_Twink, LVar4, LVar5, LVar6)
EVT_CALL(LoadPath, 85, EVT_PTR(N(TwinkDepartPath1)), ARRAY_COUNT(N(TwinkDepartPath1)), EASING_LINEAR)
EVT_LABEL(0)
EVT_CALL(GetNextPathPos)
EVT_ADDF(LVar1, LVar4)
EVT_ADDF(LVar2, LVar5)
EVT_ADDF(LVar3, LVar6)
EVT_CALL(SetNpcPos, NPC_Twink, LVar1, LVar2, LVar3)
EVT_CALL(N(HavePartyFaceTwink))
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(0)
EVT_END_IF
EVT_WAIT(45)
EVT_THREAD
EVT_CALL(LoadPath, 60, EVT_PTR(N(TwinkReturnPath)), ARRAY_COUNT(N(TwinkReturnPath)), EASING_LINEAR)
EVT_LABEL(1)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Twink, LVar1, LVar2, LVar3)
EVT_CALL(N(HavePartyFaceTwink))
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(1)
EVT_END_IF
EVT_END_THREAD
EVT_WAIT(30)
EVT_CALL(GetNpcPos, NPC_Twink, LVar3, LVar1, LVar2)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, LVar3)
EVT_DIV(LVar0, 2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(275.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(16.0), EVT_FLOAT(-8.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Twink, ANIM_Twink_Talk, ANIM_Twink_Idle, 0, MSG_HOS_0036)
EVT_THREAD
EVT_CALL(GetNpcPos, NPC_Twink, LVar4, LVar5, LVar6)
EVT_CALL(LoadPath, 120, EVT_PTR(N(TwinkDepartPath2)), ARRAY_COUNT(N(TwinkDepartPath2)), EASING_QUADRATIC_IN)
EVT_LABEL(2)
EVT_CALL(GetNextPathPos)
EVT_ADDF(LVar1, LVar4)
EVT_ADDF(LVar2, LVar5)
EVT_ADDF(LVar3, LVar6)
EVT_CALL(SetNpcPos, NPC_Twink, LVar1, LVar2, LVar3)
EVT_CALL(N(HavePartyFaceTwink))
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(2)
EVT_END_IF
EVT_END_THREAD
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(12.5), EVT_FLOAT(-10.0))
EVT_CALL(N(AddOffsetForCamPos))
EVT_CALL(SetCamPosA, CAM_DEFAULT, LVar0, LVar1)
EVT_CALL(SetCamPosB, CAM_DEFAULT, LVar2, LVar3)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(30)
EVT_CALL(SetNpcFlagBits, NPC_Twink, NPC_FLAG_40000, TRUE)
EVT_SETF(LVar0, EVT_FLOAT(0.0))
EVT_LOOP(10)
EVT_ADDF(LVar0, EVT_FLOAT(36.0))
EVT_CALL(SetNpcRotation, NPC_Twink, 0, LVar0, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(SetNpcFlagBits, NPC_Twink, NPC_FLAG_40000, FALSE)
EVT_WAIT(120)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 270, 0)
EVT_CALL(PlayerFaceNpc, NPC_PARTNER, FALSE)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(275.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(10)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_HOS_0037)
EVT_CALL(EnablePartnerAI)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_NodYes)
EVT_WAIT(30)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_THREAD
EVT_SET(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};

View File

@ -1,6 +1,6 @@
#include "hos_00.h"
void func_80240C40_A0C930(void) {
void N(setup_gfx_background_shade)(void) {
s32 alpha = update_lerp(0, 0.0f, 216.0f, gPlayerStatus.position.x - 200.0f, 500);
if (alpha < 0) {
@ -13,3 +13,10 @@ void func_80240C40_A0C930(void) {
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, alpha);
}
EvtScript N(EVS_SetupBackgroundShade) = {
EVT_CALL(SetModelCustomGfx, MODEL_g107, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_background_shade)), NULL)
EVT_RETURN
EVT_END
};

View File

@ -1,9 +0,0 @@
#include "hos_01.h"
#include "common/UnkEffect0FFuncs.inc.c"
#include "world/common/todo/GetFloorCollider.inc.c"
static char* N(exit_str_0) = "kmr_24";
static char* N(exit_str_1) = "hos_00";
static char* N(exit_str_2) = "hos_02";

View File

@ -1,75 +0,0 @@
#include "hos_01.h"
#include "effects.h"
extern u32 D_80241C2C_A124AC;
extern u32 D_80241C30_A124B0;
#include "world/common/atomic/TexturePan.inc.c"
ApiStatus func_80240AAC_A1132C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->unk_78 = 190.0f;
effect->data.unk_75->unk_7C = 220.0f;
effect->data.unk_75->unk_68 = 0.7f;
return ApiStatus_DONE2;
}
ApiStatus func_80240B10_A11390(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->unk_78 = 170.0f;
effect->data.unk_75->unk_7C = 170.0f;
effect->data.unk_75->unk_68 = 2.0f;
return ApiStatus_DONE2;
}
ApiStatus func_80240B64_A113E4(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->masterAlpha = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void func_80240BB8_A11438(void) {
gDPSetCombineLERP(gMasterGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0,
PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, D_80241C2C_A124AC);
}
ApiStatus func_80240C08_A11488(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241C2C_A124AC = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void func_80240C34_A114B4(void) {
gDPSetCombineLERP(gMasterGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0,
PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, D_80241C30_A124B0);
}
ApiStatus func_80240C84_A11504(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_80241C30_A124B0 = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
#include "world/common/todo/SwitchToPartner.inc.c"
ApiStatus func_80240CDC_A1155C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 a0 = evt_get_variable(script, *args++);
s32 a1 = evt_get_variable(script, *args++);
s32 a2 = evt_get_variable(script, *args++);
s32 a3 = evt_get_variable(script, *args++);
s32 a4 = evt_get_variable(script, *args++);
fx_sparkles(a0, a1, a2, a3, a4);
return ApiStatus_DONE2;
}

View File

@ -1,7 +0,0 @@
#include "hos_01.h"
#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c"
#define NAMESPACE hos_01_dup
#include "world/common/todo/GetFloorCollider.inc.c"
#define NAMESPACE hos_01

View File

@ -2,8 +2,46 @@
/// @brief Shooting Star Summit - Shooting Star Summit
#include "common.h"
#include "../hos.h"
#include "message_ids.h"
#include "map.h"
#include "../hos.h"
#include "mapfs/hos_01_shape.h"
#include "mapfs/hos_01_hit.h"
#include "sprite/npc/WorldGoombario.h"
enum {
NPC_Eldstar = 0,
NPC_Mamar = 1,
NPC_Skolar = 2,
NPC_Muskular = 3,
NPC_Misstar = 4,
NPC_Klevar = 5,
NPC_Kalmar = 6,
};
enum {
MV_AlphaAmt_Eldstar = MapVar(0),
MV_AlphaAmt_Others = MapVar(1),
MV_StarBeamFXPtr = MapVar(10),
MV_StarBeamState = MapVar(11),
};
enum {
MF_SpiritsGone = MapFlag(0),
};
#define NAMESPACE hos_01
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_SetupModelFX);
extern EvtScript N(EVS_Scene_StarWayOpened);
extern EvtScript N(EVS_AscendStarBeam);
extern NpcGroupList N(DefaultNPCs);
extern EvtScript N(EVS_MakeEntities);
API_CALLABLE(N(func_80240AAC_A1132C));
API_CALLABLE(N(func_80240B10_A11390));
API_CALLABLE(N(SetStarBeamMasterAlpha));

View File

@ -0,0 +1,14 @@
#include "hos_01.h"
EntryList N(Entrances) = {
[hos_01_ENTRY_0] { -400.0, 0.0, 410.0, 45.0 },
[hos_01_ENTRY_1] { 22.0, 285.0, -190.0, 0.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_hos_01 },
};

View File

@ -0,0 +1,10 @@
#include "hos_01.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_01_ENTRY_0)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,150 @@
#include "hos_01.h"
#include "../common/FallingStars.inc.c"
#include "world/common/todo/GetFloorCollider.inc.c"
//@bug malformed script is missing EVT_RETURN and EVT_END, only works because another EvtScript follows
EvtScript N(EVS_GotoMap_kmr_24_0) = {
EVT_CALL(FadeOutMusic, 0, 1500)
EVT_CALL(GotoMapSpecial, EVT_PTR("kmr_24"), kmr_24_ENTRY_0, TRANSITION_11)
EVT_WAIT(100)
};
EvtScript N(EVS_ExitWalk_hos_00_1) = EVT_EXIT_WALK(60, hos_01_ENTRY_0, "hos_00", hos_00_ENTRY_1);
EvtScript N(EVS_ExitStarBeam) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_IF_LT(GB_StoryProgress, STORY_CH8_OPENED_PATH_TO_STAR_WAY)
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(20)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_CALL(IsPlayerOnValidFloor, LVar0)
EVT_IF_EQ(LVar0, TRUE)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_IF
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(DisablePartnerAI, 0)
EVT_EXEC_WAIT(N(EVS_AscendStarBeam))
EVT_CALL(GotoMap, EVT_PTR("hos_02"), hos_02_ENTRY_0)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_00_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilisw, 1, 0)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_NE(LVar0, hos_01_ENTRY_1)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitStarBeam)), TRIGGER_FLOOR_TOUCH, COLLIDER_deilin, 1, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterStarBeam) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_100, TRUE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -30, 250, -160)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -30, 250, -160)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_SET(LVar2, 360)
EVT_CALL(MakeLerp, 500, 250, 60, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, -30, LVar0, -160)
EVT_CALL(SetNpcPos, NPC_PARTNER, -30, LVar0, -170)
EVT_ADD(LVar2, 40)
EVT_CALL(InterpPlayerYaw, LVar2, 0)
EVT_CALL(SetNpcRotation, NPC_PARTNER, 0, LVar2, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_SET(LVar0, LVar2)
EVT_SUB(LVar0, 360)
EVT_SUB(LVar2, LVar0)
EVT_SET(LVar0, 40)
EVT_LABEL(10)
EVT_IF_LT(LVar2, 540)
EVT_CALL(InterpPlayerYaw, LVar2, 0)
EVT_CALL(SetNpcRotation, NPC_PARTNER, 0, LVar2, 0)
EVT_ADD(LVar2, LVar0)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_SET(LVar2, 180)
EVT_SUB(LVar0, 5)
EVT_IF_GT(LVar0, 20)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(SetNpcRotation, NPC_PARTNER, 0, 0, 0)
EVT_CALL(N(func_80240AAC_A1132C), MV_StarBeamFXPtr)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE)
EVT_CALL(EnablePartnerAI)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_LABEL(20)
EVT_CALL(N(GetFloorCollider), LVar0)
EVT_IF_NE(LVar0, COLLIDER_o234)
EVT_WAIT(1)
EVT_GOTO(20)
EVT_END_IF
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitStarBeam)), TRIGGER_FLOOR_TOUCH, COLLIDER_deilin, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_SHOOTING_STAR_SUMMIT)
EVT_CALL(SetSpriteShading, SHADING_HOS_01)
EVT_SETUP_CAMERA_NO_LEAD()
EVT_THREAD
EVT_LABEL(1)
EVT_IF_NE(GB_StoryProgress, STORY_CH0_MET_STAR_SPIRITS)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_EXEC_WAIT(N(EVS_GotoMap_kmr_24_0))
EVT_END_THREAD
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_SetupModelFX))
EVT_EXEC(N(EVS_Starfall_Random))
EVT_EXEC(N(EVS_SetupMusic))
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_01_ENTRY_0)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_CASE_EQ(hos_01_ENTRY_1)
EVT_THREAD
EVT_EXEC_WAIT(N(EVS_EnterStarBeam))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_END_THREAD
EVT_END_SWITCH
EVT_IF_EQ(GB_StoryProgress, STORY_CH7_STAR_SPRIT_DEPARTED)
EVT_EXEC(N(EVS_Scene_StarWayOpened))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,210 @@
#include "hos_01.h"
#include "effects.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
s32 N(GlowingStarAlpha) = 255;
s32 N(GivingPowerAlpha) = 255;
API_CALLABLE(N(func_80240AAC_A1132C)) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->unk_78 = 190.0f;
effect->data.unk_75->unk_7C = 220.0f;
effect->data.unk_75->unk_68 = 0.7f;
return ApiStatus_DONE2;
}
API_CALLABLE(N(func_80240B10_A11390)) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->unk_78 = 170.0f;
effect->data.unk_75->unk_7C = 170.0f;
effect->data.unk_75->unk_68 = 2.0f;
return ApiStatus_DONE2;
}
API_CALLABLE(N(SetStarBeamMasterAlpha)) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
effect->data.unk_75->masterAlpha = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void N(setup_gfx_glowing_star)(void) {
gDPSetCombineLERP(gMasterGfxPos++,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, N(GlowingStarAlpha));
}
API_CALLABLE(N(SetGlowingStarAlpha)) {
Bytecode* args = script->ptrReadPos;
N(GlowingStarAlpha) = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void N(setup_gfx_giving_power)(void) {
gDPSetCombineLERP(gMasterGfxPos++,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, N(GivingPowerAlpha));
}
API_CALLABLE(N(SetGivingPowerAlpha)) {
Bytecode* args = script->ptrReadPos;
N(GivingPowerAlpha) = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
EvtScript N(EVS_UpdateGivingPower) = {
EVT_LOOP(0)
EVT_CALL(MakeLerp, 180, 80, 45, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetGivingPowerAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 80, 180, 35, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetGivingPowerAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupModelFX) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_4)
TEX_PAN_PARAMS_STEP( 0, 0, -170, -70)
TEX_PAN_PARAMS_FREQ( 0, 0, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_5)
TEX_PAN_PARAMS_STEP( 0, 0, 200, -100)
TEX_PAN_PARAMS_FREQ( 0, 0, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o178, TEX_PANNER_4)
EVT_CALL(SetTexPanner, MODEL_o179, TEX_PANNER_4)
EVT_CALL(SetTexPanner, MODEL_o208, TEX_PANNER_5)
EVT_CALL(SetTexPanner, MODEL_o211, TEX_PANNER_5)
EVT_IF_LT(GB_StoryProgress, STORY_CH7_STAR_SPRIT_DEPARTED)
EVT_CALL(EnableModel, MODEL_7, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_CALL(EnableModel, MODEL_6, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH5_STAR_SPRIT_DEPARTED)
EVT_CALL(EnableModel, MODEL_5, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH4_STAR_SPRIT_DEPARTED)
EVT_CALL(EnableModel, MODEL_4, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH3_STAR_SPIRIT_RESCUED)
EVT_CALL(EnableModel, MODEL_3, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH2_STAR_SPRIT_DEPARTED)
EVT_CALL(EnableModel, MODEL_2, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH1_STAR_SPRIT_DEPARTED)
EVT_CALL(EnableModel, MODEL_1, FALSE)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_IF_LT(GB_StoryProgress, STORY_CH8_OPENED_PATH_TO_STAR_WAY)
EVT_CALL(EnableModel, MODEL_power, FALSE)
EVT_ELSE
EVT_PLAY_EFFECT(EFFECT_75, 0, -30, 250, -160, 1, -1)
EVT_SET(MV_StarBeamFXPtr, LVarF)
EVT_SET(LVar0, 255)
EVT_CALL(N(SetStarBeamMasterAlpha), MV_StarBeamFXPtr, LVar0)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_01_ENTRY_1)
EVT_CALL(N(func_80240B10_A11390), MV_StarBeamFXPtr)
EVT_ELSE
EVT_CALL(N(func_80240AAC_A1132C), MV_StarBeamFXPtr)
EVT_END_IF
EVT_END_IF
EVT_CALL(SetRenderMode, MODEL_1, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_2, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_3, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_4, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_5, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_6, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_7, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetModelCustomGfx, MODEL_1, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_2, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_3, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_4, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_5, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_6, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_7, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_glowing_star)), NULL)
EVT_CALL(TranslateModel, MODEL_power, 0, 2, 0)
EVT_CALL(SetModelCustomGfx, MODEL_power, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_giving_power)), NULL)
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(MakeLerp, 255, 100, 60, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetGlowingStarAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 100, 255, 35, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetGlowingStarAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_IF_GE(GB_StoryProgress, STORY_CH8_OPENED_PATH_TO_STAR_WAY)
EVT_EXEC_WAIT(N(EVS_UpdateGivingPower))
EVT_ELSE
EVT_CALL(N(SetGivingPowerAlpha), 0)
EVT_LABEL(10)
EVT_IF_NE(MV_StarBeamState, 1)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(MakeLerp, 0, 180, 55, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetGivingPowerAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_SET(MV_StarBeamState, 2)
EVT_EXEC_WAIT(N(EVS_UpdateGivingPower))
EVT_END_IF
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,513 @@
#include "hos_01.h"
#include "effects.h"
#include "world/common/todo/SwitchToPartner.inc.c"
API_CALLABLE(N(DrawAppearSparkles)) {
Bytecode* args = script->ptrReadPos;
s32 type = evt_get_variable(script, *args++);
s32 posX = evt_get_variable(script, *args++);
s32 posY = evt_get_variable(script, *args++);
s32 posZ = evt_get_variable(script, *args++);
s32 duration = evt_get_variable(script, *args++);
fx_sparkles(type, posX, posY, posZ, duration);
return ApiStatus_DONE2;
}
#include "world/common/npc/StarSpirit.inc.c"
EvtScript N(EVS_MuteMusicOnPlayerApproach) = {
EVT_SET(LVarA, 0)
EVT_LABEL(0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_GE(LVar1, 245)
EVT_CALL(IsPlayerWithin, -30, -165, 180, LVar3)
EVT_IF_EQ(LVar3, 1)
EVT_GOTO(10)
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_GOTO(0)
EVT_LABEL(10)
EVT_SET(LVarA, 1)
EVT_CALL(FadeOutMusic, 0, 2000)
EVT_WAIT(60)
EVT_LABEL(20)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 245)
EVT_CALL(IsPlayerWithin, -30, -165, 180, LVar3)
EVT_IF_EQ(LVar3, 0)
EVT_GOTO(30)
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_GOTO(20)
EVT_LABEL(30)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_WAIT(30)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_StarSpiritsPlea) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -35, 250, -145)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -35, 250, -145)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-5.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(func_802D2C14, 2)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_100, TRUE)
EVT_THREAD
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar2, 30)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, 0)
EVT_CALL(NpcJump0, NPC_PARTNER, LVar0, LVar1, LVar2, 15)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_IDLE)
EVT_END_THREAD
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SPIRIT_THEME, 1, 8)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 0, MSG_HOS_0000)
EVT_WAIT(10)
EVT_WAIT(1)
EVT_CALL(PlayerFaceNpc, NPC_Eldstar, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_Eldstar, NPC_FLAG_100, TRUE)
EVT_CALL(SetNpcJumpscale, NPC_Eldstar, 0)
EVT_CALL(NpcJump0, NPC_Eldstar, 21, 260, -277, 30)
EVT_CALL(EnableModel, MODEL_1, TRUE)
EVT_CALL(PlaySound, SOUND_64)
EVT_CALL(GetNpcPos, NPC_Mamar, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(GetNpcPos, NPC_Skolar, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(GetNpcPos, NPC_Muskular, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(GetNpcPos, NPC_Misstar, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(GetNpcPos, NPC_Kalmar, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 15)
EVT_CALL(N(DrawAppearSparkles), 0, LVar0, LVar1, LVar2, 10)
EVT_CALL(EnableModel, MODEL_2, TRUE)
EVT_CALL(EnableModel, MODEL_3, TRUE)
EVT_CALL(EnableModel, MODEL_4, TRUE)
EVT_CALL(EnableModel, MODEL_5, TRUE)
EVT_CALL(EnableModel, MODEL_6, TRUE)
EVT_CALL(EnableModel, MODEL_7, TRUE)
EVT_SETF(MV_AlphaAmt_Others, EVT_FLOAT(-80.0))
EVT_LOOP(20)
EVT_ADDF(MV_AlphaAmt_Others, EVT_FLOAT(6.0))
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(EnableNpcShadow, NPC_Mamar, TRUE)
EVT_CALL(EnableNpcShadow, NPC_Skolar, TRUE)
EVT_CALL(EnableNpcShadow, NPC_Muskular, TRUE)
EVT_CALL(EnableNpcShadow, NPC_Misstar, TRUE)
EVT_CALL(EnableNpcShadow, NPC_Klevar, TRUE)
EVT_CALL(EnableNpcShadow, NPC_Kalmar, TRUE)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 0, MSG_HOS_0001)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 270)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.8))
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-6.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 0, MSG_HOS_0002)
EVT_CALL(GetNpcPos, NPC_Mamar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-6.9))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Mamar, ANIM_WorldMamar_TalkHappy, ANIM_WorldEldstar_Idle, 0, MSG_HOS_0003)
EVT_CALL(GetNpcPos, NPC_Skolar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-7.3))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Skolar, ANIM_WorldSkolar_TalkAngry, ANIM_WorldMamar_Idle, 0, MSG_HOS_0004)
EVT_CALL(GetNpcPos, NPC_Muskular, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-7.7))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Muskular, ANIM_WorldMuskular_Talk, ANIM_WorldMuskular_Idle, 0, MSG_HOS_0005)
EVT_CALL(GetNpcPos, NPC_Misstar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-7.7))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Misstar, ANIM_WorldMisstar_Talk, ANIM_WorldMisstar_Idle, 0, MSG_HOS_0006)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-7.3))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Klevar, ANIM_WorldKlevar_Talk, ANIM_WorldKlevar_Idle, 0, MSG_HOS_0007)
EVT_CALL(GetNpcPos, NPC_Kalmar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(20.0), EVT_FLOAT(-6.9))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Kalmar, ANIM_WorldKalmar_Talk, ANIM_WorldKalmar_Idle, 0, MSG_HOS_0008)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 200)
EVT_WAIT(30)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 0)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Kalmar, ANIM_WorldKalmar_Talk, ANIM_WorldKalmar_Idle, 0, MSG_HOS_0009)
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, -300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(16.0), EVT_FLOAT(-6.0))
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 0, MSG_HOS_000A)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 200)
EVT_SET(AB_HOS_StatcAmt_Mamar, 200)
EVT_SET(AB_HOS_StatcAmt_Skolar, 200)
EVT_SET(AB_HOS_StatcAmt_Muskular, 200)
EVT_SET(AB_HOS_StatcAmt_Misstar, 200)
EVT_SET(AB_HOS_StatcAmt_Klevar, 200)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 200)
EVT_WAIT(30)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 0)
EVT_SET(AB_HOS_StatcAmt_Mamar, 0)
EVT_SET(AB_HOS_StatcAmt_Skolar, 0)
EVT_SET(AB_HOS_StatcAmt_Muskular, 0)
EVT_SET(AB_HOS_StatcAmt_Misstar, 0)
EVT_SET(AB_HOS_StatcAmt_Klevar, 0)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 0)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 0, MSG_HOS_000B)
EVT_CALL(EnableNpcShadow, NPC_Eldstar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Mamar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Skolar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Muskular, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Misstar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Klevar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Kalmar, FALSE)
EVT_CALL(FullyRestoreHPandFP)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 100)
EVT_SET(AB_HOS_StatcAmt_Mamar, 100)
EVT_SET(AB_HOS_StatcAmt_Skolar, 100)
EVT_SET(AB_HOS_StatcAmt_Muskular, 100)
EVT_SET(AB_HOS_StatcAmt_Misstar, 100)
EVT_SET(AB_HOS_StatcAmt_Klevar, 100)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 100)
EVT_SETF(MV_AlphaAmt_Eldstar, EVT_FLOAT(40.0))
EVT_SETF(MV_AlphaAmt_Others, EVT_FLOAT(40.0))
EVT_LOOP(20)
EVT_ADDF(MV_AlphaAmt_Eldstar, EVT_FLOAT(-6.0))
EVT_ADDF(MV_AlphaAmt_Others, EVT_FLOAT(-6.0))
EVT_WAIT(1)
EVT_END_LOOP
EVT_SET(MF_SpiritsGone, TRUE)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 0)
EVT_SET(AB_HOS_StatcAmt_Mamar, 0)
EVT_SET(AB_HOS_StatcAmt_Skolar, 0)
EVT_SET(AB_HOS_StatcAmt_Muskular, 0)
EVT_SET(AB_HOS_StatcAmt_Misstar, 0)
EVT_SET(AB_HOS_StatcAmt_Klevar, 0)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 0)
EVT_CALL(EnableModel, MODEL_1, FALSE)
EVT_CALL(EnableModel, MODEL_2, FALSE)
EVT_CALL(EnableModel, MODEL_3, FALSE)
EVT_CALL(EnableModel, MODEL_4, FALSE)
EVT_CALL(EnableModel, MODEL_5, FALSE)
EVT_CALL(EnableModel, MODEL_6, FALSE)
EVT_CALL(EnableModel, MODEL_7, FALSE)
EVT_CALL(DisablePartnerAI, 0)
EVT_WAIT(10)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 20)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
EVT_CALL(N(SwitchToPartner), PARTNER_GOOMBARIO)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_ADD(LVar2, 30)
EVT_CALL(SetNpcSpeed, NPC_PARTNER, EVT_FLOAT(2.0))
EVT_CALL(NpcMoveTo, NPC_PARTNER, LVar0, LVar2, 0)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(PlayerFaceNpc, NPC_PARTNER, FALSE)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_HOS_000C)
EVT_CALL(EnablePartnerAI)
EVT_THREAD
EVT_SET(GB_StoryProgress, STORY_CH0_MET_STAR_SPIRITS)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(1.5))
EVT_END_THREAD
EVT_CALL(FadeOutMusic, 0, 3000)
EVT_WAIT(10)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Eldstar) = {
EVT_EXEC(N(EVS_Scene_StarSpiritsPlea))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcAux_Eldstar) = {
EVT_SET(AB_HOS_StatcAmt_Eldstar, 0)
EVT_SET(AB_HOS_StatcAmt_Mamar, 0)
EVT_SET(AB_HOS_StatcAmt_Skolar, 0)
EVT_SET(AB_HOS_StatcAmt_Muskular, 0)
EVT_SET(AB_HOS_StatcAmt_Misstar, 0)
EVT_SET(AB_HOS_StatcAmt_Klevar, 0)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 0)
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Eldstar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Eldstar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Mamar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Mamar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Mamar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Skolar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Skolar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Skolar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Muskular, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Muskular, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Muskular, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Misstar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Misstar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Misstar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Klevar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Klevar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Klevar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_IF_EQ(AB_HOS_StatcAmt_Kalmar, 0)
EVT_CALL(RandInt, 45, LVar1)
EVT_ADD(LVar1, 105)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 200)
EVT_WAIT(10)
EVT_SET(AB_HOS_StatcAmt_Kalmar, 0)
EVT_WAIT(LVar1)
EVT_ELSE
EVT_WAIT(1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_LOOP(0)
EVT_SETF(LVar0, 0)
EVT_SETF(LVar1, 0)
EVT_LOOP(20)
EVT_ADDF(LVar0, EVT_FLOAT(4.0))
EVT_ADDF(LVar1, EVT_FLOAT(4.0))
EVT_SETF(LVar2, LVar0)
EVT_ADDF(LVar2, MV_AlphaAmt_Eldstar)
EVT_SETF(LVar3, LVar1)
EVT_ADDF(LVar3, MV_AlphaAmt_Others)
EVT_IF_LT(LVar2, 0)
EVT_SETF(LVar2, EVT_FLOAT(0.0))
EVT_END_IF
EVT_IF_LT(LVar3, 0)
EVT_SETF(LVar3, EVT_FLOAT(0.0))
EVT_END_IF
EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2)
EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3)
EVT_WAIT(1)
EVT_END_LOOP
EVT_LOOP(20)
EVT_ADDF(LVar0, EVT_FLOAT(-4.0))
EVT_ADDF(LVar1, EVT_FLOAT(-4.0))
EVT_SETF(LVar2, LVar0)
EVT_ADDF(LVar2, MV_AlphaAmt_Eldstar)
EVT_SETF(LVar3, LVar1)
EVT_ADDF(LVar3, MV_AlphaAmt_Others)
EVT_IF_LT(LVar2, 0)
EVT_SETF(LVar2, EVT_FLOAT(0.0))
EVT_END_IF
EVT_IF_LT(LVar3, 0)
EVT_SETF(LVar3, EVT_FLOAT(0.0))
EVT_END_IF
EVT_CALL(func_802CFD30, NPC_Eldstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Eldstar, 1, LVar2)
EVT_CALL(func_802CFD30, NPC_Mamar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Mamar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Skolar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Skolar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Muskular, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Muskular, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Misstar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Misstar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Klevar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Klevar, 1, LVar3)
EVT_CALL(func_802CFD30, NPC_Kalmar, FOLD_TYPE_D, 0, AB_HOS_StatcAmt_Kalmar, 1, LVar3)
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Eldstar) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Eldstar)))
EVT_CALL(BindNpcAux, NPC_SELF, EVT_PTR(N(EVS_NpcAux_Eldstar)))
EVT_IF_LT(GB_StoryProgress, STORY_CH0_MET_STAR_SPIRITS)
EVT_EXEC(N(EVS_MuteMusicOnPlayerApproach))
EVT_END_IF
EVT_IF_GE(GB_StoryProgress, STORY_CH0_MET_STAR_SPIRITS)
EVT_CALL(SetNpcPos, NPC_Eldstar, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Mamar, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Skolar, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Muskular, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Misstar, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Klevar, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Kalmar, NPC_DISPOSE_LOCATION)
EVT_RETURN
EVT_END_IF
EVT_CALL(EnableNpcShadow, NPC_Mamar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Skolar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Muskular, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Misstar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Klevar, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Kalmar, FALSE)
EVT_SET(MV_AlphaAmt_Eldstar, 40)
EVT_SET(MV_AlphaAmt_Others, -80)
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_StarSpirits)[] = {
{
.id = NPC_Eldstar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -30.0f, 260.0f, -170.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_Eldstar),
.drops = NPC_NO_DROPS,
.animations = ELDSTAR_ANIMS,
.tattle = MSG_NpcTattle_Eldstar,
},
{
.id = NPC_Mamar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 100.0f, 260.0f, -215.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = MAMAR_ANIMS,
},
{
.id = NPC_Skolar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -145.0f, 260.0f, -225.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = SKOLAR_ANIMS,
},
{
.id = NPC_Muskular,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 20.0f, 260.0f, -45.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = MUSKULAR_ANIMS,
},
{
.id = NPC_Misstar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -155.0f, 260.0f, -125.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = MISSTAR_ANIMS,
},
{
.id = NPC_Klevar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 90.0f, 260.0f, -110.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = KLEVAR_ANIMS,
},
{
.id = NPC_Kalmar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -75.0f, 260.0f, -290.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_8 | ENEMY_FLAG_100 | ENEMY_FLAG_200 | ENEMY_FLAG_400 | ENEMY_FLAG_800,
.drops = NPC_NO_DROPS,
.animations = KALMAR_ANIMS,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_StarSpirits)),
{}
};

View File

@ -0,0 +1,10 @@
#include "hos_01.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_HiddenPanel), -210, 30, 285, 0, MODEL_o210, MAKE_ENTITY_END)
EVT_CALL(AssignPanelFlag, GF_HOS01_HiddenPanel)
EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, -350, 0, -275, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_HOS01_Item_StarPiece)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,145 @@
#include "hos_01.h"
#include "effects.h"
#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c"
#define NAME_SUFFIX _StarWay
#include "world/common/todo/GetFloorCollider.inc.c"
#define NAME_SUFFIX
EvtScript N(EVS_Scene_StarWayOpened) = {
EVT_LABEL(0)
EVT_CALL(N(GetFloorCollider_StarWay), LVar0)
EVT_IF_NE(LVar0, COLLIDER_o234)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_CALL(func_802D2884, -30, -160, 0)
EVT_WAIT(15)
EVT_CALL(ShowMessageAtScreenPos, MSG_HOS_005C, 160, 40)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -100)
EVT_DIV(LVar0, 2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, 3)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ShowMessageAtScreenPos, MSG_HOS_005D, 160, 40)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_WAY_OPENS, 0, 8)
EVT_WAIT(10)
EVT_CALL(EnableModel, MODEL_power, TRUE)
EVT_SET(MV_StarBeamState, 1)
EVT_LABEL(10)
EVT_IF_NE(MV_StarBeamState, 2)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -100, 245, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -100, 245, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 600)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_PLAY_EFFECT(EFFECT_75, 0, -30, 250, -160, 1, -1)
EVT_SET(MV_StarBeamFXPtr, LVarF)
EVT_CALL(N(func_80240AAC_A1132C), MV_StarBeamFXPtr)
EVT_CALL(MakeLerp, 1, 255, 55, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetStarBeamMasterAlpha), MV_StarBeamFXPtr, LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(45)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -100)
EVT_DIV(LVar0, 2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ShowMessageAtScreenPos, MSG_HOS_005E, 160, 40)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(5.0))
EVT_SET(GB_StoryProgress, STORY_CH8_OPENED_PATH_TO_STAR_WAY)
EVT_CALL(SetMusicTrack, 0, SONG_SHOOTING_STAR_SUMMIT, 0, 8)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_AscendStarBeam) = {
EVT_CALL(N(func_80240B10_A11390), MV_StarBeamFXPtr)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -30, 250, -160)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -30, 250, -160)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0))
EVT_CALL(PlayerMoveTo, -30, -160, 0)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_WAY_OPENS, 1, 8)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_40 | NPC_FLAG_100, TRUE)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, EVT_FLOAT(1.0))
EVT_CALL(NpcJump0, NPC_PARTNER, -30, 250, -170, 15)
EVT_THREAD
EVT_SET(LVar2, 90)
EVT_CALL(MakeLerp, 1, 90, 60, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_ADD(LVar2, LVar0)
EVT_CALL(InterpPlayerYaw, LVar2, 0)
EVT_CALL(SetNpcRotation, NPC_PARTNER, 0, LVar2, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_LOOP(0)
EVT_ADD(LVar2, LVar0)
EVT_CALL(InterpPlayerYaw, LVar2, 0)
EVT_CALL(SetNpcRotation, NPC_PARTNER, 0, LVar2, 0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT(30)
EVT_CALL(N(UnsetCamera0MoveFlag1))
EVT_THREAD
EVT_LABEL(10)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 430)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_END_THREAD
EVT_CALL(GetPlayerPos, LVar2, LVar3, LVar4)
EVT_SET(LVar5, LVar4)
EVT_ADD(LVar5, -10)
EVT_CALL(MakeLerp, LVar3, 700, 90, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar2, LVar0, LVar5)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};

View File

@ -143,7 +143,7 @@ EvtScript N(EVS_NpcInit_ShopOwner) = {
EVT_END
};
StaticNpc N(NpcData_StarKid_01)[] = {
StaticNpc N(NpcData_Townsfolk)[] = {
{
.id = NPC_StarMan_01,
.settings = &N(NpcSettings_StarMan),
@ -260,6 +260,6 @@ StaticNpc N(NpcData_StarKid_01)[] = {
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_StarKid_01)),
NPC_GROUP(N(NpcData_Townsfolk)),
{}
};

View File

@ -1,27 +0,0 @@
#include "hos_04.h"
static char* N(exit_str_0) = "hos_03";
static char* N(exit_str_1) = "hos_05";
extern u16 D_802416F0_A285C0;
void func_80240000_A26ED0(void) {
f32 temp_f0 = ((sin_rad(D_802416F0_A285C0 * (1 / 32.0f)) + 1.0f) * 0.25f) + 0.75;
guScale(&gDisplayContext->matrixStack[gMatrixListPos], (temp_f0 * 0.3) + 0.5, temp_f0, (temp_f0 * 0.3) + 0.5);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
D_802416F0_A285C0++;
}
void func_80240154_A27024(void) {
f64 t1 = (sin_rad(D_802416F0_A285C0 * (1 / 32.0f)) * 10.0f) + 1.5;
f64 t2 = sin_rad(D_802416F0_A285C0 * 0.25f) * 2.5;
guTranslate(&gDisplayContext->matrixStack[gMatrixListPos], 0.0f, t1 + t2, 0.0f);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
}
#include "world/common/atomic/TexturePan.inc.c"

View File

@ -1,6 +0,0 @@
#include "hos_04.h"
ApiStatus func_802405C0_A27490(Evt* script, s32 isInitialCall) {
script->varTable[0] = gGameStatusPtr->entryID;
return ApiStatus_DONE2;
}

View File

@ -1,132 +0,0 @@
#include "hos_04.h"
#include "nu/nusys.h"
extern f32 D_80241B54_A28A24;
extern f32 D_80241B74_A28A44;
extern f32 D_80241B7C_A28A4C;
extern u16* D_80241B80_A28A50;
extern s32 D_80241B84_A28A54;
extern s32 D_80241B88_A28A58;
BSS f32 D_80243370;
BSS f32 D_80243374;
ApiStatus N(SetCamXXVfov)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 cameraID = evt_get_variable(script, *args++);
gCameras[cameraID].vfov = evt_get_float_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus func_80240654_A27524(Evt* script, s32 isInitialCall) {
if (gGameStatusPtr->creditsViewportMode < 5U) {
gGameStatusPtr->creditsViewportMode++;
state_init_intro();
}
return ApiStatus_DONE1;
}
ApiStatus func_8024068C_A2755C(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
void func_80240694_A27564(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32* arg4) {
f32 temp_f2 = arg1 - arg2;
if (arg1 - arg0 > 0.0f) {
if (temp_f2 < 0.0f) {
*arg4 = arg1;
} else if (arg3 < temp_f2) {
*arg4 += arg3;
} else {
*arg4 += temp_f2;
}
} else if (temp_f2 > 0.0f) {
*arg4 = arg1;
} else if (temp_f2 < -arg3) {
*arg4 -= arg3;
} else {
*arg4 += temp_f2;
}
}
void func_80240734_A27604(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32* arg5) {
f32 var_f12_2;
if (arg3 > arg4) {
arg3 = arg4;
}
switch (arg0) {
case 1:
var_f12_2 = sin_deg((arg3 / arg4) * 90.0f);
break;
case 2:
if (arg3 < 30.0f) {
var_f12_2 = 0.0f;
} else {
var_f12_2 = sin_deg((((arg3 - 30.0f) / (arg4 - 30.0f)) * 90.0f) + -90.0f) + 1.0f;
}
break;
case 3:
var_f12_2 = (sin_deg(((arg3 / arg4) * 180.0f) - 90.0f) + 1.0f) * 0.5;
break;
case 4:
var_f12_2 = sin_deg(((arg3 / arg4) * 90.0f) - 90.0f) + 1.0f;
break;
case 5:
var_f12_2 = (2.0 * (sin_deg(((arg3 / arg4) * 60.0f) - 60.0f) + 0.8660254f)) / 1.7320507764816284;
break;
default:
var_f12_2 = arg3 / arg4;
break;
}
*arg5 = arg1 + ((arg2 - arg1) * var_f12_2);
}
ApiStatus func_802408F8_A277C8(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[gCurrentCameraID];
if (nuGfxCfb_ptr == D_80241B80_A28A50) {
return ApiStatus_BLOCK;
}
D_80241B80_A28A50 = nuGfxCfb_ptr;
func_80240694_A27564(700.0f, 300.0f, D_80241B7C_A28A4C, 1.2f, &D_80241B7C_A28A4C);
camera->panActive = TRUE;
camera->controlSettings.boomLength = D_80241B7C_A28A4C;
return ApiStatus_BLOCK;
}
ApiStatus func_802409B0_A27880(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[gCurrentCameraID];
if (isInitialCall) {
D_80243370 = D_80241B54_A28A24;
}
func_80240734_A27604(1, D_80241B54_A28A24, 700.0f, D_80241B84_A28A54, 70.0f, &D_80243370);
camera->panActive = TRUE;
camera->controlSettings.boomLength = D_80243370;
D_80241B84_A28A54++;
if (D_80241B84_A28A54 < 70) {
return ApiStatus_BLOCK;
}
return ApiStatus_DONE1;
}
ApiStatus func_80240A84_A27954(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[gCurrentCameraID];
if (isInitialCall) {
D_80243374 = D_80241B74_A28A44;
}
func_80240734_A27604(5, D_80241B74_A28A44, -80.0f, D_80241B88_A28A58, 200.0f, &D_80243374);
camera->panActive = TRUE;
camera->controlSettings.viewPitch = D_80243374;
D_80241B88_A28A58++;
if (D_80241B88_A28A58 == 200) {
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}

View File

@ -1,21 +0,0 @@
#include "hos_04.h"
ApiStatus func_80240B60_A27A30(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[1] = 0;
}
script->functionTemp[1] += 16;
if (script->functionTemp[1] > 255) {
script->functionTemp[1] = 255;
}
set_screen_overlay_params_front(0, script->functionTemp[1]);
if (script->functionTemp[1] == 255) {
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}

View File

@ -1,104 +0,0 @@
#include "hos_04.h"
extern u32 D_80243250_A2A120; // mode
extern s32 D_80243254_A2A124; // alpha related
extern s32* D_80243258_A2A128;
extern s32* D_80243284_A2A154[4]; // array of pointers to ints
const char N(exit_str_0)[] = "hos_20";
const char N(exit_str_1)[] = "kpa_60";
const char N(exit_str_2)[] = "hos_00";
const char N(exit_str_3)[] = "osr_03";
const char N(exit_str_4)[] = "hos_05";
BSS s32 D_80243380;
void func_80240BD0_A27AA0(s32** arg0) {
u8 type;
f32 zoom1;
f32 zoom2;
s32 messageID;
s32 opacity;
s32 yOffset;
s32 t;
s32 t2;
if (D_80243258_A2A128 == NULL) {
D_80243258_A2A128 = arg0[D_800779B0];
}
switch (D_80243250_A2A120) {
case 0:
if (D_80243258_A2A128[0] == -1) {
D_80243250_A2A120 = 4;
D_80243380 = D_80243258_A2A128[1];
} else {
D_80243254_A2A124 += 10;
if (D_80243254_A2A124 > 255) {
D_80243254_A2A124 = 255;
D_80243250_A2A120 = 1;
D_80243380 = D_80243258_A2A128[1];
}
}
break;
case 1:
if (D_80243380 == 0) {
D_80243250_A2A120 = 2;
} else {
D_80243380--;
}
break;
case 2:
D_80243254_A2A124 -= 10;
if (D_80243254_A2A124 < 0) {
D_80243254_A2A124 = 0;
t = D_80243258_A2A128[2];
D_80243258_A2A128 += 2;
if (t == 0) {
D_80243250_A2A120 = 3;
} else {
D_80243250_A2A120 = 0;
}
}
break;
case 3:
break;
case 4:
if (D_80243380 != 0) {
D_80243380--;
break;
}
t2 = D_80243258_A2A128[2];
D_80243258_A2A128 += 2;
if (t2 == 0) {
D_80243250_A2A120 = 3;
} else {
D_80243250_A2A120 = 0;
}
break;
}
get_screen_overlay_params(1, &type, &zoom1);
get_screen_overlay_params(0, &type, &zoom2);
opacity = ((D_80243254_A2A124 * (255.0f - zoom1) * (255.0f - zoom2)) / 255.0f) / 255.0f;
if (opacity > 0) {
messageID = D_80243258_A2A128[0];
if (messageID != 0) {
yOffset = 0;
if (get_msg_lines(messageID) >= 2) {
yOffset = -7;
}
draw_msg(D_80243258_A2A128[0], 0, yOffset + 196, opacity, -1, 0);
}
}
}
ApiStatus func_80240E40_A27D10(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
set_curtain_draw_callback((void (*)) evt_get_variable(script, *args++));
return ApiStatus_DONE2;
}
void func_80240E6C_A27D3C(void) {
func_80240BD0_A27AA0(D_80243284_A2A154);
}

View File

@ -2,8 +2,36 @@
/// @brief Shooting Star Summit - Outside the Sanctuary
#include "common.h"
#include "../hos.h"
#include "message_ids.h"
#include "map.h"
#include "../hos.h"
#include "mapfs/hos_04_shape.h"
#include "mapfs/hos_04_hit.h"
#include "sprite/npc/Twink.h"
enum {
NPC_Twink = 0,
};
enum {
MV_Starship_PosX = MapVar(10),
MV_Starship_PosY = MapVar(11),
MV_Starship_PosZ = MapVar(12),
MV_Starship_Yaw = MapVar(13),
};
#define NAMESPACE hos_04
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_Starship_FlyingAway);
extern EvtScript N(EVS_SetupNarrator);
extern EvtScript N(EVS_Intro_PreHeist_Unused);
extern EvtScript N(EVS_Intro_PostHeist);
extern EvtScript N(EVS_SetupFountains);
extern EvtScript N(EVS_BetaStarship_Flight1);
extern EvtScript N(EVS_BetaStarship_Flight2);
extern EvtScript N(EVS_BetaStarship_Return);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,17 @@
#include "hos_04.h"
EntryList N(Entrances) = {
[hos_04_ENTRY_0] { -565.0, 0.0, 0.0, 90.0 },
[hos_04_ENTRY_1] { 100.0, 100.0, 0.0, 270.0 },
[hos_04_ENTRY_2] { 0.0, 0.0, 0.0, 0.0 },
[hos_04_ENTRY_3] { -1570.0, 0.0, 0.0, 90.0 },
[hos_04_ENTRY_4] { -1570.0, 0.0, 0.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_hos_04 },
};

View File

@ -0,0 +1,28 @@
#include "hos_04.h"
EvtScript N(EVS_PlayIntroSong) = {
EVT_WAIT(80)
EVT_CALL(SetMusicTrack, 0, SONG_INTRO_STORY, 2, 8)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_04_ENTRY_2)
EVT_CALL(SetMusicTrack, 0, SONG_STARSHIP_THEME, 0, 8)
EVT_CASE_EQ(hos_04_ENTRY_3)
EVT_CASE_EQ(hos_04_ENTRY_4)
EVT_EXEC(N(EVS_PlayIntroSong))
EVT_CASE_DEFAULT
EVT_IF_EQ(GF_HOS04_Visited, FALSE)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SANCTUARY, 1, 8)
EVT_ELSE
EVT_CALL(SetMusicTrack, 0, SONG_STAR_HAVEN, 0, 8)
EVT_END_IF
EVT_CALL(PlaySound, SOUND_80000064)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,102 @@
#include "hos_04.h"
EvtScript N(EVS_ExitWalk_hos_03_1) = EVT_EXIT_WALK(60, hos_04_ENTRY_0, "hos_03", hos_03_ENTRY_1);
EvtScript N(EVS_ExitWalk_hos_05_0) = EVT_EXIT_WALK(60, hos_04_ENTRY_1, "hos_05", hos_05_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_03_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilinw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_05_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_o163, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_SET(AF_HOS_B5, FALSE)
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_04_ENTRY_0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitnw, COLLIDER_FLAGS_UPPER_MASK)
EVT_IF_EQ(GF_HOS04_Visited, FALSE)
EVT_THREAD
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetPlayerPos, -630, 0, 0)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_EQ(LVar0, PARTNER_NONE)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcPos, NPC_PARTNER, -660, 0, 0)
EVT_WAIT(1)
EVT_CALL(EnablePartnerAI)
EVT_END_IF
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -565, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -565, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 1350)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(15.0), EVT_FLOAT(-25.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-15.0), EVT_FLOAT(-100.0))
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(87.5), EVT_FLOAT(50.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(4.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.15))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC_WAIT(EnterWalk)
EVT_WAIT(20)
EVT_SET(GF_HOS04_Visited, TRUE)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, 0, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_SET(AF_HOS_B5, TRUE)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_THREAD
EVT_ELSE
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_END_IF
EVT_CASE_EQ(hos_04_ENTRY_1)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitnw, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(hos_04_ENTRY_2)
EVT_EXEC(N(EVS_Starship_FlyingAway))
EVT_CASE_EQ(hos_04_ENTRY_3)
EVT_EXEC_WAIT(N(EVS_Intro_PreHeist_Unused))
EVT_CASE_EQ(hos_04_ENTRY_4)
EVT_EXEC_WAIT(N(EVS_Intro_PostHeist))
EVT_CASE_EQ(hos_04_ENTRY_5)
EVT_CALL(EnableGroup, MODEL_g1, FALSE)
EVT_EXEC(N(EVS_BetaStarship_Flight1))
EVT_CASE_EQ(hos_04_ENTRY_6)
EVT_CALL(EnableGroup, MODEL_g1, FALSE)
EVT_EXEC(N(EVS_BetaStarship_Flight2))
EVT_CASE_EQ(hos_04_ENTRY_7)
EVT_CALL(EnableGroup, MODEL_g1, FALSE)
EVT_EXEC(N(EVS_BetaStarship_Return))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_STAR_HAVEN)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_ALT_NO_LEAD()
EVT_THREAD
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_END_THREAD
EVT_EXEC(N(EVS_SetupFountains))
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupNarrator))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,52 @@
#include "hos_04.h"
u16 N(FountainPumpPhase) = 0;
void N(setup_gfx_fountain_water)(void) {
f32 temp_f0 = ((sin_rad(N(FountainPumpPhase) * (1 / 32.0f)) + 1.0f) * 0.25f) + 0.75;
guScale(&gDisplayContext->matrixStack[gMatrixListPos], (temp_f0 * 0.3) + 0.5, temp_f0, (temp_f0 * 0.3) + 0.5);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
N(FountainPumpPhase)++;
}
void N(setup_gfx_fountain_stars)(void) {
f64 t1 = (sin_rad(N(FountainPumpPhase) * (1 / 32.0f)) * 10.0f) + 1.5;
f64 t2 = sin_rad(N(FountainPumpPhase) * 0.25f) * 2.5;
guTranslate(&gDisplayContext->matrixStack[gMatrixListPos], 0.0f, t1 + t2, 0.0f);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
}
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(EVS_SetupFountains) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 100, -80, -50, 120)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( 0,-2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(EnableTexPanning, MODEL_o438, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o462, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o469, TRUE)
EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o462, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o465, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o461, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_fountain_water)), NULL)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_fountain_stars)), NULL)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,22 @@
#include "hos_04.h"
API_CALLABLE(N(GetLastEntryID)) {
script->varTable[0] = gGameStatusPtr->entryID;
return ApiStatus_DONE2;
}
EvtScript N(EVS_DoNothing) = {
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupUnused) = {
EVT_CALL(N(GetLastEntryID))
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_04_ENTRY_0)
EVT_SET(LVar0, -1)
EVT_EXEC(N(EVS_DoNothing))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,222 @@
#include "hos_04.h"
#include "nu/nusys.h"
Vec3f N(TwinkFlightPath)[] = {
{ -669.0, 98.0, -34.0 },
{ -669.0, 68.0, -34.0 },
{ -644.0, 14.0, -23.0 },
{ -564.0, 8.0, 40.0 },
{ -324.0, 136.0, 175.0 },
{ -38.0, 118.0, 0.0 },
{ 205.0, 111.0, 0.0 },
{ 305.0, 101.0, 0.0 },
};
s32 N(Unused) = 0;
CameraControlSettings N(CamSettings_PreHeist) = {
.type = CAMERA_SETTINGS_TYPE_0,
.boomLength = 700,
.boomPitch = -0.9,
.posA = { 0.0, -1.0, 0.0 },
.posB = { 500.0, -1.0, 0.0 },
.viewPitch = -17.4,
.flag = FALSE,
};
CameraControlSettings N(CamSettings_PostHeist) = {
.type = CAMERA_SETTINGS_TYPE_0,
.boomLength = 665,
.boomPitch = -0.9,
.posA = { 0.0, -1.0, 0.0 },
.posB = { 500.0, -1.0, 0.0 },
.viewPitch = -17.4,
.flag = FALSE,
};
API_CALLABLE(N(SetCamVfov)) {
Bytecode* args = script->ptrReadPos;
s32 cameraID = evt_get_variable(script, *args++);
gCameras[cameraID].vfov = evt_get_float_variable(script, *args++);
return ApiStatus_DONE2;
}
API_CALLABLE(N(ResumeIntroState)) {
if (
gGameStatusPtr->creditsViewportMode == 0 ||
gGameStatusPtr->creditsViewportMode == 1 ||
gGameStatusPtr->creditsViewportMode == 2 ||
gGameStatusPtr->creditsViewportMode == 3 ||
gGameStatusPtr->creditsViewportMode == 4)
{
gGameStatusPtr->creditsViewportMode++;
state_init_intro();
}
return ApiStatus_DONE1;
}
API_CALLABLE(N(BlockForever)) {
return ApiStatus_BLOCK;
}
#define INTRO_MATH_EXTENDED
#include "../common/IntroMathUtil.inc.c"
f32 N(TargetBoomLengthPre) = 700;
u16* N(ColorBufferPtr) = NULL;
API_CALLABLE(N(AnimateBoomLengthPreHeist)) {
Camera* camera = &gCameras[gCurrentCameraID];
if (nuGfxCfb_ptr == N(ColorBufferPtr)) {
return ApiStatus_BLOCK;
}
N(ColorBufferPtr) = nuGfxCfb_ptr;
N(lerp_value_with_max_step)(700.0f, 300.0f, N(TargetBoomLengthPre), 1.2f, &N(TargetBoomLengthPre));
camera->panActive = TRUE;
camera->controlSettings.boomLength = N(TargetBoomLengthPre);
return ApiStatus_BLOCK;
}
s32 N(TargetBoomLengthPost) = 0;
BSS f32 N(CurrentBoomLengthPost);
API_CALLABLE(N(AnimateBoomLengthPostHeist)) {
Camera* camera = &gCameras[gCurrentCameraID];
if (isInitialCall) {
N(CurrentBoomLengthPost) = N(CamSettings_PostHeist).boomLength;
}
N(interp_value_with_easing)(INTRO_MATH_EASING_SIN_OUT, N(CamSettings_PostHeist).boomLength, 700.0f,
N(TargetBoomLengthPost), 70.0f, &N(CurrentBoomLengthPost));
camera->panActive = TRUE;
camera->controlSettings.boomLength = N(CurrentBoomLengthPost);
N(TargetBoomLengthPost)++;
if (N(TargetBoomLengthPost) < 70) {
return ApiStatus_BLOCK;
}
return ApiStatus_DONE1;
}
s32 N(TargetViewPitch) = 0;
BSS f32 N(CurrentViewPitch);
API_CALLABLE(N(AnimateViewPitchPostHeist)) {
Camera* camera = &gCameras[gCurrentCameraID];
if (isInitialCall) {
N(CurrentViewPitch) = N(CamSettings_PostHeist).viewPitch;
}
N(interp_value_with_easing)(INTRO_MATH_EASING_5, N(CamSettings_PostHeist).viewPitch, -80.0f,
N(TargetViewPitch), 200.0f, &N(CurrentViewPitch));
camera->panActive = TRUE;
camera->controlSettings.viewPitch = N(CurrentViewPitch);
N(TargetViewPitch)++;
if (N(TargetViewPitch) == 200) {
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
extern EvtScript N(EVS_ControlTwink);
EvtScript N(EVS_Intro_PostHeist) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_CALL(N(SetCamVfov), CAM_DEFAULT, 75)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 30, 0)
EVT_CALL(LoadSettings, CAM_DEFAULT, EVT_PTR(N(CamSettings_PostHeist)))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_THREAD
EVT_EXEC(N(EVS_ControlTwink))
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ControlTwink) = {
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Back)
EVT_CALL(SetNpcYaw, NPC_Twink, 180)
EVT_CALL(N(AnimateBoomLengthPostHeist))
EVT_WAIT(15)
EVT_THREAD
EVT_WAIT(10)
EVT_CALL(InterpNpcYaw, NPC_Twink, 0, 0)
EVT_WAIT(2)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Still)
EVT_WAIT(20)
EVT_CALL(InterpNpcYaw, NPC_Twink, 180, 0)
EVT_WAIT(2)
EVT_CALL(SetNpcAnimation, NPC_Twink, ANIM_Twink_Back)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(100)
EVT_CALL(N(AnimateViewPitchPostHeist))
EVT_END_THREAD
EVT_CALL(LoadPath, 200, EVT_PTR(N(TwinkFlightPath)), ARRAY_COUNT(N(TwinkFlightPath)), EASING_LINEAR)
EVT_LABEL(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Twink, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 1)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(SetNpcPos, NPC_Twink, NPC_DISPOSE_LOCATION)
EVT_THREAD
EVT_WAIT(85)
EVT_CALL(N(BlockForever))
EVT_END_THREAD
EVT_WAIT(120)
EVT_CALL(N(ResumeIntroState))
EVT_RETURN
EVT_END
};
// establishing shot of the star shrine; camera slowly moves along the path toward it
EvtScript N(EVS_Intro_PreHeist_Unused) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_CALL(N(SetCamVfov), CAM_DEFAULT, 75)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 30, 0)
EVT_CALL(LoadSettings, CAM_DEFAULT, EVT_PTR(N(CamSettings_PreHeist)))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_THREAD
EVT_CALL(N(AnimateBoomLengthPreHeist))
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(300)
EVT_CALL(N(ResumeIntroState))
EVT_END_THREAD
EVT_RETURN
EVT_END
};
#include "world/common/npc/StarSpirit.inc.c"
#include "world/common/npc/Twink.h"
EvtScript N(EVS_NpcInit_Twink) = {
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Twink) = {
.id = NPC_Twink,
.settings = &N(NpcSettings_StarSpirit),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_Twink),
.drops = NPC_NO_DROPS,
.animations = TWINK_ANIMS,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Twink)),
{}
};

View File

@ -0,0 +1,303 @@
#include "hos_04.h"
API_CALLABLE(N(ScreenOverlayFadeIn)) {
if (isInitialCall) {
script->functionTemp[1] = 0;
}
script->functionTemp[1] += 16;
if (script->functionTemp[1] > 255) {
script->functionTemp[1] = 255;
}
set_screen_overlay_params_front(0, script->functionTemp[1]);
if (script->functionTemp[1] == 255) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
EvtScript N(EVS_Starship_FlyingAway) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(SetCamPerspective, CAM_DEFAULT, 3, 45, 16, 4096)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -280, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -280, 0, 0)
EVT_CALL(SetCamType, CAM_DEFAULT, 0, FALSE)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(550.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-688.0), EVT_FLOAT(50.0))
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(-544.0), EVT_FLOAT(50.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(2.0), EVT_FLOAT(-20.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_THREAD
EVT_CALL(PlaySound, SOUND_181)
EVT_CALL(MakeLerp, 0, 900, 45, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, MODEL_g161, 0, LVar0, 0)
EVT_ADD(LVar0, 520)
EVT_CALL(SetPlayerPos, 315, LVar0, 5)
EVT_CALL(SetNpcPos, NPC_PARTNER, 313, LVar0, 5)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT(55)
EVT_CALL(GotoMap, EVT_PTR("hos_20"), hos_20_ENTRY_0)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetStarshipPosRot) = {
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 100)
EVT_LABEL(10)
EVT_SET(LVar3, LVar4)
EVT_SET(LVar4, LVar5)
EVT_SET(LVar5, LVar3)
EVT_CALL(MakeLerp, LVar3, LVar4, 30, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(0.1))
EVT_ADDF(LVar2, MV_Starship_PosY)
EVT_CALL(TranslateGroup, MODEL_g161, MV_Starship_PosX, LVar2, 0)
EVT_CALL(RotateGroup, MODEL_g161, MV_Starship_PosZ, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_GOTO(10)
EVT_RETURN
EVT_END
};
// flight1 (same as hos_20 entry 0, without motion lines)
EvtScript N(EVS_BetaStarship_Flight1) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_g1, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -500, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -5000, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -5000, 50)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 5000, 50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-7.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_SET(MV_Starship_Yaw, 0)
EVT_SET(MV_Starship_PosX, -5000)
EVT_SET(MV_Starship_PosY, -525)
EVT_SET(MV_Starship_PosZ, 180)
EVT_EXEC(N(EVS_SetStarshipPosRot))
EVT_WAIT(1)
EVT_THREAD
EVT_SET(LVar7, 45)
EVT_LOOP(20)
EVT_ADD(MV_Starship_PosX, LVar7)
EVT_WAIT(1)
EVT_END_LOOP
EVT_SET(LVar7, 50)
EVT_LOOP(0)
EVT_ADD(MV_Starship_PosX, LVar7)
EVT_WAIT(1)
EVT_CALL(GetModelCenter, MODEL_o480)
EVT_ADD(LVar0, 25)
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, 10)
EVT_ADD(LVar2, 2)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
EVT_CALL(GetCamPosition, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_IF_GT(LVar0, LVar3)
EVT_IF_GT(LVar7, 45)
EVT_SUB(LVar7, 1)
EVT_END_IF
EVT_END_IF
EVT_IF_GT(MV_Starship_PosX, 2000)
EVT_SET(MV_Starship_Yaw, 1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, -5000)
EVT_LOOP(0)
EVT_ADD(LVar0, 45)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_LABEL(20)
EVT_IF_EQ(MV_Starship_Yaw, 0)
EVT_WAIT(1)
EVT_GOTO(20)
EVT_END_IF
EVT_IF_LT(GB_StoryProgress, STORY_UNUSED_0000005D)
EVT_CALL(GotoMap, EVT_PTR("hos_00"), hos_00_ENTRY_3)
EVT_ELSE
EVT_SET(LVar0, 2)
EVT_LOOP(10)
EVT_MUL(LVar0, 2)
EVT_ADD(MV_Starship_PosX, LVar0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(20)
EVT_CALL(GotoMap, EVT_PTR("kpa_60"), kpa_60_ENTRY_4)
EVT_END_IF
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
// flight2 (same as hos_20 entry 1, without motion lines)
EvtScript N(EVS_BetaStarship_Flight2) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_g1, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -500, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -5000, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -5000, 50)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 5000, 50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-7.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_SET(MV_Starship_Yaw, 0)
EVT_SET(MV_Starship_PosX, -4673)
EVT_SET(MV_Starship_PosY, -525)
EVT_SET(MV_Starship_PosZ, 180)
EVT_EXEC(N(EVS_SetStarshipPosRot))
EVT_WAIT(1)
EVT_THREAD
EVT_LOOP(0)
EVT_ADD(MV_Starship_PosX, 45)
EVT_WAIT(1)
EVT_CALL(GetModelCenter, MODEL_o480)
EVT_ADD(LVar0, 25)
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, 10)
EVT_ADD(LVar2, 2)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, -5000)
EVT_LOOP(0)
EVT_ADD(LVar0, 45)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_IF_GT(LVar0, 0)
EVT_SET(MV_Starship_Yaw, 1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_LABEL(20)
EVT_IF_EQ(MV_Starship_Yaw, 0)
EVT_WAIT(1)
EVT_GOTO(20)
EVT_END_IF
EVT_SET(LVar0, 2)
EVT_LOOP(10)
EVT_MUL(LVar0, 2)
EVT_ADD(MV_Starship_PosX, LVar0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_WAIT(20)
EVT_CALL(GotoMap, EVT_PTR("osr_03"), osr_03_ENTRY_3)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
// return flight (same as hos_20 entry 2, without motion lines)
EvtScript N(EVS_BetaStarship_Return) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_g1, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(SetNpcYaw, NPC_PARTNER, 90)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -500, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 5000, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -5000, 50)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 5000, 50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-7.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_SET(MV_Starship_Yaw, 0)
EVT_SET(MV_Starship_PosX, 5000)
EVT_SET(MV_Starship_PosY, -525)
EVT_SET(MV_Starship_PosZ, 0)
EVT_EXEC(N(EVS_SetStarshipPosRot))
EVT_WAIT(2)
EVT_THREAD
EVT_CALL(InterpPlayerYaw, 225, 0)
EVT_SET(LVar7, -50)
EVT_LOOP(0)
EVT_ADD(MV_Starship_PosX, LVar7)
EVT_CALL(GetModelCenter, MODEL_o480)
EVT_ADD(LVar0, -25)
EVT_ADD(LVar2, -5)
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar2, 10)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
EVT_WAIT(1)
EVT_CALL(GetCamPosition, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_IF_LT(LVar0, LVar3)
EVT_IF_LT(LVar7, -45)
EVT_ADD(LVar7, 1)
EVT_END_IF
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 5000)
EVT_LOOP(0)
EVT_ADD(LVar0, -45)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, 0, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_IF_LT(LVar0, -1000)
EVT_SET(MV_Starship_Yaw, 1)
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_LABEL(20)
EVT_IF_EQ(MV_Starship_Yaw, 0)
EVT_WAIT(1)
EVT_GOTO(20)
EVT_END_IF
EVT_SET(LVar0, -2)
EVT_LOOP(10)
EVT_MUL(LVar0, 2)
EVT_ADD(MV_Starship_PosX, LVar0)
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GotoMap, EVT_PTR("hos_05"), hos_05_ENTRY_1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,32 @@
#include "hos_04.h"
#include "../common/Narrator.inc.c"
IntroMessage N(HeistMessageList)[] = {
{ INTRO_MSG_BLANK, 89 },
{ MSG_Intro_001B, 44 },
{ MSG_Intro_001C, 44 },
{ MSG_Intro_001D, 44 },
{}, // end of list
};
IntroMessage* N(IntroMessages)[] = {
N(HeistMessageList),
N(HeistMessageList),
N(HeistMessageList),
N(HeistMessageList),
};
void N(curtain_callback_narration)(void) {
N(UpdateIntroMessages)(N(IntroMessages));
}
EvtScript N(EVS_SetupNarrator) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_04_ENTRY_4)
EVT_CALL(N(SetCurtainCallback), EVT_PTR(N(curtain_callback_narration)))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -1,47 +0,0 @@
#include "hos_05.h"
static char* N(exit_str_0) = "hos_04";
static char* N(exit_str_1) = "";
#include "world/common/atomic/UnkFunc27.inc.c"
#include "world/common/atomic/TexturePan.inc.c"
ApiStatus N(AwaitScriptComplete)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 waitingScriptID = evt_get_variable(script, *args++);
if (!does_script_exist(waitingScriptID)) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
ApiStatus func_80240634_A2A874(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 idx = evt_get_variable(script, *args++);
script->varTable[idx] = evt_get_float_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus func_80240690_A2A8D0(Evt* script, s32 isInitialCall) {
f32 vt2 = script->varTable[2];
f32 temp_f20;
f32 temp_f26;
script->varTable[2] = EVT_FLOAT(0.0);
script->varTable[3] = EVT_FLOAT(100.0);
script->varTable[4] = EVT_FLOAT(0.0);
temp_f26 = (script->varTable[1] * 180.0f) / PI;
temp_f20 = (rand_int(10) / vt2) + 3.0f;
script->varTable[10] = EVT_FLOAT_TO_FIXED(temp_f20 * cos_rad(temp_f26));
script->varTable[11] = EVT_FLOAT_TO_FIXED(rand_int(15) + 5);
script->varTable[12] = EVT_FLOAT_TO_FIXED(temp_f20 * sin_rad(temp_f26));
script->varTable[13] = EVT_FLOAT_TO_FIXED((f32)(rand_int(10) + 10) * -0.05);
return ApiStatus_DONE2;
}

View File

@ -1,10 +0,0 @@
#include "hos_05.h"
ApiStatus func_80240830_A2AA70(Evt* script, s32 isInitialCall) {
gPlayerData.starBeamLevel = 1;
gPlayerData.curHP = gPlayerData.curMaxHP;
gPlayerData.curFP = gPlayerData.curMaxFP;
gPlayerData.specialBarsFilled = gPlayerData.maxStarPower * 256;
sync_status_menu();
return ApiStatus_DONE2;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,118 +0,0 @@
#include "hos_05.h"
u32 D_8024DA90_A37CD0 = 0; // mode
s32 D_8024DA94_A37CD4 = 0; // alpha related
s32* D_8024DA98_A37CD8 = NULL;
s32 D_8024DA9C_A37CDC[] = {
-1, 30, 1, 50, 2, 50, -1, 50, 3, 50, 4, 50, 5, 50, -1, 50, 6, 50, 7, 50, 8, 50, -1, 50, 9, 50, 10, 50, 11, 50,
-1, 50, 12, 30, 13, 30, 14, 50, 15, 30, 16, 30, 17, 30, 18, 50, 19, 30, -1, 40, 20, 56, -1, 50, 21, 30,
-1, 30, 22, 50, -1, 30, 23, 50, 24, 50, -1, 60, 25, 50, -1, 24, 26, 30, 0, 0
};
s32* D_8024DBCC_A37E0C[4] = { D_8024DA9C_A37CDC, D_8024DA9C_A37CDC, D_8024DA9C_A37CDC, D_8024DA9C_A37CDC };
EvtScript D_8024DBDC_A37E1C = {
EVT_CALL(GetEntryID, LocalVar(0))
EVT_SWITCH(LocalVar(0))
EVT_CASE_EQ(3)
EVT_CALL(func_80244C60_A2EEA0, EVT_PTR(func_80244C8C_A2EECC))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
// BSS
extern s32 D_8024F570;
void func_802449F0_A2EC30(s32** arg0) {
u8 type;
f32 zoom1;
f32 zoom2;
s32 messageID;
s32 opacity;
s32 yOffset;
s32 t;
s32 t2;
if (D_8024DA98_A37CD8 == NULL) {
D_8024DA98_A37CD8 = arg0[D_800779B0];
}
switch (D_8024DA90_A37CD0) {
case 0:
if (D_8024DA98_A37CD8[0] == -1) {
D_8024DA90_A37CD0 = 4;
D_8024F570 = D_8024DA98_A37CD8[1];
} else {
D_8024DA94_A37CD4 += 10;
if (D_8024DA94_A37CD4 > 255) {
D_8024DA94_A37CD4 = 255;
D_8024DA90_A37CD0 = 1;
D_8024F570 = D_8024DA98_A37CD8[1];
}
}
break;
case 1:
if (D_8024F570 == 0) {
D_8024DA90_A37CD0 = 2;
} else {
D_8024F570--;
}
break;
case 2:
D_8024DA94_A37CD4 -= 10;
if (D_8024DA94_A37CD4 < 0) {
D_8024DA94_A37CD4 = 0;
t = D_8024DA98_A37CD8[2];
D_8024DA98_A37CD8 += 2;
if (t == 0) {
D_8024DA90_A37CD0 = 3;
} else {
D_8024DA90_A37CD0 = 0;
}
}
break;
case 3:
break;
case 4:
if (D_8024F570 != 0) {
D_8024F570--;
break;
}
t2 = D_8024DA98_A37CD8[2];
D_8024DA98_A37CD8 += 2;
if (t2 == 0) {
D_8024DA90_A37CD0 = 3;
} else {
D_8024DA90_A37CD0 = 0;
}
break;
}
get_screen_overlay_params(1, &type, &zoom1);
get_screen_overlay_params(0, &type, &zoom2);
opacity = ((D_8024DA94_A37CD4 * (255.0f - zoom1) * (255.0f - zoom2)) / 255.0f) / 255.0f;
if (opacity > 0) {
messageID = D_8024DA98_A37CD8[0];
if (messageID != 0) {
yOffset = 0;
if (get_msg_lines(messageID) >= 2) {
yOffset = -7;
}
draw_msg(D_8024DA98_A37CD8[0], 0, yOffset + 196, opacity, -1, 0);
}
}
}
ApiStatus func_80244C60_A2EEA0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
void (*callback)(void) = (void (*)(void))evt_get_variable(script, *args++);
set_curtain_draw_callback(callback);
return ApiStatus_DONE2;
}
void func_80244C8C_A2EECC(void) {
func_80243100_A2D340();
func_802449F0_A2EC30(D_8024DBCC_A37E0C);
}
static const f32 padding[2] = { 0.0f, 0.0f };

View File

@ -1,117 +0,0 @@
#include "hos_05.h"
#include "model.h"
extern s32 D_8024DCCC_A37F0C;
extern s32 D_8024DCD0_A37F10;
extern s16 D_802D9D72; // something wrong with this / the next
extern u8 D_802D9D73;
#define NAMESPACE dup_hos_05
#include "world/common/atomic/UnkFunc27.inc.c"
#include "world/common/atomic/TexturePan.inc.c"
#define NAMESPACE hos_05
BSS s32 D_8024F570[4];
BSS u8 N(oldPrimR), N(oldPrimG), N(oldPrimB);
BSS u8 N(oldEnvR), N(oldEnvG), N(oldEnvB);
BSS s32 N(newPrimR), N(newPrimG), N(newPrimB);
BSS s32 N(newEnvR), N(newEnvG), N(newEnvB);
BSS s32 N(duration), N(time);
ApiStatus func_802452C4_A2F504(Evt* script, s32 isInitialCall) {
Bytecode* args;
args = script->ptrReadPos;
if (isInitialCall) {
get_model_env_color_parameters(&N(oldPrimR), &N(oldPrimG), &N(oldPrimB), &N(oldEnvR), &N(oldEnvG), &N(oldEnvB));
N(newPrimR) = evt_get_variable(script, *args++);
N(newPrimG) = evt_get_variable(script, *args++);
N(newPrimB) = evt_get_variable(script, *args++);
N(newEnvR) = evt_get_variable(script, *args++);
N(newEnvG) = evt_get_variable(script, *args++);
N(newEnvB) = evt_get_variable(script, *args++);
N(duration) = evt_get_variable(script, *args++);
N(time) = 0;
}
if (N(duration) > 0) {
N(time)++;
set_model_env_color_parameters(
(N(oldPrimR) + ((N(newPrimR) - N(oldPrimR)) * N(time)) / N(duration)),
(N(oldPrimG) + ((N(newPrimG) - N(oldPrimG)) * N(time)) / N(duration)),
(N(oldPrimB) + ((N(newPrimB) - N(oldPrimB)) * N(time)) / N(duration)),
(N(oldEnvR) + ( (N(newEnvR) - N(oldEnvR)) * N(time)) / N(duration)),
(N(oldEnvG) + ( (N(newEnvG) - N(oldEnvG)) * N(time)) / N(duration)),
(N(oldEnvB) + ( (N(newEnvB) - N(oldEnvB)) * N(time)) / N(duration)));
if (N(time) >= N(duration)) {
return ApiStatus_DONE2;
}
} else {
set_model_env_color_parameters(N(newPrimR), N(newPrimG), N(newPrimB), N(newEnvR), N(newEnvG), N(newEnvB));
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
void func_8024564C_A2F88C(void) {
gDPSetCombineLERP(gMasterGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0,
PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, D_802D9D73);
}
ApiStatus func_8024569C_A2F8DC(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_802D9D72 = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void func_802456C8_A2F908(void) {
gDPSetCombineLERP(gMasterGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0,
PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, D_8024DCCC_A37F0C);
}
ApiStatus func_80245718_A2F958(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_8024DCCC_A37F0C = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
void func_80245744_A2F984(void) {
gDPSetCombineLERP(gMasterGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, TEXEL0, 0,
PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, D_8024DCD0_A37F10);
}
ApiStatus func_80245794_A2F9D4(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
D_8024DCD0_A37F10 = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus func_802457C0_A2FA00(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[CAM_DEFAULT];
if (isInitialCall) {
script->functionTemp[0] = 40;
}
script->functionTemp[0]--;
if (camera->currentController != NULL) {
camera->currentController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01);
} else if (camera->prevController != NULL) {
camera->prevController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01);
}
if (script->functionTemp[0] == 0) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
const char* N(exit_str_0) = "hos_20";
const char* N(exit_str_1) = "hos_04";

View File

@ -2,12 +2,58 @@
/// @brief Shooting Star Summit - Star Sanctuary
#include "common.h"
#include "../hos.h"
#include "message_ids.h"
#include "map.h"
#include "../hos.h"
#include "mapfs/hos_05_shape.h"
#include "mapfs/hos_05_hit.h"
#include "sprite/npc/WorldEldstar.h"
#include "sprite/npc/WorldMamar.h"
#include "sprite/npc/WorldSkolar.h"
#include "sprite/npc/WorldMuskular.h"
#include "sprite/npc/WorldMisstar.h"
#include "sprite/npc/WorldKlevar.h"
#include "sprite/npc/WorldKalmar.h"
#include "sprite/npc/WorldBowser.h"
#include "sprite/npc/WorldKammy.h"
#include "sprite/npc/StarRod.h"
enum {
NPC_Eldstar = 0,
NPC_Mamar = 1,
NPC_Skolar = 2,
NPC_Muskular = 3,
NPC_Misstar = 4,
NPC_Klevar = 5,
NPC_Kalmar = 6,
NPC_Bowser_Main = 7,
NPC_Bowser_Prop = 8,
NPC_Kammy = 9,
NPC_StarRod = 10,
};
enum {
MV_Starship_Yaw = MapVar(10),
MV_Starship_PosY = MapVar(11),
MV_PlayerOnBoard = MapVar(12),
MV_PartnerOnBoard = MapVar(13),
};
#define NAMESPACE hos_05
void func_80243100_A2D340(void);
ApiStatus func_80244C60_A2EEA0(Evt* script, s32 isInitialCall);
void func_80244C8C_A2EECC(void);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_SetupStarship);
extern EvtScript N(EVS_Starship_Summon);
extern EvtScript N(EVS_Starship_Depart);
extern EvtScript N(EVS_SetupStarshipAndWater);
extern EvtScript N(EVS_EnterStarship);
extern EvtScript N(EVS_Intro_Main);
extern EvtScript N(EVS_SetupNarrator);
extern EvtScript N(EVS_SetupLightBeam);
extern NpcGroupList N(IntroNPCs);
extern NpcGroupList N(DefaultNPCs);
void N(draw_foreground_bowser_silhouette)(void);

View File

@ -0,0 +1,23 @@
#include "hos_05.h"
EntryList N(Entrances) = {
[hos_05_ENTRY_0] { 0.0, 85.0, 390.0, 0.0 },
[hos_05_ENTRY_1] { 0.0, 700.0, 0.0, 225.0 },
[hos_05_ENTRY_2] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_3] { 0.0, 85.0, 390.0, 0.0 },
[hos_05_ENTRY_4] { 0.0, 85.0, 390.0, 0.0 },
[hos_05_ENTRY_5] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_6] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_7] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_8] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_9] { 0.0, 0.0, 0.0, 0.0 },
[hos_05_ENTRY_A] { 354.0, 0.0, 294.0, 117.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_hos_05 },
};

View File

@ -0,0 +1,29 @@
#include "hos_05.h"
EvtScript N(EVS_PlayIntroStoryMusic) = {
EVT_WAIT(40)
EVT_CALL(SetMusicTrack, 0, SONG_INTRO_STORY, 0, 8)
EVT_WAIT(2030)
EVT_CALL(SetMusicTrack, 0, SONG_INTRO_STORY, 1, 8)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_05_ENTRY_1)
EVT_CALL(SetMusicTrack, 0, SONG_STARSHIP_THEME, 1, 8)
EVT_CALL(PlaySound, SOUND_80000065)
EVT_CASE_EQ(hos_05_ENTRY_3)
EVT_EXEC(N(EVS_PlayIntroStoryMusic))
EVT_CASE_EQ(hos_05_ENTRY_4)
EVT_CASE_DEFAULT
EVT_IF_EQ(AF_HOS_B5, FALSE)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SANCTUARY, 0, 8)
EVT_END_IF
EVT_CALL(PlaySound, SOUND_80000065)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,51 @@
#include "hos_05.h"
EvtScript N(EVS_ExitWalk_hos_04_1) = EVT_EXIT_WALK(60, hos_05_ENTRY_0, "hos_04", hos_04_ENTRY_1);
MAP_RODATA_PAD(1, exits);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_hos_04_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Starship_Depart)), TRIGGER_FLOOR_TOUCH, COLLIDER_o630, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_STAR_HAVEN)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_ALT_NO_LEAD()
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_05_ENTRY_3)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(IntroNPCs)))
EVT_ELSE
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_END_IF
EVT_EXEC(N(EVS_SetupStarshipAndWater))
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_05_ENTRY_0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.5))
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(hos_05_ENTRY_1)
EVT_THREAD
EVT_EXEC_WAIT(N(EVS_EnterStarship))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_END_THREAD
EVT_CASE_EQ(hos_05_ENTRY_3)
EVT_EXEC_WAIT(N(EVS_Intro_Main))
EVT_END_SWITCH
EVT_EXEC(N(EVS_SetupNarrator))
EVT_CALL(EnableGroup, MODEL_g277, FALSE)
EVT_CALL(EnableGroup, MODEL_g279, FALSE)
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_RANGE(hos_05_ENTRY_0, hos_05_ENTRY_1)
EVT_EXEC(N(EVS_SetupLightBeam))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,180 @@
#include "hos_05.h"
#include "world/common/atomic/UnkFunc27.inc.c"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
API_CALLABLE(N(AwaitScriptComplete)) {
Bytecode* args = script->ptrReadPos;
s32 waitingScriptID = evt_get_variable(script, *args++);
if (!does_script_exist(waitingScriptID)) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
API_CALLABLE(N(CastToLocalFloat)) {
Bytecode* args = script->ptrReadPos;
s32 idx = evt_get_variable(script, *args++);
script->varTable[idx] = evt_get_float_variable(script, *args++);
return ApiStatus_DONE2;
}
API_CALLABLE(N(func_80240690_A2A8D0)) {
f32 vt2 = script->varTable[2];
f32 magnitude;
f32 angle;
script->varTable[2] = EVT_FLOAT(0.0);
script->varTable[3] = EVT_FLOAT(100.0);
script->varTable[4] = EVT_FLOAT(0.0);
angle = (script->varTable[1] * 180.0f) / PI;
magnitude = (rand_int(10) / vt2) + 3.0f;
script->varTable[10] = EVT_FLOAT_TO_FIXED(magnitude * cos_rad(angle));
script->varTable[11] = EVT_FLOAT_TO_FIXED(rand_int(15) + 5);
script->varTable[12] = EVT_FLOAT_TO_FIXED(magnitude * sin_rad(angle));
script->varTable[13] = EVT_FLOAT_TO_FIXED((f32)(rand_int(10) + 10) * -0.05);
return ApiStatus_DONE2;
}
EvtScript N(EVS_SetupStarshipAndWater) = {
EVT_EXEC(N(EVS_SetupStarship))
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 100, -80, -50, 120)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o33, TEX_PANNER_1)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_C)
TEX_PAN_PARAMS_STEP( -80, 140, 80, -100)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o34, TEX_PANNER_C)
EVT_RETURN
EVT_END
};
EvtScript N(D_80246028_A30268) = {
EVT_CALL(N(func_80240690_A2A8D0))
EVT_LABEL(0)
EVT_ADDF(LVarB, LVarD)
EVT_ADDF(LVar2, LVarA)
EVT_ADDF(LVar3, LVarB)
EVT_ADDF(LVar4, LVarC)
EVT_CALL(TranslateModel, LVar0, LVar2, LVar3, LVar4)
EVT_CALL(N(CastToLocalFloat), 6, LVar2)
EVT_MUL(LVar6, LVar6)
EVT_CALL(N(CastToLocalFloat), 7, LVar4)
EVT_MUL(LVar7, LVar7)
EVT_ADD(LVar6, LVar7)
EVT_IF_LT(LVar6, 10000)
EVT_CALL(N(CastToLocalFloat), 5, LVar3)
EVT_IF_LT(LVar5, 136)
EVT_CALL(N(CastToLocalFloat), 5, LVarB)
EVT_IF_LT(LVar5, 0)
EVT_MULF(LVarB, EVT_FLOAT(-1.0))
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_CALL(N(CastToLocalFloat), 5, LVar2)
EVT_CALL(N(CastToLocalFloat), 6, LVar3)
EVT_CALL(N(CastToLocalFloat), 7, LVar4)
EVT_IF_LT(LVar6, 0)
EVT_RETURN
EVT_END_IF
EVT_IF_GT(LVar6, 300)
EVT_RETURN
EVT_END_IF
EVT_IF_LT(LVar5, -300)
EVT_RETURN
EVT_END_IF
EVT_IF_GT(LVar5, 300)
EVT_RETURN
EVT_END_IF
EVT_IF_LT(LVar7, -300)
EVT_RETURN
EVT_END_IF
EVT_IF_GT(LVar7, 600)
EVT_RETURN
EVT_END_IF
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(D_80246298_A304D8) = {
EVT_SET(LVarF, LVar2)
EVT_CALL(GetPlayerPos, LVar2, LVar3, LVar4)
EVT_CALL(RandInt, 40, LVar2)
EVT_ADDF(LVar2, EVT_FLOAT(-20.0))
EVT_ADDF(LVar3, EVT_FLOAT(-5.0))
EVT_CALL(RandInt, 40, LVar4)
EVT_ADDF(LVar4, EVT_FLOAT(-20.0))
EVT_CALL(RandInt, 30, LVar5)
EVT_ADDF(LVar5, EVT_FLOAT(30.0))
EVT_MULF(LVar5, EVT_FLOAT(0.01))
EVT_LABEL(0)
EVT_ADDF(LVar2, 0)
EVT_ADDF(LVar3, 0)
EVT_ADDF(LVar4, 0)
EVT_MULF(LVar5, EVT_FLOAT(0.9))
EVT_CALL(TranslateModel, LVar0, LVar2, LVar3, LVar4)
EVT_CALL(ScaleModel, LVar0, LVar5, LVar5, LVar5)
EVT_SETF(LVar6, LVar5)
EVT_MULF(LVar6, EVT_FLOAT(10.0))
EVT_CALL(N(CastToLocalFloat), 6, LVar6)
EVT_IF_LT(LVar6, 2)
EVT_RETURN
EVT_END_IF
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_8024644C) = {
EVT_SET(LVar0, LVar3)
EVT_SET(LVar2, 5)
EVT_LOOP(LVar2)
EVT_CALL(RandInt, 360, LVar1)
EVT_EXEC_GET_TID(N(D_80246028_A30268), LVar3)
EVT_IF_NE(LVar3, 0)
EVT_CALL(N(AwaitScriptComplete), LVar3)
EVT_END_IF
EVT_END_LOOP
EVT_LABEL(0)
EVT_CALL(RandInt, 360, LVar1)
EVT_EXEC_GET_TID(N(D_80246298_A304D8), LVar3)
EVT_IF_NE(LVar3, 0)
EVT_CALL(N(AwaitScriptComplete), LVar3)
EVT_END_IF
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_80246540) = {
EVT_SET(LVar0, LVar3)
EVT_LABEL(0)
EVT_CALL(RandInt, 360, LVar1)
EVT_EXEC_GET_TID(N(D_80246298_A304D8), LVar3)
EVT_IF_NE(LVar3, 0)
EVT_CALL(N(AwaitScriptComplete), LVar3)
EVT_END_IF
EVT_GOTO(0)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,645 @@
#include "hos_05.h"
#include "effects.h"
API_CALLABLE(N(UnlockStarBeam)) {
gPlayerData.starBeamLevel = 1;
gPlayerData.curHP = gPlayerData.curMaxHP;
gPlayerData.curFP = gPlayerData.curMaxFP;
gPlayerData.specialBarsFilled = gPlayerData.maxStarPower * 256;
sync_status_menu();
return ApiStatus_DONE2;
}
#include "world/common/npc/StarSpirit.inc.c"
NpcSettings N(NpcSettings_Bowser) = {
.height = 75,
.radius = 72,
.level = 99,
};
NpcSettings N(NpcSettings_Kammy) = {
.height = 34,
.radius = 24,
.level = 26,
.onHit = &EnemyNpcHit,
.onDefeat = &EnemyNpcDefeat,
};
EvtScript N(EVS_NpcAuxAI_StarRod) = {
EVT_RETURN
EVT_END
};
NpcSettings N(NpcSettings_StarRod) = {
.height = 24,
.radius = 24,
.level = 99,
.otherAI = &N(EVS_NpcAuxAI_StarRod),
};
EvtScript N(EVS_StarSpirit_HoverBobbing) = {
EVT_CALL(SetNpcVar, NPC_Eldstar, 0, 0)
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar2, LVar3, LVar4)
EVT_LOOP(0)
EVT_CALL(MakeLerp, 0, 15, 20, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(LVar5, LVar3)
EVT_ADD(LVar5, LVar0)
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Eldstar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Mamar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Mamar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Skolar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Skolar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Muskular, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Muskular, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Misstar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Misstar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Klevar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Kalmar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Kalmar, LVar2, LVar5, LVar4)
EVT_LABEL(10)
EVT_WAIT(2)
EVT_CALL(GetNpcVar, NPC_Eldstar, 0, LVar6)
EVT_IF_NE(LVar6, 0)
EVT_GOTO(10)
EVT_END_IF
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 15, 0, 20, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(LVar5, LVar3)
EVT_ADD(LVar5, LVar0)
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Eldstar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Mamar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Mamar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Skolar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Skolar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Muskular, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Muskular, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Misstar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Misstar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Klevar, LVar2, LVar5, LVar4)
EVT_CALL(GetNpcPos, NPC_Kalmar, LVar2, LVar0, LVar4)
EVT_CALL(SetNpcPos, NPC_Kalmar, LVar2, LVar5, LVar4)
EVT_LABEL(11)
EVT_WAIT(2)
EVT_CALL(GetNpcVar, NPC_Eldstar, 0, LVar6)
EVT_IF_NE(LVar6, 0)
EVT_GOTO(11)
EVT_END_IF
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_RecieveStarBeam) = {
EVT_LOOP(0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar2, 85)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(15)
EVT_END_IF
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD
EVT_CALL(func_802D2C14, 1)
EVT_WAIT(30)
EVT_CALL(PlayerMoveTo, 0, 80, 10)
EVT_CALL(PlayerFaceNpc, NPC_Eldstar, FALSE)
EVT_END_THREAD
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 0, 136, 80)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 136, 80)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(510.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, 0, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(10.0), EVT_FLOAT(-2.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 220, -275)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(-4.5), EVT_FLOAT(-3.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 512, MSG_HOS_0069)
EVT_CALL(func_802D2C14, 0)
EVT_WAIT(30)
EVT_CALL(SetSelfVar, 0, 1)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 136, 80)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(600.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, 0, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(10.0), EVT_FLOAT(-2.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(MakeLerp, 0, 360, 25, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, NPC_Eldstar, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Mamar, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Skolar, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Muskular, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Misstar, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Klevar, 0, LVar0, 0)
EVT_CALL(SetNpcRotation, NPC_Kalmar, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(GetPlayerPos, LVar6, LVar7, LVar8)
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Eldstar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Eldstar, ANIM_WorldEldstar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Eldstar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Eldstar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Eldstar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Eldstar, ANIM_WorldEldstar_Idle)
EVT_ADD(LVar7, 20)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, LVar6, LVar7, LVar8)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, LVar6, LVar7, LVar8, 10)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Mamar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Mamar, ANIM_WorldMamar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Mamar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Mamar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Mamar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Mamar, ANIM_WorldMamar_Idle)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Skolar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Skolar, ANIM_WorldSkolar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Skolar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Skolar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Skolar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Skolar, ANIM_WorldSkolar_Idle)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Muskular, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Muskular, ANIM_WorldMuskular_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Muskular, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Muskular, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Muskular, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Muskular, ANIM_WorldMuskular_Idle)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Misstar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Misstar, ANIM_WorldMisstar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Misstar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Misstar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Misstar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Misstar, ANIM_WorldMisstar_Idle)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Klevar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Klevar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Klevar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Klevar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Idle)
EVT_END_THREAD
EVT_CALL(SetNpcFlagBits, NPC_Kalmar, NPC_FLAG_400000, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Kalmar, ANIM_WorldKalmar_Leap)
EVT_CALL(SetNpcJumpscale, NPC_Kalmar, EVT_FLOAT(3.2))
EVT_CALL(GetNpcPos, NPC_Kalmar, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Kalmar, LVar0, LVar1, LVar2, 5)
EVT_CALL(SetNpcAnimation, NPC_Kalmar, ANIM_WorldKalmar_Idle)
EVT_THREAD
EVT_PLAY_EFFECT(EFFECT_RADIAL_SHIMMER, 2, 0, 154, 85, EVT_FLOAT(2.8), 100)
EVT_CALL(PlaySound, SOUND_212D)
EVT_WAIT(115)
EVT_CALL(PlaySoundAtPlayer, SOUND_188, 0)
EVT_ADD(LVar7, 20)
EVT_PLAY_EFFECT(EFFECT_ENERGY_ORB_WAVE, 4, LVar6, LVar7, LVar8, EVT_FLOAT(0.3), 30)
EVT_END_THREAD
EVT_WAIT(40)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, 10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, 10, 154, 88, 10)
EVT_WAIT(6)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, 10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, 10, 154, 88, 15)
EVT_WAIT(6)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, -10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, -10, 154, 88, 20)
EVT_WAIT(6)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, 10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, 10, 154, 88, 25)
EVT_WAIT(6)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_GotItem)
EVT_LOOP(3)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, 0, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, 0, 154, 88, 30)
EVT_WAIT(6)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, -10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, -10, 154, 88, 30)
EVT_WAIT(6)
EVT_CALL(PlaySoundAt, SOUND_B000001F, 0, 10, 154, 88)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 0, 10, 154, 88, 30)
EVT_WAIT(6)
EVT_END_LOOP
EVT_CALL(N(UnlockStarBeam))
EVT_CALL(SetSelfVar, 0, 0)
EVT_WAIT(30)
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_0198, 160, 40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_WAIT(30)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 220, -275)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(-4.5), EVT_FLOAT(-3.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 512, MSG_HOS_006A)
EVT_WAIT(30)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 136, 80)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(510.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, 0, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(8.0), EVT_FLOAT(-7.9))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_SET(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED)
EVT_EXEC_WAIT(N(EVS_Starship_Summon))
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 220, -275)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(-4.5), EVT_FLOAT(-3.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Eldstar, ANIM_WorldEldstar_Wave, ANIM_WorldEldstar_Idle, 512, MSG_HOS_006B)
EVT_WAIT(30)
EVT_CALL(SetNpcAnimation, NPC_Mamar, ANIM_WorldMamar_Back)
EVT_CALL(SetNpcAnimation, NPC_Muskular, ANIM_WorldMuskular_Back)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Back)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o616, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(SetZoneEnabled, ZONE_o622, FALSE)
EVT_CALL(SetCamPerspective, CAM_DEFAULT, 3, 25, 16, 4096)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.5))
EVT_CALL(EnableModel, MODEL_o362, FALSE)
EVT_CALL(EnableModel, MODEL_o397, FALSE)
EVT_WAIT(15)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_StarSpirit) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_RANGE(hos_05_ENTRY_0, hos_05_ENTRY_1)
EVT_CALL(SetNpcAnimation, NPC_Mamar, ANIM_WorldMamar_Back)
EVT_CALL(SetNpcAnimation, NPC_Muskular, ANIM_WorldMuskular_Back)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Back)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_EQ(STORY_CH8_REACHED_STAR_HAVEN)
EVT_EXEC(N(EVS_StarSpirit_HoverBobbing))
EVT_CALL(GetSelfNpcID, LVar0)
EVT_IF_EQ(LVar0, NPC_Eldstar)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_Scene_RecieveStarBeam)))
EVT_END_IF
EVT_CASE_GE(STORY_CH8_STAR_SHIP_ACTIVATED)
EVT_EXEC(N(EVS_StarSpirit_HoverBobbing))
EVT_CASE_DEFAULT
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
s32 N(ExtraAnims_Eldstar)[] = {
ANIM_WorldEldstar_Idle,
ANIM_WorldEldstar_Panic,
ANIM_WorldEldstar_Wave,
ANIM_WorldEldstar_Angry,
ANIM_WorldEldstar_Hurt,
ANIM_WorldEldstar_Back,
-1
};
s32 N(ExtraAnims_Mamar)[] = {
ANIM_WorldMamar_Idle,
ANIM_WorldMamar_Panic,
ANIM_WorldMamar_Angry,
ANIM_WorldMamar_Hurt,
ANIM_WorldMamar_Back,
ANIM_WorldMamar_Talk,
-1
};
s32 N(ExtraAnims_Skolar)[] = {
ANIM_WorldSkolar_Idle,
ANIM_WorldSkolar_IdleSad,
ANIM_WorldSkolar_Panic,
ANIM_WorldSkolar_Hurt,
ANIM_WorldSkolar_Talk,
ANIM_WorldSkolar_Back,
-1
};
s32 N(ExtraAnims_Muskular)[] = {
ANIM_WorldMuskular_Idle,
ANIM_WorldMuskular_Panic,
ANIM_WorldMuskular_Hurt,
ANIM_WorldMuskular_Happy,
ANIM_WorldMuskular_Back,
-1
};
s32 N(ExtraAnims_Misstar)[] = {
ANIM_WorldMisstar_Still,
ANIM_WorldMisstar_Idle,
ANIM_WorldMisstar_Panic,
ANIM_WorldMisstar_Hurt,
ANIM_WorldMisstar_Happy,
ANIM_WorldMisstar_Back,
-1
};
s32 N(ExtraAnims_Klevar)[] = {
ANIM_WorldKlevar_Idle,
ANIM_WorldKlevar_Panic,
ANIM_WorldKlevar_Hurt,
ANIM_WorldKlevar_TalkHappy,
ANIM_WorldKlevar_Back,
-1
};
s32 N(ExtraAnims_Kalmar)[] = {
ANIM_WorldKalmar_Idle,
ANIM_WorldKalmar_Panic,
ANIM_WorldKalmar_Hurt,
ANIM_WorldKalmar_TalkHappy,
ANIM_WorldKalmar_Back,
-1
};
StaticNpc N(NpcData_StarSpirits)[] = {
{
.id = NPC_Mamar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 220.0f, 220.0f, -170.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = MAMAR_ANIMS,
.extraAnimations = N(ExtraAnims_Mamar),
},
{
.id = NPC_Skolar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -275.0f, 220.0f, 60.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = SKOLAR_ANIMS,
.extraAnimations = N(ExtraAnims_Skolar),
},
{
.id = NPC_Muskular,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 125.0f, 220.0f, 250.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = MUSKULAR_ANIMS,
.extraAnimations = N(ExtraAnims_Muskular),
},
{
.id = NPC_Misstar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -125.0f, 220.0f, 250.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = MISSTAR_ANIMS,
.extraAnimations = N(ExtraAnims_Misstar),
},
{
.id = NPC_Klevar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 275.0f, 220.0f, 60.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = KLEVAR_ANIMS,
.extraAnimations = N(ExtraAnims_Klevar),
},
{
.id = NPC_Kalmar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { -220.0f, 220.0f, -170.0f },
.yaw = 90,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = KALMAR_ANIMS,
.extraAnimations = N(ExtraAnims_Kalmar),
},
{
.id = NPC_Eldstar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { 0.0f, 220.0f, -275.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.init = &N(EVS_NpcInit_StarSpirit),
.drops = NPC_NO_DROPS,
.animations = ELDSTAR_ANIMS,
.extraAnimations = N(ExtraAnims_Eldstar),
},
};
s32 N(NpcData_ClownCar)[] = {
ANIM_WorldBowser_ClownCarStill,
ANIM_WorldBowser_ClownCarIdle,
ANIM_WorldBowser_ClownCarOpenMouth,
ANIM_WorldBowser_ClownCarBrandish,
ANIM_WorldBowser_ClownCarStarRod,
ANIM_WorldBowser_ClownCarCloseMouth,
ANIM_WorldBowser_ClownCarFireBreath,
ANIM_WorldBowser_ClownCarTalk,
ANIM_WorldBowser_ClownCarLaugh,
ANIM_WorldBowser_ClownCarPropeller,
-1
};
s32 N(ExtraAnims_Kammy)[] = {
ANIM_WorldKammy_Anim09,
ANIM_WorldKammy_Anim0B,
ANIM_WorldKammy_Anim0D,
ANIM_WorldKammy_Anim0E,
ANIM_WorldKammy_Anim11,
ANIM_WorldKammy_Anim12,
ANIM_WorldKammy_Anim17,
-1
};
StaticNpc N(NpcData_Thieves)[] = {
{
.id = NPC_Bowser_Main,
.settings = &N(NpcSettings_Bowser),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.drops = {
.dropFlags = NPC_DROP_FLAG_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_WorldBowser_Idle,
.walk = ANIM_WorldBowser_Idle,
.run = ANIM_WorldBowser_Idle,
.chase = ANIM_WorldBowser_Idle,
.anim_4 = ANIM_WorldBowser_Idle,
.anim_5 = ANIM_WorldBowser_Idle,
.death = ANIM_WorldBowser_Idle,
.hit = ANIM_WorldBowser_Idle,
.anim_8 = ANIM_WorldBowser_Idle,
.anim_9 = ANIM_WorldBowser_Idle,
.anim_A = ANIM_WorldBowser_Idle,
.anim_B = ANIM_WorldBowser_Idle,
.anim_C = ANIM_WorldBowser_Idle,
.anim_D = ANIM_WorldBowser_Idle,
.anim_E = ANIM_WorldBowser_Idle,
.anim_F = ANIM_WorldBowser_Idle,
},
.extraAnimations = N(NpcData_ClownCar),
},
{
.id = NPC_Bowser_Prop,
.settings = &N(NpcSettings_Bowser),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.drops = {
.dropFlags = NPC_DROP_FLAG_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_WorldBowser_Idle,
.walk = ANIM_WorldBowser_Idle,
.run = ANIM_WorldBowser_Idle,
.chase = ANIM_WorldBowser_Idle,
.anim_4 = ANIM_WorldBowser_Idle,
.anim_5 = ANIM_WorldBowser_Idle,
.death = ANIM_WorldBowser_Idle,
.hit = ANIM_WorldBowser_Idle,
.anim_8 = ANIM_WorldBowser_Idle,
.anim_9 = ANIM_WorldBowser_Idle,
.anim_A = ANIM_WorldBowser_Idle,
.anim_B = ANIM_WorldBowser_Idle,
.anim_C = ANIM_WorldBowser_Idle,
.anim_D = ANIM_WorldBowser_Idle,
.anim_E = ANIM_WorldBowser_Idle,
.anim_F = ANIM_WorldBowser_Idle,
},
.extraAnimations = N(NpcData_ClownCar),
},
{
.id = NPC_Kammy,
.settings = &N(NpcSettings_Kammy),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.drops = {
.dropFlags = NPC_DROP_FLAG_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_WorldKammy_Anim01,
.walk = ANIM_WorldKammy_Anim02,
.run = ANIM_WorldKammy_Anim03,
.chase = ANIM_WorldKammy_Anim03,
.anim_4 = ANIM_WorldKammy_Anim01,
.anim_5 = ANIM_WorldKammy_Anim01,
.death = ANIM_WorldKammy_Anim00,
.hit = ANIM_WorldKammy_Anim00,
.anim_8 = ANIM_WorldKammy_Anim03,
.anim_9 = ANIM_WorldKammy_Anim03,
.anim_A = ANIM_WorldKammy_Anim03,
.anim_B = ANIM_WorldKammy_Anim03,
.anim_C = ANIM_WorldKammy_Anim03,
.anim_D = ANIM_WorldKammy_Anim03,
.anim_E = ANIM_WorldKammy_Anim03,
.anim_F = ANIM_WorldKammy_Anim03,
},
.extraAnimations = N(ExtraAnims_Kammy),
},
{
.id = NPC_StarRod,
.settings = &N(NpcSettings_StarRod),
.pos = { 0.0f, 174.0f, 0.0f },
.yaw = 270,
.flags = ENEMY_FLAG_1 | ENEMY_FLAG_200 | ENEMY_FLAG_800,
.drops = {
.dropFlags = NPC_DROP_FLAG_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_StarRod_Still,
.walk = ANIM_StarRod_Still,
.run = ANIM_StarRod_Still,
.chase = ANIM_StarRod_Still,
.anim_4 = ANIM_StarRod_Still,
.anim_5 = ANIM_StarRod_Still,
.death = ANIM_StarRod_Still,
.hit = ANIM_StarRod_Still,
.anim_8 = ANIM_StarRod_Still,
.anim_9 = ANIM_StarRod_Still,
.anim_A = ANIM_StarRod_Still,
.anim_B = ANIM_StarRod_Still,
.anim_C = ANIM_StarRod_Still,
.anim_D = ANIM_StarRod_Still,
.anim_E = ANIM_StarRod_Still,
.anim_F = ANIM_StarRod_Still,
},
},
};
NpcGroupList N(IntroNPCs) = {
NPC_GROUP(N(NpcData_Thieves)),
NPC_GROUP(N(NpcData_StarSpirits)),
{}
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_StarSpirits)),
{}
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
#include "hos_05.h"
#include "../common/Narrator.inc.c"
IntroMessage N(HeistMessageList)[] = {
{ INTRO_MSG_BLANK, 30 },
{ MSG_Intro_0001, 50 },
{ MSG_Intro_0002, 50 },
{ INTRO_MSG_BLANK, 50 },
{ MSG_Intro_0003, 50 },
{ MSG_Intro_0004, 50 },
{ MSG_Intro_0005, 50 },
{ INTRO_MSG_BLANK, 50 },
{ MSG_Intro_0006, 50 },
{ MSG_Intro_0007, 50 },
{ MSG_Intro_0008, 50 },
{ INTRO_MSG_BLANK, 50 },
{ MSG_Intro_0009, 50 },
{ MSG_Intro_000A, 50 },
{ MSG_Intro_000B, 50 },
{ INTRO_MSG_BLANK, 50 },
{ MSG_Intro_000C, 30 },
{ MSG_Intro_000D, 30 },
{ MSG_Intro_000E, 50 },
{ MSG_Intro_000F, 30 },
{ MSG_Intro_0010, 30 },
{ MSG_Intro_0011, 30 },
{ MSG_Intro_0012, 50 },
{ MSG_Intro_0013, 30 },
{ INTRO_MSG_BLANK, 40 },
{ MSG_Intro_0014, 56 },
{ INTRO_MSG_BLANK, 50 },
{ MSG_Intro_0015, 30 },
{ INTRO_MSG_BLANK, 30 },
{ MSG_Intro_0016, 50 },
{ INTRO_MSG_BLANK, 30 },
{ MSG_Intro_0017, 50 },
{ MSG_Intro_0018, 50 },
{ INTRO_MSG_BLANK, 60 },
{ MSG_Intro_0019, 50 },
{ INTRO_MSG_BLANK, 24 },
{ MSG_Intro_001A, 30 },
{}, // end of list
};
IntroMessage* N(IntroMessages)[] = {
N(HeistMessageList),
N(HeistMessageList),
N(HeistMessageList),
N(HeistMessageList),
};
void N(curtain_callback_narration)(void) {
N(draw_foreground_bowser_silhouette)();
N(UpdateIntroMessages)(N(IntroMessages));
}
EvtScript N(EVS_SetupNarrator) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(hos_05_ENTRY_3)
EVT_CALL(N(SetCurtainCallback), EVT_PTR(N(curtain_callback_narration)))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,280 @@
#include "hos_05.h"
#include "effects.h"
#include "model.h"
extern u16 StarShrineLightBeamAlpha;
MAP_RODATA_PAD(1,unk);
#define NAME_SUFFIX _Starship
#include "world/common/atomic/UnkFunc27.inc.c"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
API_CALLABLE(N(SetWorldColorParams)) {
Bytecode* args;
static u8 oldPrimR, oldPrimG, oldPrimB;
static u8 oldEnvR, oldEnvG, oldEnvB;
static s32 newPrimR, newPrimG, newPrimB;
static s32 newEnvR, newEnvG, newEnvB;
static s32 duration, time;
args = script->ptrReadPos;
if (isInitialCall) {
get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB);
newPrimR = evt_get_variable(script, *args++);
newPrimG = evt_get_variable(script, *args++);
newPrimB = evt_get_variable(script, *args++);
newEnvR = evt_get_variable(script, *args++);
newEnvG = evt_get_variable(script, *args++);
newEnvB = evt_get_variable(script, *args++);
duration = evt_get_variable(script, *args++);
time = 0;
}
if (duration > 0) {
time++;
set_model_env_color_parameters(
oldPrimR + ((newPrimR - oldPrimR) * time) / duration,
oldPrimG + ((newPrimG - oldPrimG) * time) / duration,
oldPrimB + ((newPrimB - oldPrimB) * time) / duration,
oldEnvR + ( (newEnvR - oldEnvR) * time) / duration,
oldEnvG + ( (newEnvG - oldEnvG) * time) / duration,
oldEnvB + ( (newEnvB - oldEnvB) * time) / duration);
if (time >= duration) {
return ApiStatus_DONE2;
}
} else {
set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
#define NAME_SUFFIX
void N(setup_gfx_light_beam)(void) {
gDPSetCombineLERP(gMasterGfxPos++,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, StarShrineLightBeamAlpha & 0xFF);
}
API_CALLABLE(N(SetLightBeamAlpha)) {
Bytecode* args = script->ptrReadPos;
StarShrineLightBeamAlpha = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
s32 N(StarshipShimmerAmt) = 255;
void N(setup_gfx_starship_shimmer)(void) {
gDPSetCombineLERP(gMasterGfxPos++,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, N(StarshipShimmerAmt));
}
API_CALLABLE(N(SetStarshipShimmerAmt)) {
Bytecode* args = script->ptrReadPos;
N(StarshipShimmerAmt) = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
s32 N(UnusedAlphaParam) = 255;
void N(setup_gfx_unused)(void) {
gDPSetCombineLERP(gMasterGfxPos++,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0,
TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, N(UnusedAlphaParam));
}
API_CALLABLE(N(SetUnusedAlphaParam)) {
Bytecode* args = script->ptrReadPos;
N(UnusedAlphaParam) = evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
EvtScript N(EVS_Starship_Update) = {
EVT_LOOP(0)
EVT_CALL(MakeLerp, 0, 60, 30, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(0.1))
EVT_ADDF(LVar2, MV_Starship_PosY)
EVT_CALL(TranslateGroup, MODEL_g279, 0, LVar2, 0)
EVT_CALL(TranslateGroup, MODEL_g277, 0, LVar2, 0)
EVT_CALL(RotateGroup, MODEL_g277, MV_Starship_Yaw, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 60, 0, 30, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(0.1))
EVT_ADDF(LVar2, MV_Starship_PosY)
EVT_CALL(TranslateGroup, MODEL_g279, 0, LVar2, 0)
EVT_CALL(TranslateGroup, MODEL_g277, 0, LVar2, 0)
EVT_CALL(RotateGroup, MODEL_g277, MV_Starship_Yaw, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_UpdateStarshipCollision) = {
EVT_LOOP(0)
EVT_CALL(UpdateColliderTransform, COLLIDER_o630)
EVT_CALL(UpdateColliderTransform, COLLIDER_o627)
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupStarship) = {
EVT_CALL(ParentColliderToModel, COLLIDER_o630, MODEL_o637)
EVT_CALL(ParentColliderToModel, COLLIDER_o627, MODEL_o637)
EVT_IF_GE(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED)
EVT_EXEC(N(EVS_UpdateStarshipCollision))
EVT_SET(MV_Starship_Yaw, -110)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, hos_05_ENTRY_3)
EVT_SET(MV_Starship_PosY, 900)
EVT_ELSE
EVT_SET(MV_Starship_PosY, -85)
EVT_END_IF
EVT_EXEC(N(EVS_Starship_Update))
EVT_END_IF
EVT_RETURN
EVT_END
};
s32 N(MostSolidGeometry)[] = {
MODEL_g283, MODEL_o4, MODEL_o6, MODEL_g5, MODEL_g97, MODEL_g157, 0xFFFF
};
EvtScript N(EVS_SetupLightBeam) = {
EVT_CALL(EnableGroup, MODEL_g268, FALSE)
EVT_CALL(EnableGroup, MODEL_g178, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED)
EVT_CALL(EnableModel, MODEL_o8, FALSE)
EVT_ELSE
EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL)
EVT_CALL(EnableModel, MODEL_o8, TRUE)
EVT_CALL(N(SetLightBeamAlpha), 127)
EVT_CALL(EnableGroup, MODEL_g277, TRUE)
EVT_CALL(EnableModel, MODEL_o362, FALSE)
EVT_CALL(EnableModel, MODEL_o397, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o616, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(SetZoneEnabled, ZONE_o622, FALSE)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.5))
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Starship_Summon) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD
EVT_CALL(N(UnkFunc27_Starship), 2, NULL, FOG_MODE_3)
EVT_CALL(N(UnkFunc27_Starship), 1, EVT_PTR(N(MostSolidGeometry)), FOG_MODE_3)
EVT_CALL(N(SetWorldColorParams_Starship), 255, 255, 255, 0, 0, 0, 0)
EVT_WAIT(1)
EVT_CALL(N(SetWorldColorParams_Starship), 102, 102, 102, 0, 0, 0, 60)
EVT_END_THREAD
EVT_EXEC(N(EVS_UpdateStarshipCollision))
EVT_SET(MV_Starship_Yaw, 0)
EVT_SET(MV_Starship_PosY, 0)
EVT_EXEC(N(EVS_Starship_Update))
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_9)
TEX_PAN_PARAMS_STEP( -90, 70, -60, 90)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan_Starship))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o646, 9)
EVT_CALL(PlaySoundAt, SOUND_A3, 0, 0, 250, 0)
EVT_PLAY_EFFECT(EFFECT_LIGHT_RAYS, 2, 0, 250, 0, 10, LVar9)
EVT_WAIT(20)
EVT_CALL(SetModelCustomGfx, MODEL_o646, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_starship_shimmer)), NULL)
EVT_CALL(EnableGroup, MODEL_g279, TRUE)
EVT_THREAD
EVT_CALL(MakeLerp, 0, 200, 75, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetStarshipShimmerAmt), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT(60)
EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL)
EVT_CALL(EnableModel, MODEL_o8, TRUE)
EVT_CALL(MakeLerp, 0, 127, 60, EASING_COS_IN_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetLightBeamAlpha), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(40)
EVT_CALL(PlaySoundAt, SOUND_4A3, 0, 0, 250, 0)
EVT_CALL(func_802D7B10, LVar9)
EVT_CALL(EnableGroup, MODEL_g277, TRUE)
EVT_CALL(MakeLerp, 200, 0, 45, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetStarshipShimmerAmt), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(EnableGroup, MODEL_g279, FALSE)
EVT_THREAD
EVT_CALL(MakeLerp, 0, -110, 90, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(MV_Starship_Yaw, LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(MakeLerp, 0, -85, 60, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(MV_Starship_PosY, LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(30)
EVT_CALL(N(SetWorldColorParams_Starship), 255, 255, 255, 0, 0, 0, 60)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,202 @@
#include "hos_05.h"
#include "effects.h"
#include "model.h"
API_CALLABLE(N(SwingCameraPitchUpward)) {
Camera* camera = &gCameras[CAM_DEFAULT];
if (isInitialCall) {
script->functionTemp[0] = 40;
}
script->functionTemp[0]--;
if (camera->currentController != NULL) {
camera->currentController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01);
} else if (camera->prevController != NULL) {
camera->prevController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01);
}
if (script->functionTemp[0] == 0) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
EvtScript N(EVS_UpdatePassengers) = {
EVT_LABEL(0)
EVT_CALL(GetModelCenter, MODEL_o637)
EVT_ADD(LVar0, -5)
EVT_IF_EQ(MV_PlayerOnBoard, TRUE)
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
EVT_END_IF
EVT_ADD(LVar0, 10)
EVT_IF_EQ(MV_PartnerOnBoard, TRUE)
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
EVT_END_IF
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Starship_Depart) = {
EVT_CALL(GetPartnerInUse, LVar9)
EVT_IF_NE(LVar9, PARTNER_NONE)
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_40, TRUE)
EVT_EXEC_GET_TID(N(EVS_UpdatePassengers), LVar9)
EVT_CALL(HidePlayerShadow, TRUE)
EVT_CALL(GetModelCenter, MODEL_o637)
EVT_ADD(LVar0, -5)
EVT_CALL(SetPlayerJumpscale, 0)
EVT_CALL(PlayerJump2, LVar0, LVar1, LVar2, 2)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_SET(MV_PlayerOnBoard, TRUE)
EVT_CALL(InterpPlayerYaw, 0, 0)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(DisablePartnerAI, 0)
EVT_ADD(LVar0, 10)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, EVT_FLOAT(1.5))
EVT_CALL(NpcJump0, NPC_PARTNER, LVar0, LVar1, LVar2, 12)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_IDLE)
EVT_SET(MV_PartnerOnBoard, TRUE)
EVT_CALL(EnableNpcShadow, NPC_PARTNER, FALSE)
EVT_WAIT(10)
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_0188, 160, 40)
EVT_CALL(ShowChoice, MSG_Choice_000C)
EVT_CALL(CloseMessage)
EVT_IF_EQ(LVar0, 1)
// player chose "not ready to take off"
EVT_KILL_THREAD(LVar9)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_SET(MV_PlayerOnBoard, FALSE)
EVT_THREAD
EVT_SET(MV_PartnerOnBoard, FALSE)
EVT_CALL(PartnerIsFlying, LVar0)
EVT_IF_EQ(LVar0, TRUE)
EVT_WAIT(10)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, 1)
EVT_CALL(NpcJump0, NPC_PARTNER, 45, 162, 25, 10)
EVT_END_IF
EVT_CALL(EnableNpcShadow, NPC_PARTNER, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_40, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_END_THREAD
EVT_CALL(SetPlayerJumpscale, 1)
EVT_CALL(PlayerJump, 25, 162, 45, 10)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(HidePlayerShadow, FALSE)
EVT_WAIT(10)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END_IF
EVT_WAIT(20)
EVT_IF_LT(GB_StoryProgress, STORY_UNUSED_0000005D)
EVT_CALL(SetMusicTrack, 0, SONG_STARSHIP_THEME, 0, 8)
EVT_ELSE
EVT_CALL(SetMusicTrack, 0, SONG_STARSHIP_THEME, 1, 8)
EVT_END_IF
EVT_THREAD
EVT_WAIT(25)
EVT_CALL(N(SwingCameraPitchUpward))
EVT_END_THREAD
EVT_CALL(PlaySoundAtPlayer, SOUND_17D, 0)
EVT_SET(LVar2, MV_Starship_PosY)
EVT_CALL(MakeLerp, 0, 1000, 100, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_ADD(LVar0, LVar2)
EVT_SET(MV_Starship_PosY, LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_IF_LT(GB_StoryProgress, STORY_UNUSED_0000005D)
EVT_CALL(GotoMap, EVT_PTR("hos_04"), hos_04_ENTRY_2)
EVT_ELSE
EVT_CALL(GotoMap, EVT_PTR("hos_20"), hos_20_ENTRY_0)
EVT_END_IF
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterStarship) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_40, TRUE)
EVT_CALL(HidePlayerShadow, TRUE)
EVT_CALL(EnableNpcShadow, NPC_PARTNER, FALSE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 0, 180, -5)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 180, -5)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(550.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-35.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_SET(MV_PlayerOnBoard, TRUE)
EVT_SET(MV_PartnerOnBoard, TRUE)
EVT_EXEC_GET_TID(N(EVS_UpdatePassengers), LVar9)
EVT_THREAD
EVT_WAIT(25)
EVT_CALL(MakeLerp, -350, -70, 60, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_DIVF(LVar2, 10)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(PlaySoundAtPlayer, SOUND_17F, 0)
EVT_CALL(MakeLerp, 750, -85, 90, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(MV_Starship_PosY, LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_KILL_THREAD(LVar9)
EVT_SET(MV_PlayerOnBoard, FALSE)
EVT_CALL(SetPlayerJumpscale, 1)
EVT_CALL(PlayerJump, 25, 162, 45, 10)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(HidePlayerShadow, FALSE)
EVT_THREAD
EVT_SET(MV_PartnerOnBoard, FALSE)
EVT_CALL(GetCurrentPartnerID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(PARTNER_PARAKARRY)
EVT_CASE_EQ(PARTNER_BOW)
EVT_CASE_EQ(PARTNER_WATT)
EVT_CASE_EQ(PARTNER_LAKILESTER)
EVT_CASE_DEFAULT
EVT_WAIT(10)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, 1)
EVT_CALL(NpcJump0, NPC_PARTNER, 45, 162, 25, 10)
EVT_END_SWITCH
EVT_CALL(EnableNpcShadow, NPC_PARTNER, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_40, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_END_THREAD
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SANCTUARY, 0, 8)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.5))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};

View File

@ -1,7 +0,0 @@
#include "hos_06.h"
static char* N(exit_str_0) = "hos_00";
static char* N(exit_str_1) = "";
#include "world/common/atomic/TexturePan.inc.c"

View File

@ -1,134 +0,0 @@
#include "hos_06.h"
#include "hud_element.h"
extern ShopItemData D_802435EC_A3CACC[];
extern IconHudScriptPair gItemHudScripts[];
#include "world/common/todo/StashVars.inc.c"
#define NAMESPACE dup2_hos_06
#include "world/common/todo/GetItemName.inc.c"
#define NAMESPACE hos_06
#define NAMESPACE dup_hos_06
#include "world/common/todo/GetNpcCollisionHeight.inc.c"
#include "world/common/todo/AddPlayerHandsOffset.inc.c"
#define NAMESPACE hos_06
extern s32 N(ItemChoice_HasSelectedItem);
extern s32 N(ItemChoice_SelectedItemID);
#include "world/common/todo/ItemChoice_WaitForSelection.inc.c"
ApiStatus N(ItemChoice_SaveSelected)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
N(ItemChoice_SelectedItemID) = evt_get_variable(script, *args++);
N(ItemChoice_HasSelectedItem) = TRUE;
return ApiStatus_DONE2;
}
BSS s32 hos_06_D_80246260[114];
ApiStatus func_802406E0_A39BC0(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32* ptr = (s32*) evt_get_variable(script, *args++);
s32 i;
if (ptr != NULL) {
for (i = 0; ptr[i] != 0; i++) {
hos_06_D_80246260[i] = ptr[i];
}
hos_06_D_80246260[i] = 0;
} else {
for (i = 0; i < 112; i++) {
hos_06_D_80246260[i] = i + 16;
hos_06_D_80246260[112] = 0;
}
}
return ApiStatus_DONE2;
}
extern s32 N(LetterDelivery_SavedNpcAnim);
#include "world/common/todo/LetterDelivery.inc.c"
ApiStatus Merlow_GetPlayerStarPieces(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
evt_set_variable(script, *args++, gPlayerData.starPieces);
return ApiStatus_DONE2;
}
ApiStatus Merlow_SetBadgePurchased(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 index = evt_get_variable(script, *args++);
evt_set_variable(NULL, GF_HOS06_MerlowBadge_00 + index, TRUE);
return ApiStatus_DONE2;
}
ApiStatus Merlow_ShopBadgesPopup(Evt* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PopupMenu* menu;
s32 selected, menuPos, i;
if (isInitialCall) {
script->functionTempPtr[2] = heap_malloc(sizeof(*menu));
menu = script->functionTempPtr[2];
menuPos = 0;
for (i = 0; i < 15; i++) {
if (!evt_get_variable(NULL, GF_HOS06_MerlowBadge_00 + i)) {
ItemData* item = &gItemTable[D_802435EC_A3CACC[i].itemID];
IconHudScriptPair* itemHudScripts = &gItemHudScripts[item->hudElemID];
menu->userIndex[menuPos] = i;
menu->nameMsg[menuPos] = item->nameMsg;
menu->ptrIcon[menuPos] = itemHudScripts->enabled;
menu->enabled[menuPos] = playerData->starPieces >= D_802435EC_A3CACC[i].price;
if (playerData->starPieces < D_802435EC_A3CACC[i].price) {
menu->ptrIcon[menuPos] = itemHudScripts->disabled;
menu->enabled[menuPos] = FALSE;
}
menu->descMsg[menuPos] = D_802435EC_A3CACC[i].descMsg;
menu->value[menuPos] = D_802435EC_A3CACC[i].price;
menuPos++;
}
}
menu->popupType = POPUP_MENU_TRADE_FOR_BADGE;
menu->numEntries = menuPos;
menu->initialPos = 0;
create_popup_menu(menu);
script->functionTemp[0] = 0;
}
menu = script->functionTempPtr[2];
if (script->functionTemp[0] == 0) {
script->functionTemp[1] = menu->result;
if (script->functionTemp[1] != 0) {
hide_popup_menu();
} else {
return ApiStatus_BLOCK;
}
}
script->functionTemp[0]++;
if (script->functionTemp[0] < 20) {
return ApiStatus_BLOCK;
}
destroy_popup_menu();
selected = script->functionTemp[1];
if (selected != 0xFF) {
ShopItemData* selectedItem;
i = menu->userIndex[selected - 1];
selectedItem = &D_802435EC_A3CACC[i];
script->varTable[0] = selectedItem->itemID;
script->varTable[1] = selectedItem->price;
script->varTable[2] = i;
script->varTable[4] = gItemTable[selectedItem->itemID].nameMsg;
script->varTable[5] = gMoveTable[gItemTable[selectedItem->itemID].moveID].costBP;
} else {
script->varTable[0] = -1;
}
heap_free(script->functionTempPtr[2]);
return ApiStatus_DONE2;
}

View File

@ -1,6 +0,0 @@
#include "hos_06.h"
ApiStatus func_80240D30_A3A210(Evt* script, s32 isInitialCall) {
script->varTable[0] = gGameStatusPtr->entryID;
return ApiStatus_DONE2;
}

View File

@ -1,413 +0,0 @@
#include "hos_06.h"
#include "effects.h"
#include "model.h"
#include "world/common/todo/GetNpcCollisionHeight.inc.c"
#include "world/common/todo/AddPlayerHandsOffset.inc.c"
extern u8 D_802447D0_A3DCB0[];
#define NAMESPACE dup_hos_06
extern s32 N(ItemChoice_HasSelectedItem);
extern s32 N(ItemChoice_SelectedItemID);
#include "world/common/todo/ItemChoice_WaitForSelection.inc.c"
ApiStatus N(ItemChoice_SaveSelected)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
N(ItemChoice_SelectedItemID) = evt_get_variable(script, *args++);
N(ItemChoice_HasSelectedItem) = TRUE;
return ApiStatus_DONE2;
}
#define NAMESPACE hos_06
BSS s32 hos_06_D_80246430[113];
ApiStatus func_80241008_A3A4E8(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32* ptr = (s32*) evt_get_variable(script, *args++);
s32 i;
if (ptr != NULL) {
for (i = 0; ptr[i] != 0; i++) {
hos_06_D_80246430[i] = ptr[i];
}
hos_06_D_80246430[i] = 0;
} else {
for (i = 0; i < 112; i++) {
hos_06_D_80246430[i] = i + 16;
hos_06_D_80246430[112] = 0;
}
}
return ApiStatus_DONE2;
}
#define NAMESPACE dup_hos_06
#include "world/common/todo/StashVars.inc.c"
#define NAMESPACE hos_06
#include "world/common/todo/GetItemName.inc.c"
s32 func_802411BC_A3A69C(s32 badgeID) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gPlayerData.badges); i++) {
if (gPlayerData.badges[i] == badgeID) {
return TRUE;
}
}
return FALSE;
}
ApiStatus func_802411F0_A3A6D0(Evt* script, s32 isInitialCall) {
u32 i;
for (i = 0; i < 79; i++) {
evt_set_variable(NULL, AreaFlag(3) + i, 0);
}
for (i = 0; i < 16; i++) {
evt_set_variable(NULL, AreaFlag(100) + i, 0);
}
return ApiStatus_DONE2;
}
typedef struct UnkThing {
/* 0x00 */ s32 unk_00;
/* 0x04 */ s32 unk_04;
/* 0x08 */ s32 unk_08;
} UnkThing; // size = 0xC
extern UnkThing D_802447D4_A3DCB4[79];
extern UnkThing D_80244B88_A3E068[16];
extern UnkThing D_80244C48_A3E128[63];
ApiStatus func_8024126C_A3A74C(Evt* script, s32 isInitialCall) {
s32 temp_s6 = evt_get_variable(NULL, GameByte(0));
u32 count = 0;
UnkThing* it;
s32 temp_s5;
u32 i;
script->varTable[1] = 0;
for (i = 0, it = D_802447D4_A3DCB4; i < ARRAY_COUNT(D_802447D4_A3DCB4); i++, it++) {
if (temp_s6 >= it->unk_08 &&
func_802411BC_A3A69C(it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(3 + i)) == 0) {
count++;
}
}
if (count > 0) {
temp_s5 = rand_int(count - 1);
it = D_802447D4_A3DCB4;
count = 0;
i = 0;
for (; i < ARRAY_COUNT(D_802447D4_A3DCB4); i++, it++) {
if (temp_s6 >= it->unk_08 &&
func_802411BC_A3A69C(it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(3 + i)) == 0)
{
if (count == temp_s5) {
script->varTable[1] = it->unk_00;
evt_set_variable(NULL, AreaFlag(3 + i), 1);
break;
}
count++;
}
}
return ApiStatus_DONE2;
}
for (i = 0, it = D_802447D4_A3DCB4; i < ARRAY_COUNT(D_802447D4_A3DCB4); i++, it++) {
if (it->unk_08 == 0x2712 &&
func_802411BC_A3A69C(it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(3 + i)) == 0)
{
count++;
}
}
if (count > 0) {
temp_s5 = rand_int(count - 1);
it = D_802447D4_A3DCB4;
count = 0;
i = 0;
for (; i < ARRAY_COUNT(D_802447D4_A3DCB4); i++, it++) {
if (it->unk_08 == 0x2712 &&
func_802411BC_A3A69C(it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(3 + i)) == 0)
{
if (count == temp_s5) {
script->varTable[1] = it->unk_00;
evt_set_variable(NULL, AreaFlag(3 + i), 1);
break;
}
count++;
}
}
}
return ApiStatus_DONE2;
}
ApiStatus func_802414E4_A3A9C4(Evt* script, s32 isInitialCall) {
s32 temp_s5 = evt_get_variable(NULL, GameByte(0));
u32 count = 0;
s32 temp_s7;
UnkThing* it;
u32 i;
script->varTable[1] = 0;
it = D_80244B88_A3E068;
for (i = 0; i < ARRAY_COUNT(D_80244B88_A3E068); i++, it++) {
if (temp_s5 >= it->unk_08 &&
evt_get_variable(NULL, it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(100 + i)) == 0)
{
count++;
}
}
if (count > 0) {
temp_s7 = rand_int(count - 1);
it = D_80244B88_A3E068;
count = 0;
for (i = 0; i < ARRAY_COUNT(D_80244B88_A3E068); i++, it++) {
if (temp_s5 >= it->unk_08 &&
evt_get_variable(NULL, it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(100 + i)) == 0)
{
if (count == temp_s7) {
script->varTable[1] = it->unk_00;
evt_set_variable(NULL, AreaFlag(100 + i), 1);
break;
}
count++;
}
}
}
return ApiStatus_DONE2;
}
ApiStatus func_80241668_A3AB48(Evt* script, s32 isInitialCall) {
s32 temp_s5 = evt_get_variable(NULL, GameByte(0));
u32 count = 0;
s32 temp_s7;
UnkThing* it;
u32 i;
script->varTable[1] = 0;
it = D_80244C48_A3E128;
for (i = 0; i < ARRAY_COUNT(D_80244C48_A3E128); i++, it++) {
if (temp_s5 >= it->unk_08 &&
evt_get_variable(NULL, it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(116 + i)) == 0)
{
count++;
}
}
if (count > 0) {
temp_s7 = rand_int(count - 1);
it = D_80244C48_A3E128;
count = 0;
for (i = 0; i < ARRAY_COUNT(D_80244C48_A3E128); i++, it++) {
if (temp_s5 >= it->unk_08 &&
evt_get_variable(NULL, it->unk_04) == 0 &&
evt_get_variable(NULL, AreaFlag(116 + i)) == 0)
{
if (count == temp_s7) {
script->varTable[1] = it->unk_00;
evt_set_variable(NULL, AreaFlag(116 + i), 1);
break;
}
count++;
}
}
}
return ApiStatus_DONE2;
}
ApiStatus func_802417EC_A3ACCC(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 idx = evt_get_variable(script, *args++);
s32 outVar = *args++;
if (gPlayerData.coins < D_802447D0_A3DCB0[idx]) {
evt_set_variable(script, outVar, TRUE);
} else {
evt_set_variable(script, outVar, FALSE);
}
return ApiStatus_DONE2;
}
ApiStatus func_80241860_A3AD40(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 idx = evt_get_variable(script, *args++);
gPlayerData.coins -= D_802447D0_A3DCB0[idx];
return ApiStatus_DONE2;
}
ApiStatus func_802418A4_A3AD84(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 idx = evt_get_variable(script, *args++);
gPlayerData.coins += D_802447D0_A3DCB0[idx];
return ApiStatus_DONE2;
}
ApiStatus func_802418E8_A3ADC8(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x79)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7A)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7B)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7C)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7D)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7F)), -1, FOG_MODE_3);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0xD0)), -1, FOG_MODE_3);
set_model_env_color_parameters(255, 255, 255, 0, 0, 0);
script->functionTemp[0] = 255;
}
script->functionTemp[0] -= 4;
if (script->functionTemp[0] < 64) {
script->functionTemp[0] = 64;
}
set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0);
if (script->functionTemp[0] == 64) {
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
ApiStatus func_80241A58_A3AF38(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 64;
script->functionTemp[2] = 64;
script->functionTemp[1] = 0;
}
if (script->functionTemp[1] == 0) {
script->functionTemp[0] += 4;
script->functionTemp[2] += 4;
if (script->functionTemp[0] > 127) {
script->functionTemp[0] = 127;
}
if (script->functionTemp[2] > 127) {
script->functionTemp[2] = 127;
}
if (script->functionTemp[0] == 127 && (script->functionTemp[2] == script->functionTemp[0])) {
script->functionTemp[1] = 1;
}
} else {
script->functionTemp[0] -= 4;
script->functionTemp[2] -= 4;
if (script->functionTemp[0] < 64) {
script->functionTemp[0] = 64;
}
if (script->functionTemp[2] < 0) {
script->functionTemp[2] = 0;
}
}
set_model_env_color_parameters(
script->functionTemp[0], script->functionTemp[0], script->functionTemp[0],
script->functionTemp[2], script->functionTemp[2], script->functionTemp[2]
);
if (script->functionTemp[0] == 64 && script->functionTemp[2] == 0) {
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
ApiStatus func_80241B74_A3B054(Evt* script, s32 isInitialCall) {
if (isInitialCall) {
script->functionTemp[0] = 64;
}
script->functionTemp[0] += 4;
if (script->functionTemp[0] > 255) {
script->functionTemp[0] = 255;
}
set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0);
if (script->functionTemp[0] == 255) {
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x79)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7A)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7B)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7C)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7D)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0x7F)), -1, FOG_MODE_0);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(0xD0)), -1, FOG_MODE_0);
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
// TODO may not be motionBlurFlame
ApiStatus func_80241CCC_A3B1AC(Evt* script, s32 isInitialCall) {
EffectInstance* effects[3];
Matrix4f sp28, sp68;
f32 tx;
f32 ty;
f32 temp_f24;
f32 temp_f28;
f32 temp_f30;
s32 i;
if (isInitialCall) {
script->functionTemp[0] = 180;
script->functionTempPtr[1] = (EffectInstance*) evt_get_variable(script, ArrayVar(3));
script->functionTempPtr[2] = (EffectInstance*) evt_get_variable(script, ArrayVar(4));
script->functionTempPtr[3] = (EffectInstance*) evt_get_variable(script, ArrayVar(5));
}
effects[0] = script->functionTempPtr[1];
effects[1] = script->functionTempPtr[2];
effects[2] = script->functionTempPtr[3];
temp_f30 = (sin_deg(script->functionTemp[0]) * 10.0f) + 10.0f;
temp_f28 = (sin_deg(script->functionTemp[0]) * 25.0f) + 10.0f;
temp_f24 = script->functionTemp[0] * 10;
for (i = 0; i < ARRAY_COUNT(effects); i++) {
guRotateF(sp28, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guRotateF(sp68, i * 120, 0.0f, 0.0f, 1.0f);
guMtxCatF(sp68, sp28, sp28);
tx = temp_f30 * sin_deg(temp_f24);
ty = temp_f28 * cos_deg(temp_f24);
guTranslateF(sp68, tx, ty, 0.0f);
guMtxCatF(sp68, sp28, sp28);
effects[i]->data.motionBlurFlame->pos.x = sp28[3][0];
effects[i]->data.motionBlurFlame->pos.y = sp28[3][1];
effects[i]->data.motionBlurFlame->pos.z = sp28[3][2];
}
script->functionTemp[0]--;
if (script->functionTemp[0] < 16) {
for (i = 0; i < ARRAY_COUNT(effects); i++) {
effects[i]->data.motionBlurFlame->unk_4C = script->functionTemp[0];
}
}
if (script->functionTemp[0] < 0) {
for (i = 0; i < ARRAY_COUNT(effects); i++) {
remove_effect(effects[i]);
}
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
ApiStatus func_80241F98_A3B478(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
// TODO effect may be wrong
effect->data.energyOrbWave->unk_1C++;
return ApiStatus_DONE2;
}

View File

@ -1,124 +0,0 @@
#include "hos_06.h"
#include "hud_element.h"
#define NAMESPACE dup2_hos_06
#include "world/common/todo/StashVars.inc.c"
#define NAMESPACE hos_06
#define NAMESPACE dup_hos_06
#include "world/common/todo/GetItemName.inc.c"
#define NAMESPACE hos_06
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
extern IconHudScriptPair gItemHudScripts[];
extern s32 D_80245EEC_A3F3CC[5];
ApiStatus func_8024228C_A3B76C(Evt* script, s32 isInitialCall) {
PopupMenu *menu;
s32 numEntries;
s32 index;
s32 temp;
s32 var1;
s32 var2;
s32 i;
if (isInitialCall) {
menu = heap_malloc(sizeof(*menu));
script->functionTempPtr[2] = menu;
temp = script->varTable[0];
script->varTable[10] = script->varTable[0];
if (temp == 0) {
script->varTable[1] = GF_KKJ16_Item_PowerRush;
script->varTable[2] = GF_KKJ_Stored_PowerRush;
menu->popupType = POPUP_MENU_USEKEY;
} else {
script->varTable[1] = GF_KKJ_Stored_PowerRush;
script->varTable[2] = GF_KKJ_Retrieved_PowerRush;
menu->popupType = POPUP_MENU_TAKE_FROM_CHEST;
}
numEntries = 0;
for (i = 0; i < ARRAY_COUNT(D_80245EEC_A3F3CC); i++) {
var1 = evt_get_variable(NULL, script->varTable[1] + i);
var2 = evt_get_variable(NULL, script->varTable[2] + i);
if (var1 != 0 && var2 == 0) {
ItemData* item = &gItemTable[D_80245EEC_A3F3CC[i]];
IconHudScriptPair* itemHudScripts = &gItemHudScripts[item->hudElemID];
menu->ptrIcon[numEntries] = itemHudScripts->enabled;
menu->userIndex[numEntries] = i;
menu->enabled[numEntries] = TRUE;
menu->nameMsg[numEntries] = item->nameMsg;
menu->descMsg[numEntries] = item->shortDescMsg;
numEntries++;
}
}
if (numEntries == 0) {
script->varTable[0] = 0;
return ApiStatus_DONE1;
}
menu->numEntries = numEntries;
menu->initialPos = 0;
create_popup_menu(menu);
script->functionTemp[0] = 0;
}
menu = script->functionTempPtr[2];
if (script->functionTemp[0] == 0) {
script->functionTemp[1] = menu->result;
if (script->functionTemp[1] == 0) {
return ApiStatus_BLOCK;
}
hide_popup_menu();
}
script->functionTemp[0]++;
if (script->functionTemp[0] < 15) {
return ApiStatus_BLOCK;
}
destroy_popup_menu();
temp = script->functionTemp[1];
if (temp == 255) {
script->varTable[0] = -1;
} else {
index = menu->userIndex[temp - 1];
script->varTable[0] = D_80245EEC_A3F3CC[index];
if (script->varTable[10] == 0) {
evt_set_variable(NULL, script->varTable[2] + index, 1);
}
heap_free(script->functionTempPtr[2]);
}
return ApiStatus_DONE2;
}
ApiStatus func_802424CC_A3B9AC(Evt* script, s32 isInitialCall) {
s32* ptr = D_80245EEC_A3F3CC;
s32 found = FALSE;
s32 i;
for (i = 0; i < ARRAY_COUNT(D_80245EEC_A3F3CC); i++) {
s32 var = ptr[i];
if (script->varTable[0] == var) {
found = TRUE;
break;
}
}
if (found) {
evt_set_variable(NULL, GF_KKJ_Retrieved_PowerRush + i, TRUE);
}
return ApiStatus_DONE2;
}
#include "world/common/todo/GetItemEmptyCount.inc.c"

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