mirror of
https://github.com/pmret/papermario.git
synced 2024-09-08 02:29:49 +02:00
area kmr (#898)
* kmr_02 ok * some cleanup * foliage EVS * quiz cleanup * partners * cleanup pass ? * kmr_02 done * kmr_20 ok * begin kmr_20 cleanup * enough kmr_20 * kpa_90+ * more kpa Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
parent
cfb36ee36e
commit
0e54cd9b30
@ -2717,6 +2717,8 @@ enum VisibilityGroup {
|
||||
VIS_GROUP_3 = 3,
|
||||
VIS_GROUP_4 = 4,
|
||||
VIS_GROUP_5 = 5,
|
||||
VIS_GROUP_6 = 6,
|
||||
VIS_GROUP_7 = 7,
|
||||
};
|
||||
|
||||
enum ItemSpawnModes {
|
||||
@ -3239,6 +3241,20 @@ enum PartnerActions {
|
||||
PARTNER_ACTION_LAKILESTER_1 = 1,
|
||||
};
|
||||
|
||||
enum PartnerStates {
|
||||
PARTNER_CMD_NONE = 0,
|
||||
PARTNER_CMD_INIT = 1,
|
||||
PARTNER_CMD_INSTA_SWITCH = 2, // skips put away / take out scripts. assumes valid current partner.
|
||||
PARTNER_CMD_SWITCH = 3, // assumes valid current partner.
|
||||
PARTNER_CMD_PUT_AWAY = 4, // switches to null partner.
|
||||
PARTNER_CMD_INSTA_PUT_AWAY = 5,
|
||||
PARTNER_CMD_TAKE_OUT = 6, // assumes no current partner.
|
||||
PARTNER_CMD_INSTA_TAKE_OUT = 7,
|
||||
PARTNER_CMD_USE_ABILITY = 8,
|
||||
PARTNER_CMD_RESET = 9,
|
||||
PARTNER_CMD_ABORT = 10,
|
||||
};
|
||||
|
||||
/// @see gAreas
|
||||
enum Areas {
|
||||
AREA_KMR,
|
||||
|
@ -10,6 +10,7 @@
|
||||
// temporary: some standard script names
|
||||
#define EVS_MakeEntities EVS_MakeEntities
|
||||
#define EVS_SetupMusic EVS_SetupMusic
|
||||
#define EVS_SetupRooms EVS_SetupRooms
|
||||
#define EVS_SetupFoliage EVS_SetupFoliage
|
||||
#define EVS_BindExitTriggers EVS_BindExitTriggers
|
||||
#define EVS_EnterMap EVS_EnterMap
|
||||
|
@ -13,6 +13,13 @@
|
||||
|
||||
#define NO_DROPS { { F16(100), F16(0), 0, F16(0) }, }
|
||||
|
||||
// rename this to NO_DROPS and the above to NO_STAT_DROPS after all map data done
|
||||
#define NPC_NO_DROPS { \
|
||||
.dropFlags = NPC_DROP_FLAGS_80, \
|
||||
.heartDrops = NO_DROPS, \
|
||||
.flowerDrops = NO_DROPS, \
|
||||
}
|
||||
|
||||
#define STANDARD_HEART_DROPS(attempts) { \
|
||||
{ F16(20), F16(70), attempts, F16(50) }, \
|
||||
{ F16(30), F16(60), attempts, F16(50) }, \
|
||||
|
@ -13,8 +13,8 @@ enum GameBytes {
|
||||
GB_Unused_EVT_09 = GameByte(0x009),
|
||||
GB_Unused_EVT_0A = GameByte(0x00A),
|
||||
GB_Unused_EVT_0B = GameByte(0x00B),
|
||||
GB_Unused_KMR_00 = GameByte(0x00C),
|
||||
GB_Unused_KMR_01 = GameByte(0x00D),
|
||||
GB_KMR20_MarioReadDiaryFlags_00 = GameByte(0x00C),
|
||||
GB_KMR20_MarioReadDiaryFlags_01 = GameByte(0x00D),
|
||||
GB_KMR20_MarioReadLetterFlags_00 = GameByte(0x00E),
|
||||
GB_KMR20_MarioReadLetterFlags_01 = GameByte(0x00F),
|
||||
GB_Unused_KMR_04 = GameByte(0x010),
|
||||
|
@ -287,7 +287,6 @@ ApiStatus SetBattleCamParam(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_8026DF88(Evt* script, s32 isInitialCall);
|
||||
ApiStatus InitAnimatedModels(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_8024CE9C(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CABE8(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CAE50(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802807D0(Evt* script, s32 isInitialCall);
|
||||
ApiStatus PartnerYieldTurn(Evt* script, s32 isInitialCall); ///< YieldTurn copy
|
||||
|
@ -93,6 +93,7 @@ ApiStatus SetCamEnabled(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetCamFlag80(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetCamPerspective(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetCamViewport(Evt* script, s32 isInitialCall);
|
||||
ApiStatus func_802CABE8(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetCamBGColor(Evt* script, s32 isInitialCall);
|
||||
ApiStatus SetCamTarget(Evt* script, s32 isInitialCall);
|
||||
ApiStatus InterpCamTargetPos(Evt* script, s32 isInitialCall);
|
||||
|
@ -150,11 +150,11 @@ extern UNK_TYPE D_800E92D8;
|
||||
extern UNK_TYPE D_80147574;
|
||||
extern s8 D_8014C248[];
|
||||
|
||||
extern UNK_FUN_PTR(D_8010C920);
|
||||
extern UNK_FUN_PTR(D_8010C940);
|
||||
extern UNK_FUN_PTR(PulseStoneNotificationCallback);
|
||||
extern UNK_FUN_PTR(TalkNotificationCallback);
|
||||
extern Entity* TweesterTouchingPartner;
|
||||
extern Entity* TweesterTouchingPlayer;
|
||||
extern UNK_FUN_PTR(D_8010C958);
|
||||
extern UNK_FUN_PTR(InteractNotificationCallback);
|
||||
extern s32 PrevPlayerDirection;
|
||||
extern s32 PeachDisguiseNpcIndex;
|
||||
extern s32 D_8010C980;
|
||||
|
60
src/77480.c
60
src/77480.c
@ -11,7 +11,7 @@
|
||||
|
||||
extern f32 D_800F7B48;
|
||||
extern s32 D_800F7B4C;
|
||||
extern UNK_FUN_PTR(D_8010C93C);
|
||||
extern UNK_FUN_PTR(ISpyNotificationCallback);
|
||||
extern s8 D_8015A57A;
|
||||
extern s32 GoombarioGetTattleID;
|
||||
|
||||
@ -986,27 +986,27 @@ void player_render_interact_prompts(void) {
|
||||
void check_for_ispy(void) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
|
||||
if (D_8015A57A != 0 && D_8010C93C == NULL) {
|
||||
if (D_8015A57A != 0 && ISpyNotificationCallback == NULL) {
|
||||
if (!(playerStatus->animFlags &
|
||||
(PA_FLAGS_SPEECH_PROMPT_AVAILABLE | PA_FLAGS_INTERACT_PROMPT_AVAILABLE))) {
|
||||
dma_copy(E225B0_ROM_START, E225B0_ROM_END, E225B0_VRAM_DEF);
|
||||
D_8010C93C = func_802B72C0_E22870;
|
||||
ISpyNotificationCallback = func_802B72C0_E22870;
|
||||
}
|
||||
}
|
||||
|
||||
if (D_8010C93C != NULL) {
|
||||
D_8010C93C();
|
||||
if (ISpyNotificationCallback != NULL) {
|
||||
ISpyNotificationCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E0330(void) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_100) && (D_8010C93C != NULL)) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_100) && (ISpyNotificationCallback != NULL)) {
|
||||
func_802B7000_E225B0();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E0374(void) {
|
||||
D_8010C93C = NULL;
|
||||
ISpyNotificationCallback = NULL;
|
||||
gPlayerStatusPtr->animFlags &= ~PA_FLAGS_100;
|
||||
}
|
||||
|
||||
@ -1014,7 +1014,7 @@ void check_for_pulse_stone(void) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
s32 dx, dy;
|
||||
|
||||
if (D_8010C920 == NULL) {
|
||||
if (PulseStoneNotificationCallback == NULL) {
|
||||
if (gPlayerStatus.animFlags & PA_FLAGS_100) {
|
||||
return;
|
||||
}
|
||||
@ -1039,23 +1039,23 @@ void check_for_pulse_stone(void) {
|
||||
|
||||
if (!(gPlayerStatus.animFlags & (PA_FLAGS_SPEECH_PROMPT_AVAILABLE | PA_FLAGS_INTERACT_PROMPT_AVAILABLE))) {
|
||||
dma_copy(E21870_ROM_START, E21870_ROM_END, E21870_VRAM_DEF);
|
||||
D_8010C920 = func_802B7140;
|
||||
PulseStoneNotificationCallback = func_802B7140;
|
||||
}
|
||||
}
|
||||
|
||||
if (D_8010C920 != NULL) {
|
||||
D_8010C920();
|
||||
if (PulseStoneNotificationCallback != NULL) {
|
||||
PulseStoneNotificationCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E04D0(void) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_40) && (D_8010C920 != 0)) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_40) && (PulseStoneNotificationCallback != 0)) {
|
||||
func_802B71D4();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E0514(void) {
|
||||
D_8010C920 = 0;
|
||||
PulseStoneNotificationCallback = NULL;
|
||||
gPlayerStatusPtr->animFlags &= ~PA_FLAGS_40;
|
||||
}
|
||||
|
||||
@ -1074,38 +1074,38 @@ s32 has_valid_conversation_npc(void) {
|
||||
}
|
||||
|
||||
void check_for_conversation_prompt(void) {
|
||||
if (gPlayerStatus.animFlags & PA_FLAGS_100 || D_8010C958 || D_8010C920) {
|
||||
if (gPlayerStatus.animFlags & PA_FLAGS_100 || InteractNotificationCallback || PulseStoneNotificationCallback) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (D_8010C940 == NULL) {
|
||||
if (TalkNotificationCallback == NULL) {
|
||||
if (gPlayerStatus.inputEnabledCounter || gPlayerStatus.flags & PS_FLAGS_PAUSED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (has_valid_conversation_npc()) {
|
||||
D_8010C940 = NULL;
|
||||
TalkNotificationCallback = NULL;
|
||||
dma_copy(E20EB0_ROM_START, E20EB0_ROM_END, E20EB0_VRAM_DEF);
|
||||
D_8010C940 = func_802B70B4_E201C4;
|
||||
TalkNotificationCallback = func_802B70B4_E201C4;
|
||||
} else {
|
||||
D_8010C940 = NULL;
|
||||
TalkNotificationCallback = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (D_8010C940 != NULL) {
|
||||
D_8010C940();
|
||||
if (TalkNotificationCallback != NULL) {
|
||||
TalkNotificationCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E0658(void) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_SPEECH_PROMPT_AVAILABLE) && (D_8010C940 != 0)) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_SPEECH_PROMPT_AVAILABLE) && (TalkNotificationCallback != 0)) {
|
||||
func_802B71C8();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E069C(void) {
|
||||
D_8010C940 = 0;
|
||||
TalkNotificationCallback = NULL;
|
||||
gPlayerStatusPtr->animFlags &= ~PA_FLAGS_SPEECH_PROMPT_AVAILABLE;
|
||||
}
|
||||
|
||||
@ -1162,11 +1162,11 @@ void check_for_interactables(void) {
|
||||
Npc* npc = gPlayerStatus.encounteredNPC;
|
||||
s32 phi_s2;
|
||||
|
||||
if ((playerStatus->animFlags & PA_FLAGS_100) || D_8010C940 || D_8010C920) {
|
||||
if ((playerStatus->animFlags & PA_FLAGS_100) || TalkNotificationCallback || PulseStoneNotificationCallback) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (D_8010C958 == NULL) {
|
||||
if (InteractNotificationCallback == NULL) {
|
||||
s32 curInteraction = gCollisionStatus.currentWall;
|
||||
|
||||
if (playerStatus->inputEnabledCounter != 0) {
|
||||
@ -1252,27 +1252,27 @@ void check_for_interactables(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (D_8010C958 == NULL) {
|
||||
if (InteractNotificationCallback == NULL) {
|
||||
dma_copy(E20110_ROM_START, E20110_ROM_END, E20110_VRAM_DEF);
|
||||
D_8010C958 = func_802B70B4_E201C4;
|
||||
InteractNotificationCallback = func_802B70B4_E201C4;
|
||||
|
||||
}
|
||||
|
||||
if (D_8010C958 != NULL) {
|
||||
D_8010C958();
|
||||
if (InteractNotificationCallback != NULL) {
|
||||
InteractNotificationCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B71E8_E202F8(void);
|
||||
|
||||
void func_800E0AD0(void) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (D_8010C958 != 0)) {
|
||||
if ((gPlayerStatusPtr->animFlags & PA_FLAGS_INTERACT_PROMPT_AVAILABLE) && (InteractNotificationCallback != 0)) {
|
||||
func_802B71E8_E202F8();
|
||||
}
|
||||
}
|
||||
|
||||
void func_800E0B14(void) {
|
||||
D_8010C958 = 0;
|
||||
InteractNotificationCallback = NULL;
|
||||
gPlayerStatusPtr->animFlags &= ~PA_FLAGS_INTERACT_PROMPT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,9 @@ void reset_player_status(void) {
|
||||
|
||||
PeachDisguiseNpcIndex = -1;
|
||||
TweesterTouchingPartner = NULL;
|
||||
D_8010C920 = 0;
|
||||
D_8010C940 = 0;
|
||||
D_8010C958 = 0;
|
||||
PulseStoneNotificationCallback = NULL;
|
||||
TalkNotificationCallback = NULL;
|
||||
InteractNotificationCallback = NULL;
|
||||
D_8010C92C = 0;
|
||||
PrevPlayerDirection = 0;
|
||||
D_8010C980 = 0;
|
||||
|
@ -45,7 +45,7 @@ void func_802B70B4_E201C4(void) {
|
||||
D_802B7CB8_E20DC8->scale = 0.4f;
|
||||
D_802B7CB8_E20DC8->unk_23 = 0;
|
||||
D_802B7CB8_E20DC8->unk_0C = -gCameras[gCurrentCameraID].currentYaw;
|
||||
D_8010C958 = func_802B7728_E20838;
|
||||
InteractNotificationCallback = func_802B7728_E20838;
|
||||
D_802B7CB8_E20DC8->unk_24 = 0xFF;
|
||||
D_802B7CB8_E20DC8->unk_1C = 0xFF;
|
||||
}
|
||||
@ -226,7 +226,7 @@ void func_802B7728_E20838(void) {
|
||||
D_802B7CB8_E20DC8->unk_1C = 0;
|
||||
}
|
||||
if ((scale >= 70.0f && scale <= 110.0f) || (scale >= 250.0f && scale <= 290.0f)) {
|
||||
D_8010C958 = func_802B79C8_E20AD8;
|
||||
InteractNotificationCallback = func_802B79C8_E20AD8;
|
||||
}
|
||||
var_s0 = E20110_UnkAngleFunc1(scale);
|
||||
break;
|
||||
@ -253,7 +253,7 @@ void func_802B7728_E20838(void) {
|
||||
void func_802B79C8_E20AD8(void) {
|
||||
func_802B75E8_E206F8();
|
||||
gPlayerStatusPtr->interactingWithID = -1;
|
||||
D_8010C958 = 0;
|
||||
InteractNotificationCallback = NULL;
|
||||
gPlayerStatusPtr->encounteredNPC = NULL;
|
||||
gPlayerStatusPtr->animFlags &= ~PA_FLAGS_INTERACT_PROMPT_AVAILABLE;
|
||||
func_800EF3D4(0);
|
||||
|
@ -71,7 +71,7 @@ void func_802B7140(void) {
|
||||
D_802B7D18_E22588->pos.y = playerStatus->position.y + playerStatus->colliderHeight + 8.0f;
|
||||
D_802B7D18_E22588->pos.z = playerStatus->position.z;
|
||||
playerStatus->animFlags |= PA_FLAGS_40;
|
||||
D_8010C920 = func_802B74F0;
|
||||
PulseStoneNotificationCallback = func_802B74F0;
|
||||
}
|
||||
|
||||
void func_802B71D4(void) {
|
||||
@ -155,7 +155,7 @@ void func_802B74F0(void) {
|
||||
D_802B7D18_E22588->pos.z = playerStatus->position.z;
|
||||
|
||||
if (!func_802B704C()) {
|
||||
D_8010C920 = NULL;
|
||||
PulseStoneNotificationCallback = NULL;
|
||||
playerStatus->animFlags &= ~PA_FLAGS_40;
|
||||
return;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ BSS struct802B7C78 D_802B7CB0;
|
||||
|
||||
struct802B7C78* D_802B7C78_E23228 = &D_802B7CB0;
|
||||
|
||||
extern void (*D_8010C93C)(void);
|
||||
extern void (*ISpyNotificationCallback)(void);
|
||||
|
||||
void func_802B735C_E2290C(void);
|
||||
|
||||
@ -95,7 +95,7 @@ void func_802B72C0_E22870(void) {
|
||||
D_802B7C78_E23228->unk_28 = 0xFF;
|
||||
|
||||
gPlayerStatus.animFlags |= PA_FLAGS_100;
|
||||
D_8010C93C = &func_802B735C_E2290C;
|
||||
ISpyNotificationCallback = &func_802B735C_E2290C;
|
||||
}
|
||||
|
||||
void func_802B735C_E2290C(void) {
|
||||
@ -150,7 +150,7 @@ void func_802B735C_E2290C(void) {
|
||||
|
||||
if (D_802B7C78_E23228->unk_18++ > 50) {
|
||||
gCurrentHiddenPanels.activateISpy = FALSE;
|
||||
D_8010C93C = NULL;
|
||||
ISpyNotificationCallback = NULL;
|
||||
playerStatus->animFlags &= ~PA_FLAGS_100;
|
||||
}
|
||||
break;
|
||||
|
@ -218,7 +218,7 @@ EvtScript N(takeTurn_80223804) = {
|
||||
|
||||
#include "common/FoliageTransform.inc.c"
|
||||
|
||||
EvtScript N(shakeTree) = {
|
||||
EvtScript N(EVS_ShakeTree) = {
|
||||
EVT_SET_TIMESCALE(EVT_FLOAT(2.0))
|
||||
EVT_USE_BUF(LVar0)
|
||||
EVT_BUF_READ4(LVar1, LVar2, LVar3, LVar4)
|
||||
@ -332,7 +332,7 @@ ShakeTreeConfig N(tree) = {
|
||||
|
||||
EvtScript N(shake_goomnut_tree) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(tree)))
|
||||
EVT_EXEC_WAIT(N(shakeTree))
|
||||
EVT_EXEC_WAIT(N(EVS_ShakeTree))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -931,6 +931,12 @@ f32 test_ray_collider_horizontal(s32 ignoreFlags, s32 colliderID, f32 x, f32 y,
|
||||
return ret;
|
||||
}
|
||||
|
||||
enum {
|
||||
ENTITY_TEST_ANY = 0,
|
||||
ENTITY_TEST_DOWN = 1,
|
||||
ENTITY_TEST_LATERAL = 2,
|
||||
};
|
||||
|
||||
s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ,
|
||||
f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32* hitNx, f32* hitNy, f32* hitNz) {
|
||||
f32 hitDepthDown, hitDepthHoriz;
|
||||
@ -949,15 +955,15 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3
|
||||
ColliderTriangle *triangle = &entityTriangle;
|
||||
|
||||
entityIndex = -1;
|
||||
type = 0;
|
||||
type = ENTITY_TEST_ANY;
|
||||
hitDepthDown = hitDepthHoriz = *hitDepth;
|
||||
|
||||
if (dirX == 0 && dirZ == 0 && dirY < 0) {
|
||||
hitDepthHoriz = 0;
|
||||
type = 1;
|
||||
type = ENTITY_TEST_DOWN;
|
||||
} else if (dirY == 0) {
|
||||
hitDepthDown = 0;
|
||||
type = 2;
|
||||
type = ENTITY_TEST_LATERAL;
|
||||
}
|
||||
|
||||
gCollisionRayLength = -1;
|
||||
@ -979,15 +985,15 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
case 1:
|
||||
case ENTITY_TEST_ANY:
|
||||
case ENTITY_TEST_DOWN:
|
||||
dist = entity->position.y;
|
||||
dist2 = hitDepthDown + entity->effectiveSize * 2;
|
||||
if (dist + dist2 < startY || startY < dist - dist2) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case ENTITY_TEST_LATERAL:
|
||||
dist = entity->position.y;
|
||||
dist2 = entity->effectiveSize * 2;
|
||||
if (dist + dist2 < startY || startY < dist - dist2) {
|
||||
@ -1037,14 +1043,14 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3
|
||||
*hitDepth = gCollisionRayLength;
|
||||
|
||||
switch (type) {
|
||||
case 0:
|
||||
case ENTITY_TEST_ANY:
|
||||
hitDepthDown = gCollisionRayLength;
|
||||
hitDepthHoriz = gCollisionRayLength;
|
||||
break;
|
||||
case 1:
|
||||
case ENTITY_TEST_DOWN:
|
||||
hitDepthDown = gCollisionRayLength;
|
||||
break;
|
||||
case 2:
|
||||
case ENTITY_TEST_LATERAL:
|
||||
hitDepthHoriz = gCollisionRayLength;
|
||||
break;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "FoliageTransform.inc.c"
|
||||
|
||||
EvtScript N(searchBush) = {
|
||||
EvtScript N(EVS_SearchBush) = {
|
||||
EVT_USE_BUF(LVar0)
|
||||
EVT_BUF_READ4(LVar1, LVar2, LVar3, LVar4)
|
||||
EVT_CALL(GetPlayerPos, LVar5, LVarF, LVar7)
|
||||
@ -67,7 +67,7 @@ EvtScript N(searchBush) = {
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(shakeTree) = {
|
||||
EvtScript N(EVS_ShakeTree) = {
|
||||
EVT_SET_TIMESCALE(EVT_FLOAT(2.0))
|
||||
EVT_USE_BUF(LVar0)
|
||||
EVT_BUF_READ4(LVar1, LVar2, LVar3, LVar4)
|
||||
|
@ -44,7 +44,7 @@ void func_802B70B4(void) {
|
||||
D_802B79A8_E21858->unk_18 = 0;
|
||||
D_802B79A8_E21858->unk_2A = 0;
|
||||
D_802B79A8_E21858->scale = 0.1f;
|
||||
D_8010C940 = func_802B742C;
|
||||
TalkNotificationCallback = func_802B742C;
|
||||
playerStatus->animFlags |= PA_FLAGS_SPEECH_PROMPT_AVAILABLE;
|
||||
temp = D_802B79A8_E21858;
|
||||
temp->unk_2A = 0;
|
||||
@ -135,7 +135,7 @@ void func_802B742C(void) {
|
||||
}
|
||||
D_802B79A8_E21858->unk_10 = unk10;
|
||||
if ((unk10 >= 70.0f && unk10 <= 110.0f) || (unk10 >= 250.0f && unk10 <= 290.0f)) {
|
||||
D_8010C940 = NULL;
|
||||
TalkNotificationCallback = NULL;
|
||||
playerStatus->encounteredNPC = NULL;
|
||||
playerStatus->animFlags &= ~PA_FLAGS_SPEECH_PROMPT_AVAILABLE;
|
||||
return;
|
||||
|
@ -614,10 +614,10 @@ ApiStatus BindNpcDefeat(Evt* script, s32 isInitialCall) {
|
||||
ApiStatus SetSelfVar(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
Enemy* owner = script->owner1.enemy;
|
||||
s32 var1 = evt_get_variable(script, *args++);
|
||||
s32 var2 = evt_get_variable(script, *args);
|
||||
s32 index = evt_get_variable(script, *args++);
|
||||
s32 value = evt_get_variable(script, *args++);
|
||||
|
||||
owner->varTable[var1] = var2;
|
||||
owner->varTable[index] = value;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
#include "effects.h"
|
||||
#include "message_ids.h"
|
||||
#include "ld_addrs.h"
|
||||
#include "entity.h"
|
||||
|
||||
@ -357,9 +358,9 @@ void entity_HeartBlock_change_render_script(Entity* entity) {
|
||||
}
|
||||
|
||||
void entity_HeartBlock_show_tutorial_message(Entity* entity) {
|
||||
if ((!gPlayerData.partners[PARTNER_GOOMBARIO].enabled) && get_global_flag(GF_Tutorial_HeartBlock) == 0) {
|
||||
if (!gPlayerData.partners[PARTNER_GOOMBARIO].enabled && !get_global_flag(GF_Tutorial_HeartBlock)) {
|
||||
HeartBlockPrinterClosed = FALSE;
|
||||
msg_get_printer_for_msg(0x1D0001, &HeartBlockPrinterClosed);
|
||||
msg_get_printer_for_msg(MSG_Menus_Tutorial_HeartBlock, &HeartBlockPrinterClosed);
|
||||
set_time_freeze_mode(TIME_FREEZE_PARTIAL);
|
||||
gOverrideFlags |= GLOBAL_OVERRIDES_40;
|
||||
disable_player_input();
|
||||
|
@ -2154,7 +2154,7 @@ void draw_number(s32 value, s32 x, s32 y, s32 charset, s32 palette, s32 opacity,
|
||||
s32 texSize = gMsgNumbers[charset].texSize;
|
||||
|
||||
y -= 2;
|
||||
if (y > 240U) {
|
||||
if (y < 0 || y > 240) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2162,7 +2162,7 @@ void draw_number(s32 value, s32 x, s32 y, s32 charset, s32 palette, s32 opacity,
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
u8 digit;
|
||||
if (valueStr[i] == 0) {
|
||||
if (valueStr[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2117,7 +2117,7 @@ void func_8003D788(Npc* npc, s32 arg1) {
|
||||
f32 cosTheta;
|
||||
|
||||
phi_a2 = 0;
|
||||
if (gGameStatusPtr->areaID == 5) {
|
||||
if (gGameStatusPtr->areaID == AREA_HOS) {
|
||||
phi_a2 = gGameStatusPtr->mapID == 2;
|
||||
}
|
||||
if (arg1 == 2) {
|
||||
|
@ -302,7 +302,7 @@ StaticNpc N(PassiveNPCs)[] = {
|
||||
},
|
||||
{
|
||||
.id = NPC_ChuckQuizmo,
|
||||
.settings = &N(Quizmo_NpcSettings),
|
||||
.settings = &N(NpcSettings_ChuckQuizmo),
|
||||
.pos = { -400.0f, 0.0f, 100.0f },
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
|
||||
.initVarCount = 1,
|
||||
|
@ -41,8 +41,8 @@ BombTrigger N(BombPos_Tree1) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_yasi, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_yasi, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -576,7 +576,7 @@ StaticNpc N(PassiveNPCs)[] = {
|
||||
},
|
||||
{
|
||||
.id = NPC_ChuckQuizmo,
|
||||
.settings = &N(Quizmo_NpcSettings),
|
||||
.settings = &N(NpcSettings_ChuckQuizmo),
|
||||
.pos = { -335.0f, 0.0f, 90.0f },
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_8 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000,
|
||||
.initVarCount = 1,
|
||||
|
@ -49,8 +49,8 @@ EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(AF_FLO_TreeDrop_RedBerry1, FALSE)
|
||||
EVT_SET(AF_FLO_TreeDrop_RedBerry2, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o242, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o242, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -238,8 +238,8 @@ BombTrigger N(BombPos_CrystalTree) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_CrystalTree)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o5, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_CrystalTree)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o5, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_CrystalTree)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -49,8 +49,8 @@ EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(AF_FLO_TreeDrop_BlueBerry1, FALSE)
|
||||
EVT_SET(AF_FLO_TreeDrop_BlueBerry2, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o172, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o172, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -136,14 +136,14 @@ EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 0)
|
||||
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o10, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o10, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o3, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o3, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o13, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree3)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o13, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree3)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -43,8 +43,8 @@ BombTrigger N(BombPos_Tree1) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o85, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o85, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "world/common/todo/UnkFunc42.inc.c"
|
||||
|
||||
#include "world/common/enemy/complete/Lakitu.h"
|
||||
#include "world/common/enemy/complete/Magikoopa.h"
|
||||
#include "world/common/enemy/complete/YMagikoopa.h"
|
||||
|
||||
NpcSettings N(NpcSettings_Lakitu) = {
|
||||
.height = 32,
|
||||
|
@ -40,11 +40,11 @@ BombTrigger N(BombPos_Tree2) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o27, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o27, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o30, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o30, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -54,8 +54,8 @@ EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(AF_FLO_TreeDrop_BubbleBerry1, FALSE)
|
||||
EVT_SET(AF_FLO_TreeDrop_BubbleBerry2, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o124, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o124, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -51,8 +51,8 @@ EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(AF_FLO_TreeDrop_YellowBerry1, FALSE)
|
||||
EVT_SET(AF_FLO_TreeDrop_YellowBerry2, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o42, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o42, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -135,13 +135,13 @@ SearchBushConfig N(SearchBush_Bush4) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k4, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k4, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k5, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k5, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k6, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k6, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush4)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k7, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k7, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -44,8 +44,8 @@ BombTrigger N(D_80247A1C_B27F5C) = {
|
||||
EvtScript N(EVS_80247A2C) = {
|
||||
EVT_SET(AF_JAN_0D, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o282, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(D_80247A1C_B27F5C)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o282, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(D_80247A1C_B27F5C)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -26,6 +26,8 @@ enum {
|
||||
AF_KMR_07 = AreaFlag(7),
|
||||
AF_KMR_08 = AreaFlag(8),
|
||||
AF_KMR_09 = AreaFlag(9),
|
||||
AF_KMR_0B = AreaFlag(11),
|
||||
AF_KMR_0C = AreaFlag(12),
|
||||
AF_KMR_0D = AreaFlag(13),
|
||||
};
|
||||
|
||||
|
@ -1,306 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
#include "effects.h"
|
||||
#include "model.h"
|
||||
|
||||
BSS u8 D_80257F20; // r
|
||||
BSS u8 D_80257F21; // g
|
||||
BSS u8 D_80257F22; // b
|
||||
BSS u8 D_80257F23; // a
|
||||
BSS u8 oldPrimR, oldPrimG, oldPrimB;
|
||||
BSS u8 oldEnvR, oldEnvG, oldEnvB;
|
||||
|
||||
static char* N(exit_str_0) = "kmr_05";
|
||||
static char* N(exit_str_1) = "kmr_00";
|
||||
static char* N(exit_str_2) = "kmr_09";
|
||||
static char* N(exit_str_3) = "";
|
||||
|
||||
#define CHUCK_QUIZMO_NPC_ID 8
|
||||
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
|
||||
extern s32* D_80244B2C_8B4B9C[];
|
||||
extern s32* D_802480AC_8B811C[];
|
||||
|
||||
NOP_FIX // TODO remove when D_80244B2C_8B4B9C is migrated
|
||||
ApiStatus func_802402E0_8B0350(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcID = evt_get_variable(script, *args++);
|
||||
s32 territoryIndex = evt_get_variable(script, *args++);
|
||||
s32* var_s0 = D_80244B2C_8B4B9C[territoryIndex];
|
||||
Enemy* enemy = get_enemy(npcID);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < (s32) (sizeof(enemy->territory->wander) / sizeof(i)); i++) {
|
||||
s32* wander = (s32*) &enemy->territory->wander;
|
||||
|
||||
wander[i] = var_s0[i];
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
NOP_UNFIX // TODO remove when D_80244B2C_8B4B9C is migrated
|
||||
|
||||
ApiStatus func_80240370_8B03E0(Evt* script, s32 isInitialCall) {
|
||||
set_map_change_fade_rate(1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
extern s32 N(Quizmo_Worker);
|
||||
extern s32 N(Quizmo_AnswerResult);
|
||||
extern EffectInstance* N(Quizmo_StageEffect);
|
||||
extern EffectInstance* N(Quizmo_AudienceEffect);
|
||||
extern EffectInstance* N(Quizmo_VannaTEffect);
|
||||
|
||||
#include "world/common/atomic/Quizmo.inc.c"
|
||||
|
||||
#include "world/common/enemy/ai/StationaryAI.inc.c"
|
||||
|
||||
static char* N(exit_str_4) = "nok_02";
|
||||
static char* N(exit_str_5) = "kmr_03";
|
||||
static char* N(exit_str_6) = "\0\0\0\0";
|
||||
|
||||
#include "world/common/util/ChangeNpcToPartner.inc.c"
|
||||
|
||||
ApiStatus func_80242014_8B2084(Evt* script, s32 isInitialCall) {
|
||||
if (get_npc_unsafe(NPC_PARTNER)->flags & NPC_FLAG_1000) {
|
||||
return ApiStatus_DONE2;
|
||||
} else {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
}
|
||||
|
||||
#include "world/common/todo/GetNpcCollisionHeight.inc.c"
|
||||
|
||||
#include "world/common/todo/AddPlayerHandsOffset.inc.c"
|
||||
|
||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_8024226C_8B22DC);
|
||||
|
||||
extern s32 N(ItemChoice_HasSelectedItem);
|
||||
extern s32 N(ItemChoice_SelectedItemID);
|
||||
|
||||
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 kmr_02_D_80257F2C[11]; // unused?
|
||||
BSS s32 kmr_02_D_80257F58[114];
|
||||
|
||||
ApiStatus func_802422F8_8B2368(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++) {
|
||||
kmr_02_D_80257F58[i] = ptr[i];
|
||||
}
|
||||
kmr_02_D_80257F58[i] = 0;
|
||||
} else {
|
||||
for (i = 0; i < 112; i++) {
|
||||
kmr_02_D_80257F58[i] = i + 16;
|
||||
kmr_02_D_80257F58[112] = 0;
|
||||
}
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
NOP_FIX // TODO remove when D_802480AC_8B811C is migrated
|
||||
ApiStatus func_80242394_8B2404(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcID = evt_get_variable(script, *args++);
|
||||
s32 territoryIndex = evt_get_variable(script, *args++);
|
||||
s32* var_s0 = D_802480AC_8B811C[territoryIndex];
|
||||
Enemy* enemy = get_enemy(npcID);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < (s32) (sizeof(enemy->territory->wander) / sizeof(i)); i++) {
|
||||
s32* wander = (s32*) &enemy->territory->wander;
|
||||
|
||||
wander[i] = var_s0[i];
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
NOP_UNFIX // TODO remove when D_802480AC_8B811C is migrated
|
||||
|
||||
extern s32 N(LetterDelivery_SavedNpcAnim);
|
||||
#include "world/common/todo/LetterDelivery.inc.c"
|
||||
|
||||
ApiStatus func_80242710_8B2780(Evt* script, s32 isInitialCall) {
|
||||
script->varTable[0] = gPlayerData.curHP == gPlayerData.curMaxHP;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
extern u8 D_80257B00_8C7B70;
|
||||
extern u16 D_80257D00_8C7D70;
|
||||
|
||||
BSS MessageImageData D_80258120;
|
||||
|
||||
ApiStatus func_80242734_8B27A4(void) {
|
||||
D_80258120.raster = &D_80257B00_8C7B70; // TODO extract image
|
||||
D_80258120.palette = &D_80257D00_8C7D70; // TODO extract pal
|
||||
D_80258120.width = 32; // TOOD image header define
|
||||
D_80258120.height = 32; // TOOD image header define
|
||||
D_80258120.format = G_IM_FMT_CI;
|
||||
D_80258120.bitDepth = 0;
|
||||
set_message_images(&D_80258120);
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
|
||||
ApiStatus func_80242788_8B27F8(Evt* script, s32 isInitialCall) {
|
||||
gPlayerData.partners[PARTNER_GOOMPA].enabled = FALSE;
|
||||
func_800EB2A4(0);
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
|
||||
ApiStatus func_802427B0_8B2820(Evt* script, s32 isInitialCall) {
|
||||
if (gGameStatusPtr->pressedButtons[0] & BUTTON_START) {
|
||||
return ApiStatus_DONE2;
|
||||
} else {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus func_802427CC_8B283C(Evt* script, s32 isInitialCall) {
|
||||
set_game_mode(GAME_MODE_PAUSE);
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
|
||||
ApiStatus func_802427EC_8B285C(Evt* script, s32 isInitialCall) {
|
||||
close_status_menu();
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_8024280C_8B287C(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
Npc* npc = resolve_npc(script, 0);
|
||||
|
||||
npc->renderYaw += evt_get_float_variable(script, *args++);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#define KAMMY_NPC 7
|
||||
#include "world/common/util/GetKammyBroomEmitterPos.inc.c"
|
||||
|
||||
#include "world/common/todo/SyncStatusMenu.inc.c"
|
||||
|
||||
#ifdef NON_EQUIVALENT
|
||||
// control flow + data migration
|
||||
ApiStatus func_8024295C_8B29CC(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 r = evt_get_variable(script, *args++);
|
||||
s32 g = evt_get_variable(script, *args++);
|
||||
s32 b = evt_get_variable(script, *args++);
|
||||
s32 a = evt_get_variable(script, *args++);
|
||||
s32 temp_s0_5 = evt_get_variable(script, *args++);
|
||||
|
||||
if (isInitialCall) {
|
||||
get_background_color_blend(&D_80257F20, &D_80257F21, &D_80257F22, &D_80257F23);
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
|
||||
if (temp_s0_5 > 0) {
|
||||
set_background_color_blend(
|
||||
D_80257F20 + (((r - D_80257F20) * script->functionTemp[0]) / temp_s0_5),
|
||||
D_80257F21 + (((g - D_80257F21) * script->functionTemp[0]) / temp_s0_5),
|
||||
D_80257F22 + (((b - D_80257F22) * script->functionTemp[0]) / temp_s0_5),
|
||||
D_80257F23 + (((a - D_80257F23) * script->functionTemp[0]) / temp_s0_5)
|
||||
);
|
||||
|
||||
script->functionTemp[0]++;
|
||||
if (temp_s0_5 < script->functionTemp[0]) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
} else {
|
||||
set_background_color_blend(r, g, b, a);
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_02/8B0070", func_8024295C_8B29CC);
|
||||
#endif
|
||||
|
||||
ApiStatus func_80242BA8_8B2C18(Evt* script, s32 isInitialCall) {
|
||||
*gBgRenderTypePtr = 1;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80242BC0_8B2C30(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args;
|
||||
|
||||
s32 newEnvR, newEnvB, newEnvG;
|
||||
s32 newPrimR, newPrimG, newPrimB;
|
||||
s32 duration;
|
||||
|
||||
args = script->ptrReadPos;
|
||||
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++);
|
||||
if (isInitialCall) {
|
||||
get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB);
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
if (duration > 0) {
|
||||
set_model_env_color_parameters(
|
||||
oldPrimR + ((newPrimR - oldPrimR) * script->functionTemp[0]) / duration,
|
||||
oldPrimG + ((newPrimG - oldPrimG) * script->functionTemp[0]) / duration,
|
||||
oldPrimB + ((newPrimB - oldPrimB) * script->functionTemp[0]) / duration,
|
||||
oldEnvR + ( (newEnvR - oldEnvR) * script->functionTemp[0]) / duration,
|
||||
oldEnvG + ( (newEnvG - oldEnvG) * script->functionTemp[0]) / duration,
|
||||
oldEnvB + ( (newEnvB - oldEnvB) * script->functionTemp[0]) / duration);
|
||||
script->functionTemp[0]++;
|
||||
if (duration < script->functionTemp[0]) {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB);
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ApiStatus func_80242F08_8B2F78(Evt* script, s32 isInitialCall) {
|
||||
mdl_set_all_fog_mode(3);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80242F28_8B2F98(Evt* script, s32 isInitialCall) {
|
||||
func_8011B950(0x9C, -1, 1, 1);
|
||||
set_background_color_blend(0, 0, 0, 255);
|
||||
gCameras[CAM_DEFAULT].bgColor[0] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[1] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[2] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
extern s16 D_8024E538_8BE5A8[];
|
||||
|
||||
ApiStatus func_80242F7C_8B2FEC(Evt* script, s32 isInitialCall) {
|
||||
Npc* npc;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[1] = 0.0f;
|
||||
script->functionTempPtr[2] = get_npc_safe(script->owner2.npcID);
|
||||
script->functionTemp[3] = D_8024E538_8BE5A8[script->owner2.npcID];
|
||||
}
|
||||
|
||||
if (script->functionTemp[3] != 0) {
|
||||
script->functionTemp[3]--;
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
npc = script->functionTempPtr[2];
|
||||
npc->verticalRenderOffset = sin_deg(script->functionTempF[1]) * 1.5f;
|
||||
script->functionTempF[1] = clamp_angle(script->functionTempF[1] + 18.0f);
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_80243034_8B30A4(Evt* script, s32 isInitialCall) {
|
||||
get_item_entity(script->varTable[0])->scale = 0.6f;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "world/common/atomic/ToadHouse.inc.c"
|
@ -1,43 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
ApiStatus func_80243370_8B33E0(Evt* script, s32 isInitialCall) {
|
||||
PlayerData* playerData = &gPlayerData;
|
||||
s32 cond = FALSE;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
|
||||
if (playerData->equippedBadges[i] != 0) {
|
||||
cond = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
script->varTable[0] = cond;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/SetEntityPositionF.inc.c"
|
||||
|
||||
#include "world/common/todo/GetEntityPosition.inc.c"
|
||||
|
||||
static char* N(exit_str_6) = "tik_01";
|
||||
|
||||
ApiStatus func_80243514_8B3584(Evt* script, s32 isInitialCall) {
|
||||
Entity* entity = get_entity_by_index(script->varTable[10]);
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
script->functionTemp[1] = 60;
|
||||
}
|
||||
|
||||
entity->scale.x = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->scale.y = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->scale.z = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.5f;
|
||||
script->functionTemp[1]--;
|
||||
|
||||
if (script->functionTemp[1] == -1) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "world/common/todo/CheckPartnerFlags1000.inc.c"
|
||||
|
||||
extern s32* D_8025578C_8C57FC[4]; // EnemyTerritoryWander
|
||||
|
||||
NOP_FIX // TODO remove when D_8025578C_8C57FC is migrated
|
||||
ApiStatus func_8024366C_8B36DC(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcID = evt_get_variable(script, *args++);
|
||||
s32 territoryIndex = evt_get_variable(script, *args++);
|
||||
s32* var_s0 = D_8025578C_8C57FC[territoryIndex];
|
||||
Enemy* enemy = get_enemy(npcID);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < (s32) (sizeof(enemy->territory->wander) / sizeof(i)); i++) {
|
||||
s32* wander = (s32*) &enemy->territory->wander;
|
||||
|
||||
wander[i] = var_s0[i];
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
NOP_UNFIX // TODO remove when D_8025578C_8C57FC is migrated
|
||||
|
||||
|
||||
#include "world/common/todo/UnkFunc42.inc.c"
|
@ -1,3 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "common/foliage.inc.c"
|
@ -1,8 +0,0 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
BSS char D_80258140[0x200];
|
||||
BSS char D_80258340[0x3D90];
|
||||
BSS char D_8025C0D0;
|
||||
|
||||
#define PARTY_IMAGE "party_kurio"
|
||||
#include "world/common/todo/LoadPartyImage.inc.c"
|
@ -2,9 +2,75 @@
|
||||
/// @brief Goomba Region - Goomba Village
|
||||
|
||||
#include "common.h"
|
||||
#include "../kmr.h"
|
||||
#include "message_ids.h"
|
||||
#include "map.h"
|
||||
|
||||
#include "../kmr.h"
|
||||
#include "mapfs/kmr_02_shape.h"
|
||||
#include "mapfs/kmr_02_hit.h"
|
||||
|
||||
#include "sprite/npc/Goompa.h"
|
||||
#include "sprite/npc/ChuckQuizmo.h"
|
||||
#include "sprite/npc/WorldParakarry.h"
|
||||
#include "sprite/npc/WorldGoombario.h"
|
||||
#include "sprite/npc/Goombaria.h"
|
||||
#include "sprite/npc/Gooma.h"
|
||||
#include "sprite/npc/Goompapa.h"
|
||||
#include "sprite/npc/Goomama.h"
|
||||
#include "sprite/npc/Toad.h"
|
||||
#include "sprite/npc/WorldEldstar.h"
|
||||
#include "sprite/npc/WorldKammy.h"
|
||||
|
||||
enum {
|
||||
NPC_Goompa = 0,
|
||||
NPC_Goombaria = 1,
|
||||
NPC_Goombario = 2,
|
||||
NPC_Goompapa = 3,
|
||||
NPC_Goomama = 4,
|
||||
NPC_Gooma = 5,
|
||||
NPC_Toad = 6,
|
||||
NPC_Kammy = 7,
|
||||
NPC_ChuckQuizmo = 8,
|
||||
NPC_Eldstar_01 = 11,
|
||||
NPC_Eldstar_02 = 12,
|
||||
NPC_Parakarry = 13,
|
||||
};
|
||||
|
||||
enum {
|
||||
MV_Unk_00 = MapVar(0),
|
||||
MV_Unk_01 = MapVar(1),
|
||||
MV_Unk_04 = MapVar(4),
|
||||
MV_Unk_05 = MapVar(5),
|
||||
};
|
||||
|
||||
enum {
|
||||
MF_SpawnFlag_BushCoin = MapFlag(10),
|
||||
MF_SpawnFlag_Goomnut = MapFlag(11),
|
||||
};
|
||||
|
||||
#define NAMESPACE kmr_02
|
||||
|
||||
extern EvtScript N(EVS_Main);
|
||||
extern EvtScript N(EVS_SetupMusic);
|
||||
extern EvtScript N(EVS_FadeOutMusic);
|
||||
extern EvtScript N(EVS_PlayRestingSong);
|
||||
extern EvtScript N(EVS_PushNewPartnerSong);
|
||||
extern EvtScript N(EVS_PopSong);
|
||||
extern EvtScript N(EVS_SetupRooms);
|
||||
extern EvtScript N(EVS_SetupToadHouse);
|
||||
extern EvtScript N(EVS_SetWallsDown_ToadHouse);
|
||||
extern EvtScript N(EVS_Scene_KammyStrikes);
|
||||
extern EvtScript N(EVS_NpcAux_Kammy);
|
||||
extern EvtScript N(EVS_SummonGateBlock);
|
||||
extern EvtScript N(EVS_NpcInteract_ToadHouse);
|
||||
extern EvtScript N(EVS_SetupFoliage);
|
||||
extern EvtScript N(EVS_MakeEntities);
|
||||
extern NpcGroupList N(EpilogueNPCs);
|
||||
extern NpcGroupList N(NpcGroup1);
|
||||
extern NpcGroupList N(PrologueNPCs);
|
||||
extern NpcGroupList N(DefaultNPCs);
|
||||
|
||||
extern IMG_BIN N(heart_block_img)[];
|
||||
extern PAL_BIN N(heart_block_pal)[];
|
||||
|
||||
API_CALLABLE(N(LoadPartyImage));
|
||||
|
23
src/world/area_kmr/kmr_02/kmr_02_0_header.c
Normal file
23
src/world/area_kmr/kmr_02/kmr_02_0_header.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
EntryList N(Entrances) = {
|
||||
[kmr_02_ENTRY_0] { 391.0, 0.0, 286.0, 315.0 },
|
||||
[kmr_02_ENTRY_1] { -371.0, 0.0, 304.0, 45.0 },
|
||||
[kmr_02_ENTRY_2] { -473.0, 0.0, 4.0, 90.0 },
|
||||
[kmr_02_ENTRY_3] { 0.0, 35.0, 355.0, 180.0 },
|
||||
[kmr_02_ENTRY_4] { 60.0, 0.0, 10.0, 0.0 },
|
||||
[kmr_02_ENTRY_5] { -230.0, 36.0, -332.0, 0.0 },
|
||||
[kmr_02_ENTRY_6] { 0.0, 0.0, 0.0, 0.0 },
|
||||
[kmr_02_ENTRY_7] { 0.0, 0.0, 0.0, 0.0 },
|
||||
[kmr_02_ENTRY_8] { 0.0, 0.0, 0.0, 0.0 },
|
||||
[kmr_02_ENTRY_9] { 0.0, 0.0, 0.0, 0.0 },
|
||||
[kmr_02_ENTRY_A] { 200.0, 50.0, 70.0, 90.0 },
|
||||
};
|
||||
|
||||
MapSettings N(settings) = {
|
||||
.main = &N(EVS_Main),
|
||||
.entryList = &N(Entrances),
|
||||
.entryCount = ENTRY_COUNT(N(Entrances)),
|
||||
.background = &gBackgroundImage,
|
||||
.tattle = { MSG_MapTattle_kmr_02 },
|
||||
};
|
43
src/world/area_kmr/kmr_02/kmr_02_1_music.c
Normal file
43
src/world/area_kmr/kmr_02/kmr_02_1_music.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
EvtScript N(EVS_FadeOutMusic) = {
|
||||
EVT_CALL(FadeInMusic, 0, SONG_GOOMBA_VILLAGE, 0, 3000, 0, 127)
|
||||
EVT_CALL(ClearAmbientSounds, 250)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupMusic) = {
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH0_MET_INNKEEPER)
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_GOOMBA_VILLAGE, 0, 8)
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_OR_EQ(kmr_02_ENTRY_1)
|
||||
EVT_CASE_OR_EQ(kmr_02_ENTRY_5)
|
||||
EVT_CALL(ClearAmbientSounds, 250)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_PushNewPartnerSong) = {
|
||||
EVT_CALL(PushSong, SONG_NEW_PARTNER, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_PopSong) = {
|
||||
EVT_CALL(FadeOutMusic, 0, 500)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(PopSong)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_PlayRestingSong) = {
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_TAKING_REST, 0, 8)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
191
src/world/area_kmr/kmr_02/kmr_02_2_main.c
Normal file
191
src/world/area_kmr/kmr_02/kmr_02_2_main.c
Normal file
@ -0,0 +1,191 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#include "world/common/entity/Pipe.data.inc.c"
|
||||
|
||||
#define NAME_SUFFIX _Main
|
||||
#include "world/common/npc/GoombaFamily_Wander.inc.c"
|
||||
#include "wander_territories.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
EvtScript N(EVS_ExitWalk_kmr_05_1) = EVT_EXIT_WALK(60, kmr_02_ENTRY_2, "kmr_05", kmr_05_ENTRY_1);
|
||||
EvtScript N(EVS_ExitWalk_kmr_00_0) = EVT_EXIT_WALK(60, kmr_02_ENTRY_1, "kmr_00", kmr_00_ENTRY_0);
|
||||
EvtScript N(EVS_ExitWalk_kmr_09_0) = EVT_EXIT_WALK(60, kmr_02_ENTRY_0, "kmr_09", kmr_09_ENTRY_0);
|
||||
|
||||
MAP_RODATA_PAD(1, exits);
|
||||
|
||||
EvtScript N(EVS_SetupGoombaRoadGate) = {
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(RotateGroup, MODEL_g197, 120, 0, -1, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g196, 120, 0, 1, 0)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o757, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_BindExitTriggers) = {
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kmr_05_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kmr_00_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili2, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kmr_09_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili3, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_EnterMap) = {
|
||||
EVT_CALL(GetLoadType, LVar1)
|
||||
EVT_IF_EQ(LVar1, LOAD_FROM_FILE_SELECT)
|
||||
EVT_EXEC(EnterSavePoint)
|
||||
EVT_EXEC(N(EVS_BindExitTriggers))
|
||||
EVT_EXEC(N(EVS_SetupGoombaRoadGate))
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_NE(LVar0, kmr_02_ENTRY_0)
|
||||
EVT_EXEC(N(EVS_SetupGoombaRoadGate))
|
||||
EVT_END_IF
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(kmr_02_ENTRY_2)
|
||||
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC(EnterWalk)
|
||||
EVT_IF_EQ(GF_KMR02_ReturnedWithGoompa, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(DisablePartnerAI, 0)
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_Goompa_Talk, ANIM_Goompa_Idle, 4, MSG_CH0_001C)
|
||||
EVT_CALL(EnablePartnerAI)
|
||||
EVT_SET(GF_KMR02_ReturnedWithGoompa, TRUE)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_END_IF
|
||||
EVT_CASE_EQ(kmr_02_ENTRY_3)
|
||||
EVT_IF_EQ(GF_KMR02_WarpPipe, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetPlayerPos, LVar0, NPC_DISPOSE_POS_Y, LVar2)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(PlaySound, SOUND_208E)
|
||||
EVT_SET(GF_KMR02_WarpPipe, TRUE)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetPlayerActionState, ACTION_STATE_IDLE)
|
||||
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_END_IF
|
||||
EVT_SET(LVarA, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC_WAIT(N(EVS_Pipe_EnterVertical))
|
||||
EVT_CASE_EQ(kmr_02_ENTRY_5)
|
||||
EVT_EXEC(N(EVS_SetWallsDown_ToadHouse))
|
||||
EVT_EXEC(N(EVS_BindExitTriggers))
|
||||
EVT_CASE_EQ(kmr_02_ENTRY_A)
|
||||
// beta entrance for 'post' pipe
|
||||
EVT_EXEC(EnterPostPipe)
|
||||
EVT_EXEC(N(EVS_BindExitTriggers))
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC(EnterWalk)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ShowMessage_ItsLocked) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_00D8, 160, 40)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenGoombaRoadGate) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_tt2, SOUND_1D2, 0)
|
||||
EVT_CALL(MakeLerp, 0, 120, 20, EASING_COS_IN_OUT)
|
||||
EVT_LABEL(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g197, LVar0, 0, -1, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g196, LVar0, 0, 1, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(0)
|
||||
EVT_END_IF
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o757, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
API_CALLABLE(N(SetMapChangeFadeSlowest)) {
|
||||
set_map_change_fade_rate(1); //normally 20
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Main) = {
|
||||
EVT_SET(GB_WorldLocation, LOCATION_GOOMBA_VILLAGE)
|
||||
EVT_CALL(SetSpriteShading, SHADING_NONE)
|
||||
EVT_SETUP_CAMERA_NO_LEAD()
|
||||
EVT_CALL(GetLoadType, LVar0)
|
||||
EVT_IF_EQ(LVar0, LOAD_FROM_FILE_SELECT)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
// check for cutscene entry
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_NE(LVar0, kmr_02_ENTRY_4)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(EpilogueNPCs)))
|
||||
EVT_EXEC(N(EVS_FadeOutMusic))
|
||||
EVT_RETURN
|
||||
EVT_LABEL(10)
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_EQ(STORY_UNUSED_FFFFFF8C)
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(NpcGroup1)))
|
||||
EVT_CASE_LT(STORY_UNUSED_FFFFFF8C)
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(PrologueNPCs)))
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
|
||||
EVT_END_SWITCH
|
||||
EVT_LABEL(20)
|
||||
EVT_CALL(ClearDefeatedEnemies)
|
||||
EVT_EXEC_WAIT(N(EVS_SetupRooms))
|
||||
EVT_EXEC_WAIT(N(EVS_SetupToadHouse))
|
||||
EVT_EXEC_WAIT(N(EVS_MakeEntities))
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_EXEC_WAIT(N(EVS_SetupFoliage))
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH0_FELL_OFF_CLIFF)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShowMessage_ItsLocked)), TRIGGER_WALL_PRESS_A, COLLIDER_mm1, 1, 0)
|
||||
EVT_CASE_LT(STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_OpenGoombaRoadGate)), TRIGGER_WALL_PRESS_A, COLLIDER_tt2, 1, 0)
|
||||
EVT_END_SWITCH
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH0_GATE_CRUSHED)
|
||||
EVT_CALL(EnableGroup, MODEL_2, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_4, FALSE)
|
||||
EVT_CASE_LT(STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(EnableGroup, MODEL_1, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_4, FALSE)
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(EnableGroup, MODEL_1, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_2, FALSE)
|
||||
EVT_END_SWITCH
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o757, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt1, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_EXEC(N(EVS_EnterMap))
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_NE(GB_StoryProgress, STORY_CH0_WAKE_UP)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_EQ(LVar0, kmr_02_ENTRY_5)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(N(SetMapChangeFadeSlowest))
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
2353
src/world/area_kmr/kmr_02/kmr_02_3_npc.c
Normal file
2353
src/world/area_kmr/kmr_02/kmr_02_3_npc.c
Normal file
File diff suppressed because it is too large
Load Diff
312
src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c
Normal file
312
src/world/area_kmr/kmr_02/kmr_02_4_rooms_1.c
Normal file
@ -0,0 +1,312 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#define NAME_SUFFIX _Rooms1
|
||||
#include "world/common/npc/GoombaFamily_Wander.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
EvtScript N(EVS_OpenDoor_House) = {
|
||||
EVT_CALL(RotateModel, MODEL_syoumen_enter, LVar0, 0, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_DropDoor_House) = {
|
||||
EVT_CALL(RotateModel, MODEL_syoumen_enter, LVar0, EVT_FLOAT(54.56), 0, EVT_FLOAT(31.5))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MoveWalls_House) = {
|
||||
EVT_CALL(RotateModel, MODEL_door_ki, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o122, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o123, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o121, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o137, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o140, LVar0, -1, 0, 0)
|
||||
EVT_IF_EQ(LVar0, 90)
|
||||
EVT_CALL(EnableModel, MODEL_door_ki, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_o122, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_o123, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_o121, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_o137, FALSE)
|
||||
EVT_ELSE
|
||||
EVT_CALL(EnableModel, MODEL_door_ki, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o122, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o123, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o121, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o137, TRUE)
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcAI_Goombario_NoAI) = {
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcAI_Goombario) = {
|
||||
EVT_EXEC_WAIT(N(EVS_NpcAI_GoombaFamily_Wander_Rooms1))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToggleVis_House) = {
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(0)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_of, 1)
|
||||
EVT_CASE_EQ(1)
|
||||
EVT_CASE_EQ(2)
|
||||
EVT_IF_EQ(GB_StoryProgress, STORY_CH0_MET_GOOMPA)
|
||||
EVT_IF_EQ(GF_KMR02_Met_Goompapa, TRUE)
|
||||
EVT_IF_EQ(GF_KMR02_Goombario_RelayedMessage, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(BindNpcAI, NPC_Goombario, EVT_PTR(N(EVS_NpcAI_Goombario_NoAI)))
|
||||
EVT_CALL(SetNpcPos, NPC_Goombario, -54, 0, -55)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_CASE_EQ(3)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_of, 0)
|
||||
EVT_IF_EQ(GB_StoryProgress, STORY_CH0_MET_GOOMPA)
|
||||
EVT_IF_EQ(GF_KMR02_Met_Goompapa, TRUE)
|
||||
EVT_IF_EQ(GF_KMR02_Goombario_RelayedMessage, FALSE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombario, ANIM_WorldGoombario_Walk)
|
||||
EVT_CALL(NpcMoveTo, NPC_Goombario, 8, -94, 20)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goombario, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_CH0_0050)
|
||||
EVT_CALL(BindNpcAI, NPC_Goombario, EVT_PTR(N(EVS_NpcAI_Goombario)))
|
||||
EVT_SET(GF_KMR02_Goombario_RelayedMessage, TRUE)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenDoor_Verdana) = {
|
||||
EVT_CALL(RotateModel, MODEL_ura_exit, LVar0, 0, -1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MoveWalls_Verdana) = {
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToggleVis_Verdana) = {
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(0)
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CASE_EQ(1)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 0)
|
||||
EVT_CASE_EQ(2)
|
||||
EVT_IF_GT(GB_StoryProgress, STORY_CH0_GATE_CRUSHED)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_Inspect_DangerSealed, 160, 40)
|
||||
EVT_SET(LVar0, -1)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 1)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 499, 0, -378)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 499, 70, -378)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 370)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH0_GATE_CRUSHED)
|
||||
EVT_CASE_LT(STORY_CH0_FELL_OFF_CLIFF)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 0)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CASE_LT(STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 0)
|
||||
EVT_CASE_GE(STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(EnableModel, MODEL_o437, FALSE)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o625, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_END_SWITCH
|
||||
EVT_CASE_EQ(3)
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH0_GATE_CRUSHED)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_WAIT(12)
|
||||
EVT_IF_EQ(GB_StoryProgress, STORY_CH0_GATE_CRUSHED)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_Thinking)
|
||||
EVT_LOOP(3)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 1)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 0)
|
||||
EVT_WAIT(10)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(FadeOutMusic, 0, 0)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80016)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(InterpPlayerYaw, 233, 1)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(InterpPlayerYaw, 53, 1)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(InterpPlayerYaw, 233, 1)
|
||||
EVT_WAIT(3)
|
||||
EVT_CALL(InterpPlayerYaw, 53, 1)
|
||||
EVT_WAIT(3)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80017)
|
||||
EVT_WAIT(30)
|
||||
EVT_SET(GB_StoryProgress, STORY_CH0_FELL_OFF_CLIFF)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80018)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
|
||||
EVT_CALL(GetCamPosition, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_SUB(LVar1, 150)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(PlaySoundAtPlayer, SOUND_161, 0)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(DisablePartnerAI, 0)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80019)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_SUB(LVar1, 16)
|
||||
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_IF_GT(GB_StoryProgress, STORY_CH0_GATE_CRUSHED)
|
||||
EVT_CALL(GetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
|
||||
EVT_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_SUB(LVar1, 16)
|
||||
EVT_CALL(SetNpcPos, NPC_PARTNER, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_END_IF
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(GotoMap, EVT_PTR("kmr_03"), kmr_03_ENTRY_2)
|
||||
EVT_WAIT(100)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
MAP_RODATA_PAD(1,unk);
|
||||
|
||||
s32 N(InsideNPCs_House)[] = {
|
||||
NPC_Gooma,
|
||||
NPC_Goompa,
|
||||
-1
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupRooms) = {
|
||||
// goomba family home, main room
|
||||
EVT_CALL(MakeDoorAdvanced,
|
||||
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_5),
|
||||
EVT_PTR(N(EVS_OpenDoor_House)),
|
||||
EVT_PTR(N(EVS_MoveWalls_House)),
|
||||
EVT_PTR(N(EVS_DropDoor_House)),
|
||||
EVT_PTR(N(EVS_ToggleVis_House)),
|
||||
COLLIDER_deilit5,
|
||||
COLLIDER_deilit6,
|
||||
MODEL_kuribou_house,
|
||||
EVT_PTR(N(InsideNPCs_House)))
|
||||
// verdana
|
||||
EVT_CALL(MakeDoorAdvanced,
|
||||
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_7),
|
||||
EVT_PTR(N(EVS_OpenDoor_Verdana)),
|
||||
EVT_PTR(N(EVS_MoveWalls_Verdana)),
|
||||
NULL,
|
||||
EVT_PTR(N(EVS_ToggleVis_Verdana)),
|
||||
COLLIDER_deilit4,
|
||||
COLLIDER_deilit4_1,
|
||||
MODEL_kuribou_house,
|
||||
EVT_PTR(N(InsideNPCs_House)))
|
||||
EVT_SET(LVar0, 3)
|
||||
EVT_EXEC(N(EVS_ToggleVis_House))
|
||||
EVT_CALL(SetGroupEnabled, MODEL_monohoshi, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
extern EvtScript N(EVS_ToadHouse_SetDialogue);
|
||||
extern EvtScript N(EVS_ToadHouse_GetInBed);
|
||||
extern EvtScript N(EVS_ToadHouse_ReturnFromRest);
|
||||
|
||||
#include "world/common/complete/ToadHouseBlanketAnim.inc.c"
|
||||
#include "world/common/atomic/ToadHouse.inc.c"
|
||||
#include "world/common/atomic/ToadHouse.data.inc.c"
|
||||
|
||||
EvtScript N(EVS_ToadHouse_SetDialogue) = {
|
||||
EVT_IF_EQ(GF_KMR02_ToadHouse_Intro, FALSE)
|
||||
EVT_SET(LVar0, MSG_CH0_0013)
|
||||
EVT_SET(LVar8, MSG_CH0_0013)
|
||||
EVT_SET(GF_KMR02_ToadHouse_Intro, TRUE)
|
||||
EVT_ELSE
|
||||
EVT_SET(LVar0, MSG_CH0_0014)
|
||||
EVT_SET(LVar8, MSG_CH0_0015)
|
||||
EVT_END_IF
|
||||
EVT_SET(LVar1, MSG_CH0_0016)
|
||||
EVT_SET(LVar2, MSG_CH0_0017)
|
||||
EVT_SET(LVar3, MSG_CH0_0018)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToadHouse_GetInBed) = {
|
||||
EVT_EXEC(N(EVS_PlayRestingSong))
|
||||
EVT_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(N(ToadHouse_CamSetFOV), 0, 40)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 34, -8)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 220)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-46.0), EVT_FLOAT(-311.0))
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(-262.4), EVT_FLOAT(-324.6))
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 1, 10)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0))
|
||||
EVT_CALL(PlayerMoveTo, -212, -376, 0)
|
||||
EVT_CALL(InterpPlayerYaw, 191, 1)
|
||||
EVT_CALL(SetPlayerPos, -212, 21, -376)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(InterpPlayerYaw, 114, 1)
|
||||
EVT_CALL(HidePlayerShadow, TRUE)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(func_802D286C, 0x00000800)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_10002, 5, 7, 1, 1, 0)
|
||||
EVT_WAIT(61)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8001D)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(70)
|
||||
EVT_CALL(N(ToadHouse_CamSetFOV), 0, 25)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToadHouse_ReturnFromRest) = {
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_CALL(HidePlayerShadow, FALSE)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_10002, 0, 0, 0, 0, 0)
|
||||
EVT_CALL(SetPlayerPos, -183, 19, -341)
|
||||
EVT_CALL(PlayerMoveTo, -132, -325, 20)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInteract_ToadHouse) = {
|
||||
EVT_EXEC_WAIT(N(EVS_NpcInteract_ToadHouseKeeper))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
147
src/world/area_kmr/kmr_02/kmr_02_5_entity.c
Normal file
147
src/world/area_kmr/kmr_02/kmr_02_5_entity.c
Normal file
@ -0,0 +1,147 @@
|
||||
#include "kmr_02.h"
|
||||
#include "entity.h"
|
||||
#include "effects.h"
|
||||
|
||||
API_CALLABLE(N(PlayerHasBadgeEquipped)) {
|
||||
PlayerData* playerData = &gPlayerData;
|
||||
s32 hasBadgeEquipped = FALSE;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
|
||||
if (playerData->equippedBadges[i] != 0) {
|
||||
hasBadgeEquipped = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
script->varTable[0] = hasBadgeEquipped;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/SetEntityPositionF.inc.c"
|
||||
#include "world/common/todo/GetEntityPosition.inc.c"
|
||||
|
||||
EvtScript N(EVS_GotoMap_tik_01_2) = {
|
||||
EVT_CALL(GotoMap, EVT_PTR("tik_01"), tik_01_ENTRY_2)
|
||||
EVT_WAIT(100)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
API_CALLABLE(N(AnimateBlockScale)) {
|
||||
Entity* entity = get_entity_by_index(script->varTable[10]);
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
script->functionTemp[1] = 60;
|
||||
}
|
||||
|
||||
entity->scale.x = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->scale.y = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->scale.z = (60 - script->functionTemp[1]) / 60.0f;
|
||||
entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.5f;
|
||||
script->functionTemp[1]--;
|
||||
|
||||
if (script->functionTemp[1] == -1) {
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_OnSmash_GateBlock) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goompapa, ANIM_Goompapa_Talk, ANIM_Goompapa_Idle, 0, MSG_CH0_0066)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(N(PlayerHasBadgeEquipped))
|
||||
EVT_IF_EQ(LVar0, FALSE)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goompapa, ANIM_Goompapa_Talk, ANIM_Goompapa_Idle, 0, MSG_CH0_0067)
|
||||
EVT_WAIT(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_SET(GB_StoryProgress, STORY_CH0_SMASHED_GATE_BLOCK)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SummonGateBlock) = {
|
||||
EVT_CALL(PlaySoundAt, SOUND_207A, 0, 373, 88, 255)
|
||||
EVT_CALL(GetNpcPos, NPC_Kammy, LVar0, LVar1, LVar2)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 0, 373, 88, 255, 1, 100)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(PlaySoundAt, SOUND_207B, 0, 326, 150, 261)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 1, 326, 150, 261, 1, 60)
|
||||
EVT_WAIT(20)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 1, 326, 150, 261, 1, 60)
|
||||
EVT_WAIT(10)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 1, 326, 150, 261, 1, 60)
|
||||
EVT_WAIT(5)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 1, 326, 150, 261, 1, 60)
|
||||
EVT_WAIT(3)
|
||||
EVT_PLAY_EFFECT(EFFECT_GATHER_ENERGY_PINK, 1, 326, 150, 261, 1, 60)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_Hammer1Block), 326, 120, 261, 148, MAKE_ENTITY_END)
|
||||
EVT_SET(LVarA, LVar0)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_OnSmash_GateBlock)))
|
||||
EVT_CALL(N(AnimateBlockScale))
|
||||
EVT_SET(LVar9, LVarA)
|
||||
EVT_CALL(N(GetEntityPosition), LVar9, LVar2, LVar3, LVar4)
|
||||
EVT_CALL(MakeLerp, LVar3, 300, 20, EASING_QUADRATIC_IN)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(N(SetEntityPositionF), LVar9, LVar2, LVar0, LVar4)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(PlaySoundAt, SOUND_207C, 0, LVar2, LVar0, LVar4)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0F)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(15)
|
||||
EVT_PLAY_EFFECT(EFFECT_LANDING_DUST, 4, LVar2, 0, LVar4, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(PlaySoundAt, SOUND_207D, 0, LVar2, LVar0, LVar4)
|
||||
EVT_CALL(MakeLerp, 300, 0, 20, EASING_CUBIC_IN)
|
||||
EVT_LABEL(20)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(N(SetEntityPositionF), LVar9, LVar2, LVar0, LVar4)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(20)
|
||||
EVT_END_IF
|
||||
EVT_CALL(EnableGroup, MODEL_2, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_1, FALSE)
|
||||
EVT_CALL(PlaySoundAt, SOUND_DD, 0, LVar2, LVar0, LVar4)
|
||||
EVT_THREAD
|
||||
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 15, EVT_FLOAT(1.0))
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MakeEntities) = {
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH0_GATE_CRUSHED)
|
||||
EVT_CASE_LT(STORY_CH0_SMASHED_GATE_BLOCK)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_Hammer1Block_WideX), 326, 0, 261, 270, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_OnSmash_GateBlock)))
|
||||
EVT_CASE_LT(STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_tt2, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_END_SWITCH
|
||||
EVT_IF_EQ(GF_KMR02_WarpPipe, FALSE)
|
||||
EVT_IF_EQ(GF_TIK01_WarpPipes, TRUE)
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_NE(LVar0, kmr_02_ENTRY_3)
|
||||
EVT_SET(GF_KMR02_WarpPipe, TRUE)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_BlueWarpPipe), 0, 0, 355, 0, kmr_02_ENTRY_3, EVT_PTR(N(EVS_GotoMap_tik_01_2)), EVT_INDEX_OF_GAME_FLAG(GF_KMR02_WarpPipe), MAKE_ENTITY_END)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_SavePoint), 250, 60, 75, -15, MAKE_ENTITY_END)
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_CALL(MakeItemEntity, ITEM_SHOOTING_STAR, 510, 0, -340, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KMR02_Item_ShootingStar)
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
103
src/world/area_kmr/kmr_02/kmr_02_6_rooms_2.c
Normal file
103
src/world/area_kmr/kmr_02/kmr_02_6_rooms_2.c
Normal file
@ -0,0 +1,103 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
EvtScript N(EVS_OpenDoor_ToadHouse) = {
|
||||
EVT_CALL(RotateModel, MODEL_o275, LVar0, 0, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MoveWalls_ToadHouse) = {
|
||||
EVT_SET(LVar1, LVar0)
|
||||
EVT_ADD(LVar1, LVar0)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_1, LVar1, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_2, LVar1, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_3, LVar1, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o272, LVar1, 0, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToggleVis_ToadHouse) = {
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(0)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_kino_in, 1)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o767, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CASE_EQ(1)
|
||||
EVT_CASE_EQ(2)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(5)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CASE_EQ(3)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_kino_in, 0)
|
||||
EVT_CALL(EnableModel, MODEL_o422, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o424, TRUE)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetWallsDown_ToadHouse) = {
|
||||
EVT_CALL(SetGroupEnabled, MODEL_kino_in, 1)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_1, 180, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_2, 180, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_k_k_3, 180, 0, 1, 0)
|
||||
EVT_CALL(RotateModel, MODEL_o272, 180, 0, 1, 0)
|
||||
EVT_CALL(EnableModel, MODEL_o561, FALSE)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o767, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToadSignSwinging) = {
|
||||
EVT_LABEL(9)
|
||||
EVT_CALL(MakeLerp, 10, -10, 30, EASING_COS_IN_OUT)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateModel, MODEL_kanban, LVar0, EVT_FLOAT(35.498), 0, EVT_FLOAT(-9.511))
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(MakeLerp, -10, 10, 30, EASING_COS_IN_OUT)
|
||||
EVT_LABEL(11)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateModel, MODEL_kanban, LVar0, EVT_FLOAT(35.498), 0, EVT_FLOAT(-9.511))
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(11)
|
||||
EVT_END_IF
|
||||
EVT_GOTO(9)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
s32 N(InsideNPCs_ToadHouse)[] = {
|
||||
NPC_Toad,
|
||||
-1
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupToadHouse) = {
|
||||
EVT_CALL(RotateModel, MODEL_o320, 180, 0, 1, 0)
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_NE(LVar0, kmr_02_ENTRY_5)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_kino_in, 0)
|
||||
EVT_END_IF
|
||||
// toad house
|
||||
EVT_CALL(MakeDoorAdvanced,
|
||||
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_0),
|
||||
EVT_PTR(N(EVS_OpenDoor_ToadHouse)),
|
||||
EVT_PTR(N(EVS_MoveWalls_ToadHouse)),
|
||||
NULL,
|
||||
EVT_PTR(N(EVS_ToggleVis_ToadHouse)),
|
||||
COLLIDER_deilit7,
|
||||
COLLIDER_deilit8,
|
||||
MODEL_kinopi,
|
||||
EVT_PTR(N(InsideNPCs_ToadHouse)))
|
||||
EVT_EXEC(N(EVS_ToadSignSwinging))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
351
src/world/area_kmr/kmr_02/kmr_02_7_kammy.c
Normal file
351
src/world/area_kmr/kmr_02/kmr_02_7_kammy.c
Normal file
@ -0,0 +1,351 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "world/common/todo/CheckPartnerFlags1000.inc.c"
|
||||
|
||||
#define NAME_SUFFIX _6
|
||||
#include "world/common/npc/GoombaFamily_Wander.inc.c"
|
||||
#include "wander_territories.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
#include "world/common/todo/UnkFunc42.inc.c"
|
||||
|
||||
Vec3f N(FlightPath_KammyAppear)[] = {
|
||||
{ 473.0, 150.0, 301.0 },
|
||||
{ 234.0, 80.0, 200.0 },
|
||||
{ 46.0, 150.0, 180.0 },
|
||||
};
|
||||
|
||||
Vec3f N(FlightPath_ToGate1)[] = {
|
||||
{ 46.0, 150.0, 180.0 },
|
||||
{ -93.0, 262.0, 114.0 },
|
||||
{ 118.0, 121.0, 141.0 },
|
||||
{ 340.0, 141.0, 406.0 },
|
||||
{ 550.0, 108.0, 320.0 },
|
||||
};
|
||||
|
||||
Vec3f N(FlightPath_ToGate2)[] = {
|
||||
{ 465.0, 108.0, 320.0 },
|
||||
{ 433.0, 78.0, 306.0 },
|
||||
{ 399.0, 56.0, 288.0 },
|
||||
};
|
||||
|
||||
Vec3f N(FlightPath_ToGate3)[] = {
|
||||
{ 399.0, 56.0, 288.0 },
|
||||
{ 390.0, 53.0, 284.0 },
|
||||
{ 380.0, 50.0, 282.0 },
|
||||
};
|
||||
|
||||
Vec3f N(FlightPath_KammyDepart)[] = {
|
||||
{ 380.0, 50.0, 282.0 },
|
||||
{ 290.0, 100.0, 240.0 },
|
||||
{ 204.0, 142.0, 202.0 },
|
||||
{ -391.0, 520.0, -212.0 },
|
||||
};
|
||||
|
||||
EvtScript N(EVS_PlayKammyFlightSounds) = {
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Kammy, SOUND_295, 0)
|
||||
EVT_WAIT(4)
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MakeNpcsFaceKammy) = {
|
||||
EVT_CALL(GetNpcPos, NPC_Kammy, LVar0, LVar1, LVar2)
|
||||
EVT_LABEL(0)
|
||||
EVT_CALL(GetNpcPos, NPC_Kammy, LVar3, LVar4, LVar5)
|
||||
EVT_CALL(N(UnkFunc42))
|
||||
EVT_CALL(InterpNpcYaw, NPC_Kammy, LVarA, 0)
|
||||
EVT_SET(LVar0, LVar3)
|
||||
EVT_SET(LVar1, LVar4)
|
||||
EVT_SET(LVar2, LVar5)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goombaria, NPC_Kammy, LVarA)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goombaria, LVarA, 0)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goompapa, NPC_Kammy, LVarB)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goompapa, LVarB, 0)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goombario, NPC_Kammy, LVarB)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goombario, LVarB, 0)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goomama, NPC_Kammy, LVarB)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goomama, LVarB, 0)
|
||||
EVT_CALL(PlayerFaceNpc, NPC_Kammy, FALSE)
|
||||
EVT_WAIT(1)
|
||||
EVT_GOTO(0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_KammyStrikes) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goombaria, NPC_FLAG_100, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goompapa, NPC_FLAG_100, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(EnableNpcAI, NPC_Goombario, FALSE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombario, ANIM_WorldGoombario_Idle)
|
||||
EVT_CALL(EnableNpcAI, NPC_Goomama, FALSE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goomama, ANIM_Goomama_Idle)
|
||||
EVT_CALL(EnableNpcAI, NPC_Kammy, TRUE)
|
||||
EVT_CALL(SetNpcAux, NPC_Kammy, EVT_PTR(N(EVS_NpcAux_Kammy)))
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_CH0_0059, 160, 40)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim15)
|
||||
EVT_THREAD
|
||||
EVT_EXEC_GET_TID(N(EVS_PlayKammyFlightSounds), MV_Unk_04)
|
||||
EVT_EXEC_GET_TID(N(EVS_MakeNpcsFaceKammy), MV_Unk_05)
|
||||
EVT_CALL(LoadPath, 40, EVT_PTR(N(FlightPath_KammyAppear)), ARRAY_COUNT(N(FlightPath_KammyAppear)), EASING_LINEAR)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(GetNextPathPos)
|
||||
EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8000A)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 3, 0)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, 166, 756)
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, 159, 0)
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, EVT_FLOAT(109.7))
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 1220)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)
|
||||
EVT_CALL(LoadPath, 120, EVT_PTR(N(FlightPath_ToGate1)), ARRAY_COUNT(N(FlightPath_ToGate1)), EASING_LINEAR)
|
||||
EVT_LABEL(20)
|
||||
EVT_CALL(GetNextPathPos)
|
||||
EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(20)
|
||||
EVT_END_IF
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 8, -10)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, 41, 729)
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, 300, 245)
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 440)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(PlayerFaceNpc, NPC_Kammy, FALSE)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goompapa, NPC_Kammy, LVar0)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goompapa, LVar0, 0)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goombaria, NPC_Kammy, LVar0)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goombaria, LVar0, 0)
|
||||
EVT_CALL(SetPlayerPos, 220, 0, 213)
|
||||
EVT_CALL(SetNpcPos, NPC_Goompapa, 255, 0, 232)
|
||||
EVT_CALL(SetNpcPos, NPC_Goombaria, 190, 0, 212)
|
||||
EVT_CALL(LoadPath, 10, EVT_PTR(N(FlightPath_ToGate2)), ARRAY_COUNT(N(FlightPath_ToGate2)), EASING_LINEAR)
|
||||
EVT_LABEL(30)
|
||||
EVT_CALL(GetNextPathPos)
|
||||
EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(30)
|
||||
EVT_END_IF
|
||||
EVT_KILL_THREAD(MV_Unk_04)
|
||||
EVT_KILL_THREAD(MV_Unk_05)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Kammy, SOUND_32B, 0)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim10)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -5)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -10)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, -15)
|
||||
EVT_WAIT(3)
|
||||
EVT_CALL(SetNpcRotation, NPC_Kammy, 0, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(LoadPath, 10, EVT_PTR(N(FlightPath_ToGate3)), ARRAY_COUNT(N(FlightPath_ToGate3)), EASING_LINEAR)
|
||||
EVT_LABEL(40)
|
||||
EVT_CALL(GetNextPathPos)
|
||||
EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(40)
|
||||
EVT_END_IF
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 512, MSG_CH0_005A)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 7, -10)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, 41, 729)
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, 220, 213)
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 275)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goombaria, ANIM_Goombaria_LookUpTalk, ANIM_Goombaria_LookUp, 5, MSG_CH0_005B)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(6.0), EVT_FLOAT(-6.0))
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-1731.4), EVT_FLOAT(974.9))
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(399.0), EVT_FLOAT(277.1))
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, EVT_FLOAT(60.0))
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(275.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 512, MSG_CH0_005C)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_LookUp)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_LookUp)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(600.0))
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(398.9), EVT_FLOAT(242.7))
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, EVT_FLOAT(10.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim0E)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(GetNpcPos, NPC_Kammy, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(10)
|
||||
EVT_EXEC_WAIT(N(EVS_SummonGateBlock))
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80012)
|
||||
EVT_CALL(func_802D286C, 256)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_80012, 5, 0, 1, 1, 0)
|
||||
EVT_WAIT(13)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_80012, 0, 0, 0, 0, 0)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80013)
|
||||
EVT_CALL(func_802D286C, 256)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_80013, 5, 0, 1, 1, 0)
|
||||
EVT_WAIT(13)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_80013, 0, 0, 0, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.8))
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(PlayerJump1, LVar0, LVar1, LVar2, 25)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Shock)
|
||||
EVT_CALL(func_802CFE2C, NPC_Goombaria, 0x100)
|
||||
EVT_CALL(func_802CFD30, NPC_Goombaria, FOLD_TYPE_5, 0, 1, 1, 0)
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Goombaria, EVT_FLOAT(1.5))
|
||||
EVT_CALL(GetNpcPos, NPC_Goombaria, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(NpcJump0, NPC_Goombaria, LVar0, LVar1, LVar2, 25)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_LookUp)
|
||||
EVT_CALL(func_802CFD30, 1, 0, 0, 0, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802CFE2C, NPC_Goompapa, 0x100)
|
||||
EVT_CALL(func_802CFD30, NPC_Goompapa, FOLD_TYPE_5, 0, 1, 1, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_Shock)
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Goompapa, EVT_FLOAT(1.2))
|
||||
EVT_CALL(GetNpcPos, NPC_Goompapa, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(NpcJump0, NPC_Goompapa, LVar0, LVar1, LVar2, 25)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_LookUp)
|
||||
EVT_CALL(func_802CFD30, 3, 0, 0, 0, 0, 0)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim13)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(6.0), EVT_FLOAT(-6.0))
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-1731.4), EVT_FLOAT(974.9))
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(399.0), EVT_FLOAT(277.1))
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, EVT_FLOAT(60.0))
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(275.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 512, MSG_CH0_005D)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 3, 0)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, 166, 756)
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, 159, 0)
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, EVT_FLOAT(109.7))
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 1220)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_THREAD
|
||||
EVT_LOOP(150)
|
||||
EVT_CALL(PlayerFaceNpc, NPC_Kammy, FALSE)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goombaria, NPC_Kammy, LVar0)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goombaria, LVar0, 0)
|
||||
EVT_CALL(GetAngleBetweenNPCs, NPC_Goompapa, NPC_Kammy, LVar0)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goompapa, LVar0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Kammy, ANIM_WorldKammy_Anim15)
|
||||
EVT_EXEC_GET_TID(N(EVS_MakeNpcsFaceKammy), MV_Unk_05)
|
||||
EVT_WAIT(40)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Kammy, ANIM_WorldKammy_Anim16, ANIM_WorldKammy_Anim13, 0x200, MSG_CH0_005E)
|
||||
EVT_CALL(FadeOutMusic, 0, 3000)
|
||||
EVT_EXEC_GET_TID(N(EVS_PlayKammyFlightSounds), MV_Unk_04)
|
||||
EVT_CALL(LoadPath, 90, EVT_PTR(N(FlightPath_KammyDepart)), ARRAY_COUNT(N(FlightPath_KammyDepart)), EASING_QUADRATIC_IN)
|
||||
EVT_LABEL(70)
|
||||
EVT_CALL(GetNextPathPos)
|
||||
EVT_CALL(SetNpcPos, NPC_Kammy, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(70)
|
||||
EVT_END_IF
|
||||
EVT_KILL_THREAD(MV_Unk_04)
|
||||
EVT_KILL_THREAD(MV_Unk_05)
|
||||
EVT_WAIT(20)
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_Angry)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goombaria, ANIM_Goombaria_Idle)
|
||||
EVT_CALL(SetNpcPos, NPC_Goombaria, 166, 0, 188)
|
||||
EVT_CALL(SetPlayerPos, 231, 0, 196)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(GetAngleToPlayer, NPC_Goombaria, LVar0)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Goombaria, LVar0, 0)
|
||||
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(90.0), 0, EVT_FLOAT(-300.0), EVT_FLOAT(12.0), EVT_FLOAT(-8.5))
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goompapa, ANIM_Goompapa_AngryTalk, ANIM_Goompapa_Angry, 0, MSG_CH0_005F)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80007)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_Idle)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goompapa, ANIM_Goompapa_Talk, ANIM_Goompapa_Idle, 0, MSG_CH0_0060)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goombaria, ANIM_Goombaria_Talk, ANIM_Goombaria_Idle, 0, MSG_CH0_0061)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Goompapa, ANIM_Goompapa_Talk, ANIM_Goompapa_Idle, 0, MSG_CH0_0062)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcSpeed, NPC_Goombario, EVT_FLOAT(2.0))
|
||||
EVT_CALL(EnableNpcAI, NPC_Goombario, TRUE)
|
||||
EVT_CALL(EnableNpcAI, NPC_Goomama, TRUE)
|
||||
EVT_CALL(GetNpcPos, NPC_Goombaria, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetNpcPos, NPC_Goombaria, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(EnableNpcShadow, NPC_Goombaria, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goombaria, NPC_FLAG_GRAVITY, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goombaria, NPC_FLAG_40, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goompa, NPC_FLAG_GRAVITY, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goompa, NPC_FLAG_ENABLE_HIT_SCRIPT, TRUE)
|
||||
EVT_CALL(SetNpcPos, NPC_Goompa, NPC_DISPOSE_LOCATION)
|
||||
EVT_CALL(EnableNpcShadow, NPC_Goompa, FALSE)
|
||||
EVT_SET(GB_StoryProgress, STORY_CH0_GATE_CRUSHED)
|
||||
EVT_THREAD
|
||||
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(3.0))
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Goompapa, ANIM_Goompapa_Idle)
|
||||
EVT_CALL(N(SetWanderTerritory_6), NPC_Goomama, 1)
|
||||
EVT_CALL(BindNpcAI, NPC_Goomama, EVT_PTR(N(EVS_NpcIdle_SwitchedWander_6)))
|
||||
EVT_CALL(N(SetWanderTerritory_6), NPC_Goombario, 2)
|
||||
EVT_CALL(BindNpcAI, NPC_Goombario, EVT_PTR(N(EVS_NpcIdle_SwitchedWander_6)))
|
||||
EVT_CALL(N(SetWanderTerritory_6), NPC_Goombaria, 3)
|
||||
EVT_CALL(BindNpcAI, NPC_Goombaria, EVT_PTR(N(EVS_NpcIdle_SwitchedWander_6)))
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goombaria, NPC_FLAG_100, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Goompapa, NPC_FLAG_100, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
110
src/world/area_kmr/kmr_02/kmr_02_8_foliage.c
Normal file
110
src/world/area_kmr/kmr_02/kmr_02_8_foliage.c
Normal file
@ -0,0 +1,110 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "common/foliage.inc.c"
|
||||
|
||||
FoliageModelList N(Bush1_BushModels) = FOLIAGE_MODEL_LIST(MODEL_kusa1);
|
||||
|
||||
FoliageVectorList N(Bush1_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ -418.0f, 16.0f, 237.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush1) = {
|
||||
.bush = &N(Bush1_BushModels),
|
||||
.vectors = &N(Bush1_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush2_BushModels) = FOLIAGE_MODEL_LIST(MODEL_kusa2);
|
||||
|
||||
FoliageDropList N(Bush2_Drops) = {
|
||||
.count = 1,
|
||||
.drops = {
|
||||
{
|
||||
.itemID = ITEM_COIN,
|
||||
.pos = { 124, 16, 443 },
|
||||
.spawnMode = ITEM_SPAWN_MODE_TOSS,
|
||||
.pickupFlag = GF_KMR02_Bush2_Coin,
|
||||
.spawnFlag = MF_SpawnFlag_BushCoin,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
FoliageVectorList N(Bush2_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ 124.0f, 16.0f, 443.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush2) = {
|
||||
.bush = &N(Bush2_BushModels),
|
||||
.drops = &N(Bush2_Drops),
|
||||
.vectors = &N(Bush2_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush3_BushModels) = FOLIAGE_MODEL_LIST(MODEL_kusa3);
|
||||
|
||||
FoliageVectorList N(Bush3_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ -34.0f, 21.0f, -188.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush3) = {
|
||||
.bush = &N(Bush3_BushModels),
|
||||
.vectors = &N(Bush3_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Tree1_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_midori);
|
||||
FoliageModelList N(Tree1_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_kiki);
|
||||
|
||||
FoliageDropList N(Tree1_Drops) = {
|
||||
.count = 1,
|
||||
.drops = {
|
||||
{
|
||||
.itemID = ITEM_GOOMNUT,
|
||||
.pos = { 309, 145, 66 },
|
||||
.spawnMode = ITEM_SPAWN_MODE_FALL,
|
||||
.pickupFlag = GF_KMR02_Tree1_Goomnut,
|
||||
.spawnFlag = MF_SpawnFlag_Goomnut,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
FoliageVectorList N(Tree1_Effects) = {
|
||||
.count = 2,
|
||||
.vectors = {
|
||||
{ 355.0f, 160.0f, 65.0f },
|
||||
{ 440.0f, 160.0f, 137.0f },
|
||||
}
|
||||
};
|
||||
|
||||
ShakeTreeConfig N(ShakeTree_Tree1) = {
|
||||
.leaves = &N(Tree1_LeafModels),
|
||||
.trunk = &N(Tree1_TrunkModels),
|
||||
.drops = &N(Tree1_Drops),
|
||||
.vectors = &N(Tree1_Effects),
|
||||
};
|
||||
|
||||
BombTrigger N(BombPos_Tree1) = {
|
||||
.pos = { 387.0f, 0.0f, 92.0f },
|
||||
.radius = 0.0f
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o356, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o357, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o414, 1, 0)
|
||||
EVT_SET(GF_KMR02_Tree1_Goomnut, FALSE)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o570, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
7
src/world/area_kmr/kmr_02/kmr_02_9_images.c
Normal file
7
src/world/area_kmr/kmr_02/kmr_02_9_images.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "kmr_02.h"
|
||||
|
||||
#include "world/area_kmr/kmr_02/heart_block.png.inc.c"
|
||||
#include "world/area_kmr/kmr_02/heart_block.pal.inc.c"
|
||||
|
||||
#define PARTY_IMAGE "party_kurio"
|
||||
#include "world/common/todo/LoadPartyImage.inc.c"
|
80
src/world/area_kmr/kmr_02/wander_territories.inc.c
Normal file
80
src/world/area_kmr/kmr_02/wander_territories.inc.c
Normal file
@ -0,0 +1,80 @@
|
||||
EnemyTerritoryWander N(WanderTerritory0) = {
|
||||
.centerPos = { 0, 0, 0 },
|
||||
.wanderSize = { 150, 0 },
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 0, 0, 0 },
|
||||
.detectSize = { 0, 0 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.isFlying = TRUE,
|
||||
};
|
||||
|
||||
EnemyTerritoryWander N(WanderTerritory1) = {
|
||||
.centerPos = { 0, 0, 0 },
|
||||
.wanderSize = { 150, 0 },
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 0, 0, 0 },
|
||||
.detectSize = { 0, 0 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.isFlying = TRUE,
|
||||
};
|
||||
|
||||
EnemyTerritoryWander N(WanderTerritory2) = {
|
||||
.centerPos = { 0, 0, 0 },
|
||||
.wanderSize = { 150, 0 },
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 0, 0, 0 },
|
||||
.detectSize = { 0, 0 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.isFlying = TRUE,
|
||||
};
|
||||
|
||||
EnemyTerritoryWander N(WanderTerritory3) = {
|
||||
.centerPos = { 0, 0, 0 },
|
||||
.wanderSize = { 150, 0 },
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 0, 0, 0 },
|
||||
.detectSize = { 0, 0 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.isFlying = TRUE,
|
||||
};
|
||||
|
||||
EnemyTerritoryWander* N(WanderTerritories)[] = {
|
||||
&N(WanderTerritory0),
|
||||
&N(WanderTerritory1),
|
||||
&N(WanderTerritory2),
|
||||
&N(WanderTerritory3),
|
||||
};
|
||||
|
||||
API_CALLABLE(N(SetWanderTerritory)) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
s32 npcID = evt_get_variable(script, *args++);
|
||||
s32 territoryIndex = evt_get_variable(script, *args++);
|
||||
s32* wanderData = (s32*) N(WanderTerritories)[territoryIndex];
|
||||
Enemy* enemy = get_enemy(npcID);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < (s32) (sizeof(enemy->territory->wander) / sizeof(i)); i++) {
|
||||
s32* wander = (s32*) &enemy->territory->wander;
|
||||
|
||||
wander[i] = wanderData[i];
|
||||
}
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
MobileAISettings N(AISettings_SwitchedWander) = {
|
||||
.moveSpeed = 2.0f,
|
||||
.moveTime = 15,
|
||||
.waitTime = 30,
|
||||
.playerSearchInterval = -1,
|
||||
.unk_AI_2C = 1,
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_SwitchedWander) = {
|
||||
EVT_CALL(BasicAI_Main, EVT_PTR(N(AISettings_SwitchedWander)))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
@ -163,7 +163,7 @@ EvtScript N(EVS_NpcInit_Goompa) = {
|
||||
EVT_END
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_Goompa) = {
|
||||
StaticNpc N(NpcData_GoombaFamily) = {
|
||||
.id = NPC_Goompa,
|
||||
.settings = &N(NpcSettings_Goompa),
|
||||
.pos = { -50.0f, 0.0f, 80.0f },
|
||||
@ -197,6 +197,6 @@ StaticNpc N(NpcData_Goompa) = {
|
||||
};
|
||||
|
||||
NpcGroupList N(DefaultNPCs) = {
|
||||
NPC_GROUP(N(NpcData_Goompa), BTL_KMR_PART_1_FORMATION_02),
|
||||
NPC_GROUP(N(NpcData_GoombaFamily), BTL_KMR_PART_1_FORMATION_02),
|
||||
{}
|
||||
};
|
||||
|
@ -76,10 +76,10 @@ BombTrigger N(BombPos_Tree1) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_km, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_km, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_ki, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_ki, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -290,7 +290,7 @@ StaticNpc N(NpcData_JrTroopa) = {
|
||||
},
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_Goompa) = {
|
||||
StaticNpc N(NpcData_GoombaFamily) = {
|
||||
.id = NPC_Goompa,
|
||||
.settings = &N(NpcSettings_Goompa),
|
||||
.pos = { -58.0f, 0.0f, 130.0f },
|
||||
@ -302,6 +302,6 @@ StaticNpc N(NpcData_Goompa) = {
|
||||
|
||||
NpcGroupList N(DefaultNPCs) = {
|
||||
NPC_GROUP(N(NpcData_JrTroopa), BTL_KMR_PART_3_FORMATION_02),
|
||||
NPC_GROUP(N(NpcData_Goompa)),
|
||||
NPC_GROUP(N(NpcData_GoombaFamily)),
|
||||
{}
|
||||
};
|
||||
|
@ -526,37 +526,37 @@ BombTrigger N(BombPos_Tree3) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o402, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o402, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o415, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o415, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o409, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o409, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush4)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o412, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o412, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush5)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o399, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o399, 1, 0)
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH0_FOUND_HAMMER)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush6)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush6)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410_1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410_1, 1, 0)
|
||||
EVT_ELSE
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush7)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush8)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410_1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o410_1, 1, 0)
|
||||
EVT_END_IF
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush9)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o413, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o413, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o407, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o407, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o271, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o271, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o341, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree3)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o341, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree3)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -81,8 +81,8 @@ BombTrigger N(BombPos_Tree1) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o1238, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o1238, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -61,10 +61,10 @@ BombTrigger N(BombPos_Tree1) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_k1, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_ki_a, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_ki_a, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -138,7 +138,7 @@ EvtScript N(EVS_Main) = {
|
||||
EVT_WAIT(1)
|
||||
EVT_END_IF
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_SwitchBush)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush_Scripted)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa4, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Scripted)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa4, 1, 0)
|
||||
EVT_CALL(SetGroupEnabled, MODEL_event_cam, 0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g172, NPC_DISPOSE_LOCATION)
|
||||
EVT_CALL(TranslateGroup, MODEL_g173, NPC_DISPOSE_LOCATION)
|
||||
|
@ -117,17 +117,17 @@ BombTrigger N(BombPos_Tree2) = {
|
||||
|
||||
EvtScript N(EVS_SetupFoliage) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa1, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa2, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_kusa2, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush4)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(searchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o419, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush)), TRIGGER_WALL_PRESS_A, COLLIDER_o419, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_tree1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_tree1, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_tree2, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_tree2, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
@ -1,13 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
static char* N(exit_str_0) = "mac_00";
|
||||
static char* N(exit_str_1) = "osr_00";
|
||||
static char* N(exit_str_2) = "mac_00\0";
|
||||
static char* N(exit_str_3) = "kmr_02";
|
||||
static char* N(exit_str_4) = "mac_00\0\0";
|
||||
static char* N(exit_str_5) = "";
|
||||
|
||||
ApiStatus func_80240000_8EBE20(Evt* script, s32 isInitialCall) {
|
||||
snd_ambient_slow_fade_out(0, 500);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,292 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
#include "hud_element.h"
|
||||
#include "ld_addrs.h"
|
||||
|
||||
extern HudScript HES_Item_Unused_08B;
|
||||
extern HudScript HES_Item_Unused_08B_disabled;
|
||||
extern HudScript HES_Item_Unused_08C;
|
||||
extern HudScript HES_Item_Unused_08C_disabled;
|
||||
|
||||
extern s32 D_80244D24_8F0B44[12]; // TODO remove hard-coded count when migrated
|
||||
extern s32 D_80244D54_8F0B74[12];
|
||||
extern s32 D_80244D84_8F0BA4[];
|
||||
extern s32 D_80244DB4_8F0BD4[];
|
||||
extern s32 D_80244FA0_8F0DC0[12]; // TODO remove hard-coded count when migrated
|
||||
extern s32 D_80244FD0_8F0DF0[];
|
||||
|
||||
BSS PopupMenu D_80253060;
|
||||
BSS u8 D_80253390[0x3D86];
|
||||
BSS u16 D_80257118[0x100];
|
||||
BSS char D_80257318[0x8]; // padding
|
||||
BSS u8 D_80257320[0x3D86];
|
||||
BSS u16 D_8025B0A8[0x100];
|
||||
BSS s32 D_8025B2A8; // worker ID
|
||||
BSS s32 D_8025B2AC; // opacity
|
||||
BSS MessageImageData D_8025B2B0[2];
|
||||
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
|
||||
ApiStatus func_80240310_8EC130(Evt* script, s32 isInitialCall) {
|
||||
set_map_transition_effect(4);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80240330_8EC150(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80240358_8EC178(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 127);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "common/foliage.inc.c"
|
||||
|
||||
void func_802405BC_8EC3DC(void) {
|
||||
D_8025B2AC += 20;
|
||||
if (D_8025B2AC > 255) {
|
||||
D_8025B2AC = 255;
|
||||
}
|
||||
|
||||
draw_ci_image_with_clipping(D_8025B2B0[0].raster, D_8025B2B0[0].width, D_8025B2B0[0].height, D_8025B2B0[0].format,
|
||||
D_8025B2B0[0].bitDepth, D_8025B2B0[0].palette, 85, 97, 0, 0,
|
||||
SCREEN_WIDTH, SCREEN_HEIGHT, D_8025B2AC);
|
||||
draw_ci_image_with_clipping(D_8025B2B0[1].raster, D_8025B2B0[1].width, D_8025B2B0[1].height, D_8025B2B0[1].format,
|
||||
D_8025B2B0[1].bitDepth, D_8025B2B0[1].palette, 160, 102, 0, 0,
|
||||
SCREEN_WIDTH, SCREEN_HEIGHT, D_8025B2AC);
|
||||
}
|
||||
|
||||
ApiStatus func_802406BC_8EC4DC(Evt* script, s32 isInitialCall) {
|
||||
script->functionTemp[3] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802406C8_8EC4E8(Evt* script, s32 isInitialCall) {
|
||||
PopupMenu* menu = &D_80253060;
|
||||
s32 temp;
|
||||
s32 userIndex;
|
||||
s32 temp_s0;
|
||||
s32 temp_s1;
|
||||
s32 cond;
|
||||
s32 numEntries;
|
||||
s32 gb;
|
||||
s32 i;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
numEntries = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80244D24_8F0B44); i++) {
|
||||
cond = FALSE;
|
||||
temp_s0 = D_80244D24_8F0B44[i];
|
||||
switch (temp_s0) {
|
||||
case -1:
|
||||
if (gPlayerData.quizzesCorrect != 0) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
case -2:
|
||||
if (evt_get_variable(NULL, GameFlag(282)) != 0) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
case -3:
|
||||
temp = FALSE;
|
||||
if (evt_get_variable(NULL, GameByte(0)) >= 6) {
|
||||
temp = (evt_get_variable(NULL, GameFlag(368)) != 0);
|
||||
}
|
||||
if (temp) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (evt_get_variable(NULL, GameByte(0)) >= temp_s0) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (cond) {
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08B;
|
||||
menu->userIndex[numEntries] = i;
|
||||
menu->enabled[numEntries] = TRUE;
|
||||
menu->nameMsg[numEntries] = D_80244D54_8F0B74[i];
|
||||
menu->descMsg[numEntries] = 0;
|
||||
temp = get_global_byte((i / 8) + 14) & (1 << (i % 8));
|
||||
gb = temp;
|
||||
menu->value[numEntries] = 0;
|
||||
if (gb) {
|
||||
menu->value[numEntries] = 1;
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08B_disabled;
|
||||
}
|
||||
numEntries++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numEntries == 0) {
|
||||
script->varTable[0] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
menu->popupType = POPUP_MENU_READ_POSTCARD;
|
||||
menu->numEntries = numEntries;
|
||||
menu->initialPos = script->functionTemp[3];
|
||||
create_popup_menu(menu);
|
||||
status_menu_respond_to_changes();
|
||||
close_status_menu();
|
||||
script->functionTemp[1] = 0;
|
||||
script->functionTemp[0] = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (script->functionTemp[1] == 0) {
|
||||
script->functionTemp[2] = menu->result;
|
||||
if (script->functionTemp[2] != 0) {
|
||||
hide_popup_menu();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
script->functionTemp[1]++;
|
||||
if (script->functionTemp[1] >= 15) {
|
||||
destroy_popup_menu();
|
||||
if (script->functionTemp[2] == 0xFF) {
|
||||
script->varTable[0] = -1;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
script->functionTemp[3] = script->functionTemp[2] - 1;
|
||||
userIndex = menu->userIndex[script->functionTemp[2] - 1];
|
||||
script->varTable[0] = D_80244D84_8F0BA4[userIndex];
|
||||
temp_s1 = (userIndex / 8) + 14;
|
||||
set_global_byte(temp_s1, get_global_byte(temp_s1) | (1 << (userIndex % 8)));
|
||||
if (userIndex == 3) {
|
||||
evt_set_variable(NULL, GameFlag(103), 1);
|
||||
}
|
||||
|
||||
dma_copy(charset_ROM_START + D_80244DB4_8F0BD4[0],
|
||||
charset_ROM_START + D_80244DB4_8F0BD4[0] + sizeof(D_80253390),
|
||||
D_80253390);
|
||||
dma_copy(charset_ROM_START + D_80244DB4_8F0BD4[1],
|
||||
charset_ROM_START + D_80244DB4_8F0BD4[1] + sizeof(D_80257118),
|
||||
D_80257118);
|
||||
D_8025B2B0[0].width = 150;
|
||||
D_8025B2B0[0].palette = D_80257118;
|
||||
D_8025B2B0[0].height = 105;
|
||||
D_8025B2B0[0].raster = D_80253390;
|
||||
D_8025B2B0[0].format = G_IM_FMT_CI;
|
||||
D_8025B2B0[0].bitDepth = 0;
|
||||
|
||||
dma_copy(charset_ROM_START + D_80244DB4_8F0BD4[(userIndex * 2) + 2],
|
||||
charset_ROM_START + D_80244DB4_8F0BD4[(userIndex * 2) + 2] + sizeof(D_80257320),
|
||||
D_80257320);
|
||||
dma_copy(charset_ROM_START + D_80244DB4_8F0BD4[(userIndex * 2) + 3],
|
||||
charset_ROM_START + D_80244DB4_8F0BD4[(userIndex * 2) + 3] + sizeof(D_8025B0A8),
|
||||
D_8025B0A8);
|
||||
D_8025B2B0[1].width = 70;
|
||||
D_8025B2B0[1].raster = D_80257320;
|
||||
D_8025B2B0[1].palette = D_8025B0A8;
|
||||
D_8025B2B0[1].height = 95;
|
||||
D_8025B2B0[1].format = G_IM_FMT_CI;
|
||||
D_8025B2B0[1].bitDepth = 1;
|
||||
|
||||
D_8025B2A8 = create_worker_frontUI(NULL, func_802405BC_8EC3DC);
|
||||
D_8025B2AC = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_80240B20_8EC940(Evt* script, s32 isInitialCall) {
|
||||
free_worker(D_8025B2A8);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80240B48_8EC968(Evt* script, s32 isInitialCall) {
|
||||
script->functionTemp[3] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80240B54_8EC974(Evt* script, s32 isInitialCall) {
|
||||
PopupMenu* menu = &D_80253060;
|
||||
s32 userIndex;
|
||||
s32 numEntries;
|
||||
s32 gb;
|
||||
s32 a1;
|
||||
s32 i;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
numEntries = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(D_80244FA0_8F0DC0); i++) {
|
||||
if (evt_get_variable(NULL, GameByte(0)) >= D_80244FA0_8F0DC0[i]) {
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08C;
|
||||
menu->userIndex[numEntries] = i;
|
||||
menu->enabled[numEntries] = TRUE;
|
||||
menu->nameMsg[numEntries] = 0;
|
||||
menu->descMsg[numEntries] = 0;
|
||||
gb = get_global_byte((i / 8) + 12);
|
||||
menu->value[numEntries] = 0;
|
||||
a1 = gb & (1 << (i % 8));
|
||||
if (a1) {
|
||||
menu->value[numEntries] = 1;
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08C_disabled;
|
||||
}
|
||||
numEntries++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numEntries == 0) {
|
||||
script->varTable[0] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
menu->popupType = POPUP_MENU_READ_DIARY_PAGE;
|
||||
menu->numEntries = numEntries;
|
||||
menu->initialPos = script->functionTemp[3];
|
||||
create_popup_menu(menu);
|
||||
status_menu_respond_to_changes();
|
||||
close_status_menu();
|
||||
script->functionTemp[1] = 0;
|
||||
script->functionTemp[0] = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (script->functionTemp[1] == 0) {
|
||||
script->functionTemp[2] = menu->result;
|
||||
if (script->functionTemp[2] != 0) {
|
||||
hide_popup_menu();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
script->functionTemp[1]++;
|
||||
if (script->functionTemp[1] >= 15) {
|
||||
destroy_popup_menu();
|
||||
if (script->functionTemp[2] == 0xFF) {
|
||||
script->varTable[0] = -1;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
script->functionTemp[3] = script->functionTemp[2] - 1;
|
||||
userIndex = menu->userIndex[script->functionTemp[2] - 1];
|
||||
script->varTable[0] = D_80244FD0_8F0DF0[userIndex];
|
||||
a1 = get_global_byte((userIndex / 8) + 12) | (1 << (userIndex % 8));
|
||||
set_global_byte((userIndex / 8) + 12, a1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_80240DA4_8ECBC4(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
ApiStatus func_80240DD0_8ECBF0(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 0x3F);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c"
|
@ -1,6 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#define NAMESPACE dup_kmr_20
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAMESPACE kmr_20
|
||||
|
@ -1,6 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#define NAMESPACE dup2_kmr_20
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAMESPACE kmr_20
|
||||
|
@ -1,15 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#include "world/common/atomic/ToadHouse.inc.c"
|
||||
|
||||
ApiStatus func_8024159C_8ED3BC(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_802415C4_8ED3E4(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 0x3F);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/WaitForPlayerToLand.inc.c"
|
@ -1,19 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
#include "animation_script.h"
|
||||
|
||||
#include "world/common/todo/StashVars.inc.c"
|
||||
|
||||
#include "world/common/todo/GetItemName.inc.c"
|
||||
|
||||
extern AnimScript Entity_SimpleSpring_AnimLaunch;
|
||||
|
||||
ApiStatus func_80241738_8ED558(Evt* script, s32 isInitialCall) {
|
||||
Entity* entity = get_entity_by_index(0);
|
||||
|
||||
if (entity == NULL) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
play_model_animation(entity->virtualModelIndex, Entity_SimpleSpring_AnimLaunch);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
#include "model.h"
|
||||
|
||||
#define NAMESPACE dup_kmr_20
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#define NAMESPACE kmr_20
|
||||
|
||||
#define NAMESPACE dup3_kmr_20
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAMESPACE kmr_20
|
||||
|
||||
ApiStatus func_80241C9C_8EDABC(Evt* script, s32 isInitialCall) {
|
||||
func_8011B950(269, -1, 1, 1);
|
||||
set_background_color_blend(0, 0, 0, 255);
|
||||
|
||||
gCameras[CAM_DEFAULT].bgColor[0] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[1] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[2] = 0;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80241CF0_8EDB10(Evt* script, s32 isInitialCall) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
|
||||
gCameras[CAM_DEFAULT].moveSpeed = evt_get_float_variable(script, *args++);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80241D1C_8EDB3C(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 0x3F);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
#include "model.h"
|
||||
|
||||
#define NAMESPACE dup2_kmr_20
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#define NAMESPACE kmr_20
|
||||
|
||||
ApiStatus func_80242030_8EDE50(Evt* script, s32 isInitialCall) {
|
||||
func_8011B950(269, -1, 0, 1);
|
||||
set_background_color_blend(0, 0, 0, 0);
|
||||
|
||||
gCameras[CAM_DEFAULT].bgColor[0] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[1] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[2] = 0;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_80242084_8EDEA4(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;
|
||||
}
|
||||
|
||||
ApiStatus func_802420EC_8EDF0C(Evt* script, s32 isInitialCall) {
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[1] = 255;
|
||||
}
|
||||
|
||||
script->functionTemp[1] -= 16;
|
||||
if (script->functionTemp[1] <= 0) {
|
||||
script->functionTemp[1] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
set_screen_overlay_params_front(0, script->functionTemp[1]);
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
ApiStatus func_80242144_8EDF64(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 0x3F);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
ApiStatus func_8024216C_8EDF8C(Evt* script, s32 isInitialCall) {
|
||||
au_ambience_set_volume(0, 1000, 0x7F);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
@ -1,198 +0,0 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
typedef struct UnkKmr20 {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ s16 unk_02;
|
||||
/* 0x04 */ s32 unk_04;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
/* 0x0C */ char unk_0C[0xC];
|
||||
/* 0x18 */ s16 unk_18;
|
||||
/* 0x1A */ s16 unk_1A;
|
||||
/* 0x1C */ s16 unk_1C;
|
||||
/* 0x1E */ char unk_1E[0x2];
|
||||
/* 0x20 */ s32 unk_20;
|
||||
/* 0x24 */ u16 equippedBadges;
|
||||
/* 0x26 */ s16 unk_26;
|
||||
/* 0x28 */ s16 unk_28;
|
||||
} UnkKmr20;
|
||||
|
||||
extern Gfx D_80252D50_8FEB70[];
|
||||
extern s32 D_80252DC0_8FEBE0[];
|
||||
|
||||
void func_802421A0_8EDFC0(UnkKmr20* arg0, s32 opacity) {
|
||||
s32 width;
|
||||
|
||||
if (opacity > 0) {
|
||||
gSPDisplayList(gMasterGfxPos++, D_80252D50_8FEB70);
|
||||
gDPPipeSync(gMasterGfxPos++);
|
||||
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 16, 120, 24, opacity * 0.65);
|
||||
gDPFillRectangle(gMasterGfxPos++, 33, 43, 287, 192);
|
||||
gDPPipeSync(gMasterGfxPos++);
|
||||
|
||||
msg_draw_frame(30, 40, 260, 155, 6, 0, 1, opacity * 0.55, opacity);
|
||||
draw_msg(MSG_CH0_00FC, 206 - get_msg_width(MSG_CH0_00FC, 0), 50, opacity, 0, 1);
|
||||
draw_number(gPlayerData.totalCoinsEarned, 216, 51, 1, 0, opacity, 2);
|
||||
draw_msg(MSG_CH0_00FD, 206 - get_msg_width(MSG_CH0_00FD, 0), 65, opacity, 0, 1);
|
||||
draw_number(arg0->equippedBadges, 231, 66, 1, 0, opacity, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 63, opacity, 0, 0);
|
||||
draw_number(80, 244, 66, 1, 0, opacity, 2);
|
||||
if (gPlayerData.starPiecesCollected == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 80, opacity, 0, 1);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FB, 206 - get_msg_width(MSG_CH0_00FB, 0), 80, opacity, 0, 1);
|
||||
draw_number(gPlayerData.starPiecesCollected, 231, 81, 1, 0, opacity, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 78, opacity, 0, 0);
|
||||
draw_number(160, 244, 80, 1, 0, opacity, 2);
|
||||
}
|
||||
|
||||
width = get_msg_width(MSG_CH0_00FE, 0);
|
||||
if (arg0->unk_26 == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 110, 95, opacity, 0, 1);
|
||||
} else {
|
||||
if (arg0->unk_26 == -1) {
|
||||
draw_msg(MSG_CH0_00FE, 206 - width, 95, opacity, 0, 1);
|
||||
draw_number(0, 231, 96, 1, 0, opacity, 3);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FE, 206 - width, 95, opacity, 0, 1);
|
||||
draw_number(arg0->unk_26, 231, 96, 1, 0, opacity, 3);
|
||||
}
|
||||
draw_msg(MSG_MenuTip_0034, 232, 93, opacity, 0, 0);
|
||||
draw_number(arg0->unk_28, 244, 95, 1, 0, opacity, 2);
|
||||
}
|
||||
|
||||
if (gPlayerData.quizzesAnswered == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 110, opacity, 0, 1);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FF, 206 - get_msg_width(MSG_CH0_00FF, 0), 110, opacity, 0, 1);
|
||||
draw_number(gPlayerData.quizzesCorrect, 231, 111, 1, 0, opacity, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 108, opacity, 0, 0);
|
||||
draw_number(gPlayerData.quizzesAnswered, 244, 111, 1, 0, opacity, 2);
|
||||
}
|
||||
|
||||
draw_msg(MSG_CH0_00F4, 206 - get_msg_width(MSG_CH0_00F4, 0), 125, opacity, 0, 1);
|
||||
draw_number(gPlayerData.battlesCount, 216, 126, 1, 0, opacity, 2);
|
||||
width = get_msg_width(MSG_CH0_00F7, 0);
|
||||
draw_msg(MSG_CH0_00F7, 206 - width, 140, opacity, 0, 1);
|
||||
draw_number(gPlayerData.playerFirstStrikes, 216, 141, 1, 0, opacity, 2);
|
||||
draw_msg(MSG_CH0_00F8, 206 - get_msg_width(MSG_CH0_00F8, 0), 155, opacity, 0, 1);
|
||||
draw_number(gPlayerData.enemyFirstStrikes, 216, 156, 1, 0, opacity, 2);
|
||||
|
||||
if (gPlayerData.powerBounces == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 170, opacity, 0, 1);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00F9, 206 - get_msg_width(MSG_CH0_00F9, 0), 170, opacity, 0, 1);
|
||||
draw_number(gPlayerData.powerBounces, 216, 171, 1, 0, opacity, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80242870_8EE690(void* data) {
|
||||
UnkKmr20* temp_v0 = (UnkKmr20*) evt_get_variable(NULL, MapVar(10));
|
||||
s32 temp_f2;
|
||||
|
||||
switch (temp_v0->unk_00) {
|
||||
case 0:
|
||||
temp_v0->unk_18 = 0;
|
||||
temp_v0->unk_08 = 0;
|
||||
temp_v0->unk_0A = 0;
|
||||
temp_v0->unk_04 = 0;
|
||||
temp_v0->unk_00 = 1;
|
||||
snd_start_sound(SOUND_21C, 0, 0);
|
||||
// fallthrough
|
||||
case 1:
|
||||
temp_v0->unk_04++;
|
||||
temp_f2 = update_lerp(0, 32.0f, 255.0f, temp_v0->unk_04, 3);
|
||||
temp_v0->unk_1A = temp_f2;
|
||||
temp_v0->unk_1C = temp_f2;
|
||||
if (temp_v0->unk_04 >= 3) {
|
||||
temp_v0->unk_00 = 2;
|
||||
temp_v0->unk_1A = 255;
|
||||
temp_v0->unk_1C = 255;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
temp_v0->unk_1A = 255;
|
||||
temp_v0->unk_1C = 255;
|
||||
if (gGameStatusPtr->currentButtons[0] & (BUTTON_A | BUTTON_B)) {
|
||||
temp_v0->unk_00 = 3;
|
||||
}
|
||||
if (temp_v0->unk_00 != 3) {
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
temp_v0->unk_04 = 0;
|
||||
temp_v0->unk_00 = 4;
|
||||
snd_start_sound(SOUND_MENU_BACK, 0, 0);
|
||||
// fallthrough
|
||||
case 4:
|
||||
temp_v0->unk_04++;
|
||||
temp_v0->unk_1A = update_lerp(0, temp_v0->unk_1C, 0.0f, temp_v0->unk_04, 3);
|
||||
if (temp_v0->unk_04 >= 3) {
|
||||
temp_v0->unk_00 = 5;
|
||||
}
|
||||
break;
|
||||
}
|
||||
func_802421A0_8EDFC0(temp_v0, temp_v0->unk_1A);
|
||||
}
|
||||
|
||||
void func_80242A04_8EE824(void) {
|
||||
RenderTask rt;
|
||||
|
||||
rt.renderMode = RENDER_MODE_2D;
|
||||
rt.appendGfxArg = NULL;
|
||||
rt.appendGfx = func_80242870_8EE690;
|
||||
rt.distance = 0;
|
||||
queue_render_task(&rt);
|
||||
}
|
||||
|
||||
void func_80242A3C_8EE85C(UnkKmr20* arg0) {
|
||||
PlayerData* playerData = &gPlayerData;
|
||||
s32 count;
|
||||
s32 i;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
|
||||
if (playerData->badges[i] != 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
arg0->equippedBadges = count;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; TRUE; i++) {
|
||||
if (D_80252DC0_8FEBE0[i] != 0) {
|
||||
if (evt_get_variable(NULL, D_80252DC0_8FEBE0[i]) != 0) {
|
||||
count++;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
arg0->unk_28 = i;
|
||||
arg0->unk_26 = count;
|
||||
if (arg0->unk_26 == 0 && evt_get_variable(NULL, GameFlag(328)) != 0) {
|
||||
arg0->unk_26 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
ApiStatus func_80242B04_8EE924(Evt* script, s32 isInitialCall) {
|
||||
UnkKmr20* temp_v0;
|
||||
|
||||
if (isInitialCall) {
|
||||
temp_v0 = script->functionTempPtr[0] = heap_malloc(sizeof(*temp_v0));
|
||||
temp_v0->unk_00 = 0;
|
||||
temp_v0->unk_1A = 255;
|
||||
temp_v0->unk_20 = create_worker_world(0, func_80242A04_8EE824);
|
||||
evt_set_variable(script, MapVar(10), (s32) temp_v0);
|
||||
func_80242A3C_8EE85C(temp_v0);
|
||||
}
|
||||
|
||||
temp_v0 = script->functionTempPtr[0];
|
||||
if (temp_v0->unk_00 == 5) {
|
||||
free_worker(temp_v0->unk_20);
|
||||
heap_free(temp_v0);
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
@ -2,11 +2,60 @@
|
||||
/// @brief Goomba Region - Mario's House
|
||||
|
||||
#include "common.h"
|
||||
#include "../kmr.h"
|
||||
#include "message_ids.h"
|
||||
#include "map.h"
|
||||
|
||||
#include "../kmr.h"
|
||||
#include "mapfs/kmr_20_shape.h"
|
||||
#include "mapfs/kmr_20_hit.h"
|
||||
|
||||
#include "sprite/npc/Luigi.h"
|
||||
#include "sprite/npc/Toad.h"
|
||||
#include "sprite/npc/WorldParakarry.h"
|
||||
#include "sprite/npc/ShyGuy.h"
|
||||
|
||||
enum {
|
||||
NPC_Scene_Parakarry = 0,
|
||||
NPC_Scene_Luigi = 1,
|
||||
|
||||
NPC_Luigi_0 = 0,
|
||||
NPC_Luigi_1 = 1,
|
||||
NPC_ShyGuy = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
MV_RecordsDataPtr = MapVar(10),
|
||||
};
|
||||
|
||||
enum {
|
||||
MF_LuigiWaiting = MapFlag(10),
|
||||
MF_ReadyForPlayerEntry = MapFlag(11),
|
||||
MF_Unk_0C = MapFlag(12),
|
||||
MF_LuigiInBasement = MapFlag(13),
|
||||
};
|
||||
|
||||
#define NAMESPACE kmr_20
|
||||
|
||||
extern EvtScript N(EVS_Main);
|
||||
extern EvtScript N(EVS_FadeOutAmbientSounds);
|
||||
extern EvtScript N(EVS_PlayRestingSong);
|
||||
extern EvtScript N(EVS_SetupMusic);
|
||||
extern EvtScript N(EVS_SetupRooms);
|
||||
extern EvtScript N(EVS_Setup_Interactables);
|
||||
extern EvtScript N(EVS_SetupBed);
|
||||
extern EvtScript N(EVS_Scene_BeginGame);
|
||||
extern EvtScript N(EVS_Scene_SettingOff);
|
||||
extern EvtScript N(EVS_Scene_BeginEpilogue);
|
||||
extern EvtScript N(EVS_Scene_EpilogueGetLetter);
|
||||
extern EvtScript N(EVS_Scene_LuigiWaitingAround);
|
||||
extern EvtScript N(EVS_Scene_CaughtLuigiInBasement);
|
||||
extern EvtScript N(EVS_Inspect_Records);
|
||||
extern EvtScript N(EVS_SecretPanel_Flip);
|
||||
extern EvtScript N(EVS_SetupTrees);
|
||||
extern EvtScript N(EVS_SetupBushes);
|
||||
extern EvtScript N(EVS_MakeEntities);
|
||||
extern NpcGroupList N(SceneNPCs);
|
||||
extern NpcGroupList N(DefaultNPCs);
|
||||
|
||||
API_CALLABLE(N(func_80241C9C_8EDABC));
|
||||
void msg_draw_frame(s32 posX, s32 posY, s32 sizeX, s32 sizeY, s32 style, s32 palette, s32 fading, s32 bgAlpha, s32 frameAlpha);
|
||||
|
17
src/world/area_kmr/kmr_20/kmr_20_0_header.c
Normal file
17
src/world/area_kmr/kmr_20/kmr_20_0_header.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
EntryList N(Entrances) = {
|
||||
[kmr_20_ENTRY_0] { 240.0, 30.0, -80.0, 90.0 },
|
||||
[kmr_20_ENTRY_1] { 240.0, 30.0, -70.0, 90.0 },
|
||||
[kmr_20_ENTRY_2] { 100.0, 44.0, -40.0, 90.0 },
|
||||
[kmr_20_ENTRY_3] { 100.0, 44.0, -40.0, 90.0 },
|
||||
[kmr_20_ENTRY_4] { 594.0, 30.0, -216.0, 180.0 },
|
||||
};
|
||||
|
||||
MapSettings N(settings) = {
|
||||
.main = &N(EVS_Main),
|
||||
.entryList = &N(Entrances),
|
||||
.entryCount = ENTRY_COUNT(N(Entrances)),
|
||||
.background = &gBackgroundImage,
|
||||
.tattle = { MSG_MapTattle_kmr_20 },
|
||||
};
|
821
src/world/area_kmr/kmr_20/kmr_20_10_npc.c
Normal file
821
src/world/area_kmr/kmr_20/kmr_20_10_npc.c
Normal file
@ -0,0 +1,821 @@
|
||||
#include "kmr_20.h"
|
||||
#include "effects.h"
|
||||
#include "animation_script.h"
|
||||
|
||||
extern AnimScript Entity_SimpleSpring_AnimLaunch;
|
||||
|
||||
NpcSettings N(NpcSettings_Luigi) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
NpcSettings N(NpcSettings_ShyGuy) = {
|
||||
.height = 23,
|
||||
.radius = 22,
|
||||
.level = 14,
|
||||
.onHit = &EnemyNpcHit,
|
||||
.onDefeat = &EnemyNpcDefeat,
|
||||
.actionFlags = AI_ACTION_JUMP_WHEN_SEE_PLAYER,
|
||||
};
|
||||
|
||||
#include "world/common/complete/GiveReward.inc.c"
|
||||
|
||||
API_CALLABLE(N(PlaySpringLaunchAnimation)) {
|
||||
Entity* entity = get_entity_by_index(0);
|
||||
|
||||
if (entity == NULL) {
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
play_model_animation(entity->virtualModelIndex, Entity_SimpleSpring_AnimLaunch);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_HandItemOver) = {
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80007)
|
||||
EVT_WAIT(20)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_KootFavorCheck_Luigi) = {
|
||||
EVT_IF_NE(GB_KootFavor_Current, 5)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_IF_NE(GF_KMR20_Gift_LuigisAutograph, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_EXEC_WAIT(N(EVS_HandItemOver))
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_0103)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_NodYes)
|
||||
EVT_WAIT(40)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_0104)
|
||||
EVT_CALL(GetNpcYaw, NPC_SELF, LVar0)
|
||||
EVT_SET(LVar1, LVar0)
|
||||
EVT_ADD(LVar1, 180)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, LVar1, 5)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleBack)
|
||||
EVT_WAIT(40)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, LVar0, 5)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_0105)
|
||||
EVT_WAIT(10)
|
||||
EVT_SET(LVar0, ITEM_KOOT_MERLUVLEE_AUTOGRAPH)
|
||||
EVT_SET(LVar1, 1)
|
||||
EVT_EXEC_WAIT(N(GiveKeyReward))
|
||||
EVT_CALL(AddKeyItem, LVar0)
|
||||
EVT_SET(GF_KMR20_Gift_LuigisAutograph, TRUE)
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH3_STAR_SPRIT_DEPARTED)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH4_DEFEATED_GENERAL_GUY)
|
||||
EVT_CALL(GetSelfVar, 0, LVar0)
|
||||
EVT_IF_EQ(LVar0, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_LuigiWaitingAround) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_1, 379, 20, -60)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_1, 39, 0)
|
||||
EVT_CALL(SetNpcCollisionSize, NPC_Luigi_1, 43, 24)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 495, 30, -115)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 495, 0, -115)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(620.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_ADD(LVar1, 25)
|
||||
EVT_ADD(LVar2, 2)
|
||||
EVT_LOOP(3)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 2, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(13)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 2, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(22)
|
||||
EVT_END_LOOP
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 2, LVar0, LVar1, LVar2)
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_LOOP(3)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_IdleSit)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_TalkSit)
|
||||
EVT_WAIT(25)
|
||||
EVT_END_LOOP
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_IdleSit)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(70)
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, 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(250.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(80)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_TalkSit, ANIM_Luigi_IdleSit, 5, MSG_CH0_00DB)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_263, 0)
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_1, EMOTE_QUESTION, -30, 40, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_THREAD
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 495, 30, -115)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 495, 0, -115)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(620.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_SET(MF_ReadyForPlayerEntry, TRUE)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_GRAVITY, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_ENABLE_HIT_SCRIPT, FALSE)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_262, 0)
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_1, EMOTE_EXCLAMATION, -30, 20, TRUE, 0, 0, 0, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Jump)
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_1, LVar0, LVar1, LVar2, 10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00DC)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 531, -128, 50)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_LOOP(10)
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_PLAY_EFFECT(EFFECT_WALKING_DUST, 1, LVar0, LVar1, LVar2, 0, 0)
|
||||
EVT_WAIT(6)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_CALL(PlayerMoveTo, 556, -158, 30)
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_CALL(DisablePartnerAI, 0)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_JUMP)
|
||||
EVT_CALL(NpcMoveTo, NPC_PARTNER, 554, -195, 28)
|
||||
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_RUN)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(3)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 495, 30, -115)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 495, 0, -115)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(620.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 564, 0, -176)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 556, 0, -158)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(270.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(2.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(40)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00DD)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_StillBack)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_263, 0)
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_1, EMOTE_QUESTION, -30, 30, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 524, -152, 10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_WAIT(15)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 39, 0)
|
||||
EVT_WAIT(45)
|
||||
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 219, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_1, EMOTE_ELLIPSIS, 20, 85, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_PARTNER, SOUND_263, 0)
|
||||
EVT_CALL(ShowEmote, NPC_PARTNER, EMOTE_QUESTION, -20, 70, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(110)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00DE)
|
||||
EVT_CALL(GetCurrentPartnerID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(PARTNER_GOOMBARIO)
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, PARTNER_ANIM_HURT, PARTNER_ANIM_RUN, 5, MSG_CH0_00DF)
|
||||
EVT_CASE_EQ(PARTNER_KOOPER)
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, PARTNER_ANIM_HURT, PARTNER_ANIM_RUN, 5, MSG_CH0_00E0)
|
||||
EVT_CASE_EQ(PARTNER_BOMBETTE)
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, PARTNER_ANIM_HURT, PARTNER_ANIM_RUN, 5, MSG_CH0_00E1)
|
||||
EVT_CASE_EQ(PARTNER_PARAKARRY)
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, PARTNER_ANIM_HURT, PARTNER_ANIM_RUN, 5, MSG_CH0_00E2)
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(SpeakToPlayer, NPC_PARTNER, PARTNER_ANIM_WALK, PARTNER_ANIM_9, 5, MSG_CH0_00DB)
|
||||
EVT_END_SWITCH
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00E3)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_GRAVITY, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_ENABLE_HIT_SCRIPT, TRUE)
|
||||
EVT_CALL(EnablePartnerAI)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.5))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcAux_Luigi_WhistleAtopObstacle) = {
|
||||
EVT_LABEL(20)
|
||||
EVT_CALL(GetNpcVar, NPC_SELF, 0, LVar0)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(21)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVarA, LVarB, LVarC)
|
||||
EVT_ADD(LVarB, 25)
|
||||
EVT_ADD(LVarC, 2)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 2, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(13)
|
||||
EVT_CALL(GetNpcVar, NPC_SELF, 0, LVar0)
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVarA, LVarB, LVarC)
|
||||
EVT_ADD(LVarB, 25)
|
||||
EVT_ADD(LVarC, 2)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 2, LVarA, LVarB, LVarC)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(21)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_TalkSit)
|
||||
EVT_WAIT(22)
|
||||
EVT_GOTO(20)
|
||||
EVT_LABEL(21)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_Luigi_InBasement) = {
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_LABEL(10)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(MF_Unk_0C, FALSE)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_LABEL(20)
|
||||
EVT_IF_EQ(MF_Unk_0C, FALSE)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetNpcVar, NPC_SELF, 0, LVar0)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(21)
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVarA, LVarB, LVarC)
|
||||
EVT_ADD(LVarA, 6)
|
||||
EVT_ADD(LVarB, 58)
|
||||
EVT_ADD(LVarC, 2)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVarA, LVarB, LVarC)
|
||||
EVT_SUB(LVarA, 4)
|
||||
EVT_ADD(LVarB, 55)
|
||||
EVT_SUB(LVarC, 1)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_IF_EQ(MF_Unk_0C, FALSE)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetNpcVar, NPC_SELF, 0, LVar0)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_GOTO(21)
|
||||
EVT_END_IF
|
||||
EVT_WAIT(28)
|
||||
EVT_GOTO(20)
|
||||
EVT_LABEL(21)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_Luigi_InBedroom) = {
|
||||
EVT_LABEL(10)
|
||||
EVT_SET(LVar0, MF_Unk_0C)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_2, FALSE)
|
||||
EVT_ELSE
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_2, TRUE)
|
||||
EVT_END_IF
|
||||
EVT_WAIT(3)
|
||||
EVT_GOTO(10)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_CaughtLuigiInBasement) = {
|
||||
EVT_SET(GF_KMR20_CaughtLuigiInBasement, TRUE)
|
||||
EVT_SET(AF_KMR_0C, TRUE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_0, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_0, 0, 1)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_WAIT(2)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVarA, LVarB, LVarC)
|
||||
EVT_ADD(LVarB, 45)
|
||||
EVT_ADD(LVarC, 1)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_WAIT(25)
|
||||
EVT_PLAY_EFFECT(EFFECT_MUSIC_NOTE, 0, LVarA, LVarB, LVarC)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_0, 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(300.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.5))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(25)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_0, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00E9)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 270, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 90, 0)
|
||||
EVT_WAIT(6)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 270, 0)
|
||||
EVT_WAIT(5)
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_0, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_0, LVar0, LVar1, LVar2, 9)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_0, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00EA)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 90, 0)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(EnableModel, MODEL_o200, FALSE)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 270, 0)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_0, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 5, MSG_CH0_00EB)
|
||||
EVT_WAIT(3)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_100, TRUE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_0, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_0, -130, -17, 15)
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_0, -145, -54, -45, 10)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_0, SOUND_2086, 0)
|
||||
EVT_CALL(N(PlaySpringLaunchAnimation))
|
||||
EVT_THREAD
|
||||
EVT_WAIT(3)
|
||||
EVT_EXEC(N(EVS_SecretPanel_Flip))
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_0, -145, 30, -45, 20)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_100, FALSE)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_0, 20, -80, 15)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_0, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_0, 48, 30, -5)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 270, 0)
|
||||
EVT_END_THREAD
|
||||
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(400.0))
|
||||
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(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_Luigi_ReadingMail) = {
|
||||
EVT_LABEL(10)
|
||||
EVT_IF_EQ(MF_Unk_0C, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2, TRUE)
|
||||
EVT_WAIT(1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2, FALSE)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_IF_GT(LVar0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_SET(GF_KMR20_CaughtLuigiReadingLetter, TRUE)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_262, 0)
|
||||
EVT_CALL(ShowEmote, NPC_SELF, EMOTE_EXCLAMATION, -30, 15, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, TRUE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 37, -72, 16)
|
||||
EVT_CALL(InterpPlayerYaw, 90, 0)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 42, -6, 10)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_Luigi) = {
|
||||
EVT_CALL(SetNpcSpeed, NPC_SELF, EVT_FLOAT(3.0))
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(SetSelfVar, 0, 0)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 635, -108, 0)
|
||||
EVT_CALL(GetSelfVar, 0, LVar0)
|
||||
EVT_IF_NE(LVar0, 0)
|
||||
EVT_GOTO(100)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 528, 20, 0)
|
||||
EVT_CALL(GetSelfVar, 0, LVar0)
|
||||
EVT_IF_NE(LVar0, 0)
|
||||
EVT_GOTO(100)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 635, -108, 0)
|
||||
EVT_CALL(GetSelfVar, 0, LVar0)
|
||||
EVT_IF_NE(LVar0, 0)
|
||||
EVT_GOTO(100)
|
||||
EVT_END_IF
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Run)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 528, 20, 0)
|
||||
EVT_CALL(GetSelfVar, 0, LVar0)
|
||||
EVT_IF_NE(LVar0, 0)
|
||||
EVT_GOTO(100)
|
||||
EVT_END_IF
|
||||
EVT_GOTO(10)
|
||||
EVT_LABEL(100)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 39, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInteract_Luigi) = {
|
||||
EVT_IF_EQ(MF_LuigiWaiting, TRUE)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00E5)
|
||||
EVT_ELSE
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH1_MERLIN_REVEALED_KOOPA_BROS)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00E6)
|
||||
EVT_CASE_LT(STORY_CH1_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00E7)
|
||||
EVT_CASE_LT(STORY_CH2_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00E8)
|
||||
EVT_CASE_LT(STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00ED)
|
||||
EVT_CASE_LT(STORY_CH4_STAR_SPRIT_DEPARTED)
|
||||
EVT_IF_EQ(GF_KMR20_ChasedOffShyGuy, FALSE)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00EE)
|
||||
EVT_ELSE
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00EF)
|
||||
EVT_END_IF
|
||||
EVT_CASE_LT(STORY_CH5_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00F0)
|
||||
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00F1)
|
||||
EVT_CASE_LT(STORY_CH7_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 0, MSG_CH0_00F2)
|
||||
EVT_CASE_LT(STORY_EPILOGUE)
|
||||
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Luigi_Talk, ANIM_Luigi_Idle, 16, MSG_CH0_00F3)
|
||||
EVT_END_SWITCH
|
||||
EVT_END_IF
|
||||
EVT_EXEC_WAIT(N(EVS_KootFavorCheck_Luigi))
|
||||
EVT_IF_NE(MF_LuigiWaiting, TRUE)
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH7_STAR_SPRIT_DEPARTED)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_LT(STORY_EPILOGUE)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 39, 5)
|
||||
EVT_END_SWITCH
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInit_Luigi_0) = {
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcCollisionSize, NPC_SELF, 45, 24)
|
||||
EVT_IF_EQ(MF_LuigiWaiting, TRUE)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Luigi)))
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH1_MERLIN_REVEALED_KOOPA_BROS)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH1_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, -145, 30, -50)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Luigi_InBedroom)))
|
||||
EVT_CASE_LT(STORY_CH2_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_IF_EQ(GF_KMR20_CaughtLuigiInBasement, FALSE)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, -83, -80, -54)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Luigi_InBasement)))
|
||||
EVT_SET(MF_LuigiInBasement, TRUE)
|
||||
EVT_ELSE
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_0, 48, 30, -5)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Luigi_0, 90, 0)
|
||||
EVT_END_IF
|
||||
EVT_CASE_LT(STORY_CH4_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH5_STAR_SPRIT_DEPARTED)
|
||||
EVT_IF_EQ(GF_KMR20_CaughtLuigiReadingLetter, FALSE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_ReadLetter)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, -102, 30, -85)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 0)
|
||||
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Luigi_ReadingMail)))
|
||||
EVT_ELSE
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 42, 30, -6)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_END_IF
|
||||
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH7_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_EPILOGUE)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInit_Luigi_1) = {
|
||||
EVT_CALL(SetNpcVar, NPC_SELF, 0, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcCollisionSize, NPC_SELF, 45, 24)
|
||||
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Luigi)))
|
||||
EVT_IF_EQ(MF_LuigiWaiting, TRUE)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH1_MERLIN_REVEALED_KOOPA_BROS)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 500, 0, -200)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CASE_LT(STORY_CH1_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH2_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 300, 50, 150)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(SetNpcAux, NPC_SELF, EVT_PTR(N(EVS_NpcAux_Luigi_WhistleAtopObstacle)))
|
||||
EVT_CASE_LT(STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH4_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 560, 0, -75)
|
||||
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Luigi)))
|
||||
EVT_CASE_LT(STORY_CH5_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 300, 50, 150)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(SetNpcAux, NPC_SELF, EVT_PTR(N(EVS_NpcAux_Luigi_WhistleAtopObstacle)))
|
||||
EVT_CASE_LT(STORY_CH7_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 300, 115, 150)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(SetNpcAux, NPC_SELF, EVT_PTR(N(EVS_NpcAux_Luigi_WhistleAtopObstacle)))
|
||||
EVT_CASE_LT(STORY_EPILOGUE)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 306, 30, -145)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 39, 0)
|
||||
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_400000, 1)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_Luigi_0) = {
|
||||
.id = NPC_Luigi_0,
|
||||
.settings = &N(NpcSettings_Luigi),
|
||||
.pos = { NPC_DISPOSE_LOCATION },
|
||||
.yaw = 90,
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
|
||||
.init = &N(EVS_NpcInit_Luigi_0),
|
||||
.drops = {
|
||||
.dropFlags = NPC_DROP_FLAGS_80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
},
|
||||
.animations = {
|
||||
.idle = ANIM_Luigi_Still,
|
||||
.walk = ANIM_Luigi_Still,
|
||||
.run = ANIM_Luigi_Still,
|
||||
.chase = ANIM_Luigi_Still,
|
||||
.anim_4 = ANIM_Luigi_Still,
|
||||
.anim_5 = ANIM_Luigi_Still,
|
||||
.death = ANIM_Luigi_Still,
|
||||
.hit = ANIM_Luigi_Still,
|
||||
.anim_8 = ANIM_Luigi_Still,
|
||||
.anim_9 = ANIM_Luigi_Still,
|
||||
.anim_A = ANIM_Luigi_Still,
|
||||
.anim_B = ANIM_Luigi_Still,
|
||||
.anim_C = ANIM_Luigi_Still,
|
||||
.anim_D = ANIM_Luigi_Still,
|
||||
.anim_E = ANIM_Luigi_Still,
|
||||
.anim_F = ANIM_Luigi_Still,
|
||||
},
|
||||
.tattle = MSG_NpcTattle_Luigi,
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_Luigi_1) = {
|
||||
.id = NPC_Luigi_1,
|
||||
.settings = &N(NpcSettings_Luigi),
|
||||
.pos = { NPC_DISPOSE_LOCATION },
|
||||
.yaw = 90,
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
|
||||
.init = &N(EVS_NpcInit_Luigi_1),
|
||||
.drops = {
|
||||
.dropFlags = NPC_DROP_FLAGS_80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
},
|
||||
.animations = {
|
||||
.idle = ANIM_Luigi_Still,
|
||||
.walk = ANIM_Luigi_Still,
|
||||
.run = ANIM_Luigi_Still,
|
||||
.chase = ANIM_Luigi_Still,
|
||||
.anim_4 = ANIM_Luigi_Still,
|
||||
.anim_5 = ANIM_Luigi_Still,
|
||||
.death = ANIM_Luigi_Still,
|
||||
.hit = ANIM_Luigi_Still,
|
||||
.anim_8 = ANIM_Luigi_Still,
|
||||
.anim_9 = ANIM_Luigi_Still,
|
||||
.anim_A = ANIM_Luigi_Still,
|
||||
.anim_B = ANIM_Luigi_Still,
|
||||
.anim_C = ANIM_Luigi_Still,
|
||||
.anim_D = ANIM_Luigi_Still,
|
||||
.anim_E = ANIM_Luigi_Still,
|
||||
.anim_F = ANIM_Luigi_Still,
|
||||
},
|
||||
.tattle = MSG_NpcTattle_Luigi,
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcIdle_ShyGuy) = {
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 500, 0, -195)
|
||||
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 1)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim03)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 482, 0, -286, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 726, 0, -153, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 603, 0, 0, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 557, 0, 130, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 357, 0, 87, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 344, 30, -8, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 276, 138, 22, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 360, 61, -117, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 427, 55, -182, 15)
|
||||
EVT_WAIT(5)
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcAI_ShyGuy) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim0C)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_ShyGuy_Red_Anim03)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_203F, 0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 495, 0, -108, 15)
|
||||
EVT_WAIT(3)
|
||||
EVT_CALL(NpcMoveTo, NPC_SELF, 550, -170, 15)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_32C, 0)
|
||||
EVT_CALL(NpcJump0, NPC_SELF, 594, 30, -220, 15)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_ENTER_PIPE, 0)
|
||||
EVT_CALL(func_802CFE2C, NPC_SELF, 0x00000800)
|
||||
EVT_CALL(func_802CFD30, NPC_SELF, FOLD_TYPE_5, 2, 1, 1, 0)
|
||||
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
|
||||
EVT_SUB(LVar1, 10)
|
||||
EVT_LOOP(30)
|
||||
EVT_SUB(LVar1, 1)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcHit_ShyGuy) = {
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_203E, 0)
|
||||
EVT_SET(GF_KMR20_ChasedOffShyGuy, TRUE)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_1, 0, 1)
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_8000000 | ENEMY_FLAGS_10000000, 1)
|
||||
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_ShyGuy)))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInit_ShyGuy) = {
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH3_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_IF_GE(GB_StoryProgress, STORY_CH4_DEFEATED_GENERAL_GUY)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_IF_NE(GF_KMR20_ChasedOffShyGuy, FALSE)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_ShyGuy)))
|
||||
EVT_CALL(BindNpcHit, NPC_SELF, EVT_PTR(N(EVS_NpcHit_ShyGuy)))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_ShyGuy) = {
|
||||
.id = NPC_ShyGuy,
|
||||
.settings = &N(NpcSettings_ShyGuy),
|
||||
.pos = { NPC_DISPOSE_LOCATION },
|
||||
.yaw = 270,
|
||||
.flags = ENEMY_FLAGS_8 | ENEMY_FLAGS_100 | ENEMY_FLAGS_200 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_100000 | ENEMY_FLAGS_200000 | ENEMY_FLAGS_400000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_10000000,
|
||||
.init = &N(EVS_NpcInit_ShyGuy),
|
||||
.drops = {
|
||||
.dropFlags = NPC_DROP_FLAGS_80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
},
|
||||
.animations = {
|
||||
.idle = ANIM_ShyGuy_Red_Anim01,
|
||||
.walk = ANIM_ShyGuy_Red_Anim02,
|
||||
.run = ANIM_ShyGuy_Red_Anim03,
|
||||
.chase = ANIM_ShyGuy_Red_Anim03,
|
||||
.anim_4 = ANIM_ShyGuy_Red_Anim01,
|
||||
.anim_5 = ANIM_ShyGuy_Red_Anim01,
|
||||
.death = ANIM_ShyGuy_Red_Anim0C,
|
||||
.hit = ANIM_ShyGuy_Red_Anim0C,
|
||||
.anim_8 = ANIM_ShyGuy_Red_Anim15,
|
||||
.anim_9 = ANIM_ShyGuy_Red_Anim12,
|
||||
.anim_A = ANIM_ShyGuy_Red_Anim11,
|
||||
.anim_B = ANIM_ShyGuy_Red_Anim10,
|
||||
.anim_C = ANIM_ShyGuy_Red_Anim05,
|
||||
.anim_D = ANIM_ShyGuy_Red_Anim01,
|
||||
.anim_E = ANIM_ShyGuy_Red_Anim01,
|
||||
.anim_F = ANIM_ShyGuy_Red_Anim01,
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(DefaultNPCs) = {
|
||||
NPC_GROUP(N(NpcData_Luigi_0)),
|
||||
NPC_GROUP(N(NpcData_Luigi_1)),
|
||||
NPC_GROUP(N(NpcData_ShyGuy)),
|
||||
{}
|
||||
};
|
445
src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c
Normal file
445
src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c
Normal file
@ -0,0 +1,445 @@
|
||||
#include "kmr_20.h"
|
||||
#include "model.h"
|
||||
|
||||
#define NAME_SUFFIX _Intro
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#include "world/common/entity/Pipe.data.inc.c"
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
API_CALLABLE(N(func_80241C9C_8EDABC)) {
|
||||
func_8011B950(MODEL_g62, -1, 1, 1);
|
||||
set_background_color_blend(0, 0, 0, 255);
|
||||
|
||||
gCameras[CAM_DEFAULT].bgColor[0] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[1] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[2] = 0;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(func_80241CF0_8EDB10)) {
|
||||
Bytecode* args = script->ptrReadPos;
|
||||
|
||||
gCameras[CAM_DEFAULT].moveSpeed = evt_get_float_variable(script, *args++);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeHalf_Intro)) {
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Luigi_PlayWalkSounds_Intro) = {
|
||||
EVT_CALL(GetNpcAnimation, NPC_Scene_Luigi, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_Walk)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_WalkLetter)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_WalkBack)
|
||||
EVT_SET(LVar1, 10)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_Run)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_RunLetter)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_RunBack)
|
||||
EVT_SET(LVar1, 5)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_END_SWITCH
|
||||
EVT_CHILD_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Luigi, SOUND_B0000019, 0)
|
||||
EVT_WAIT(LVar1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_CHILD_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Player_EnterPipe_Intro) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(HidePlayerShadow, TRUE)
|
||||
EVT_SET(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Intro))
|
||||
EVT_CALL(PlayerMoveTo, LVar1, LVar3, 3)
|
||||
EVT_SET(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Intro))
|
||||
EVT_CALL(SetPlayerPos, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(PlaySoundAtPlayer, SOUND_ENTER_PIPE, 0)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(4)
|
||||
EVT_LOOP(40)
|
||||
EVT_SUB(LVar1, 1)
|
||||
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802D286C, 0x00000800)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_10002, FOLD_TYPE_5, 2, 1, 1, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Luigi_EnterPipe_Intro) = {
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Scene_Luigi, NPC_FLAG_GRAVITY, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Scene_Luigi, NPC_FLAG_ENABLE_HIT_SCRIPT, TRUE)
|
||||
EVT_CALL(EnableNpcShadow, NPC_Scene_Luigi, FALSE)
|
||||
EVT_SET(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Intro))
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, LVar1, LVar3, 3)
|
||||
EVT_SET(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Intro))
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Luigi, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Luigi, SOUND_ENTER_PIPE, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Still)
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetNpcPos, NPC_Scene_Luigi, LVar0, LVar1, LVar2)
|
||||
EVT_ADD(LVar1, 7)
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Luigi, LVar0, LVar1, LVar2)
|
||||
EVT_LOOP(40)
|
||||
EVT_SUB(LVar1, 1)
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Luigi, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802CFE2C, NPC_Scene_Luigi, 0x00000800)
|
||||
EVT_CALL(func_802CFD30, NPC_Scene_Luigi, FOLD_TYPE_5, 2, 1, 1, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_FocusCam_Unused) = {
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 250, 30, -80)
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(N(func_80241CF0_8EDB10), EVT_FLOAT(1.8))
|
||||
EVT_CALL(InterpCamTargetPos, 0, 1, 250, 30, -80, 10)
|
||||
EVT_CALL(N(func_80241CF0_8EDB10), 1)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_TetherCamToLuigi) = {
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(SetNpcVar, NPC_Scene_Luigi, 0, 1)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(GetNpcPos, NPC_Scene_Luigi, LVar0, LVar1, LVar2)
|
||||
EVT_SUB(LVar0, 20)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(GetNpcVar, NPC_Scene_Luigi, 0, LVar0)
|
||||
EVT_IF_EQ(LVar0, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenAndCloseDoor_Intro_Impl) = {
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o246, SOUND_BASIC_DOOR_OPEN, 0)
|
||||
EVT_CALL(MakeLerp, 0, 80, 14, EASING_QUADRATIC_OUT)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g14, LVar0, 0, 1, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(MakeLerp, 80, 0, 8, EASING_QUADRATIC_OUT)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g14, LVar0, 0, 1, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o246, SOUND_BASIC_DOOR_CLOSE, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenAndCloseDoor_Intro) = {
|
||||
EVT_CALL(EnableGroup, MODEL_g72, TRUE)
|
||||
EVT_EXEC_WAIT(N(EVS_OpenAndCloseDoor_Intro_Impl))
|
||||
EVT_CALL(EnableGroup, MODEL_g72, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
s32 N(D_8024FD28_8FBB48)[] = {
|
||||
3,
|
||||
34, 35, 36,
|
||||
};
|
||||
|
||||
s32 N(D_8024FD38_8FBB58)[] = {
|
||||
3,
|
||||
422, 37, -195,
|
||||
422, 48, -195,
|
||||
422, 12, -195,
|
||||
};
|
||||
|
||||
s32* N(UnknownLists)[] = {
|
||||
N(D_8024FD28_8FBB48), 0,
|
||||
N(D_8024FD38_8FBB58), 0,
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_BeginGame) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_MAIL_CALL, 0, 8)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(InterpPlayerYaw, 90, 0)
|
||||
EVT_CALL(SetPlayerPos, -50, 30, -80)
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Luigi, 220, 30, -80)
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Parakarry, 720, 220, -150)
|
||||
EVT_CALL(SetNpcYaw, NPC_Scene_Parakarry, 270)
|
||||
EVT_CALL(EnableGroup, MODEL_g94, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g100, TRUE)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 550, 0, 20)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 550, 0, 20)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 550)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(15.0), EVT_FLOAT(-14.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.7))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(MakeLerp, 0, 70, 60, EASING_LINEAR)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(TranslateGroup, MODEL_g108, LVar0, 0, 0)
|
||||
EVT_SETF(LVar2, 0)
|
||||
EVT_SUBF(LVar2, LVar0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g106, LVar2, 0, 0)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(MakeLerp, 0, 50, 40, EASING_LINEAR)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(TranslateGroup, MODEL_g109, LVar0, 0, 0)
|
||||
EVT_SETF(LVar2, 0)
|
||||
EVT_SUBF(LVar2, LVar0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g107, LVar2, 0, 0)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_THREAD
|
||||
EVT_WAIT(50)
|
||||
EVT_CALL(MakeLerp, 0, 50, 40, EASING_LINEAR)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(TranslateGroup, MODEL_g105, LVar0, 0, 0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g102, LVar0, 0, 0)
|
||||
EVT_SETF(LVar2, 0)
|
||||
EVT_SUBF(LVar2, LVar0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g103, LVar2, 0, 0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g104, LVar2, 0, 0)
|
||||
EVT_CALL(TranslateGroup, MODEL_g101, LVar2, 0, 0)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(120)
|
||||
EVT_CALL(NpcFlyTo, NPC_Scene_Parakarry, 430, 20, -165, 60, -10, EASING_LINEAR)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Scene_Parakarry, 45, 10)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Parakarry, SOUND_E0, 0)
|
||||
EVT_THREAD
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 2, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -3, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 2, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -3, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 0, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(35)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Scene_Parakarry, 220, 5)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Scene_Parakarry, ANIM_WorldParakarry_Talk, ANIM_WorldParakarry_Idle, 5, MSG_Intro_001E)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(NpcFlyTo, NPC_Scene_Parakarry, 360, 260, 60, 60, -10, EASING_LINEAR)
|
||||
EVT_WAIT(30)
|
||||
EVT_EXEC(N(EVS_OpenAndCloseDoor_Intro))
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Run)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Intro), LVarA)
|
||||
EVT_CALL(SetNpcSpeed, NPC_Scene_Luigi, EVT_FLOAT(4.0))
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 450, -80, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 430, -165, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Idle)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Luigi, SOUND_E0, 0)
|
||||
EVT_THREAD
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 1, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 1, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -2, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 1, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 1, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -2, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 0, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_IdleLetter)
|
||||
EVT_WAIT(40)
|
||||
EVT_CALL(InterpNpcYaw, NPC_Scene_Luigi, 270, 5)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_RunLetter)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Intro), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 450, -80, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 290, -70, 0)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_CALL(EnableGroup, MODEL_g20, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g21, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g49, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_g56, TRUE)
|
||||
EVT_CALL(N(func_80241C9C_8EDABC))
|
||||
EVT_CALL(RotateGroup, MODEL_g60, 90, 1, 0, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g34, 90, -1, 0, 0)
|
||||
EVT_CALL(EnableGroup, MODEL_g60, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g34, FALSE)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 250, 30, -80)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 250, 30, -80)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Intro))
|
||||
EVT_EXEC(N(EVS_OpenAndCloseDoor_Intro_Impl))
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_WalkLetter)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Intro), LVarA)
|
||||
EVT_CALL(SetNpcSpeed, NPC_Scene_Luigi, EVT_FLOAT(2.0))
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 240, -80, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_IdleLetter)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Scene_Luigi, ANIM_Luigi_TalkLetter, ANIM_Luigi_IdleLetter, 0, MSG_Intro_001F)
|
||||
EVT_WAIT(10)
|
||||
EVT_EXEC(N(EVS_TetherCamToLuigi))
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_WalkLetter)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Intro), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 230, -130, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 110, -110, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_IdleLetter)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_CALL(SetNpcVar, NPC_Scene_Luigi, 0, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(func_802D1270, 70, -80, EVT_FLOAT(2.0))
|
||||
EVT_CALL(func_802D1270, 70, -110, EVT_FLOAT(2.0))
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Scene_Luigi, ANIM_Luigi_TalkLetter, ANIM_Luigi_IdleLetter, 0, MSG_Intro_0020)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_OpenLetter)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_IdleRead)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Scene_Luigi, ANIM_Luigi_TalkRead, ANIM_Luigi_IdleRead, 0, MSG_Intro_0021)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_ReadLetter)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_PRISONER_PEACH_THEME, 0, 8)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(ClearAmbientSounds, 250)
|
||||
EVT_CALL(GotoMapSpecial, EVT_PTR("osr_00"), osr_00_ENTRY_3, TRANSITION_7)
|
||||
EVT_WAIT(15)
|
||||
EVT_CALL(ClearAmbientSounds, 250)
|
||||
EVT_WAIT(100)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_SettingOff) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetNpcPos, NPC_Scene_Luigi, 220, 30, -70)
|
||||
EVT_CALL(SetNpcYaw, NPC_Scene_Luigi, 90)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 320, 30, -70)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 320, 30, -70)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(60)
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_PEACHS_CASTLE_PARTY, 1, 8)
|
||||
EVT_EXEC(N(EVS_OpenAndCloseDoor_Intro))
|
||||
EVT_THREAD
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcSpeed, NPC_Scene_Luigi, EVT_FLOAT(3.0))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Run)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Intro), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 320, -70, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 460, -70, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Scene_Luigi, 570, -170, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Idle)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802D1270, 320, -70, EVT_FLOAT(3.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(func_802D1270, 460, -70, EVT_FLOAT(3.0))
|
||||
EVT_CALL(func_802D1270, 570, -170, EVT_FLOAT(3.0))
|
||||
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(1.0))
|
||||
EVT_CALL(PlayerJump, 594, 30, -216, 15)
|
||||
EVT_EXEC_WAIT(N(EVS_Player_EnterPipe_Intro))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_JumpStance)
|
||||
EVT_WAIT(10)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Jump)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Luigi, SOUND_JUMP_2081, 0)
|
||||
EVT_WAIT(7)
|
||||
EVT_WAIT(7)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Scene_Luigi, ANIM_Luigi_Idle)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Scene_Luigi, SOUND_SOFT_LAND, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Scene_Luigi, EVT_FLOAT(1.0))
|
||||
EVT_CALL(NpcJump0, NPC_Scene_Luigi, 594, 30, -216, 15)
|
||||
EVT_EXEC_WAIT(N(EVS_Luigi_EnterPipe_Intro))
|
||||
EVT_EXEC(N(EVS_FadeOutAmbientSounds))
|
||||
EVT_CALL(GotoMap, EVT_PTR("mac_00"), mac_00_ENTRY_5)
|
||||
EVT_WAIT(100)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
332
src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c
Normal file
332
src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c
Normal file
@ -0,0 +1,332 @@
|
||||
#include "kmr_20.h"
|
||||
#include "model.h"
|
||||
|
||||
#define NAME_SUFFIX _Epilogue
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#include "world/common/entity/Pipe.data.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
API_CALLABLE(N(func_80242030_8EDE50)) {
|
||||
func_8011B950(MODEL_g62, -1, 0, 1);
|
||||
set_background_color_blend(0, 0, 0, 0);
|
||||
|
||||
gCameras[CAM_DEFAULT].bgColor[0] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[1] = 0;
|
||||
gCameras[CAM_DEFAULT].bgColor[2] = 0;
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(func_80242084_8EDEA4)) {
|
||||
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;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(func_802420EC_8EDF0C)) {
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[1] = 255;
|
||||
}
|
||||
|
||||
script->functionTemp[1] -= 16;
|
||||
if (script->functionTemp[1] <= 0) {
|
||||
script->functionTemp[1] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
set_screen_overlay_params_front(0, script->functionTemp[1]);
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeHalf_Epilogue)) {
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeFull_Epilogue)) {
|
||||
au_ambience_set_volume(0, 1000, 127);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Luigi_PlayWalkSounds_Epilogue) = {
|
||||
EVT_CALL(GetNpcAnimation, NPC_Luigi_1, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_Walk)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_WalkLetter)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_WalkBack)
|
||||
EVT_SET(LVar1, 10)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_Run)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_RunLetter)
|
||||
EVT_CASE_OR_EQ(ANIM_Luigi_RunBack)
|
||||
EVT_SET(LVar1, 5)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_END_SWITCH
|
||||
EVT_CHILD_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_B0000019, 0)
|
||||
EVT_WAIT(LVar1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_CHILD_THREAD
|
||||
EVT_LOOP(0)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenFrontDoor) = {
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o246, SOUND_BASIC_DOOR_OPEN, 0)
|
||||
EVT_CALL(MakeLerp, 0, 90, 10, EASING_QUADRATIC_OUT)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g14, LVar0, 0, 1, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_CloseFrontDoor) = {
|
||||
EVT_CALL(MakeLerp, 90, 0, 10, EASING_QUADRATIC_IN)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g14, LVar0, 0, 1, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o246, SOUND_BASIC_DOOR_CLOSE, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_OpenAndCloseDoor_Epilogue) = {
|
||||
EVT_CALL(EnableGroup, MODEL_g72, TRUE)
|
||||
EVT_EXEC_WAIT(N(EVS_OpenFrontDoor))
|
||||
EVT_WAIT(30)
|
||||
EVT_EXEC_WAIT(N(EVS_CloseFrontDoor))
|
||||
EVT_CALL(EnableGroup, MODEL_g72, TRUE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Player_EnterPipe_Epilogue) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(HidePlayerShadow, TRUE)
|
||||
EVT_SET(LVar0, 4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Epilogue))
|
||||
EVT_CALL(PlayerMoveTo, LVar1, LVar3, 3)
|
||||
EVT_SET(LVar0, 4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Epilogue))
|
||||
EVT_CALL(SetPlayerPos, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(PlaySoundAtPlayer, SOUND_ENTER_PIPE, 0)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(4)
|
||||
EVT_LOOP(40)
|
||||
EVT_SUB(LVar1, 1)
|
||||
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802D286C, 0x00000800)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_10002, FOLD_TYPE_5, 2, 1, 1, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Luigi_EnterPipe_Epilogue) = {
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_GRAVITY, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_ENABLE_HIT_SCRIPT, TRUE)
|
||||
EVT_CALL(EnableNpcShadow, NPC_Luigi_1, FALSE)
|
||||
EVT_SET(LVar0, 4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Epilogue))
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, LVar1, LVar3, 3)
|
||||
EVT_SET(LVar0, 4)
|
||||
EVT_CALL(N(Pipe_GetEntryPos_Epilogue))
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_1, LVar1, LVar2, LVar3)
|
||||
EVT_WAIT(2)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_ENTER_PIPE, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Still)
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_ADD(LVar1, 7)
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_LOOP(40)
|
||||
EVT_SUB(LVar1, 1)
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802CFE2C, NPC_Luigi_1, 0x00000800)
|
||||
EVT_CALL(func_802CFD30, NPC_Luigi_1, FOLD_TYPE_5, 2, 1, 1, 0)
|
||||
EVT_WAIT(25)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_BeginEpilogue) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Epilogue))
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80024)
|
||||
EVT_CALL(SetPlayerPos, 95, 44, -40)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 150, 44, -40)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 150, 44, -40)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-6.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_TalkSit, ANIM_Luigi_IdleSit, 0, MSG_Outro_000D)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80025)
|
||||
EVT_WAIT(20)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_TalkSit, ANIM_Luigi_IdleSit, 0, MSG_Outro_000E)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(GotoMap, EVT_PTR("kmr_02"), kmr_02_ENTRY_4)
|
||||
EVT_WAIT(100)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Scene_EpilogueGetLetter) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Epilogue))
|
||||
EVT_CALL(SetPlayerPos, 95, 44, -40)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80024)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 150, 44, -40)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 150, 44, -40)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-6.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_WAIT(35)
|
||||
EVT_CALL(PlaySoundAt, SOUND_E0, 0, 430, 0, -185)
|
||||
EVT_WAIT(25)
|
||||
EVT_CALL(PlaySoundAtPlayer, SOUND_263, 0)
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_0, EMOTE_QUESTION, 0, 20, FALSE, 0, 0, 0, 0)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_263, 0)
|
||||
EVT_CALL(ShowEmote, NPC_Luigi_1, EMOTE_QUESTION, 0, 20, TRUE, 0, 0, 0, 0)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_TalkSit, ANIM_Luigi_IdleSit, 0, MSG_Outro_0021)
|
||||
EVT_WAIT(10)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Luigi_1, EVT_FLOAT(1.0))
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_1, 180, 30, -20, 10)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Jump)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_JUMP_2081, 0)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Fall)
|
||||
EVT_WAIT(5)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Land)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_SOFT_LAND, 0)
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Walk)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Epilogue), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 240, -20, 30)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_WalkBack)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 240, -80, 30)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_WAIT(10)
|
||||
EVT_EXEC(N(EVS_OpenFrontDoor))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Walk)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Epilogue), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 300, -80, 30)
|
||||
EVT_EXEC_WAIT(N(EVS_CloseFrontDoor))
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_WAIT(90)
|
||||
EVT_CALL(SetNpcYaw, NPC_Luigi_1, 270)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_WalkLetter)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Epilogue), LVarA)
|
||||
EVT_EXEC(N(EVS_OpenFrontDoor))
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 240, -80, 30)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_IdleLetter)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_EXEC_WAIT(N(EVS_CloseFrontDoor))
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SpeakToPlayer, NPC_Luigi_1, ANIM_Luigi_TalkLetter, ANIM_Luigi_IdleLetter, 0, MSG_Outro_0022)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(N(func_80242084_8EDEA4))
|
||||
EVT_CALL(EnableGroup, MODEL_g20, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g21, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g49, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_g56, FALSE)
|
||||
EVT_CALL(N(func_80242030_8EDE50))
|
||||
EVT_CALL(RotateGroup, MODEL_g60, 0, 1, 0, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g34, 0, -1, 0, 0)
|
||||
EVT_CALL(EnableGroup, MODEL_g60, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g34, TRUE)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 340, 30, -70)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, 340, 30, -70)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(SetPlayerPos, 240, 30, -75)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcPos, NPC_Luigi_1, 200, 30, -75)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(N(func_802420EC_8EDF0C))
|
||||
EVT_CALL(N(SetAmbienceVolumeFull_Epilogue))
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_PEACHS_CASTLE_PARTY, 0, 8)
|
||||
EVT_EXEC(N(EVS_OpenAndCloseDoor_Epilogue))
|
||||
EVT_THREAD
|
||||
EVT_WAIT(10)
|
||||
EVT_CALL(SetNpcSpeed, NPC_Luigi_1, EVT_FLOAT(3.0))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Run)
|
||||
EVT_EXEC_GET_TID(N(EVS_Luigi_PlayWalkSounds_Epilogue), LVarA)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 320, -70, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 460, -70, 0)
|
||||
EVT_CALL(NpcMoveTo, NPC_Luigi_1, 570, -170, 0)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(func_802D1270, 320, -70, EVT_FLOAT(3.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(func_802D1270, 460, -70, EVT_FLOAT(3.0))
|
||||
EVT_CALL(func_802D1270, 570, -170, EVT_FLOAT(3.0))
|
||||
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(1.0))
|
||||
EVT_CALL(PlayerJump, 594, 30, -216, 15)
|
||||
EVT_EXEC_WAIT(N(EVS_Player_EnterPipe_Epilogue))
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_JumpStance)
|
||||
EVT_WAIT(10)
|
||||
EVT_THREAD
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Jump)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_JUMP_2081, 0)
|
||||
EVT_WAIT(7)
|
||||
EVT_WAIT(7)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_CALL(PlaySoundAtNpc, NPC_Luigi_1, SOUND_SOFT_LAND, 0)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Luigi_1, EVT_FLOAT(1.0))
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_1, 594, 30, -216, 15)
|
||||
EVT_EXEC_WAIT(N(EVS_Luigi_EnterPipe_Epilogue))
|
||||
EVT_EXEC(N(EVS_FadeOutAmbientSounds))
|
||||
EVT_CALL(GotoMap, EVT_PTR("mac_00"), mac_00_ENTRY_7)
|
||||
EVT_WAIT(100)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
MAP_RODATA_PAD(1,unk)
|
255
src/world/area_kmr/kmr_20/kmr_20_13_records.c
Normal file
255
src/world/area_kmr/kmr_20/kmr_20_13_records.c
Normal file
@ -0,0 +1,255 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#include "world/area_kmr/kmr_20/records_screen.gfx.inc.c"
|
||||
|
||||
enum {
|
||||
RECORDS_STATE_BEGIN_FADE_IN = 0,
|
||||
RECORDS_STATE_FADING_IN = 1,
|
||||
RECORDS_STATE_IDLE = 2,
|
||||
RECORDS_STATE_BEGIN_FADE_OUT = 3,
|
||||
RECORDS_STATE_FADING_OUT = 4,
|
||||
RECORDS_STATE_DONE = 5,
|
||||
};
|
||||
|
||||
typedef struct GameRecords {
|
||||
/* 0x00 */ u16 state;
|
||||
/* 0x02 */ char unk_02[0x2];
|
||||
/* 0x04 */ s32 lerpTime;
|
||||
/* 0x08 */ s16 unk_08;
|
||||
/* 0x0A */ s16 unk_0A;
|
||||
/* 0x0C */ char unk_0C[0xC];
|
||||
/* 0x18 */ s16 unk_18;
|
||||
/* 0x1A */ s16 alpha;
|
||||
/* 0x1C */ s16 lastAlpha;
|
||||
/* 0x1E */ char unk_1E[0x2];
|
||||
/* 0x20 */ s32 workerID;
|
||||
/* 0x24 */ u16 equippedBadges;
|
||||
/* 0x26 */ s16 recipesFoundCount;
|
||||
/* 0x28 */ s16 totalRecipesCount;
|
||||
} GameRecords;
|
||||
|
||||
s32 N(RecipeFoundVars)[] = {
|
||||
GF_MAC02_DiscoveredRecipe_00, GF_MAC02_DiscoveredRecipe_01,
|
||||
GF_MAC02_DiscoveredRecipe_02, GF_MAC02_DiscoveredRecipe_03,
|
||||
GF_MAC02_DiscoveredRecipe_04, GF_MAC02_DiscoveredRecipe_05,
|
||||
GF_MAC02_DiscoveredRecipe_06, GF_MAC02_DiscoveredRecipe_07,
|
||||
GF_MAC02_DiscoveredRecipe_08, GF_MAC02_DiscoveredRecipe_09,
|
||||
GF_MAC02_DiscoveredRecipe_0A, GF_MAC02_DiscoveredRecipe_0B,
|
||||
GF_MAC02_DiscoveredRecipe_0C, GF_MAC02_DiscoveredRecipe_0D,
|
||||
GF_MAC02_DiscoveredRecipe_0E, GF_MAC02_DiscoveredRecipe_0F,
|
||||
GF_MAC02_DiscoveredRecipe_10, GF_MAC02_DiscoveredRecipe_11,
|
||||
GF_MAC02_DiscoveredRecipe_13, GF_MAC02_DiscoveredRecipe_14,
|
||||
GF_MAC02_DiscoveredRecipe_15, GF_MAC02_DiscoveredRecipe_16,
|
||||
GF_MAC02_DiscoveredRecipe_17, GF_MAC02_DiscoveredRecipe_18,
|
||||
GF_MAC02_DiscoveredRecipe_19, GF_MAC02_DiscoveredRecipe_1A,
|
||||
GF_MAC02_DiscoveredRecipe_1B, GF_MAC02_DiscoveredRecipe_1C,
|
||||
GF_MAC02_DiscoveredRecipe_1D, GF_MAC02_DiscoveredRecipe_1E,
|
||||
GF_MAC02_DiscoveredRecipe_1F, GF_MAC02_DiscoveredRecipe_20,
|
||||
GF_MAC02_DiscoveredRecipe_21, GF_MAC02_DiscoveredRecipe_22,
|
||||
GF_MAC02_DiscoveredRecipe_23, GF_MAC02_DiscoveredRecipe_24,
|
||||
GF_MAC02_DiscoveredRecipe_25, GF_MAC02_DiscoveredRecipe_26,
|
||||
GF_MAC02_DiscoveredRecipe_27, GF_MAC02_DiscoveredRecipe_28,
|
||||
GF_MAC02_DiscoveredRecipe_29, GF_MAC02_DiscoveredRecipe_2A,
|
||||
GF_MAC02_DiscoveredRecipe_2B, GF_MAC02_DiscoveredRecipe_2C,
|
||||
GF_MAC02_DiscoveredRecipe_2D, GF_MAC02_DiscoveredRecipe_2F,
|
||||
GF_MAC02_DiscoveredRecipe_30, GF_MAC02_DiscoveredRecipe_31,
|
||||
GF_MAC02_DiscoveredRecipe_32, GF_MAC02_DiscoveredRecipe_33,
|
||||
0
|
||||
};
|
||||
|
||||
void N(appendGfx_records_impl)(GameRecords* records, s32 alpha) {
|
||||
s32 width;
|
||||
|
||||
if (alpha > 0) {
|
||||
gSPDisplayList(gMasterGfxPos++, N(records_screen_gfx));
|
||||
gDPPipeSync(gMasterGfxPos++);
|
||||
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 16, 120, 24, alpha * 0.65);
|
||||
gDPFillRectangle(gMasterGfxPos++, 33, 43, 287, 192);
|
||||
gDPPipeSync(gMasterGfxPos++);
|
||||
|
||||
msg_draw_frame(30, 40, 260, 155, MSG_STYLE_INSPECT, MSG_PAL_WHITE, TRUE, alpha * 0.55, alpha);
|
||||
draw_msg(MSG_CH0_00FC, 206 - get_msg_width(MSG_CH0_00FC, 0), 50, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.totalCoinsEarned, 216, 51, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
draw_msg(MSG_CH0_00FD, 206 - get_msg_width(MSG_CH0_00FD, 0), 65, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(records->equippedBadges, 231, 66, 1, MSG_PAL_WHITE, alpha, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 63, alpha, MSG_PAL_WHITE, 0);
|
||||
draw_number(80, 244, 66, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
if (gPlayerData.starPiecesCollected == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 80, alpha, MSG_PAL_WHITE, 1);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FB, 206 - get_msg_width(MSG_CH0_00FB, 0), 80, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.starPiecesCollected, 231, 81, 1, MSG_PAL_WHITE, alpha, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 78, alpha, MSG_PAL_WHITE, 0);
|
||||
draw_number(160, 244, 80, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
}
|
||||
|
||||
width = get_msg_width(MSG_CH0_00FE, 0);
|
||||
if (records->recipesFoundCount == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 110, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
} else {
|
||||
if (records->recipesFoundCount == -1) {
|
||||
draw_msg(MSG_CH0_00FE, 206 - width, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(0, 231, 96, 1, MSG_PAL_WHITE, alpha, 3);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FE, 206 - width, 95, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(records->recipesFoundCount, 231, 96, 1, MSG_PAL_WHITE, alpha, 3);
|
||||
}
|
||||
draw_msg(MSG_MenuTip_0034, 232, 93, alpha, MSG_PAL_WHITE, 0);
|
||||
draw_number(records->totalRecipesCount, 244, 95, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
}
|
||||
|
||||
if (gPlayerData.quizzesAnswered == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 110, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00FF, 206 - get_msg_width(MSG_CH0_00FF, 0), 110, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.quizzesCorrect, 231, 111, 1, MSG_PAL_WHITE, alpha, 3);
|
||||
draw_msg(MSG_MenuTip_0034, 232, 108, alpha, MSG_PAL_WHITE, 0);
|
||||
draw_number(gPlayerData.quizzesAnswered, 244, 111, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
}
|
||||
|
||||
draw_msg(MSG_CH0_00F4, 206 - get_msg_width(MSG_CH0_00F4, 0), 125, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.battlesCount, 216, 126, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
width = get_msg_width(MSG_CH0_00F7, 0);
|
||||
draw_msg(MSG_CH0_00F7, 206 - width, 140, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.playerFirstStrikes, 216, 141, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
draw_msg(MSG_CH0_00F8, 206 - get_msg_width(MSG_CH0_00F8, 0), 155, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.enemyFirstStrikes, 216, 156, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
|
||||
if (gPlayerData.powerBounces == 0) {
|
||||
draw_msg(MSG_CH0_00FA, 109, 170, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
} else {
|
||||
draw_msg(MSG_CH0_00F9, 206 - get_msg_width(MSG_CH0_00F9, 0), 170, alpha, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
|
||||
draw_number(gPlayerData.powerBounces, 216, 171, 1, MSG_PAL_WHITE, alpha, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void N(appendGfx_records)(void* data) {
|
||||
GameRecords* records = (GameRecords*) evt_get_variable(NULL, MV_RecordsDataPtr);
|
||||
|
||||
switch (records->state) {
|
||||
case RECORDS_STATE_BEGIN_FADE_IN:
|
||||
records->unk_18 = 0;
|
||||
records->unk_08 = 0;
|
||||
records->unk_0A = 0;
|
||||
records->lerpTime = 0;
|
||||
records->state = RECORDS_STATE_FADING_IN;
|
||||
snd_start_sound(SOUND_21C, 0, 0);
|
||||
// fallthrough
|
||||
case RECORDS_STATE_FADING_IN:
|
||||
records->lerpTime++;
|
||||
records->alpha = update_lerp(0, 32.0f, 255.0f, records->lerpTime, 3);
|
||||
records->lastAlpha = records->alpha;
|
||||
if (records->lerpTime >= 3) {
|
||||
records->state = RECORDS_STATE_IDLE;
|
||||
records->alpha = 255;
|
||||
records->lastAlpha = records->alpha;
|
||||
}
|
||||
break;
|
||||
case RECORDS_STATE_IDLE:
|
||||
records->alpha = 255;
|
||||
records->lastAlpha = records->alpha;
|
||||
if (gGameStatusPtr->currentButtons[0] & (BUTTON_A | BUTTON_B)) {
|
||||
records->state = RECORDS_STATE_BEGIN_FADE_OUT;
|
||||
}
|
||||
if (records->state != RECORDS_STATE_BEGIN_FADE_OUT) {
|
||||
break;
|
||||
}
|
||||
case RECORDS_STATE_BEGIN_FADE_OUT:
|
||||
records->lerpTime = 0;
|
||||
records->state = RECORDS_STATE_FADING_OUT;
|
||||
snd_start_sound(SOUND_MENU_BACK, 0, 0);
|
||||
// fallthrough
|
||||
case RECORDS_STATE_FADING_OUT:
|
||||
records->lerpTime++;
|
||||
records->alpha = update_lerp(0, records->lastAlpha, 0.0f, records->lerpTime, 3);
|
||||
if (records->lerpTime >= 3) {
|
||||
records->state = RECORDS_STATE_DONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
N(appendGfx_records_impl)(records, records->alpha);
|
||||
}
|
||||
|
||||
void N(worker_draw_game_records)(void) {
|
||||
RenderTask rt;
|
||||
|
||||
rt.renderMode = RENDER_MODE_2D;
|
||||
rt.appendGfxArg = NULL;
|
||||
rt.appendGfx = N(appendGfx_records);
|
||||
rt.distance = 0;
|
||||
queue_render_task(&rt);
|
||||
}
|
||||
|
||||
void N(calculate_records)(GameRecords* records) {
|
||||
PlayerData* playerData = &gPlayerData;
|
||||
s32 count;
|
||||
s32 i;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
|
||||
if (playerData->badges[i] != 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
records->equippedBadges = count;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; TRUE; i++) {
|
||||
if (N(RecipeFoundVars)[i] != 0) {
|
||||
if (evt_get_variable(NULL, N(RecipeFoundVars)[i]) != 0) {
|
||||
count++;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
records->totalRecipesCount = i;
|
||||
records->recipesFoundCount = count;
|
||||
if (records->recipesFoundCount == 0 && evt_get_variable(NULL, GF_MAC02_DiscoveredRecipe_12)) {
|
||||
records->recipesFoundCount = -1;
|
||||
}
|
||||
}
|
||||
|
||||
API_CALLABLE(N(ShowGameRecords)) {
|
||||
GameRecords* records;
|
||||
|
||||
if (isInitialCall) {
|
||||
records = script->functionTempPtr[0] = heap_malloc(sizeof(*records));
|
||||
records->state = RECORDS_STATE_BEGIN_FADE_IN;
|
||||
records->alpha = 255;
|
||||
records->workerID = create_worker_world(0, N(worker_draw_game_records));
|
||||
evt_set_variable(script, MV_RecordsDataPtr, (s32) records);
|
||||
N(calculate_records)(records);
|
||||
}
|
||||
|
||||
records = script->functionTempPtr[0];
|
||||
if (records->state == RECORDS_STATE_DONE) {
|
||||
free_worker(records->workerID);
|
||||
heap_free(records);
|
||||
return ApiStatus_DONE1;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Inspect_Records) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(GetPlayerPos, LVarA, LVarB, LVarC)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVarA, 30, LVarC)
|
||||
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVarA, 30, LVarC)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(320.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.2))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
|
||||
EVT_CALL(N(ShowGameRecords))
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(400.0))
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.2))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
43
src/world/area_kmr/kmr_20/kmr_20_1_music.c
Normal file
43
src/world/area_kmr/kmr_20/kmr_20_1_music.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
API_CALLABLE(N(FadeOutAmbientSounds)){
|
||||
snd_ambient_slow_fade_out(0, 500);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_SetupMusic) = {
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_EQ(STORY_INTRO)
|
||||
EVT_CALL(FadeOutMusic, 0, 500)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_GE(STORY_EPILOGUE)
|
||||
EVT_CALL(FadeOutMusic, 0, 500)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_MARIO_BROS_HOUSE, 0, 8)
|
||||
EVT_END_SWITCH
|
||||
EVT_THREAD
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_0)
|
||||
EVT_WAIT(300)
|
||||
EVT_CALL(PlayAmbientSounds, AMBIENT_BIRDS)
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(PlayAmbientSounds, AMBIENT_BIRDS)
|
||||
EVT_END_SWITCH
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_PlayRestingSong) = {
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_TAKING_REST, 0, 8)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_FadeOutAmbientSounds) = {
|
||||
EVT_CALL(N(FadeOutAmbientSounds))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
106
src/world/area_kmr/kmr_20/kmr_20_2_main.c
Normal file
106
src/world/area_kmr/kmr_20/kmr_20_2_main.c
Normal file
@ -0,0 +1,106 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#include "world/common/entity/Pipe.inc.c"
|
||||
#include "world/common/entity/Pipe.data.inc.c"
|
||||
|
||||
API_CALLABLE(N(func_80240310_8EC130)){
|
||||
set_map_transition_effect(TRANSITION_4);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_GotoMap_mac_00_4) = {
|
||||
EVT_EXEC(N(EVS_FadeOutAmbientSounds))
|
||||
EVT_CALL(GotoMap, EVT_PTR("mac_00"), mac_00_ENTRY_4)
|
||||
EVT_WAIT(100)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ExitPipe_mac_00_4) = {
|
||||
EVT_SET_GROUP(EVT_GROUP_1B)
|
||||
EVT_SET(LVarA, kmr_20_ENTRY_4)
|
||||
EVT_SET(LVarB, COLLIDER_o244)
|
||||
EVT_SET(LVarC, EVT_PTR(N(EVS_GotoMap_mac_00_4)))
|
||||
EVT_EXEC_WAIT(N(EVS_Pipe_ExitVertical))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_BindExitTriggers) = {
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitPipe_mac_00_4)), TRIGGER_FLOOR_TOUCH, COLLIDER_o244, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Main) = {
|
||||
EVT_SET(GB_WorldLocation, LOCATION_MARIOS_HOUSE)
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_EQ(LVar0, kmr_20_ENTRY_2)
|
||||
EVT_SET(GB_StoryProgress, STORY_EPILOGUE)
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_EQ(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_SET(MF_LuigiWaiting, FALSE)
|
||||
EVT_IF_EQ(GF_KMR20_ReunitedWithLuigi, FALSE)
|
||||
EVT_SET(GF_KMR20_ReunitedWithLuigi, TRUE)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH3_INVITED_TO_BOOS_MANSION)
|
||||
EVT_SET(MF_LuigiWaiting, TRUE)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_SET(MF_Unk_0C, FALSE)
|
||||
EVT_CALL(SetSpriteShading, SHADING_NONE)
|
||||
EVT_SETUP_CAMERA_NO_LEAD()
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_IF_LT(LVar0, kmr_20_ENTRY_4)
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(SceneNPCs)))
|
||||
EVT_ELSE
|
||||
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
|
||||
EVT_END_IF
|
||||
EVT_EXEC_WAIT(N(EVS_MakeEntities))
|
||||
EVT_CALL(EnableGroup, MODEL_g100, FALSE)
|
||||
EVT_EXEC(N(EVS_SetupTrees))
|
||||
EVT_EXEC(N(EVS_SetupBushes))
|
||||
EVT_EXEC(N(EVS_SetupRooms))
|
||||
EVT_EXEC(N(EVS_Setup_Interactables))
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_EPILOGUE)
|
||||
EVT_EXEC(N(EVS_SetupBed))
|
||||
EVT_END_IF
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_0)
|
||||
EVT_CALL(N(func_80240310_8EC130))
|
||||
EVT_EXEC(N(EVS_Scene_BeginGame))
|
||||
EVT_WAIT(5)
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_1)
|
||||
EVT_EXEC(N(EVS_Scene_SettingOff))
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_2)
|
||||
EVT_WAIT(60)
|
||||
EVT_EXEC(N(EVS_Scene_BeginEpilogue))
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_3)
|
||||
EVT_EXEC(N(EVS_BindExitTriggers))
|
||||
EVT_EXEC(N(EVS_Scene_EpilogueGetLetter))
|
||||
EVT_CASE_EQ(kmr_20_ENTRY_4)
|
||||
EVT_SET(GF_MAP_MariosHouse, TRUE)
|
||||
EVT_IF_EQ(MF_LuigiWaiting, TRUE)
|
||||
EVT_EXEC(N(EVS_Scene_LuigiWaitingAround))
|
||||
EVT_THREAD
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(SetPlayerPos, NPC_DISPOSE_LOCATION)
|
||||
EVT_LABEL(0)
|
||||
EVT_IF_EQ(MF_ReadyForPlayerEntry, FALSE)
|
||||
EVT_WAIT(1)
|
||||
EVT_GOTO(0)
|
||||
EVT_END_IF
|
||||
EVT_SET(LVarA, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC(N(EVS_Pipe_EnterVertical))
|
||||
EVT_END_THREAD
|
||||
EVT_ELSE
|
||||
EVT_SET(LVarA, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC(N(EVS_Pipe_EnterVertical))
|
||||
EVT_END_IF
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
102
src/world/area_kmr/kmr_20/kmr_20_3_rooms.c
Normal file
102
src/world/area_kmr/kmr_20/kmr_20_3_rooms.c
Normal file
@ -0,0 +1,102 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeHalf_Rooms)){
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeFull_Rooms)){
|
||||
au_ambience_set_volume(0, 1000, 127);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_SetDoorRot_House) = {
|
||||
EVT_CALL(RotateGroup, MODEL_g14, LVar0, 0, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MoveWalls_House) = {
|
||||
EVT_CALL(RotateGroup, MODEL_g60, LVar0, 1, 0, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g34, LVar0, -1, 0, 0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(90)
|
||||
EVT_SET(MF_Unk_0C, TRUE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_2, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g60, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g34, FALSE)
|
||||
EVT_CASE_EQ(0)
|
||||
EVT_IF_EQ(MF_Unk_0C, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g72, TRUE)
|
||||
EVT_SET(MF_Unk_0C, FALSE)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_0, NPC_FLAG_2, TRUE)
|
||||
EVT_END_IF
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_CALL(EnableGroup, MODEL_g60, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g34, TRUE)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToggleVis_House) = {
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(0)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Rooms))
|
||||
EVT_CALL(EnableGroup, MODEL_g20, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g21, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g49, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_g56, TRUE)
|
||||
EVT_CASE_EQ(1)
|
||||
EVT_CASE_EQ(2)
|
||||
EVT_CASE_EQ(3)
|
||||
EVT_CALL(N(SetAmbienceVolumeFull_Rooms))
|
||||
EVT_CALL(EnableGroup, MODEL_g20, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g21, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g49, FALSE)
|
||||
EVT_CALL(EnableModel, MODEL_g56, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g72, FALSE)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
s32 N(InteriorNPCs_House)[] = {
|
||||
NPC_Luigi_0,
|
||||
-1
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupRooms) = {
|
||||
EVT_CALL(MakeDoorAdvanced,
|
||||
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_0),
|
||||
EVT_PTR(N(EVS_SetDoorRot_House)),
|
||||
EVT_PTR(N(EVS_MoveWalls_House)),
|
||||
NULL,
|
||||
EVT_PTR(N(EVS_ToggleVis_House)),
|
||||
COLLIDER_o246,
|
||||
COLLIDER_o245,
|
||||
MODEL_g62,
|
||||
EVT_PTR(N(InteriorNPCs_House)))
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_OR_EQ(kmr_20_ENTRY_2)
|
||||
EVT_CASE_OR_EQ(kmr_20_ENTRY_3)
|
||||
EVT_CALL(EnableGroup, MODEL_g20, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g21, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g49, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_g56, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_g72, FALSE)
|
||||
EVT_CALL(N(func_80241C9C_8EDABC))
|
||||
EVT_CALL(RotateGroup, MODEL_g60, 90, 1, 0, 0)
|
||||
EVT_CALL(RotateGroup, MODEL_g34, 90, -1, 0, 0)
|
||||
EVT_CALL(EnableGroup, MODEL_g60, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_g34, FALSE)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Rooms))
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_CASE_DEFAULT
|
||||
EVT_SET(LVar0, 3)
|
||||
EVT_EXEC(N(EVS_ToggleVis_House))
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
538
src/world/area_kmr/kmr_20/kmr_20_4_documents.c
Normal file
538
src/world/area_kmr/kmr_20/kmr_20_4_documents.c
Normal file
@ -0,0 +1,538 @@
|
||||
#include "kmr_20.h"
|
||||
#include "hud_element.h"
|
||||
#include "ld_addrs.h"
|
||||
|
||||
#define PACKED_BYTE(base, i) \
|
||||
(i / 8) + EVT_INDEX_OF_GAME_BYTE(base)
|
||||
|
||||
#define GET_PACKED_FLAG(base, i) \
|
||||
get_global_byte((i / 8) + EVT_INDEX_OF_GAME_BYTE(base)) & (1 << (i % 8))
|
||||
|
||||
#define SET_PACKED_FLAG(base, i) \
|
||||
get_global_byte((i / 8) + EVT_INDEX_OF_GAME_BYTE(base)) | (1 << (i % 8))
|
||||
|
||||
extern HudScript HES_Item_Unused_08B;
|
||||
extern HudScript HES_Item_Unused_08B_disabled;
|
||||
extern HudScript HES_Item_Unused_08C;
|
||||
extern HudScript HES_Item_Unused_08C_disabled;
|
||||
|
||||
BSS PopupMenu N(ChooseDocumentPopupMenu);
|
||||
BSS IMG_BIN N(LetterBackgroundImg)[0x3D86];
|
||||
BSS PAL_BIN N(LetterBackgroundPal)[0x100];
|
||||
BSS char N(static_pad)[0x8]; // padding
|
||||
BSS IMG_BIN N(LetterPhotoImg)[0x3D86];
|
||||
BSS PAL_BIN N(N(LetterPhotoPal))[0x100];
|
||||
BSS s32 N(LetterWorkerID);
|
||||
BSS s32 N(LetterAlpha);
|
||||
BSS MessageImageData N(LetterImgData)[2];
|
||||
|
||||
#define NAME_SUFFIX _Unused
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
void N(worker_draw_letter)(void) {
|
||||
N(LetterAlpha) += 20;
|
||||
if (N(LetterAlpha) > 255) {
|
||||
N(LetterAlpha) = 255;
|
||||
}
|
||||
|
||||
draw_ci_image_with_clipping(N(LetterImgData)[0].raster,
|
||||
N(LetterImgData)[0].width, N(LetterImgData)[0].height,
|
||||
N(LetterImgData)[0].format, N(LetterImgData)[0].bitDepth,
|
||||
N(LetterImgData)[0].palette,
|
||||
85, 97,
|
||||
0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
N(LetterAlpha));
|
||||
|
||||
draw_ci_image_with_clipping(N(LetterImgData)[1].raster,
|
||||
N(LetterImgData)[1].width, N(LetterImgData)[1].height,
|
||||
N(LetterImgData)[1].format, N(LetterImgData)[1].bitDepth,
|
||||
N(LetterImgData)[1].palette,
|
||||
160, 102,
|
||||
0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
|
||||
N(LetterAlpha));
|
||||
}
|
||||
|
||||
s32 N(LetterStoryRequirements)[] = {
|
||||
STORY_INTRO,
|
||||
STORY_CH4_PULLED_SWITCH_SWITCH,
|
||||
STORY_CH1_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH2_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH3_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH3_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH4_STAR_SPIRIT_RESCUED,
|
||||
STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY,
|
||||
STORY_CH5_RETURNED_TO_TOAD_TOWN,
|
||||
STORY_CH6_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH4_GOT_TAYCE_TS_CAKE,
|
||||
STORY_CH7_STAR_SPIRIT_RESCUED,
|
||||
};
|
||||
|
||||
s32 N(LetterSenderStringIDs)[] = {
|
||||
MSG_Document_Letter_Mario01_From,
|
||||
MSG_Document_Letter_Mario02_From,
|
||||
MSG_Document_Letter_Mario03_From,
|
||||
MSG_Document_Letter_Mario04_From,
|
||||
MSG_Document_Letter_Mario05_From,
|
||||
MSG_Document_Letter_Mario06_From,
|
||||
MSG_Document_Letter_Mario07_From,
|
||||
MSG_Document_Letter_Mario08_From,
|
||||
MSG_Document_Letter_Mario09_From,
|
||||
MSG_Document_Letter_Mario10_From,
|
||||
MSG_Document_Letter_Mario11_From,
|
||||
MSG_Document_Letter_Mario12_From,
|
||||
};
|
||||
|
||||
s32 N(LetterBodyStringIDs)[] = {
|
||||
MSG_Document_Letter_Mario01_Body,
|
||||
MSG_Document_Letter_Mario02_Body,
|
||||
MSG_Document_Letter_Mario03_Body,
|
||||
MSG_Document_Letter_Mario04_Body,
|
||||
MSG_Document_Letter_Mario05_Body,
|
||||
MSG_Document_Letter_Mario06_Body,
|
||||
MSG_Document_Letter_Mario07_Body,
|
||||
MSG_Document_Letter_Mario08_Body,
|
||||
MSG_Document_Letter_Mario09_Body,
|
||||
MSG_Document_Letter_Mario10_Body,
|
||||
MSG_Document_Letter_Mario11_Body,
|
||||
MSG_Document_Letter_Mario12_Body,
|
||||
};
|
||||
|
||||
//TODO shiftability -- these are offsets relative to 0x10F1B0
|
||||
s32 N(LetterDmaOffsets)[] = {
|
||||
0x0000B290, 0x0000D158,
|
||||
0x0000D178, 0x0000EB78,
|
||||
0x0000ED78, 0x00010778,
|
||||
0x00010978, 0x00012378,
|
||||
0x00012578, 0x00013F78,
|
||||
0x00014178, 0x00015B78,
|
||||
0x00015D78, 0x00017778,
|
||||
0x00017978, 0x00019378,
|
||||
0x00019578, 0x0001AF78,
|
||||
0x0001B178, 0x0001CB78,
|
||||
0x0001CD78, 0x0001E778,
|
||||
0x0001E978, 0x00020378,
|
||||
0x00020578, 0x00021F78,
|
||||
};
|
||||
|
||||
API_CALLABLE(N(InitLetters)){
|
||||
script->functionTemp[3] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(ReadLetters)){
|
||||
PopupMenu* menu = &N(ChooseDocumentPopupMenu);
|
||||
s32 temp;
|
||||
s32 userIndex;
|
||||
s32 storyReq;
|
||||
s32 flags;
|
||||
s32 cond;
|
||||
s32 numEntries;
|
||||
s32 i;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
numEntries = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(N(LetterStoryRequirements)); i++) {
|
||||
cond = FALSE;
|
||||
storyReq = N(LetterStoryRequirements)[i];
|
||||
switch (storyReq) {
|
||||
case STORY_CH4_PULLED_SWITCH_SWITCH:
|
||||
if (gPlayerData.quizzesCorrect != 0) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
case STORY_CH4_GAVE_CAKE_TO_GOURMET_GUY:
|
||||
if (evt_get_variable(NULL, GF_MAC02_TayceT_HasCookbook) != 0) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
case STORY_CH4_GOT_TAYCE_TS_CAKE:
|
||||
temp = FALSE;
|
||||
if (evt_get_variable(NULL, GB_StoryProgress) >= STORY_CH4_BEGAN_PEACH_MISSION) {
|
||||
temp = (evt_get_variable(NULL, GF_MAC01_BoughtBadgeFromRowf) != 0);
|
||||
}
|
||||
if (temp) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (evt_get_variable(NULL, GB_StoryProgress) >= storyReq) {
|
||||
cond = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (cond) {
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08B;
|
||||
menu->userIndex[numEntries] = i;
|
||||
menu->enabled[numEntries] = TRUE;
|
||||
menu->nameMsg[numEntries] = N(LetterSenderStringIDs)[i];
|
||||
menu->descMsg[numEntries] = 0;
|
||||
temp = GET_PACKED_FLAG(GB_KMR20_MarioReadLetterFlags_00, i);
|
||||
|
||||
menu->value[numEntries] = 0;
|
||||
if (temp) {
|
||||
menu->value[numEntries] = 1;
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08B_disabled;
|
||||
}
|
||||
numEntries++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numEntries == 0) {
|
||||
script->varTable[0] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
menu->popupType = POPUP_MENU_READ_POSTCARD;
|
||||
menu->numEntries = numEntries;
|
||||
menu->initialPos = script->functionTemp[3];
|
||||
create_popup_menu(menu);
|
||||
status_menu_respond_to_changes();
|
||||
close_status_menu();
|
||||
script->functionTemp[1] = 0;
|
||||
script->functionTemp[0] = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (script->functionTemp[1] == 0) {
|
||||
script->functionTemp[2] = menu->result;
|
||||
if (script->functionTemp[2] != 0) {
|
||||
hide_popup_menu();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
script->functionTemp[1]++;
|
||||
if (script->functionTemp[1] >= 15) {
|
||||
destroy_popup_menu();
|
||||
if (script->functionTemp[2] == 255) {
|
||||
script->varTable[0] = -1;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
script->functionTemp[3] = script->functionTemp[2] - 1;
|
||||
userIndex = menu->userIndex[script->functionTemp[2] - 1];
|
||||
script->varTable[0] = N(LetterBodyStringIDs)[userIndex];
|
||||
|
||||
flags = SET_PACKED_FLAG(GB_KMR20_MarioReadLetterFlags_00, userIndex);
|
||||
set_global_byte(PACKED_BYTE(GB_KMR20_MarioReadLetterFlags_00, userIndex), flags);
|
||||
if (userIndex == 3) {
|
||||
evt_set_variable(NULL, GF_KMR20_ReadThankYouLetterFromKoopaVillage, TRUE);
|
||||
}
|
||||
|
||||
dma_copy(charset_ROM_START + N(LetterDmaOffsets)[0],
|
||||
charset_ROM_START + N(LetterDmaOffsets)[0] + sizeof(N(LetterBackgroundImg)),
|
||||
N(LetterBackgroundImg));
|
||||
dma_copy(charset_ROM_START + N(LetterDmaOffsets)[1],
|
||||
charset_ROM_START + N(LetterDmaOffsets)[1] + sizeof(N(LetterBackgroundPal)),
|
||||
N(LetterBackgroundPal));
|
||||
|
||||
N(LetterImgData)[0].raster = N(LetterBackgroundImg);
|
||||
N(LetterImgData)[0].palette = N(LetterBackgroundPal);
|
||||
N(LetterImgData)[0].width = 150;
|
||||
N(LetterImgData)[0].height = 105;
|
||||
N(LetterImgData)[0].format = G_IM_FMT_CI;
|
||||
N(LetterImgData)[0].bitDepth = G_IM_SIZ_4b;
|
||||
|
||||
dma_copy(charset_ROM_START + N(LetterDmaOffsets)[(userIndex * 2) + 2],
|
||||
charset_ROM_START + N(LetterDmaOffsets)[(userIndex * 2) + 2] + sizeof(N(LetterPhotoImg)),
|
||||
N(LetterPhotoImg));
|
||||
dma_copy(charset_ROM_START + N(LetterDmaOffsets)[(userIndex * 2) + 3],
|
||||
charset_ROM_START + N(LetterDmaOffsets)[(userIndex * 2) + 3] + sizeof(N(N(LetterPhotoPal))),
|
||||
N(N(LetterPhotoPal)));
|
||||
|
||||
N(LetterImgData)[1].raster = N(LetterPhotoImg);
|
||||
N(LetterImgData)[1].palette = N(N(LetterPhotoPal));
|
||||
N(LetterImgData)[1].width = 70;
|
||||
N(LetterImgData)[1].height = 95;
|
||||
N(LetterImgData)[1].format = G_IM_FMT_CI;
|
||||
N(LetterImgData)[1].bitDepth = G_IM_SIZ_8b;
|
||||
|
||||
N(LetterWorkerID) = create_worker_frontUI(NULL, N(worker_draw_letter));
|
||||
N(LetterAlpha) = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(CleanupLetters)){
|
||||
free_worker(N(LetterWorkerID));
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Inspect_Letters) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH0_TWINK_GAVE_LUCKY_STAR)
|
||||
EVT_SET(GF_KMR20_CheckedDeskForMail, TRUE)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_CH0_0102, 160, 40)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_ELSE
|
||||
EVT_IF_EQ(GF_KMR20_CheckedDeskForMail, FALSE)
|
||||
EVT_SET(GF_KMR20_CheckedDeskForMail, TRUE)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_CH0_0101, 160, 40)
|
||||
EVT_WAIT(5)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_CALL(N(InitLetters))
|
||||
EVT_LABEL(0)
|
||||
EVT_CALL(N(ReadLetters))
|
||||
EVT_IF_EQ(LVar0, -1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_IF_EQ(LVar0, 0)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(ShowMessageAtScreenPos, LVar0, 160, 40)
|
||||
EVT_CALL(N(CleanupLetters))
|
||||
EVT_GOTO(0)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
s32 N(DiaryStoryRequirements)[] = {
|
||||
STORY_CH3_GOT_SUPER_BOOTS,
|
||||
STORY_CH3_GOT_SUPER_BOOTS,
|
||||
STORY_CH4_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH4_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH5_TRADED_VASE_FOR_SEED,
|
||||
STORY_CH5_TRADED_VASE_FOR_SEED,
|
||||
STORY_CH6_RETURNED_TO_TOAD_TOWN,
|
||||
STORY_CH6_RETURNED_TO_TOAD_TOWN,
|
||||
STORY_CH7_STAR_SPRIT_DEPARTED,
|
||||
STORY_CH7_STAR_SPRIT_DEPARTED,
|
||||
STORY_EPILOGUE,
|
||||
STORY_EPILOGUE,
|
||||
};
|
||||
|
||||
s32 N(DiaryEntryStringIDs)[] = {
|
||||
MSG_Document_LuigisDiary_01,
|
||||
MSG_Document_LuigisDiary_02,
|
||||
MSG_Document_LuigisDiary_03,
|
||||
MSG_Document_LuigisDiary_04,
|
||||
MSG_Document_LuigisDiary_05,
|
||||
MSG_Document_LuigisDiary_06,
|
||||
MSG_Document_LuigisDiary_07,
|
||||
MSG_Document_LuigisDiary_08,
|
||||
MSG_Document_LuigisDiary_09,
|
||||
MSG_Document_LuigisDiary_10,
|
||||
MSG_Document_LuigisDiary_11,
|
||||
MSG_Document_LuigisDiary_12,
|
||||
};
|
||||
|
||||
API_CALLABLE(N(InitDiary)){
|
||||
script->functionTemp[3] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(ReadDiary)){
|
||||
PopupMenu* menu = &N(ChooseDocumentPopupMenu);
|
||||
s32 userIndex;
|
||||
s32 numEntries;
|
||||
s32 flags;
|
||||
s32 i;
|
||||
|
||||
if (isInitialCall) {
|
||||
script->functionTemp[0] = 0;
|
||||
}
|
||||
|
||||
switch (script->functionTemp[0]) {
|
||||
case 0:
|
||||
numEntries = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(N(DiaryStoryRequirements)); i++) {
|
||||
if (evt_get_variable(NULL, GB_StoryProgress) >= N(DiaryStoryRequirements)[i]) {
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08C;
|
||||
menu->userIndex[numEntries] = i;
|
||||
menu->enabled[numEntries] = TRUE;
|
||||
menu->nameMsg[numEntries] = 0;
|
||||
menu->descMsg[numEntries] = 0;
|
||||
flags = GET_PACKED_FLAG(GB_KMR20_MarioReadDiaryFlags_00, i);
|
||||
|
||||
menu->value[numEntries] = 0;
|
||||
if (flags) {
|
||||
menu->value[numEntries] = 1;
|
||||
menu->ptrIcon[numEntries] = &HES_Item_Unused_08C_disabled;
|
||||
}
|
||||
numEntries++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numEntries == 0) {
|
||||
script->varTable[0] = 0;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
menu->popupType = POPUP_MENU_READ_DIARY_PAGE;
|
||||
menu->numEntries = numEntries;
|
||||
menu->initialPos = script->functionTemp[3];
|
||||
create_popup_menu(menu);
|
||||
status_menu_respond_to_changes();
|
||||
close_status_menu();
|
||||
script->functionTemp[1] = 0;
|
||||
script->functionTemp[0] = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (script->functionTemp[1] == 0) {
|
||||
script->functionTemp[2] = menu->result;
|
||||
if (script->functionTemp[2] != 0) {
|
||||
hide_popup_menu();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
script->functionTemp[1]++;
|
||||
if (script->functionTemp[1] >= 15) {
|
||||
destroy_popup_menu();
|
||||
if (script->functionTemp[2] == 255) {
|
||||
script->varTable[0] = -1;
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
script->functionTemp[3] = script->functionTemp[2] - 1;
|
||||
userIndex = menu->userIndex[script->functionTemp[2] - 1];
|
||||
script->varTable[0] = N(DiaryEntryStringIDs)[userIndex];
|
||||
// separate lines required to match, cant combine macro
|
||||
flags = SET_PACKED_FLAG(GB_KMR20_MarioReadDiaryFlags_00, userIndex);
|
||||
set_global_byte(PACKED_BYTE(GB_KMR20_MarioReadDiaryFlags_00, userIndex), flags);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(MuteAmbienceVolume_Documents)){
|
||||
au_ambience_set_volume(0, 1000, 1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
EvtScript N(EVS_Inspect_LuigisDiary) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_IF_EQ(AF_KMR_0C, TRUE)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_CH0_00EC, 160, 40)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_IF_EQ(GF_KMR20_FoundLuigisDiary, FALSE)
|
||||
EVT_SET(GF_KMR20_FoundLuigisDiary, TRUE)
|
||||
EVT_CALL(ShowMessageAtScreenPos, MSG_CH0_0100, 160, 40)
|
||||
EVT_WAIT(5)
|
||||
EVT_END_IF
|
||||
EVT_CALL(N(InitDiary))
|
||||
EVT_LABEL(0)
|
||||
EVT_CALL(N(ReadDiary))
|
||||
EVT_IF_EQ(LVar0, -1)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_IF_EQ(LVar0, 0)
|
||||
EVT_GOTO(10)
|
||||
EVT_END_IF
|
||||
EVT_CALL(ShowMessageAtScreenPos, LVar0, 160, 40)
|
||||
EVT_GOTO(0)
|
||||
EVT_LABEL(10)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Shake_Mailbox) = {
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o305, SOUND_E0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -2, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, -2, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, -3, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, -1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(TranslateModel, MODEL_o222, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o223, 0, 0, 0)
|
||||
EVT_CALL(TranslateModel, MODEL_o224, 0, 0, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SecretPanel_Flip) = {
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o252, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o252, SOUND_20AB, 0)
|
||||
EVT_CALL(MakeLerp, 0, 2160, 60, EASING_QUADRATIC_OUT)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g61, LVar0, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o252, SOUND_20AC, 0)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o252, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Setup_SecretPanel) = {
|
||||
EVT_CALL(GetPlayerActionState, LVar0)
|
||||
EVT_IF_NE(LVar0, ACTION_STATE_SPIN_POUND)
|
||||
EVT_IF_NE(LVar0, ACTION_STATE_TORNADO_POUND)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(N(MuteAmbienceVolume_Documents))
|
||||
EVT_IF_LT(GB_StoryProgress, STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_IF_EQ(AF_KMR_0C, TRUE)
|
||||
EVT_CALL(EnableModel, MODEL_o200, FALSE)
|
||||
EVT_END_IF
|
||||
EVT_END_IF
|
||||
EVT_LOOP(0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(GetPlayerActionState, LVar0)
|
||||
EVT_IF_EQ(LVar0, ACTION_STATE_IDLE)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_EXEC(N(EVS_SecretPanel_Flip))
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(SetPlayerPos, -150, 30, -35)
|
||||
EVT_LOOP(0)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(GetPlayerActionState, LVar0)
|
||||
EVT_IF_EQ(LVar0, ACTION_STATE_IDLE)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_IF_EQ(MF_LuigiInBasement, TRUE)
|
||||
EVT_SET(MF_LuigiInBasement, FALSE)
|
||||
EVT_EXEC(N(EVS_Scene_CaughtLuigiInBasement))
|
||||
EVT_END_IF
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Setup_Interactables) = {
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Inspect_Letters)), TRIGGER_WALL_PRESS_A, COLLIDER_o251, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Inspect_LuigisDiary)), TRIGGER_WALL_PRESS_A, COLLIDER_o240, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Shake_Mailbox)), TRIGGER_WALL_PRESS_A, COLLIDER_o305, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Setup_SecretPanel)), TRIGGER_FLOOR_TOUCH, COLLIDER_o252, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Inspect_Records)), TRIGGER_WALL_PRESS_A, COLLIDER_o355, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
146
src/world/area_kmr/kmr_20/kmr_20_5_entity.c
Normal file
146
src/world/area_kmr/kmr_20/kmr_20_5_entity.c
Normal file
@ -0,0 +1,146 @@
|
||||
#include "kmr_20.h"
|
||||
#include "entity.h"
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeHalf_Entity)){
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/UnsetCamera0MoveFlag1.inc.c"
|
||||
|
||||
EvtScript N(EVS_SecretPanel_FlipBack) = {
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o252, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o252, SOUND_20AB, 0)
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Entity))
|
||||
EVT_CALL(MakeLerp, 0, -2160, 60, EASING_QUADRATIC_OUT)
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(RotateGroup, MODEL_g61, LVar0, 1, 0, 0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_BREAK_LOOP
|
||||
EVT_END_IF
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(PlaySoundAtCollider, COLLIDER_o252, SOUND_20AC, 0)
|
||||
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o252, COLLIDER_FLAGS_UPPER_MASK)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_TetherCamToPlayer) = {
|
||||
EVT_LOOP(0)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(SetCamTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_END_LOOP
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_UseSpring_Basement) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(SetPlayerActionState, ACTION_STATE_JUMP)
|
||||
EVT_WAIT(1)
|
||||
EVT_EXEC_GET_TID(N(EVS_TetherCamToPlayer), LVarA)
|
||||
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.7))
|
||||
EVT_IF_EQ(AF_KMR_0B, FALSE)
|
||||
EVT_CALL(PlayerJump, -110, -80, -35, 20)
|
||||
EVT_SET(AF_KMR_0B, TRUE)
|
||||
EVT_ELSE
|
||||
EVT_CALL(N(UnsetCamera0MoveFlag1))
|
||||
EVT_EXEC(N(EVS_SecretPanel_FlipBack))
|
||||
EVT_CALL(PlayerJump, -150, 30, -90, 30)
|
||||
EVT_CALL(InterpPlayerYaw, 180, 0)
|
||||
EVT_SET(AF_KMR_0B, FALSE)
|
||||
EVT_END_IF
|
||||
EVT_WAIT(30)
|
||||
EVT_KILL_THREAD(LVarA)
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_CALL(SetPlayerActionState, ACTION_STATE_IDLE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Luigi_JumpFromBlock) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetEnemyFlagBits, NPC_Luigi_1, ENEMY_FLAGS_100, 0)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_GRAVITY, TRUE)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_1, 0, 1)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Jump)
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Luigi_1, 1)
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_1, LVar0, 0, LVar2, 25)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_1, 0, 2)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Luigi_JumpFromHighBlock) = {
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(SetEnemyFlagBits, NPC_Luigi_1, ENEMY_FLAGS_100, 0)
|
||||
EVT_CALL(SetNpcFlagBits, NPC_Luigi_1, NPC_FLAG_GRAVITY, TRUE)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_1, 0, 1)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Jump)
|
||||
EVT_CALL(SetNpcJumpscale, NPC_Luigi_1, 1)
|
||||
EVT_CALL(GetNpcPos, NPC_Luigi_1, LVar0, LVar1, LVar2)
|
||||
EVT_ADD(LVar0, 50)
|
||||
EVT_CALL(NpcJump0, NPC_Luigi_1, LVar0, 0, LVar2, 25)
|
||||
EVT_CALL(SetNpcAnimation, NPC_Luigi_1, ANIM_Luigi_Idle)
|
||||
EVT_CALL(SetNpcVar, NPC_Luigi_1, 0, 2)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_BlastRock) = {
|
||||
EVT_CALL(SetNpcAux, NPC_Luigi_1, 0)
|
||||
EVT_EXEC(N(EVS_Luigi_JumpFromBlock))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SmashBlock) = {
|
||||
EVT_CALL(SetNpcAux, NPC_Luigi_1, 0)
|
||||
EVT_THREAD
|
||||
EVT_EXEC_WAIT(N(EVS_Luigi_JumpFromBlock))
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_BreakBlock_Brick) = {
|
||||
EVT_CALL(SetNpcAux, NPC_Luigi_1, 0)
|
||||
EVT_THREAD
|
||||
EVT_EXEC_WAIT(N(EVS_Luigi_JumpFromHighBlock))
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_MakeEntities) = {
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_ScriptSpring), -150, -80, -50, 0, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_UseSpring_Basement)))
|
||||
EVT_CALL(SetEntityCullMode, 1)
|
||||
EVT_SWITCH(GB_StoryProgress)
|
||||
EVT_CASE_LT(STORY_CH1_STAR_SPRIT_DEPARTED)
|
||||
EVT_CASE_LT(STORY_CH2_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_BombableRock), 300, 0, 150, 0, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_BlastRock)))
|
||||
EVT_CASE_LT(STORY_CH3_STAR_SPIRIT_RESCUED)
|
||||
EVT_CASE_LT(STORY_CH4_STAR_SPRIT_DEPARTED)
|
||||
EVT_CASE_LT(STORY_CH5_STAR_SPRIT_DEPARTED)
|
||||
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_Hammer3Block), 300, 0, 150, 55, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_SmashBlock)))
|
||||
EVT_CASE_LT(STORY_CH7_STAR_SPRIT_DEPARTED)
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_BrickBlock), 300, 90, 150, 55, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignScript, EVT_PTR(N(EVS_BreakBlock_Brick)))
|
||||
EVT_CASE_LT(STORY_EPILOGUE)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
35
src/world/area_kmr/kmr_20/kmr_20_6_trees.c
Normal file
35
src/world/area_kmr/kmr_20/kmr_20_6_trees.c
Normal file
@ -0,0 +1,35 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#define NAME_SUFFIX _Trees
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
FoliageModelList N(Tree1_LeafModels) = FOLIAGE_MODEL_LIST(MODEL_o325);
|
||||
FoliageModelList N(Tree1_TrunkModels) = FOLIAGE_MODEL_LIST(MODEL_o326);
|
||||
|
||||
FoliageVectorList N(Tree1_Effects) = {
|
||||
.count = 2,
|
||||
.vectors = {
|
||||
{ -138.0f, 114.0f, 232.0f },
|
||||
{ -53.0f, 114.0f, 222.0f },
|
||||
}
|
||||
};
|
||||
|
||||
ShakeTreeConfig N(ShakeTree_Tree1) = {
|
||||
.leaves = &N(Tree1_LeafModels),
|
||||
.trunk = &N(Tree1_TrunkModels),
|
||||
.vectors = &N(Tree1_Effects),
|
||||
};
|
||||
|
||||
BombTrigger N(BombPos_Tree1) = {
|
||||
.pos = { -106.0f, 0.0f, 201.0f },
|
||||
.radius = 0.0f
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupTrees) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree_Trees)), TRIGGER_WALL_HAMMER, COLLIDER_o341, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ShakeTree_Trees)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
90
src/world/area_kmr/kmr_20/kmr_20_7_bushes.c
Normal file
90
src/world/area_kmr/kmr_20/kmr_20_7_bushes.c
Normal file
@ -0,0 +1,90 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
#define NAME_SUFFIX _Bushes
|
||||
#include "common/foliage.inc.c"
|
||||
#define NAME_SUFFIX
|
||||
|
||||
FoliageModelList N(Bush1_BushModels) = FOLIAGE_MODEL_LIST(MODEL_o227);
|
||||
|
||||
FoliageVectorList N(Bush1_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ -33.0f, 13.0f, -233.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush1) = {
|
||||
.bush = &N(Bush1_BushModels),
|
||||
.vectors = &N(Bush1_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush2_BushModels) = FOLIAGE_MODEL_LIST(MODEL_o371);
|
||||
|
||||
FoliageVectorList N(Bush2_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ 83.0f, 16.0f, 40.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush2) = {
|
||||
.bush = &N(Bush2_BushModels),
|
||||
.vectors = &N(Bush2_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush3_BushModels) = FOLIAGE_MODEL_LIST(MODEL_o372);
|
||||
|
||||
FoliageVectorList N(Bush3_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ 513.0f, 16.0f, 100.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush3) = {
|
||||
.bush = &N(Bush3_BushModels),
|
||||
.vectors = &N(Bush3_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush4_BushModels) = FOLIAGE_MODEL_LIST(MODEL_o373);
|
||||
|
||||
FoliageVectorList N(Bush4_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ 644.0f, 14.0f, 57.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush4) = {
|
||||
.bush = &N(Bush4_BushModels),
|
||||
.vectors = &N(Bush4_Effects),
|
||||
};
|
||||
|
||||
FoliageModelList N(Bush5_BushModels) = FOLIAGE_MODEL_LIST(MODEL_o374);
|
||||
|
||||
FoliageVectorList N(Bush5_Effects) = {
|
||||
.count = 1,
|
||||
.vectors = {
|
||||
{ 708.0f, 16.0f, -233.0f },
|
||||
}
|
||||
};
|
||||
|
||||
SearchBushConfig N(SearchBush_Bush5) = {
|
||||
.bush = &N(Bush5_BushModels),
|
||||
.vectors = &N(Bush5_Effects),
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupBushes) = {
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush1)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Bushes)), TRIGGER_WALL_PRESS_A, COLLIDER_o337, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush2)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Bushes)), TRIGGER_WALL_PRESS_A, COLLIDER_o350, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush3)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Bushes)), TRIGGER_WALL_PRESS_A, COLLIDER_o348, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush4)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Bushes)), TRIGGER_WALL_PRESS_A, COLLIDER_o347, 1, 0)
|
||||
EVT_SET(LVar0, EVT_PTR(N(SearchBush_Bush5)))
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_SearchBush_Bushes)), TRIGGER_WALL_PRESS_A, COLLIDER_o349, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
195
src/world/area_kmr/kmr_20/kmr_20_8_bed.c
Normal file
195
src/world/area_kmr/kmr_20/kmr_20_8_bed.c
Normal file
@ -0,0 +1,195 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
extern EvtScript N(EVS_ToadHouse_SetDialogue);
|
||||
extern EvtScript N(EVS_ToadHouse_GetInBed);
|
||||
extern EvtScript N(EVS_ToadHouse_ReturnFromRest);
|
||||
|
||||
#include "world/common/complete/ToadHouseBlanketAnim.inc.c"
|
||||
#include "world/common/atomic/ToadHouse.inc.c"
|
||||
#include "world/common/atomic/ToadHouse.data.inc.c"
|
||||
|
||||
API_CALLABLE(N(MuteAmbienceVolume_Bed)) {
|
||||
au_ambience_set_volume(0, 1000, 1);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(SetAmbienceVolumeHalf_Bed)) {
|
||||
au_ambience_set_volume(0, 1000, 63);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
#include "world/common/todo/WaitForPlayerToLand.inc.c"
|
||||
|
||||
EvtScript N(EVS_ToadHouse_SetDialogue) = {
|
||||
EVT_SET(LVar0, MSG_CH0_0106)
|
||||
EVT_SET(LVar8, MSG_CH0_0107)
|
||||
EVT_SET(LVar1, 0)
|
||||
EVT_SET(LVar2, 0)
|
||||
EVT_SET(LVar3, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToadHouse_GetInBed) = {
|
||||
EVT_EXEC(N(EVS_PlayRestingSong))
|
||||
EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0))
|
||||
EVT_CALL(PlayerMoveTo, -28, -100, 0)
|
||||
EVT_CALL(InterpPlayerYaw, 300, 0)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(6)
|
||||
EVT_CALL(N(ToadHouse_CamSetFOV), 0, 40)
|
||||
EVT_CALL(SetCamType, CAM_DEFAULT, 4, FALSE)
|
||||
EVT_CALL(SetCamPitch, CAM_DEFAULT, 35, -10)
|
||||
EVT_CALL(SetCamDistance, CAM_DEFAULT, 135)
|
||||
EVT_CALL(SetCamPosA, CAM_DEFAULT, -170, 0)
|
||||
EVT_CALL(SetCamPosB, CAM_DEFAULT, -109, -76)
|
||||
EVT_CALL(SetCamPosC, CAM_DEFAULT, 0, 120)
|
||||
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
|
||||
EVT_CALL(EnableGroup, MODEL_o170, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o172, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o175, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o177, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o178, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o183, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o188, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o189, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o186, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o190, FALSE)
|
||||
EVT_CALL(EnableGroup, MODEL_o191, FALSE)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(GetPlayerPos, LVar4, LVar5, LVar6)
|
||||
EVT_CALL(MakeLerp, 30, 85, 6, EASING_LINEAR)
|
||||
EVT_LOOP(6)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(SetPlayerPos, LVar4, LVar0, LVar6)
|
||||
EVT_END_LOOP
|
||||
EVT_CALL(HidePlayerShadow, TRUE)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(func_802D286C, 0x00000800)
|
||||
EVT_CALL(func_802D2520, 0x00010002, 5, 7, 1, 1, 0)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(60)
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8001D)
|
||||
EVT_END_THREAD
|
||||
EVT_CALL(N(MuteAmbienceVolume_Bed))
|
||||
EVT_WAIT(75)
|
||||
EVT_THREAD
|
||||
EVT_WAIT(65)
|
||||
EVT_CALL(N(ToadHouse_CamSetFOV), 0, 25)
|
||||
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
|
||||
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
|
||||
EVT_WAIT(1)
|
||||
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
|
||||
EVT_CALL(EnableGroup, MODEL_o170, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o172, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o175, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o177, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o178, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o183, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o188, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o189, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o186, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o190, TRUE)
|
||||
EVT_CALL(EnableGroup, MODEL_o191, TRUE)
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ToadHouse_ReturnFromRest) = {
|
||||
EVT_CALL(N(SetAmbienceVolumeHalf_Bed))
|
||||
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
|
||||
EVT_CALL(HidePlayerShadow, FALSE)
|
||||
EVT_CALL(func_802D2520, ANIM_Mario_10002, 0, 0, 0, 0, 0)
|
||||
EVT_CALL(SetPlayerPos, -45, 30, -70)
|
||||
EVT_CALL(InterpPlayerYaw, 90, 0)
|
||||
EVT_CALL(SetNpcPos, NPC_PARTNER, -75, 30, -70)
|
||||
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 90, 0)
|
||||
EVT_WAIT(5)
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_UseBed) = {
|
||||
EVT_CALL(N(WaitForPlayerToLand))
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_CALL(N(ToadHouse_InitScreenOverlay), 0, 0, 0)
|
||||
EVT_EXEC_WAIT(N(EVS_ToadHouse_SetDialogue))
|
||||
EVT_IF_EQ(LVar0, 0)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_SET(LVar9, LVar1)
|
||||
EVT_SET(LVarA, LVar2)
|
||||
EVT_SET(LVarB, LVar3)
|
||||
EVT_CALL(N(ToadHouse_DoesPlayerNeedSleep))
|
||||
EVT_IF_EQ(LVar1, 0)
|
||||
EVT_SET(LVar8, LVar0)
|
||||
EVT_END_IF
|
||||
EVT_CALL(ShowMessageAtScreenPos, LVar8, 160, 40)
|
||||
EVT_CALL(ShowChoice, MSG_Choice_0007)
|
||||
EVT_WAIT(10)
|
||||
EVT_IF_EQ(LVar0, 1)
|
||||
EVT_CALL(CloseMessage)
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END_IF
|
||||
EVT_CALL(CloseMessage)
|
||||
EVT_CALL(SetPlayerJumpscale, 1)
|
||||
EVT_CALL(DisablePlayerPhysics, TRUE)
|
||||
EVT_CALL(N(ToadHouse_DisableStatusMenu))
|
||||
EVT_IF_NE(LVar4, 0)
|
||||
EVT_EXEC(N(8024AC8C))
|
||||
EVT_END_IF
|
||||
EVT_CALL(N(ToadHouse_PutPartnerAway), LVarA)
|
||||
EVT_WAIT(20)
|
||||
EVT_EXEC_GET_TID(N(EVS_ToadHouse_GetInBed), LVar9)
|
||||
EVT_CALL(N(ToadHouse_AwaitScriptComplete), LVar9)
|
||||
EVT_THREAD
|
||||
EVT_CALL(MakeLerp, 0, 255, 60, EASING_LINEAR)
|
||||
EVT_LABEL(0)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(N(ToadHouse_UpdateScreenOverlay), 3, LVar0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(0)
|
||||
EVT_END_IF
|
||||
EVT_CALL(FullyRestoreHPandFP)
|
||||
EVT_CALL(FullyRestoreSP)
|
||||
EVT_IF_NE(LVar4, 0)
|
||||
EVT_EXEC(N(8024AC14))
|
||||
EVT_END_IF
|
||||
EVT_CALL(N(ToadHouse_GetPartnerBackOut), LVarA)
|
||||
EVT_WAIT(30)
|
||||
EVT_CALL(MakeLerp, 255, 0, 30, EASING_LINEAR)
|
||||
EVT_LABEL(1)
|
||||
EVT_CALL(UpdateLerp)
|
||||
EVT_CALL(N(ToadHouse_UpdateScreenOverlay), 0, LVar0)
|
||||
EVT_WAIT(1)
|
||||
EVT_IF_EQ(LVar1, 1)
|
||||
EVT_GOTO(1)
|
||||
EVT_END_IF
|
||||
EVT_END_THREAD
|
||||
EVT_WAIT(90)
|
||||
EVT_EXEC_GET_TID(N(EVS_ToadHouse_ReturnFromRest), LVar9)
|
||||
EVT_CALL(N(ToadHouse_AwaitScriptComplete), LVar9)
|
||||
EVT_CALL(DisablePlayerPhysics, FALSE)
|
||||
EVT_CALL(N(ToadHouse_ShowStatusMenu))
|
||||
EVT_CALL(DisablePlayerInput, FALSE)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_SetupBed) = {
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_UseBed)), TRIGGER_WALL_PRESS_A, COLLIDER_o352, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
91
src/world/area_kmr/kmr_20/kmr_20_9_npc_scenes.c
Normal file
91
src/world/area_kmr/kmr_20/kmr_20_9_npc_scenes.c
Normal file
@ -0,0 +1,91 @@
|
||||
#include "kmr_20.h"
|
||||
|
||||
NpcSettings N(NpcSettings_Scenes) = {
|
||||
.height = 24,
|
||||
.radius = 24,
|
||||
.level = 99,
|
||||
};
|
||||
|
||||
EvtScript N(EVS_NpcInit_Luigi_Scenes) = {
|
||||
EVT_CALL(SetNpcCollisionSize, NPC_SELF, 46, 26)
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_OR_EQ(kmr_20_ENTRY_2)
|
||||
EVT_CASE_OR_EQ(kmr_20_ENTRY_3)
|
||||
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Luigi_IdleSit)
|
||||
EVT_CALL(SetNpcPos, NPC_SELF, 196, 44, -37)
|
||||
EVT_CALL(SetNpcYaw, NPC_SELF, 270)
|
||||
EVT_END_CASE_GROUP
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_Scenes)[] = {
|
||||
{
|
||||
.id = NPC_Scene_Parakarry,
|
||||
.settings = &N(NpcSettings_Scenes),
|
||||
.pos = { NPC_DISPOSE_LOCATION },
|
||||
.yaw = 90,
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_8 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_200000 | ENEMY_FLAGS_400000,
|
||||
.drops = {
|
||||
.dropFlags = NPC_DROP_FLAGS_80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
},
|
||||
.animations = {
|
||||
.idle = ANIM_WorldParakarry_Idle,
|
||||
.walk = ANIM_WorldParakarry_Walk,
|
||||
.run = ANIM_WorldParakarry_Run,
|
||||
.chase = ANIM_WorldParakarry_Run,
|
||||
.anim_4 = ANIM_WorldParakarry_Idle,
|
||||
.anim_5 = ANIM_WorldParakarry_Idle,
|
||||
.death = ANIM_WorldParakarry_Still,
|
||||
.hit = ANIM_WorldParakarry_Still,
|
||||
.anim_8 = ANIM_WorldParakarry_Idle,
|
||||
.anim_9 = ANIM_WorldParakarry_Idle,
|
||||
.anim_A = ANIM_WorldParakarry_Idle,
|
||||
.anim_B = ANIM_WorldParakarry_Idle,
|
||||
.anim_C = ANIM_WorldParakarry_Idle,
|
||||
.anim_D = ANIM_WorldParakarry_Idle,
|
||||
.anim_E = ANIM_WorldParakarry_Idle,
|
||||
.anim_F = ANIM_WorldParakarry_Idle,
|
||||
},
|
||||
},
|
||||
{
|
||||
.id = NPC_Scene_Luigi,
|
||||
.settings = &N(NpcSettings_Scenes),
|
||||
.pos = { NPC_DISPOSE_LOCATION },
|
||||
.yaw = 90,
|
||||
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_8 | ENEMY_FLAGS_100 | ENEMY_FLAGS_200 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_GRAVITY,
|
||||
.init = &N(EVS_NpcInit_Luigi_Scenes),
|
||||
.drops = {
|
||||
.dropFlags = NPC_DROP_FLAGS_80,
|
||||
.heartDrops = NO_DROPS,
|
||||
.flowerDrops = NO_DROPS,
|
||||
},
|
||||
.animations = {
|
||||
.idle = ANIM_Luigi_Still,
|
||||
.walk = ANIM_Luigi_Still,
|
||||
.run = ANIM_Luigi_Still,
|
||||
.chase = ANIM_Luigi_Still,
|
||||
.anim_4 = ANIM_Luigi_Still,
|
||||
.anim_5 = ANIM_Luigi_Still,
|
||||
.death = ANIM_Luigi_Still,
|
||||
.hit = ANIM_Luigi_Still,
|
||||
.anim_8 = ANIM_Luigi_Still,
|
||||
.anim_9 = ANIM_Luigi_Still,
|
||||
.anim_A = ANIM_Luigi_Still,
|
||||
.anim_B = ANIM_Luigi_Still,
|
||||
.anim_C = ANIM_Luigi_Still,
|
||||
.anim_D = ANIM_Luigi_Still,
|
||||
.anim_E = ANIM_Luigi_Still,
|
||||
.anim_F = ANIM_Luigi_Still,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
NpcGroupList N(SceneNPCs) = {
|
||||
NPC_GROUP(N(NpcData_Scenes)),
|
||||
{}
|
||||
};
|
@ -2,24 +2,86 @@
|
||||
#define _WORLD_AREA_KPA_KPA_H_
|
||||
|
||||
enum {
|
||||
AB_KPA_0 = AreaByte(0),
|
||||
AB_KPA_1 = AreaByte(1),
|
||||
AB_KPA_2 = AreaByte(2),
|
||||
AB_KPA_3 = AreaByte(3),
|
||||
AB_KPA_4 = AreaByte(4),
|
||||
AB_KPA_5 = AreaByte(5),
|
||||
AB_KPA_6 = AreaByte(6),
|
||||
AB_KPA_7 = AreaByte(7),
|
||||
AB_KPA_8 = AreaByte(8),
|
||||
AB_KPA_9 = AreaByte(9),
|
||||
AB_KPA_A = AreaByte(10),
|
||||
AB_KPA_B = AreaByte(11),
|
||||
AB_KPA_C = AreaByte(12),
|
||||
AB_KPA_D = AreaByte(13),
|
||||
AB_KPA_E = AreaByte(14),
|
||||
AB_KPA_F = AreaByte(15),
|
||||
AB_KPA_0 = AreaByte(0),
|
||||
AB_KPA_1 = AreaByte(1),
|
||||
AB_KPA_2 = AreaByte(2),
|
||||
AB_KPA_3 = AreaByte(3),
|
||||
AB_KPA_4 = AreaByte(4),
|
||||
AB_KPA_5 = AreaByte(5),
|
||||
AB_KPA_6 = AreaByte(6),
|
||||
AB_KPA_7 = AreaByte(7),
|
||||
AB_KPA_8 = AreaByte(8),
|
||||
AB_KPA_9 = AreaByte(9),
|
||||
AB_KPA_A = AreaByte(10),
|
||||
AB_KPA_B = AreaByte(11),
|
||||
AB_KPA_C = AreaByte(12),
|
||||
AB_KPA_D = AreaByte(13),
|
||||
AB_KPA_E = AreaByte(14),
|
||||
AB_KPA_F = AreaByte(15),
|
||||
};
|
||||
|
||||
#define AF_KPA(index) AreaFlag(index)
|
||||
enum {
|
||||
AF_KPA_03 = AreaFlag(3),
|
||||
AF_KPA_04 = AreaFlag(4),
|
||||
AF_KPA_05 = AreaFlag(5),
|
||||
AF_KPA_06 = AreaFlag(6),
|
||||
AF_KPA133_HitWaterSwitch = AreaFlag(8),
|
||||
AF_KPA134_HitWaterSwitch = AreaFlag(9),
|
||||
};
|
||||
|
||||
extern MapSettings kpa_01_settings;
|
||||
extern MapSettings kpa_03_settings;
|
||||
extern MapSettings kpa_04_settings;
|
||||
extern MapSettings kpa_08_settings;
|
||||
extern MapSettings kpa_09_settings;
|
||||
extern MapSettings kpa_10_settings;
|
||||
extern MapSettings kpa_11_settings;
|
||||
extern MapSettings kpa_12_settings;
|
||||
extern MapSettings kpa_13_settings;
|
||||
extern MapSettings kpa_14_settings;
|
||||
extern MapSettings kpa_15_settings;
|
||||
extern MapSettings kpa_16_settings;
|
||||
extern MapSettings kpa_17_settings;
|
||||
extern MapSettings kpa_32_settings;
|
||||
extern MapSettings kpa_33_settings;
|
||||
extern MapSettings kpa_40_settings;
|
||||
extern MapSettings kpa_41_settings;
|
||||
extern MapSettings kpa_50_settings;
|
||||
extern MapSettings kpa_51_settings;
|
||||
extern MapSettings kpa_52_settings;
|
||||
extern MapSettings kpa_53_settings;
|
||||
extern MapSettings kpa_60_settings;
|
||||
extern MapSettings kpa_61_settings;
|
||||
extern MapSettings kpa_62_settings;
|
||||
extern MapSettings kpa_63_settings;
|
||||
extern MapSettings kpa_70_settings;
|
||||
extern MapSettings kpa_81_settings;
|
||||
extern MapSettings kpa_82_settings;
|
||||
extern MapSettings kpa_83_settings;
|
||||
extern MapSettings kpa_90_settings;
|
||||
extern MapSettings kpa_91_settings;
|
||||
extern MapSettings kpa_94_settings;
|
||||
extern MapSettings kpa_95_settings;
|
||||
extern MapSettings kpa_96_settings;
|
||||
extern MapSettings kpa_100_settings;
|
||||
extern MapSettings kpa_101_settings;
|
||||
extern MapSettings kpa_102_settings;
|
||||
extern MapSettings kpa_111_settings;
|
||||
extern MapSettings kpa_112_settings;
|
||||
extern MapSettings kpa_113_settings;
|
||||
extern MapSettings kpa_114_settings;
|
||||
extern MapSettings kpa_115_settings;
|
||||
extern MapSettings kpa_116_settings;
|
||||
extern MapSettings kpa_117_settings;
|
||||
extern MapSettings kpa_118_settings;
|
||||
extern MapSettings kpa_119_settings;
|
||||
extern MapSettings kpa_121_settings;
|
||||
extern MapSettings kpa_130_settings;
|
||||
extern MapSettings kpa_133_settings;
|
||||
extern MapSettings kpa_134_settings;
|
||||
|
||||
s32 kpa_100_map_init(void);
|
||||
s32 kpa_101_map_init(void);
|
||||
s32 kpa_114_map_init(void);
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +0,0 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
static char* N(exit_str_0) = "kpa_14";
|
||||
static char* N(exit_str_1) = "kpa_03";
|
||||
|
||||
#include "world/common/atomic/CreateDarkness.inc.c"
|
@ -1,5 +0,0 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
#include "world/common/enemy/ai/TackleAI.inc.c"
|
||||
|
||||
#include "world/common/todo/AwaitPlayerNearNpc.inc.c"
|
@ -2,8 +2,21 @@
|
||||
/// @brief Bowser's Castle - Dark Cave 1
|
||||
|
||||
#include "common.h"
|
||||
#include "../kpa.h"
|
||||
#include "message_ids.h"
|
||||
#include "map.h"
|
||||
|
||||
#include "../kpa.h"
|
||||
#include "mapfs/kpa_01_shape.h"
|
||||
#include "mapfs/kpa_01_hit.h"
|
||||
|
||||
enum {
|
||||
NPC_BonyBeetle_01 = 0,
|
||||
NPC_BonyBeetle_02 = 1,
|
||||
};
|
||||
|
||||
#define NAMESPACE kpa_01
|
||||
|
||||
extern EvtScript N(EVS_Main);
|
||||
extern EvtScript N(EVS_SetupMusic);
|
||||
extern EvtScript N(EVS_MakeEntities);
|
||||
extern NpcGroupList N(DefaultNPCs);
|
||||
|
13
src/world/area_kpa/kpa_01/kpa_01_0_header.c
Normal file
13
src/world/area_kpa/kpa_01/kpa_01_0_header.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
EntryList N(Entrances) = {
|
||||
[kpa_01_ENTRY_0] { 690.0, -378.0, 337.0, 90.0 },
|
||||
[kpa_01_ENTRY_1] { -511.0, 149.0, 57.0, 90.0 },
|
||||
};
|
||||
|
||||
MapSettings N(settings) = {
|
||||
.main = &N(EVS_Main),
|
||||
.entryList = &N(Entrances),
|
||||
.entryCount = ENTRY_COUNT(N(Entrances)),
|
||||
.tattle = { MSG_MapTattle_kpa_01 },
|
||||
};
|
9
src/world/area_kpa/kpa_01/kpa_01_1_music.c
Normal file
9
src/world/area_kpa/kpa_01/kpa_01_1_music.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
EvtScript N(EVS_SetupMusic) = {
|
||||
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE_CAVES, 0, 8)
|
||||
EVT_CALL(ClearAmbientSounds, 250)
|
||||
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
67
src/world/area_kpa/kpa_01/kpa_01_2_main.c
Normal file
67
src/world/area_kpa/kpa_01/kpa_01_2_main.c
Normal file
@ -0,0 +1,67 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
#include "world/common/atomic/CreateDarkness.inc.c"
|
||||
|
||||
EvtScript N(EVS_SetupDarkness) = {
|
||||
EVT_THREAD
|
||||
EVT_CALL(N(DarkRoomUpdate))
|
||||
EVT_END_THREAD
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ExitDoor_kpa_14_1) = {
|
||||
EVT_SET_GROUP(EVT_GROUP_1B)
|
||||
EVT_CALL(DisablePlayerInput, TRUE)
|
||||
EVT_SET(LVar0, kpa_01_ENTRY_0)
|
||||
EVT_SET(LVar1, COLLIDER_tte)
|
||||
EVT_SET(LVar2, MODEL_o205)
|
||||
EVT_SET(LVar3, DOOR_SWING_IN)
|
||||
EVT_EXEC(ExitSingleDoor)
|
||||
EVT_WAIT(17)
|
||||
EVT_CALL(GotoMap, EVT_PTR("kpa_14"), kpa_14_ENTRY_1)
|
||||
EVT_WAIT(100)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_ExitWalk_kpa_03_0) = EVT_EXIT_WALK(60, kpa_01_ENTRY_1, "kpa_03", kpa_03_ENTRY_0);
|
||||
|
||||
EvtScript N(EVS_BindExitTriggers) = {
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoor_kpa_14_1)), TRIGGER_WALL_PRESS_A, COLLIDER_tte, 1, 0)
|
||||
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_03_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_EnterMap) = {
|
||||
EVT_CALL(GetEntryID, LVar0)
|
||||
EVT_SWITCH(LVar0)
|
||||
EVT_CASE_EQ(kpa_01_ENTRY_0)
|
||||
EVT_SET(LVar0, kpa_01_ENTRY_0)
|
||||
EVT_SET(LVar1, MODEL_exit2)
|
||||
EVT_SET(LVar2, MODEL_o205)
|
||||
EVT_SET(LVar3, DOOR_SWING_IN)
|
||||
EVT_EXEC(EnterSingleDoor)
|
||||
EVT_EXEC(N(EVS_BindExitTriggers))
|
||||
EVT_CASE_EQ(kpa_01_ENTRY_1)
|
||||
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
|
||||
EVT_EXEC(EnterWalk)
|
||||
EVT_END_SWITCH
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
||||
|
||||
EvtScript N(EVS_Main) = {
|
||||
EVT_SET(GB_WorldLocation, LOCATION_BOWSERS_CASTLE)
|
||||
EVT_CALL(SetSpriteShading, SHADING_NONE)
|
||||
EVT_SETUP_CAMERA_DEFAULT()
|
||||
EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs)))
|
||||
EVT_EXEC_WAIT(N(EVS_MakeEntities))
|
||||
EVT_EXEC(N(EVS_SetupDarkness))
|
||||
EVT_EXEC(N(EVS_EnterMap))
|
||||
EVT_WAIT(1)
|
||||
EVT_EXEC(N(EVS_SetupMusic))
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
53
src/world/area_kpa/kpa_01/kpa_01_3_npc.c
Normal file
53
src/world/area_kpa/kpa_01/kpa_01_3_npc.c
Normal file
@ -0,0 +1,53 @@
|
||||
#include "kpa_01.h"
|
||||
|
||||
#include "world/common/enemy/complete/SpikeTop.inc.c"
|
||||
|
||||
StaticNpc N(NpcData_BonyBeetle_01) = {
|
||||
.id = NPC_BonyBeetle_01,
|
||||
.settings = &N(NpcSettings_BonyBeetle),
|
||||
.pos = { 1740.0f, -215.0f, 60.0f },
|
||||
.yaw = 270,
|
||||
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000,
|
||||
.drops = BONY_BEETLE_DROPS,
|
||||
.territory = {
|
||||
.wander = {
|
||||
.isFlying = FALSE,
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.centerPos = { 1740, -215, 60 },
|
||||
.wanderSize = { 50 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 1740, -215, 60 },
|
||||
.detectSize = { 300 },
|
||||
}
|
||||
},
|
||||
.animations = BONY_BEETLE_ANIMS,
|
||||
};
|
||||
|
||||
StaticNpc N(NpcData_BonyBeetle_02) = {
|
||||
.id = NPC_BonyBeetle_02,
|
||||
.settings = &N(NpcSettings_BonyBeetle),
|
||||
.pos = { 243.0f, 5.0f, 230.0f },
|
||||
.yaw = 90,
|
||||
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000,
|
||||
.drops = BONY_BEETLE_DROPS,
|
||||
.territory = {
|
||||
.wander = {
|
||||
.isFlying = FALSE,
|
||||
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
|
||||
.wanderShape = SHAPE_CYLINDER,
|
||||
.centerPos = { 243, 5, 230 },
|
||||
.wanderSize = { 50 },
|
||||
.detectShape = SHAPE_CYLINDER,
|
||||
.detectPos = { 243, 5, 230 },
|
||||
.detectSize = { 300 },
|
||||
}
|
||||
},
|
||||
.animations = BONY_BEETLE_ANIMS,
|
||||
};
|
||||
|
||||
NpcGroupList N(DefaultNPCs) = {
|
||||
NPC_GROUP(N(NpcData_BonyBeetle_01), BTL_KPA_FORMATION_00, BTL_KPA_STAGE_03),
|
||||
NPC_GROUP(N(NpcData_BonyBeetle_02), BTL_KPA_FORMATION_01, BTL_KPA_STAGE_03),
|
||||
{}
|
||||
};
|
9
src/world/area_kpa/kpa_01/kpa_01_4_entity.c
Normal file
9
src/world/area_kpa/kpa_01/kpa_01_4_entity.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include "kpa_01.h"
|
||||
#include "entity.h"
|
||||
|
||||
EvtScript N(EVS_MakeEntities) = {
|
||||
EVT_CALL(MakeEntity, EVT_PTR(Entity_YellowBlock), 220, 208, -125, 0, ITEM_POW_BLOCK, MAKE_ENTITY_END)
|
||||
EVT_CALL(AssignBlockFlag, GF_KPA01_ItemBlock_POWBlock)
|
||||
EVT_RETURN
|
||||
EVT_END
|
||||
};
|
@ -1,6 +0,0 @@
|
||||
#include "kpa_03.h"
|
||||
|
||||
static char* N(exit_str_0) = "kpa_01";
|
||||
static char* N(exit_str_1) = "kpa_04";
|
||||
|
||||
#include "world/common/atomic/CreateDarkness.inc.c"
|
@ -1,7 +0,0 @@
|
||||
#include "kpa_03.h"
|
||||
|
||||
#include "world/common/enemy/ai/TackleAI.inc.c"
|
||||
|
||||
#include "world/common/todo/AwaitPlayerNearNpc.inc.c"
|
||||
|
||||
#include "world/common/enemy/ai/MagikoopaAI.inc.c"
|
@ -1,13 +0,0 @@
|
||||
#include "kpa_03.h"
|
||||
|
||||
ApiStatus func_80241E50_A4A410(Evt* script, s32 isInitialCall) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
|
||||
if (playerStatus->lastGoodPosition.y >= 0) {
|
||||
evt_set_variable(script, MapVar(0), FALSE);
|
||||
}
|
||||
if (playerStatus->lastGoodPosition.y <= -280) {
|
||||
evt_set_variable(script, MapVar(0), TRUE);
|
||||
}
|
||||
return ApiStatus_BLOCK;
|
||||
}
|
@ -2,8 +2,34 @@
|
||||
/// @brief Bowser's Castle - Dark Cave 2
|
||||
|
||||
#include "common.h"
|
||||
#include "../kpa.h"
|
||||
#include "message_ids.h"
|
||||
#include "map.h"
|
||||
|
||||
#include "../kpa.h"
|
||||
#include "mapfs/kpa_03_shape.h"
|
||||
#include "mapfs/kpa_03_hit.h"
|
||||
|
||||
#include "sprite/npc/BuzzyBeetle.h"
|
||||
#include "sprite/npc/Magikoopa.h"
|
||||
#include "sprite/npc/WorldKoopatrol.h"
|
||||
#include "sprite/npc/BonyBeetle.h"
|
||||
|
||||
enum {
|
||||
NPC_Koopatrol_01 = 0,
|
||||
NPC_Koopatrol_02 = 1,
|
||||
NPC_BonyBeetle_01 = 2,
|
||||
NPC_BonyBeetle_02 = 3,
|
||||
NPC_Magikoopa_01 = 4,
|
||||
NPC_Magikoopa_01_Spell = 5,
|
||||
};
|
||||
|
||||
enum {
|
||||
MV_PlayerHeightLevel = MapVar(0),
|
||||
};
|
||||
|
||||
#define NAMESPACE kpa_03
|
||||
|
||||
extern EvtScript N(EVS_Main);
|
||||
extern EvtScript N(EVS_SetupMusic);
|
||||
extern EvtScript N(EVS_MakeEntities);
|
||||
extern NpcGroupList N(DefaultNPCs);
|
||||
|
13
src/world/area_kpa/kpa_03/kpa_03_0_header.c
Normal file
13
src/world/area_kpa/kpa_03/kpa_03_0_header.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "kpa_03.h"
|
||||
|
||||
EntryList N(Entrances) = {
|
||||
[kpa_03_ENTRY_0] { 1888.0, -410.0, -93.0, 270.0 },
|
||||
[kpa_03_ENTRY_1] { -1575.0, -105.0, -158.0, 90.0 },
|
||||
};
|
||||
|
||||
MapSettings N(settings) = {
|
||||
.main = &N(EVS_Main),
|
||||
.entryList = &N(Entrances),
|
||||
.entryCount = ENTRY_COUNT(N(Entrances)),
|
||||
.tattle = { MSG_MapTattle_kpa_03 },
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user