mirror of
https://github.com/pmret/papermario.git
synced 2025-02-09 00:51:42 +01: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]);
|
||||