* kpa 1/3/4/5

* more!

* just one left

* done

* stray cleanup

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2023-01-03 05:46:15 -05:00 committed by GitHub
parent 684af8778e
commit a2e96ae3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
295 changed files with 10341 additions and 2464 deletions

View File

@ -227,7 +227,7 @@
#define RemoveItemEntity dead_RemoveItemEntity
#define IsPlayerWithin dead_IsPlayerWithin
#define IsPlayerOnValidFloor dead_IsPlayerOnValidFloor
#define GetCurrentPartner dead_GetCurrentPartner
#define GetPartnerInUse dead_GetPartnerInUse
#define MakeEntity dead_MakeEntity
#define Entity_SavePoint dead_Entity_SavePoint
#define PopSong dead_PopSong

View File

@ -204,7 +204,7 @@ ApiStatus UseEntryHeading(Evt* script, s32 isInitialCall);
ApiStatus UseExitHeading(Evt* script, s32 isInitialCall);
ApiStatus InitVirtualEntityList(Evt* script, s32 isInitialCall);
ApiStatus DisablePulseStone(Evt* script, s32 isInitialCall);
ApiStatus GetCurrentPartner(Evt* script, s32 isInitialCall);
ApiStatus GetPartnerInUse(Evt* script, s32 isInitialCall);
ApiStatus Disable8bitMario(Evt* script, s32 isInitialCall);
ApiStatus PlaySoundAtPlayer(Evt* script, s32 isInitialCall);
ApiStatus MakeLerp(Evt* script, s32 isInitialCall);

View File

@ -761,11 +761,12 @@ ApiStatus DisablePulseStone(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
ApiStatus GetCurrentPartner(Evt* script, s32 isInitialCall) {
// returns partnerID of current partner if using their ability, otherwise PARTNER_NONE
ApiStatus GetPartnerInUse(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Bytecode outVar = *args++;
PlayerData* playerData = &gPlayerData;
s32 currentPartner = 0;
s32 currentPartner = PARTNER_NONE;
if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
currentPartner = playerData->currentPartner;

View File

@ -213,7 +213,7 @@ static s32 N(pad_30D8)[] = {
EvtScript N(802430E0) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN
@ -227,7 +227,7 @@ EvtScript N(802430E0) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN

View File

@ -598,7 +598,7 @@ EvtScript N(EVS_BeanPatch_TryInteract) = {
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar0)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_RETURN
EVT_END_IF

View File

@ -381,7 +381,7 @@ EvtScript N(EVS_NpcIdle_MontyMole_01) = {
EVT_CALL(GetNpcPos, NPC_MontyMole_01, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_CALL(GetPartnerInUse, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LVar3, FALSE)
EVT_END_IF
@ -460,7 +460,7 @@ EvtScript N(EVS_NpcIdle_MontyMole_02) = {
EVT_CALL(GetNpcPos, NPC_MontyMole_02, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_CALL(GetPartnerInUse, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
@ -539,7 +539,7 @@ EvtScript N(EVS_NpcIdle_MontyMole_03) = {
EVT_CALL(GetNpcPos, NPC_MontyMole_03, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_CALL(GetPartnerInUse, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
@ -618,7 +618,7 @@ EvtScript N(EVS_NpcIdle_MontyMole_04) = {
EVT_CALL(GetNpcPos, NPC_MontyMole_04, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_CALL(GetPartnerInUse, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF

View File

@ -29,7 +29,7 @@ s32 N(KeyList)[] = {
EvtScript N(EVS_OnInteract_WaterStoneSocket) = {
EVT_IF_EQ(GF_FLO10_ShowedLilyTheWaterStone, TRUE)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_CALL(AwaitPlayerLeave, 0, 0, 19)
EVT_RETURN

View File

@ -109,7 +109,7 @@ EvtScript N(EVS_RideBigBubble) = {
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(GetCurrentPartner, LVar0)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(20)

View File

@ -99,7 +99,7 @@ EvtScript N(EVS_Scene_HuffNPuffAmbush) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetMusicTrack, 0, SONG_HUFF_N_PUFF_THEME, 0, 8)
EVT_EXEC_GET_TID(N(EVS_PlayRumbleSounds), LVar9)
EVT_CALL(GetCurrentPartner, LVar0)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(20)

View File

@ -78,7 +78,7 @@ EvtScript N(EVS_NpcAI_Buzzar) = {
EVT_END_LOOP
EVT_CALL(SetMusicTrack, 0, SONG_MINIBOSS_BATTLE, 0, 8)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(GetCurrentPartner, LVar0)
EVT_CALL(GetPartnerInUse, LVar0)
EVT_IF_NE(LVar0, 0)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(5)

View File

@ -2,29 +2,28 @@
#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_KPA17_Toad1_Dialogue = AreaByte(1),
AB_KPA17_Toad2_Dialogue = AreaByte(2),
AB_KPA17_Toad3_Dialogue = AreaByte(3),
AB_KPA17_Toad4_Dialogue = AreaByte(4),
AB_KPA91_Toad2_Dialogue = AreaByte(5),
AB_KPA91_Toad3_Dialogue = AreaByte(6),
AB_KPA91_Dryite_Dialogue = AreaByte(7),
AB_KPA95_Toad2_Dialogue = AreaByte(8),
AB_KPA95_Toad3_Dialogue = AreaByte(9),
AB_KPA95_Penguin_Dialogue = AreaByte(10),
AB_KPA_MazeProgress = AreaByte(11),
AB_KPA82_QuizRound = AreaByte(12),
AB_KPA82_RightAnswers = AreaByte(13),
AB_KPA82_WrongAnswers = AreaByte(14),
};
enum {
AF_KPA_03 = AreaFlag(3),
AF_KPA_04 = AreaFlag(4),
AF_KPA_05 = AreaFlag(5),
AF_KPA_06 = AreaFlag(6),
AF_KPA08_PlatformRaised = AreaFlag(3),
AF_KPA09_PlatformRaised = AreaFlag(4),
AF_KPA13_HitSwitchA = AreaFlag(5),
AF_KPA13_HitSwitchB = AreaFlag(6),
AF_KPA16_HitSwitch = AreaFlag(7),
AF_KPA133_HitWaterSwitch = AreaFlag(8),
AF_KPA134_HitWaterSwitch = AreaFlag(9),
};
@ -80,6 +79,11 @@ extern MapSettings kpa_130_settings;
extern MapSettings kpa_133_settings;
extern MapSettings kpa_134_settings;
s32 kpa_51_map_init(void);
s32 kpa_53_map_init(void);
s32 kpa_81_map_init(void);
s32 kpa_82_map_init(void);
s32 kpa_83_map_init(void);
s32 kpa_100_map_init(void);
s32 kpa_101_map_init(void);
s32 kpa_114_map_init(void);

View File

@ -10,8 +10,8 @@
#include "mapfs/kpa_01_hit.h"
enum {
NPC_BonyBeetle_01 = 0,
NPC_BonyBeetle_02 = 1,
NPC_BonyBeetle_01 = 0,
NPC_BonyBeetle_02 = 1,
};
#define NAMESPACE kpa_01

View File

@ -15,12 +15,12 @@
#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,
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 {

View File

@ -5,7 +5,7 @@
EvtScript N(EVS_PushStatue_Impl) = {
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar9, 0)
EVT_RETURN
@ -19,7 +19,7 @@ EvtScript N(EVS_PushStatue_Impl) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar9, 0)
EVT_RETURN

View File

@ -12,8 +12,8 @@
#include "sprite/npc/Magikoopa.h"
enum {
NPC_Magikoopa = 0,
NPC_Magikoopa_Spell = 1,
NPC_Magikoopa = 0,
NPC_Magikoopa_Spell = 1,
};
#define NAMESPACE kpa_08

View File

@ -16,10 +16,10 @@ API_CALLABLE(N(ElevatePlayer)) {
}
EvtScript N(EVS_ActivateSwitch) = {
EVT_IF_NE(AF_KPA_03, FALSE)
EVT_IF_NE(AF_KPA08_PlatformRaised, FALSE)
EVT_RETURN
EVT_END_IF
EVT_SET(AF_KPA_03, TRUE)
EVT_SET(AF_KPA08_PlatformRaised, TRUE)
EVT_CALL(N(UnsetCamera0MoveFlag1))
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_EF)
@ -79,14 +79,14 @@ EvtScript N(EVS_ActivateSwitch) = {
EVT_END_IF
EVT_END_LOOP
EVT_CALL(TranslateGroup, MODEL_move2, 0, -99, -1)
EVT_SET(AF_KPA_03, FALSE)
EVT_SET(AF_KPA08_PlatformRaised, FALSE)
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeEntities) = {
EVT_SET(AF_KPA_03, FALSE)
EVT_SET(AF_KPA08_PlatformRaised, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_RedSwitch), 10, 0, 0, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(EVS_ActivateSwitch)))
EVT_CALL(ParentColliderToModel, COLLIDER_o19, MODEL_m_yuka)

View File

@ -13,10 +13,10 @@
#include "sprite/npc/ThrownBone.h"
enum {
NPC_DryBones = 0,
NPC_DryBones_Bone1 = 1,
NPC_DryBones_Bone2 = 2,
NPC_DryBones_Bone3 = 3,
NPC_DryBones = 0,
NPC_DryBones_Bone1 = 1,
NPC_DryBones_Bone2 = 2,
NPC_DryBones_Bone3 = 3,
};
#define NAMESPACE kpa_09

View File

@ -16,10 +16,10 @@ API_CALLABLE(N(ElevatePlayer)) {
}
EvtScript N(EVS_ActivateSwitch) = {
EVT_IF_NE(AF_KPA_04, FALSE)
EVT_IF_NE(AF_KPA09_PlatformRaised, FALSE)
EVT_RETURN
EVT_END_IF
EVT_SET(AF_KPA_04, TRUE)
EVT_SET(AF_KPA09_PlatformRaised, TRUE)
EVT_CALL(N(UnsetCamera0MoveFlag1))
EVT_THREAD
EVT_SET_GROUP(EVT_GROUP_EF)
@ -79,14 +79,14 @@ EvtScript N(EVS_ActivateSwitch) = {
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_SET(AF_KPA_04, FALSE)
EVT_SET(AF_KPA09_PlatformRaised, FALSE)
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeEntities) = {
EVT_SET(AF_KPA_04, FALSE)
EVT_SET(AF_KPA09_PlatformRaised, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_RedSwitch), -325, 0, -8, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(EVS_ActivateSwitch)))
EVT_CALL(ParentColliderToModel, COLLIDER_o19, MODEL_m_yuka)

View File

@ -13,9 +13,9 @@
#include "sprite/npc/ToadGuard.h"
enum {
NPC_Toad_01 = 0,
NPC_Toad_02 = 1,
NPC_ToadGuard = 2,
NPC_Toad_01 = 0,
NPC_Toad_02 = 1,
NPC_ToadGuard = 2,
};
#define NAMESPACE kpa_10

View File

@ -14,9 +14,16 @@
#include "sprite/npc/WorldKoopatrol.h"
enum {
NPC_Koopatrol = 0,
NPC_FlyingMagikoopa = 1, // spell uses ID 2
NPC_HammerBros = 50, // hammers use IDs 51-56
NPC_Koopatrol = 0,
NPC_FlyingMagikoopa = 1,
NPC_FlyingMagikoopa_Spell = 2,
NPC_HammerBros = 50,
NPC_HammerBros_Hammer1 = 51,
NPC_HammerBros_Hammer2 = 52,
NPC_HammerBros_Hammer3 = 53,
NPC_HammerBros_Hammer4 = 54,
NPC_HammerBros_Hammer5 = 55,
NPC_HammerBros_Hammer6 = 56,
};
#define NAMESPACE kpa_102

View File

@ -14,10 +14,10 @@
#include "sprite/npc/ToadGuard.h"
enum {
NPC_Koopatrol = 0,
NPC_Toad_01 = 1,
NPC_Toad_02 = 2,
NPC_ToadGuard = 3,
NPC_Koopatrol = 0,
NPC_Toad_01 = 1,
NPC_Toad_02 = 2,
NPC_ToadGuard = 3,
};
#define NAMESPACE kpa_11

View File

@ -13,14 +13,14 @@
#include "sprite/npc/ThrownBone.h"
enum {
NPC_DryBones_01 = 0,
NPC_DryBones_01_Hitbox1 = 1,
NPC_DryBones_01_Hitbox2 = 2,
NPC_DryBones_01_Hitbox3 = 3,
NPC_DryBones_02 = 4,
NPC_DryBones_02_Hitbox1 = 5,
NPC_DryBones_02_Hitbox2 = 6,
NPC_DryBones_02_Hitbox3 = 7,
NPC_DryBones_01 = 0,
NPC_DryBones_01_Hitbox1 = 1,
NPC_DryBones_01_Hitbox2 = 2,
NPC_DryBones_01_Hitbox3 = 3,
NPC_DryBones_02 = 4,
NPC_DryBones_02_Hitbox1 = 5,
NPC_DryBones_02_Hitbox2 = 6,
NPC_DryBones_02_Hitbox3 = 7,
};
#define NAMESPACE kpa_111

View File

@ -6,7 +6,7 @@
EvtScript N(EVS_PushRightStatue_Impl) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN
@ -20,7 +20,7 @@ EvtScript N(EVS_PushRightStatue_Impl) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN

View File

@ -6,7 +6,7 @@
EvtScript N(EVS_PushLeftStatue_Impl) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN
@ -20,7 +20,7 @@ EvtScript N(EVS_PushLeftStatue_Impl) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN

View File

@ -10,7 +10,13 @@
#include "mapfs/kpa_115_hit.h"
enum {
NPC_HammerBros = 20, // uses 21-26 for hammers
NPC_HammerBros = 20,
NPC_HammerBros_Hammer1 = 21,
NPC_HammerBros_Hammer2 = 22,
NPC_HammerBros_Hammer3 = 23,
NPC_HammerBros_Hammer4 = 24,
NPC_HammerBros_Hammer5 = 25,
NPC_HammerBros_Hammer6 = 26,
};
#define NAMESPACE kpa_115

View File

@ -6,7 +6,7 @@
EvtScript N(EVS_PushMiddleStatue_Impl) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN
@ -20,7 +20,7 @@ EvtScript N(EVS_PushMiddleStatue_Impl) = {
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, LVarA)
EVT_CALL(GetPartnerInUse, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_SET(LVar8, -1)
EVT_RETURN

View File

@ -2,15 +2,15 @@
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_SET(AF_KPA_05, FALSE)
EVT_SET(AF_KPA_06, FALSE)
EVT_SET(AF_KPA13_HitSwitchA, FALSE)
EVT_SET(AF_KPA13_HitSwitchB, FALSE)
EVT_IF_EQ(GF_KPA13_BlueSwitchA, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_BlueSwitch), 285, 10, -55, 0, MAKE_ENTITY_END)
EVT_CALL(AssignSwitchFlag, EVT_INDEX_OF_AREA_FLAG(AF_KPA_05))
EVT_CALL(AssignSwitchFlag, EVT_INDEX_OF_AREA_FLAG(AF_KPA13_HitSwitchA))
EVT_END_IF
EVT_IF_EQ(GF_KPA13_BlueSwitchB, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_BlueSwitch), 935, 10, -55, 0, MAKE_ENTITY_END)
EVT_CALL(AssignSwitchFlag, EVT_INDEX_OF_AREA_FLAG(AF_KPA_06))
EVT_CALL(AssignSwitchFlag, EVT_INDEX_OF_AREA_FLAG(AF_KPA13_HitSwitchB))
EVT_END_IF
EVT_RETURN
EVT_END

View File

@ -45,7 +45,7 @@ EvtScript N(EVS_SetupPlatforms) = {
EVT_CALL(UpdateColliderTransform, COLLIDER_o1070)
EVT_IF_EQ(GF_KPA13_BlueSwitchA, FALSE)
EVT_LABEL(11)
EVT_IF_EQ(AF_KPA_05, FALSE)
EVT_IF_EQ(AF_KPA13_HitSwitchA, FALSE)
EVT_WAIT(1)
EVT_GOTO(11)
EVT_END_IF
@ -115,7 +115,7 @@ EvtScript N(EVS_SetupPlatforms) = {
EVT_CALL(UpdateColliderTransform, COLLIDER_o1072)
EVT_IF_EQ(GF_KPA13_BlueSwitchB, FALSE)
EVT_LABEL(12)
EVT_IF_EQ(AF_KPA_06, FALSE)
EVT_IF_EQ(AF_KPA13_HitSwitchB, FALSE)
EVT_WAIT(1)
EVT_GOTO(12)
EVT_END_IF

View File

@ -13,34 +13,34 @@
#include "sprite/npc/BulletBill.h"
enum {
NPC_BillBlaster_01 = 0,
NPC_BillBlaster_02 = 1,
NPC_BillBlaster_03 = 2,
NPC_BillBlaster_04 = 3,
NPC_BillBlaster_05 = 4,
NPC_BillBlaster_06 = 5,
NPC_BillBlaster_07 = 6,
NPC_BillBlaster_08 = 7,
NPC_BulletBill_01 = 50,
NPC_BulletBill_02 = 51,
NPC_BulletBill_03 = 52,
NPC_BulletBill_04 = 53,
NPC_BulletBill_05 = 54,
NPC_BulletBill_06 = 55,
NPC_BulletBill_07 = 56,
NPC_BulletBill_08 = 57,
NPC_BulletBill_09 = 58,
NPC_BulletBill_10 = 59,
NPC_BulletBill_11 = 60,
NPC_BulletBill_12 = 61,
NPC_BulletBill_13 = 62,
NPC_BulletBill_14 = 63,
NPC_BulletBill_15 = 64,
NPC_BulletBill_16 = 65,
NPC_BulletBill_17 = 66,
NPC_BulletBill_18 = 67,
NPC_BulletBill_19 = 68,
NPC_BulletBill_20 = 69,
NPC_BillBlaster_01 = 0,
NPC_BillBlaster_02 = 1,
NPC_BillBlaster_03 = 2,
NPC_BillBlaster_04 = 3,
NPC_BillBlaster_05 = 4,
NPC_BillBlaster_06 = 5,
NPC_BillBlaster_07 = 6,
NPC_BillBlaster_08 = 7,
NPC_BulletBill_01 = 50,
NPC_BulletBill_02 = 51,
NPC_BulletBill_03 = 52,
NPC_BulletBill_04 = 53,
NPC_BulletBill_05 = 54,
NPC_BulletBill_06 = 55,
NPC_BulletBill_07 = 56,
NPC_BulletBill_08 = 57,
NPC_BulletBill_09 = 58,
NPC_BulletBill_10 = 59,
NPC_BulletBill_11 = 60,
NPC_BulletBill_12 = 61,
NPC_BulletBill_13 = 62,
NPC_BulletBill_14 = 63,
NPC_BulletBill_15 = 64,
NPC_BulletBill_16 = 65,
NPC_BulletBill_17 = 66,
NPC_BulletBill_18 = 67,
NPC_BulletBill_19 = 68,
NPC_BulletBill_20 = 69,
};
#define NAMESPACE kpa_130

View File

@ -10,7 +10,7 @@
#include "mapfs/kpa_133_hit.h"
enum {
NPC_Dummy = 0,
NPC_Dummy = 0,
};
enum {

View File

@ -12,12 +12,12 @@
#include "sprite/npc/Toad.h"
enum {
NPC_Dummy = 0,
NPC_Dummy = 0,
};
enum {
MV_SwitchEntityID = MapVar(0),
MV_Unk_01 = MapVar(1),
MV_PadlockEntityID = MapVar(1),
};
#define NAMESPACE kpa_134

View File

@ -63,9 +63,9 @@ EvtScript N(EVS_UnlockPrompt_Door) = {
EVT_END_IF
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_SET(GF_KPA134_UnlockedDoor, TRUE)
EVT_CALL(N(GetEntityPosition), MV_Unk_01, LVar0, LVar1, LVar2)
EVT_CALL(N(GetEntityPosition), MV_PadlockEntityID, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, 0, LVar0, LVar1, LVar2)
EVT_SET(LVar0, MV_Unk_01)
EVT_SET(LVar0, MV_PadlockEntityID)
EVT_CALL(N(RemovePadlock))
EVT_SET(LVar1, 0)
EVT_WAIT(5)
@ -79,7 +79,7 @@ EvtScript N(EVS_UnlockPrompt_Door) = {
EvtScript N(EVS_MakeEntities) = {
EVT_IF_EQ(GF_KPA134_UnlockedDoor, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_Padlock), 743, 10, 115, 270, MAKE_ENTITY_END)
EVT_SET(MV_Unk_01, LVar0)
EVT_SET(MV_PadlockEntityID, LVar0)
EVT_BIND_PADLOCK(EVT_PTR(N(EVS_UnlockPrompt_Door)), TRIGGER_WALL_PRESS_A, EVT_ENTITY_INDEX(0), EVT_PTR(N(KeyList_BowsersCastle)), 0, 1)
EVT_ELSE
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_130_0)), TRIGGER_WALL_PRESS_A, COLLIDER_nno, 1, 0)

View File

@ -1,13 +0,0 @@
#include "kpa_14.h"
static char* N(exit_str_0) = "kpa_13";
static char* N(exit_str_1) = "kpa_01";
static char* N(exit_str_2) = "kpa_16";
s32 N(get_tattle)(void) {
if (!evt_get_variable(NULL, GF_KPA16_ShutOffLava)) {
return MSG_MapTattle_kpa_14_before;
} else {
return MSG_MapTattle_kpa_14_after;
}
}

View File

@ -1,12 +0,0 @@
#include "kpa_14.h"
#include "world/common/atomic/TexturePan.inc.c"
ApiStatus func_8024034C_A577FC(Evt* script, s32 isInitialCall) {
if (gPartnerActionStatus.partnerActionState != 0) {
script->varTable[9] = gPartnerActionStatus.actingPartner;
} else {
script->varTable[9] = -1;
}
return ApiStatus_DONE2;
}

View File

@ -1,55 +0,0 @@
#include "kpa_14.h"
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
#include "world/common/todo/RemovePadlock.inc.c"
#include "world/common/todo/GetEntityPosition.inc.c"
ApiStatus N(func_80240710_A57BC0)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
CollisionStatus* collisionStatus = &gCollisionStatus;
evt_set_variable(script, *args++, collisionStatus->floorBelow);
return ApiStatus_DONE2;
}
ApiStatus func_8024073C_A57BEC(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 xVel = evt_get_variable(script, *args++);
s32 floor = evt_get_variable(script, *args++);
s32 temp_a0 = evt_get_variable(script, *args++);
PlayerStatus* playerStatus = &gPlayerStatus;
if (gCollisionStatus.currentFloor == floor || gCollisionStatus.lastTouchedFloor == floor) {
if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP &&
playerStatus->actionState != ACTION_STATE_SPIN_JUMP &&
temp_a0 == 0)
{
playerStatus->pushVelocity.x = xVel;
}
}
if (gPlayerData.currentPartner != PARTNER_NONE) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
if (partner->currentFloor == floor) {
partner->pos.x += xVel;
}
}
return ApiStatus_DONE2;
}
ApiStatus N(IsPartnerLakilester)(Evt* script, s32 isInitialCall) {
if (gPartnerActionStatus.actingPartner == PARTNER_LAKILESTER) {
script->varTable[9] = TRUE;
} else {
script->varTable[9] = FALSE;
}
return ApiStatus_DONE2;
}

View File

@ -2,8 +2,23 @@
/// @brief Bowser's Castle - Lava Channel 3
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_14_shape.h"
#include "mapfs/kpa_14_hit.h"
enum {
MV_PadlockEntityID = MapVar(0),
MV_LastFloorBeforeLavaFall = MapVar(10),
MV_TakingLavaFallDamage = MapVar(11),
};
#define NAMESPACE kpa_14
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_SetupPlatforms);
extern EvtScript N(EVS_ExitDoor_kpa_01_0);
extern EvtScript N(EVS_MakeEntities);

View File

@ -0,0 +1,22 @@
#include "kpa_14.h"
s32 N(get_tattle)(void) {
if (!evt_get_variable(NULL, GF_KPA16_ShutOffLava)) {
return MSG_MapTattle_kpa_14_before;
} else {
return MSG_MapTattle_kpa_14_after;
}
}
EntryList N(Entrances) = {
[kpa_14_ENTRY_0] { 30.0, 30.0, -150.0, 90.0 },
[kpa_14_ENTRY_1] { 1990.0, 30.0, -150.0, 270.0 },
[kpa_14_ENTRY_2] { 1776.0, 0.0, -187.0, 180.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { .get = &N(get_tattle) },
};

View File

@ -0,0 +1,17 @@
#include "kpa_14.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(PlayAmbientSounds, AMBIENT_UNDER_SEA1)
EVT_ELSE
EVT_CALL(ClearAmbientSounds, 250)
EVT_END_IF
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_1)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,263 @@
#include "kpa_14.h"
#include "effects.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
API_CALLABLE(N(GetActingPartner)) {
if (gPartnerActionStatus.partnerActionState != 0) {
script->varTable[9] = gPartnerActionStatus.actingPartner;
} else {
script->varTable[9] = -1;
}
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_kpa_13_1) = EVT_EXIT_WALK(60, kpa_14_ENTRY_0, "kpa_13", kpa_13_ENTRY_1);
EvtScript N(EVS_ExitDoor_kpa_01_0) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(LVar0, kpa_14_ENTRY_1)
EVT_SET(LVar1, COLLIDER_deilitte)
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_SET(LVar2, MODEL_o1035)
EVT_ELSE
EVT_SET(LVar2, MODEL_o1036)
EVT_END_IF
EVT_SET(LVar3, DOOR_SWING_OUT)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT(17)
EVT_CALL(GotoMap, EVT_PTR("kpa_01"), kpa_01_ENTRY_0)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ExitWalk_kpa_16_0) = EVT_EXIT_WALK(60, kpa_14_ENTRY_2, "kpa_16", kpa_16_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_13_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_16_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilin, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_14_ENTRY_0)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_CASE_EQ(kpa_14_ENTRY_1)
EVT_SET(LVar0, kpa_14_ENTRY_1)
EVT_SET(LVar1, COLLIDER_deilitte)
EVT_SET(LVar2, MODEL_o1035)
EVT_SET(LVar3, DOOR_SWING_OUT)
EVT_EXEC(EnterSingleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_14_ENTRY_2)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TexPan_Lava) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_0)
TEX_PAN_PARAMS_STEP(-1000, 0,-2000, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 1, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( -400, 0, -800, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 1, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o631, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o625, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o776, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o777, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o778, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o779, TEX_PANNER_1)
EVT_RETURN
EVT_END
};
LavaReset N(SafeFloorColliders)[] = {
{ .colliderID = COLLIDER_o202, .pos = { 110.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o201, .pos = { 345.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o196, .pos = { 550.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o197, .pos = { 800.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o195, .pos = { 1045.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o198, .pos = { 1400.0, 30.0, -135.0 }},
{ .colliderID = COLLIDER_o200, .pos = { 1590.0, 30.0, -90.0 }},
{ .colliderID = COLLIDER_o199, .pos = { 1940.0, 30.0, -135.0 }},
{ .colliderID = -1 }
};
EvtScript N(EVS_Touch_LeftOfLavaFall) = {
EVT_SET(MV_LastFloorBeforeLavaFall, COLLIDER_o195)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Touch_RightOfLavaFall) = {
EVT_SET(MV_LastFloorBeforeLavaFall, COLLIDER_o198)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeSmokeEffects) = {
EVT_LOOP(0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_PLAY_EFFECT(EFFECT_SMOKE_BURST, 0, LVar0, LVar1, LVar2, 1, 10)
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupLavaFall) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_LOOP(0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o854, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(N(GetActingPartner))
EVT_SWITCH(LVar9)
EVT_CASE_EQ(8)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o854, COLLIDER_FLAGS_UPPER_MASK)
EVT_CASE_EQ(9)
EVT_CASE_DEFAULT
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 120)
EVT_SWITCH(LVar0)
EVT_CASE_RANGE(1200, 1245)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_SET(MV_TakingLavaFallDamage, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_EXEC_GET_TID(N(EVS_MakeSmokeEffects), LVar9)
EVT_IF_EQ(MV_LastFloorBeforeLavaFall, COLLIDER_o195)
EVT_SET(LVar5, 1045)
EVT_ELSE
EVT_SET(LVar5, 1400)
EVT_END_IF
EVT_WAIT(1)
EVT_CALL(InterruptUsePartner)
EVT_CALL(SetPlayerActionState, ACTION_STATE_HIT_LAVA)
EVT_WAIT(10)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar5, 30, -135)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar5, 30, -135)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(MakeLerp, LVar0, LVar5, 30, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, LVar0, 250, -135)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 250, 30, 20, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, LVar5, LVar0, -135)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetPlayerAnimation, ANIM_Mario_8001A)
EVT_CALL(MakeLerp, 30, 60, 5, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, LVar5, LVar0, -135)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_KILL_THREAD(LVar9)
EVT_CALL(MakeLerp, 60, 30, 5, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, LVar5, LVar0, -135)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(5)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_WAIT(1)
EVT_SET(MV_TakingLavaFallDamage, FALSE)
EVT_END_SWITCH
EVT_END_IF
EVT_END_SWITCH
EVT_WAIT(1)
EVT_END_LOOP
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_EXEC_WAIT(N(EVS_MakeEntities))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(EnableGroup, MODEL_after, FALSE)
EVT_EXEC(N(EVS_TexPan_Lava))
EVT_ELSE
EVT_CALL(EnableGroup, MODEL_before, FALSE)
EVT_END_IF
EVT_EXEC(N(EVS_EnterMap))
EVT_EXEC(N(EVS_SetupMusic))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_EXEC(N(EVS_SetupPlatforms))
EVT_END_IF
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_THREAD
EVT_WAIT(2)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o625, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o776, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o818, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o819, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o820, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o821, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o822, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o823, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o824, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o825, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o826, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o827, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o828, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o829, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o830, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o857, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o858, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_deilin, SURFACE_TYPE_LAVA)
EVT_THREAD
EVT_CALL(ResetFromLava, EVT_PTR(N(SafeFloorColliders)))
EVT_END_THREAD
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Touch_LeftOfLavaFall)), TRIGGER_FLOOR_TOUCH, COLLIDER_o195, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Touch_RightOfLavaFall)), TRIGGER_FLOOR_TOUCH, COLLIDER_o198, 1, 0)
EVT_EXEC(N(EVS_SetupLavaFall))
EVT_END_THREAD
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o854, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,70 @@
#include "kpa_14.h"
#include "entity.h"
// similar to Chest.inc.c, except a script is missing...
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"
s32** N(varStash) = NULL;
EvtScript N(EVS_Chest_ShowGotItem) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_FULL)
EVT_WAIT(40)
EVT_CALL(ShowGotItem, LVar0, FALSE, 0)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_RETURN
EVT_RETURN
EVT_END
};
#include "world/common/todo/RemovePadlock.inc.c"
#include "world/common/todo/GetEntityPosition.inc.c"
s32 N(KeyList_BowsersCastle)[] = {
ITEM_BOWSER_CASTLE_KEY,
ITEM_NONE
};
EvtScript N(EVS_UnlockPrompt_Door) = {
EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(LVar0, 0)
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_00D8, 160, 40)
EVT_CALL(CloseChoicePopup)
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(LVar0, -1)
EVT_CALL(CloseChoicePopup)
EVT_RETURN
EVT_END_IF
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_SET(GF_KPA14_UnlockedDoor, TRUE)
EVT_CALL(N(GetEntityPosition), MV_PadlockEntityID, LVar0, LVar1, LVar2)
EVT_CALL(PlaySoundAt, SOUND_269, 0, LVar0, LVar1, LVar2)
EVT_SET(LVar0, MV_PadlockEntityID)
EVT_CALL(N(RemovePadlock))
EVT_SET(LVar1, 0)
EVT_WAIT(5)
EVT_CALL(CloseChoicePopup)
EVT_UNBIND
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoor_kpa_01_0)), TRIGGER_WALL_PRESS_A, COLLIDER_deilitte, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeEntities) = {
EVT_IF_EQ(GF_KPA14_UnlockedDoor, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_Padlock), 1995, 40, -162, 270, MAKE_ENTITY_END)
EVT_SET(MV_PadlockEntityID, LVar0)
EVT_BIND_PADLOCK(EVT_PTR(N(EVS_UnlockPrompt_Door)), TRIGGER_WALL_PRESS_A, EVT_ENTITY_INDEX(0), EVT_PTR(N(KeyList_BowsersCastle)), 0, 1)
EVT_ELSE
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoor_kpa_01_0)), TRIGGER_WALL_PRESS_A, COLLIDER_deilitte, 1, 0)
EVT_END_IF
EVT_CALL(MakeItemEntity, ITEM_MYSTERY, 350, 30, -150, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA14_Item_Mystery)
EVT_CALL(MakeItemEntity, ITEM_THUNDER_RAGE, 800, 30, -150, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_KPA14_Item_ThunderRage)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,103 @@
#include "kpa_14.h"
API_CALLABLE(N(GetFloorBelow)) {
Bytecode* args = script->ptrReadPos;
s32 outVar = *args++;
evt_set_variable(script, outVar, gCollisionStatus.floorBelow);
return ApiStatus_DONE2;
}
API_CALLABLE(N(AddPlatformPushVelocity)) {
Bytecode* args = script->ptrReadPos;
s32 velX = evt_get_variable(script, *args++);
s32 floor = evt_get_variable(script, *args++);
s32 temp_a0 = evt_get_variable(script, *args++);
PlayerStatus* playerStatus = &gPlayerStatus;
if (gCollisionStatus.currentFloor == floor || gCollisionStatus.lastTouchedFloor == floor) {
if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP &&
playerStatus->actionState != ACTION_STATE_SPIN_JUMP &&
temp_a0 == 0)
{
playerStatus->pushVelocity.x = velX;
}
}
if (gPlayerData.currentPartner != PARTNER_NONE) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
if (partner->currentFloor == floor) {
partner->pos.x += velX;
}
}
return ApiStatus_DONE2;
}
API_CALLABLE(N(IsPartnerLakilester)) {
if (gPartnerActionStatus.actingPartner == PARTNER_LAKILESTER) {
script->varTable[9] = TRUE;
} else {
script->varTable[9] = FALSE;
}
return ApiStatus_DONE2;
}
EvtScript N(EVS_SetupPlatforms) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_CALL(ParentColliderToModel, COLLIDER_o852, MODEL_o860)
EVT_SET(LVar0, 0)
EVT_SET(LVar3, 0)
EVT_LOOP(0)
EVT_CALL(MakeLerp, LVar0, 175, 175, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, MODEL_dai01, LVar0, 0, 0)
EVT_CALL(UpdateColliderTransform, COLLIDER_o852)
EVT_SET(LVar4, LVar0)
EVT_SUB(LVar4, LVar3)
EVT_SET(LVar3, LVar0)
EVT_CALL(N(AddPlatformPushVelocity), LVar4, COLLIDER_o852, MV_TakingLavaFallDamage)
EVT_IF_GT(LVar0, 145)
EVT_CALL(N(IsPartnerLakilester))
EVT_IF_EQ(LVar9, 1)
EVT_CALL(N(GetFloorBelow), LVar2)
EVT_IF_EQ(LVar2, COLLIDER_o858)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(20)
EVT_CALL(MakeLerp, LVar0, 0, 175, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, MODEL_dai01, LVar0, 0, 0)
EVT_CALL(UpdateColliderTransform, COLLIDER_o852)
EVT_SET(LVar4, LVar0)
EVT_SUB(LVar4, LVar3)
EVT_SET(LVar3, LVar0)
EVT_CALL(N(AddPlatformPushVelocity), LVar4, COLLIDER_o852, MV_TakingLavaFallDamage)
EVT_IF_LT(LVar0, 30)
EVT_CALL(N(IsPartnerLakilester))
EVT_IF_EQ(LVar9, 1)
EVT_CALL(N(GetFloorBelow), LVar2)
EVT_IF_EQ(LVar2, COLLIDER_o857)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(20)
EVT_END_LOOP
EVT_RETURN
EVT_END
};

View File

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

View File

@ -1,9 +0,0 @@
#include "kpa_15.h"
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
#include "world/common/todo/SomeItemEntityFunc.inc.c"
#include "world/common/todo/IsItemBadge.inc.c"

View File

@ -2,8 +2,15 @@
/// @brief Bowser's Castle - Lava Key Room
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_15_shape.h"
#include "mapfs/kpa_15_hit.h"
#define NAMESPACE kpa_15
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);

View File

@ -0,0 +1,12 @@
#include "kpa_15.h"
EntryList N(Entrances) = {
[kpa_15_ENTRY_0] { 12.0, 0.0, -97.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_15 },
};

View File

@ -0,0 +1,15 @@
#include "kpa_15.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(PlayAmbientSounds, AMBIENT_UNDER_SEA1)
EVT_END_IF
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_1)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,58 @@
#include "kpa_15.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(D_8024074C_A59ADC) = EVT_EXIT_WALK(40, kpa_15_ENTRY_0, "kpa_13", kpa_13_ENTRY_2);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(D_8024074C_A59ADC)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(D_802407D4_A59B64) = {
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_RETURN
EVT_END
};
EvtScript N(D_80240800_A59B90) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_0)
TEX_PAN_PARAMS_STEP( -400, 0, -800, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 1, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o811, 0)
EVT_CALL(SetTexPanner, MODEL_o813, 0)
EVT_CALL(SetTexPanner, MODEL_o814, 0)
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_EXEC_WAIT(N(EVS_MakeEntities))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(EnableGroup, MODEL_after, FALSE)
EVT_EXEC(N(D_80240800_A59B90))
EVT_ELSE
EVT_CALL(EnableGroup, MODEL_before, FALSE)
EVT_END_IF
EVT_EXEC(N(D_802407D4_A59B64))
EVT_EXEC(N(EVS_SetupMusic))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_THREAD
EVT_WAIT(2)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o781, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_deiliw, SURFACE_TYPE_LAVA)
EVT_END_THREAD
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,15 @@
#include "kpa_15.h"
#include "entity.h"
#include "world/common/atomic/Chest.inc.c"
EvtScript N(EVS_OpenChest_CastleKey) = EVT_OPEN_CHEST_KEY(ITEM_BOWSER_CASTLE_KEY, GF_KPA15_Chest_CastleKey2);
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_Chest), 220, 30, -100, 0, 0, MAKE_ENTITY_END)
EVT_CALL(AssignChestFlag, GF_KPA15_Chest_CastleKey2)
EVT_CALL(AssignScript, EVT_PTR(N(EVS_OpenChest_CastleKey)))
EVT_RETURN
EVT_END
};

View File

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

View File

@ -1,16 +0,0 @@
#include "kpa_16.h"
ApiStatus func_80240310_A5A340(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32 zoom = evt_get_variable(script, *args++);
set_screen_overlay_params_front(0, zoom);
return ApiStatus_DONE2;
}
ApiStatus func_8024034C_A5A37C(Evt* script, s32 isInitialCall) {
snd_ambient_80055618(0, 1);
return ApiStatus_DONE2;
}
#include "world/common/todo/GetFloorCollider.inc.c"

View File

@ -2,8 +2,35 @@
/// @brief Bowser's Castle - Lava Control Room
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_16_shape.h"
#include "mapfs/kpa_16_hit.h"
#include "sprite/npc/WorldGoombario.h"
#include "sprite/npc/WorldKooper.h"
#include "sprite/npc/WorldBombette.h"
#include "sprite/npc/WorldParakarry.h"
#include "sprite/npc/WorldBow.h"
#include "sprite/npc/WorldWatt.h"
#include "sprite/npc/WorldSushie.h"
#include "sprite/npc/WorldLakilester.h"
#include "sprite/npc/WorldKoopatrol.h"
#include "sprite/npc/Magikoopa.h"
enum {
NPC_Koopatrol_01 = 0,
NPC_Koopatrol_02 = 1,
NPC_Koopatrol_03 = 2,
NPC_Magikoopa = 3,
};
#define NAMESPACE kpa_16
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_TexPan_Steam);
extern EvtScript N(EVS_MakeEntities);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,12 @@
#include "kpa_16.h"
EntryList N(Entrances) = {
[kpa_16_ENTRY_0] { 25.0, 0.0, -92.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_16 },
};

View File

@ -0,0 +1,15 @@
#include "kpa_16.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(PlayAmbientSounds, AMBIENT_UNDER_SEA6)
EVT_END_IF
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_1)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,148 @@
#include "kpa_16.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(EVS_ExitWalk_kpa_14_2) = EVT_EXIT_WALK(40, kpa_16_ENTRY_0, "kpa_14", kpa_14_ENTRY_2);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_14_2)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TexPan_Steam) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( 0, 400, 0, 800)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o1157, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1158, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1159, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1160, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1162, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1163, TEX_PANNER_2)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TexPan_Lava) = {
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_0)
TEX_PAN_PARAMS_STEP(-1200, 0, -600, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 1, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 6144, 0, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( -800, 0, -400, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 1, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( 0, 3000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_4)
TEX_PAN_PARAMS_STEP( 0, 3200, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_5)
TEX_PAN_PARAMS_STEP( 0, 2800, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o1282, TEX_PANNER_0)
EVT_CALL(SetTexPanner, MODEL_o1283, TEX_PANNER_0)
EVT_CALL(SetTexPanner, MODEL_o1284, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o1285, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o1286, TEX_PANNER_1)
EVT_CALL(SetTexPanner, MODEL_o776, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o782, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o780, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o893, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o895, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o894, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o892, TEX_PANNER_2)
EVT_CALL(SetTexPanner, MODEL_o1331, TEX_PANNER_3)
EVT_CALL(SetTexPanner, MODEL_o1316, TEX_PANNER_4)
EVT_CALL(SetTexPanner, MODEL_o1321, TEX_PANNER_5)
EVT_CALL(SetTexPanner, MODEL_o1320, TEX_PANNER_5)
EVT_RETURN
EVT_END
};
LavaReset N(SafeFloorColliders)[] = {
{ .colliderID = COLLIDER_o197, .pos = { 470.0, 30.0, -30.0 }},
{ .colliderID = COLLIDER_o202, .pos = { 470.0, 30.0, -30.0 }},
{ .colliderID = COLLIDER_o785, .pos = { 500.0, 230.0, -140.0 }},
{ .colliderID = -1 }
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_BOWSERS_CASTLE)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_IF_EQ(GF_KPA16_Defeated_SwitchGuards, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o958, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(EnableGroup, MODEL_after, FALSE)
EVT_EXEC(N(EVS_TexPan_Lava))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o954, COLLIDER_FLAGS_UPPER_MASK)
EVT_ELSE
EVT_CALL(EnableGroup, MODEL_before, FALSE)
EVT_EXEC(N(EVS_TexPan_Steam))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o782, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_EXEC(N(EVS_EnterMap))
EVT_EXEC(N(EVS_SetupMusic))
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_THREAD
EVT_WAIT(2)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o782, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o929, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o930, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o776, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o952, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o954, SURFACE_TYPE_LAVA)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_deiliw, SURFACE_TYPE_LAVA)
EVT_THREAD
EVT_CALL(ResetFromLava, EVT_PTR(N(SafeFloorColliders)))
EVT_END_THREAD
EVT_END_THREAD
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o952, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,11 @@
#include "kpa_16.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_BlueSwitch), 470, 230, -145, 0, MAKE_ENTITY_END)
EVT_CALL(AssignSwitchFlag, EVT_INDEX_OF_AREA_FLAG(AF_KPA16_HitSwitch))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,332 @@
#include "kpa_16.h"
#include "world/common/enemy/complete/Koopatrol.h"
#include "world/common/enemy/complete/Magikoopa.h"
API_CALLABLE(N(SetScreenBlackFadeAmount)) {
Bytecode* args = script->ptrReadPos;
f32 amount = evt_get_variable(script, *args++);
set_screen_overlay_params_front(0, amount);
return ApiStatus_DONE2;
}
API_CALLABLE(N(MuteAmbience)) {
snd_ambient_80055618(0, 1);
return ApiStatus_DONE2;
}
#include "world/common/todo/GetFloorCollider.inc.c"
NpcSettings N(NpcSettings_Dummy) = {
.height = 40,
.radius = 24,
.level = 25,
};
EvtScript N(EVS_Scene_LavaShutoff) = {
EVT_LABEL(0)
EVT_IF_EQ(AF_KPA16_HitSwitch, FALSE)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
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_WAIT(1)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(350.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetPanTarget, CAM_DEFAULT, 330, 230, -150)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 330, 170, -150)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_THREAD
EVT_CALL(N(MuteAmbience))
EVT_SETF(LVar2, 1)
EVT_CALL(MakeLerp, 0, -20, 100, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_ADDF(LVar2, EVT_FLOAT(-0.01))
EVT_CALL(TranslateModel, MODEL_o1283, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o1282, 0, LVar0, 0)
EVT_CALL(ScaleModel, MODEL_o1282, LVar2, 1, 1)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_WAIT(50)
EVT_CALL(MakeLerp, 0, 255, 50, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetScreenBlackFadeAmount), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o782, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o929, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o930, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o776, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o952, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o954, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_deiliw, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o952, COLLIDER_FLAGS_UPPER_MASK)
EVT_EXEC(N(EVS_TexPan_Steam))
EVT_CALL(EnableGroup, MODEL_before, FALSE)
EVT_CALL(EnableGroup, MODEL_after, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o782, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o954, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(GF_KPA16_ShutOffLava, TRUE)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(MakeLerp, 255, 0, 50, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(N(SetScreenBlackFadeAmount), LVar0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(60)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(GetCurrentPartnerID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(PARTNER_GOOMBARIO)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldGoombario_Talk, ANIM_WorldGoombario_Idle, 0, MSG_CH8_001B)
EVT_CASE_EQ(PARTNER_KOOPER)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldKooper_Talk, ANIM_WorldKooper_Idle, 0, MSG_CH8_001C)
EVT_CASE_EQ(PARTNER_BOMBETTE)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldBombette_Talk, ANIM_WorldBombette_Idle, 0, MSG_CH8_001D)
EVT_CASE_EQ(PARTNER_PARAKARRY)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldParakarry_Talk, ANIM_WorldParakarry_Idle, 0, MSG_CH8_001E)
EVT_CASE_EQ(PARTNER_BOW)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldBow_Talk, ANIM_WorldBow_Idle, 0, MSG_CH8_001F)
EVT_CASE_EQ(PARTNER_WATT)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldWatt_Talk, ANIM_WorldWatt_Idle, 0, MSG_CH8_0020)
EVT_CASE_EQ(PARTNER_SUSHIE)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldSushie_Talk, ANIM_WorldSushie_Idle, 0, MSG_CH8_0021)
EVT_CASE_EQ(PARTNER_LAKILESTER)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldLakilester_Talk, ANIM_WorldLakilester_Idle, 0, MSG_CH8_0022)
EVT_END_SWITCH
EVT_CALL(EnablePartnerAI)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ChargeAtPlayer) = {
EVT_CHILD_THREAD
EVT_WAIT(15)
EVT_CALL(SetNpcSpeed, NPC_Koopatrol_01, EVT_FLOAT(3.0))
EVT_CALL(NpcMoveTo, NPC_Koopatrol_01, 650, -145, 0)
EVT_END_CHILD_THREAD
EVT_CHILD_THREAD
EVT_WAIT(10)
EVT_CALL(SetNpcSpeed, NPC_Koopatrol_03, EVT_FLOAT(3.5))
EVT_CALL(NpcMoveTo, NPC_Koopatrol_03, 650, -165, 0)
EVT_END_CHILD_THREAD
EVT_WAIT(5)
EVT_CALL(SetNpcSpeed, NPC_Koopatrol_02, EVT_FLOAT(4.0))
EVT_CALL(NpcMoveTo, NPC_Koopatrol_02, 650, -120, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_Guards) = {
EVT_LABEL(0)
EVT_WAIT(1)
EVT_CALL(N(GetFloorCollider), LVar0)
EVT_IF_NE(LVar0, COLLIDER_o785)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 230)
EVT_GOTO(0)
EVT_END_IF
EVT_IF_GT(LVar0, 710)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(PlaySoundAtNpc, NPC_Koopatrol_01, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Koopatrol_02, SOUND_262, 0)
EVT_CALL(PlaySoundAtNpc, NPC_Koopatrol_03, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_Koopatrol_01, EMOTE_EXCLAMATION, 0, 15, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Koopatrol_02, EMOTE_EXCLAMATION, 0, 15, TRUE, 0, 0, 0, 0)
EVT_CALL(ShowEmote, NPC_Koopatrol_03, EMOTE_EXCLAMATION, 0, 15, TRUE, 0, 0, 0, 0)
EVT_WAIT(15)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_01, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_02, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_03, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_Magikoopa, 90, 0)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_01, ANIM_WorldKoopatrol_Anim06)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_02, ANIM_WorldKoopatrol_Anim06)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_03, ANIM_WorldKoopatrol_Anim06)
EVT_WAIT(10)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 555, 230, -150)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 555, 230, -150)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(10.0), EVT_FLOAT(-10.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_THREAD
EVT_CALL(SetPlayerSpeed, EVT_FLOAT(3.0))
EVT_CALL(PlayerMoveTo, 680, -145, 0)
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_END_THREAD
EVT_CALL(SetSelfVar, 0, 0)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_02, ANIM_WorldKoopatrol_Anim06)
EVT_CALL(SetNpcSpeed, NPC_Koopatrol_02, EVT_FLOAT(4.0))
EVT_LABEL(10)
EVT_CALL(NpcMoveTo, NPC_Koopatrol_02, 550, -165, 0)
EVT_WAIT(5)
EVT_CALL(NpcMoveTo, NPC_Koopatrol_02, 510, -165, 0)
EVT_WAIT(5)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_IF_EQ(LVar0, 0)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(NpcMoveTo, NPC_Koopatrol_02, 535, -165, 0)
EVT_CALL(SetSelfVar, 0, 2)
EVT_END_THREAD
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_01, 270, 0)
EVT_CALL(SpeakToPlayer, NPC_Koopatrol_01, ANIM_WorldKoopatrol_Anim06, ANIM_WorldKoopatrol_Anim06, 1, MSG_CH8_0017)
EVT_THREAD
EVT_WAIT(5)
EVT_CALL(SetNpcJumpscale, NPC_Koopatrol_03, EVT_FLOAT(1.0))
EVT_CALL(GetNpcPos, NPC_Koopatrol_03, LVar0, LVar1, LVar2)
EVT_CALL(NpcJump0, NPC_Koopatrol_03, LVar0, LVar1, LVar2, 20)
EVT_END_THREAD
EVT_CALL(SpeakToPlayer, NPC_Koopatrol_03, ANIM_WorldKoopatrol_Anim06, ANIM_WorldKoopatrol_Anim06, 0, MSG_CH8_0018)
EVT_CALL(SetSelfVar, 0, 1)
EVT_LABEL(15)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_WAIT(1)
EVT_GOTO(15)
EVT_END_IF
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_02, 270, 0)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_03, 270, 0)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_01, ANIM_WorldKoopatrol_Anim01)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_02, ANIM_WorldKoopatrol_Anim01)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_03, ANIM_WorldKoopatrol_Anim01)
EVT_CALL(SpeakToPlayer, NPC_Magikoopa, ANIM_Magikoopa_Anim02, ANIM_Magikoopa_Anim01, 0, MSG_CH8_0019)
EVT_THREAD
EVT_WAIT(15)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_03, 90, 0)
EVT_WAIT(10)
EVT_CALL(InterpNpcYaw, NPC_Koopatrol_01, 90, 0)
EVT_END_THREAD
EVT_CALL(SpeakToPlayer, NPC_Koopatrol_02, ANIM_WorldKoopatrol_Anim08, ANIM_WorldKoopatrol_Anim01, 0, MSG_CH8_001A)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_01, ANIM_WorldKoopatrol_Anim06)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_02, ANIM_WorldKoopatrol_Anim06)
EVT_CALL(SetNpcAnimation, NPC_Koopatrol_03, ANIM_WorldKoopatrol_Anim06)
EVT_EXEC(N(EVS_ChargeAtPlayer))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_THREAD
EVT_LOOP(0)
EVT_WAIT(1)
EVT_IF_EQ(GF_KPA16_Defeated_SwitchGuards, TRUE)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_WAIT(30)
EVT_CALL(SetNpcPos, NPC_Koopatrol_01, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Koopatrol_02, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Koopatrol_03, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcPos, NPC_Magikoopa, NPC_DISPOSE_LOCATION)
EVT_END_THREAD
EVT_CALL(StartBossBattle, SONG_SPECIAL_BATTLE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Guards) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_SET(GF_KPA16_Defeated_SwitchGuards, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o958, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Guards) = {
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_EXEC(N(EVS_Scene_LavaShutoff))
EVT_END_IF
EVT_IF_EQ(GF_KPA16_Defeated_SwitchGuards, FALSE)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Guards)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Guards)))
EVT_ELSE
EVT_CALL(RemoveNpc, NPC_Magikoopa)
EVT_CALL(RemoveNpc, NPC_Koopatrol_02)
EVT_CALL(RemoveNpc, NPC_Koopatrol_03)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Guards)[] = {
{
.id = NPC_Koopatrol_01,
.settings = &N(NpcSettings_Dummy),
.pos = { 585.0f, 230.0f, -145.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000 | ENEMY_FLAGS_40000 | ENEMY_FLAGS_400000 | ENEMY_FLAGS_800000,
.init = &N(EVS_NpcInit_Guards),
.drops = KOOPATROL_DROPS,
.animations = KOOPATROL_ANIMS,
},
{
.id = NPC_Koopatrol_02,
.settings = &N(NpcSettings_Dummy),
.pos = { 525.0f, 230.0f, -165.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000 | ENEMY_FLAGS_40000 | ENEMY_FLAGS_400000 | ENEMY_FLAGS_800000,
.drops = KOOPATROL_DROPS,
.animations = KOOPATROL_ANIMS,
},
{
.id = NPC_Koopatrol_03,
.settings = &N(NpcSettings_Dummy),
.pos = { 550.0f, 230.0f, -120.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_2000 | ENEMY_FLAGS_40000 | ENEMY_FLAGS_400000 | ENEMY_FLAGS_800000,
.drops = KOOPATROL_DROPS,
.animations = KOOPATROL_ANIMS,
},
{
.id = NPC_Magikoopa,
.settings = &N(NpcSettings_Dummy),
.pos = { 505.0f, 230.0f, -120.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_4 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800 | ENEMY_FLAGS_40000 | ENEMY_FLAGS_400000 | ENEMY_FLAGS_800000,
.drops = MAGIKOOPA_DROPS,
.animations = MAGIKOOPA_ANIMS,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Guards), BTL_KPA_FORMATION_1D, BTL_KPA_STAGE_02),
{}
};

View File

@ -1,4 +0,0 @@
#include "kpa_17.h"
static char* N(exit_str_0) = "kpa_10";
static char* N(exit_str_1) = "kpa_11";

View File

@ -2,8 +2,30 @@
/// @brief Bowser's Castle - Lower Jail
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_17_shape.h"
#include "mapfs/kpa_17_hit.h"
#include "sprite/npc/WorldBombette.h"
#include "sprite/npc/Toad.h"
#include "sprite/npc/ToadMinister.h"
#include "sprite/npc/ToadGuard.h"
enum {
NPC_Toad_01 = 0,
NPC_Toad_02 = 1,
NPC_ToadGuard = 2,
NPC_ToadMinister = 3,
};
#define NAMESPACE kpa_17
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_BlastWall);
extern EvtScript N(EVS_Scene_FallIntoCell);
extern EvtScript N(EVS_MakeEntities);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,13 @@
#include "kpa_17.h"
EntryList N(Entrances) = {
[kpa_17_ENTRY_0] { 1042.0, 250.0, -496.0, 90.0 },
[kpa_17_ENTRY_1] { 1168.0, 30.0, -560.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_17 },
};

View File

@ -0,0 +1,13 @@
#include "kpa_17.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(ClearAmbientSounds, 250)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_1)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,13 @@
#include "kpa_17.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_HeartBlock), 1000, 90, -575, 0, MAKE_ENTITY_END)
EVT_CALL(MakeEntity, EVT_PTR(Entity_WoodenCrate), 820, 60, -565, 0, -1, MAKE_ENTITY_END)
EVT_CALL(MakeEntity, EVT_PTR(Entity_WoodenCrate), 820, 30, -565, 0, ITEM_TASTY_TONIC, MAKE_ENTITY_END)
EVT_CALL(AssignCrateFlag, GF_KPA17_Crate_TastyTonic)
EVT_CALL(MakeEntity, EVT_PTR(Entity_WoodenCrate), 855, 30, -565, 0, ITEM_LIFE_SHROOM, MAKE_ENTITY_END)
EVT_CALL(AssignCrateFlag, GF_KPA17_Crate_LifeShroom)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,61 @@
#include "kpa_17.h"
EvtScript N(EVS_ExitWalk_kpa_1X_2) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(UseExitHeading, 60, kpa_17_ENTRY_1)
EVT_EXEC(ExitWalk)
EVT_IF_EQ(GF_KPA16_ShutOffLava, FALSE)
EVT_CALL(GotoMap, EVT_PTR("kpa_11"), kpa_11_ENTRY_2)
EVT_ELSE
EVT_CALL(GotoMap, EVT_PTR("kpa_10"), kpa_10_ENTRY_2)
EVT_END_IF
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_1X_2)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, kpa_17_ENTRY_0)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_EXEC(N(EVS_Scene_FallIntoCell))
EVT_ELSE
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_END_IF
EVT_RETURN
EVT_END
};
BombTrigger N(BombPos_Wall) = {
.pos = { 1186.0f, 30.0f, -562.0f },
.radius = 0.0f
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_BOWSERS_CASTLE)
EVT_SET(AB_KPA17_Toad1_Dialogue, 0)
EVT_SET(AB_KPA17_Toad2_Dialogue, 0)
EVT_SET(AB_KPA17_Toad3_Dialogue, 0)
EVT_SET(AB_KPA17_Toad4_Dialogue, 0)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_ALT_NO_LEAD()
EVT_CALL(MakeNpcs, TRUE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_IF_EQ(GF_KPA17_BombedWall, FALSE)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_BlastWall)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Wall)), 1, 0)
EVT_ELSE
EVT_CALL(SetGroupEnabled, MODEL_g296, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitte, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_EXEC(N(EVS_SetupMusic))
EVT_EXEC(N(EVS_EnterMap))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,257 @@
#include "kpa_17.h"
#include "effects.h"
#include "world/common/npc/Toad_Stationary.inc.c"
EvtScript N(EVS_Scene_FallIntoCell) = {
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 1042, 30, -496)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 1042, 30, -496)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, FALSE)
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_WAIT(60)
EVT_CALL(PartnerIsFlying, LVar0)
EVT_IF_EQ(LVar0, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, NPC_FLAG_GRAVITY, TRUE)
EVT_ELSE
EVT_CALL(func_802CF56C, 1)
EVT_END_IF
EVT_CALL(PlaySoundAtPlayer, SOUND_161, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80018)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_LOOP(0)
EVT_SUB(LVar1, 16)
EVT_CALL(SetPlayerPos, LVar0, LVar1, LVar2)
EVT_WAIT(1)
EVT_IF_LE(LVar1, 30)
EVT_CALL(SetPlayerPos, LVar0, 30, LVar2)
EVT_CALL(PlaySoundAtPlayer, SOUND_3FB, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80018)
EVT_THREAD
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 20, EVT_FLOAT(0.6))
EVT_END_THREAD
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(1.0))
EVT_CALL(PlayerJump1, 1030, 30, -496, 10)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_WAIT(1)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_WAIT(1)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_WAIT(5)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_WAIT(1)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)
EVT_WAIT(1)
EVT_CALL(ShowMessageAtScreenPos, MSG_CH8_0007, 1000, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_WAIT(10)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(ClearPartnerMoveHistory, NPC_PARTNER)
EVT_CALL(func_802CF56C, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BlastWall) = {
EVT_PLAY_EFFECT(EFFECT_BOMBETTE_BREAKING, 0, 8, 8, 1, 10, 30)
EVT_CALL(EnableModel, MODEL_g296, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitte, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(GF_KPA17_BombedWall, TRUE)
EVT_CALL(WaitForPlayerInputEnabled)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(80)
EVT_CALL(DisablePartnerAI, 0)
EVT_WAIT(5)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldBombette_Talk, ANIM_WorldBombette_Idle, 0, MSG_CH8_0016)
EVT_CALL(EnablePartnerAI)
EVT_WAIT(10)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_UNBIND
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Toad_01) = {
EVT_SWITCH(GF_KPA17_BombedWall)
EVT_CASE_EQ(0)
EVT_SWITCH(AB_KPA17_Toad1_Dialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Red_Talk, ANIM_Toad_Red_Idle, 0, MSG_CH8_0009)
EVT_SET(AB_KPA17_Toad1_Dialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Red_Talk, ANIM_Toad_Red_Idle, 0, MSG_CH8_000A)
EVT_SET(AB_KPA17_Toad1_Dialogue, 0)
EVT_END_SWITCH
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Red_Talk, ANIM_Toad_Red_Idle, 0, MSG_CH8_000B)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Toad_02) = {
EVT_SWITCH(GF_KPA17_BombedWall)
EVT_CASE_EQ(0)
EVT_SWITCH(AB_KPA17_Toad2_Dialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Blue_Talk, ANIM_Toad_Blue_Idle, 0, MSG_CH8_000C)
EVT_SET(AB_KPA17_Toad2_Dialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Blue_Talk, ANIM_Toad_Blue_Idle, 0, MSG_CH8_000D)
EVT_SET(AB_KPA17_Toad2_Dialogue, 0)
EVT_END_SWITCH
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Blue_Talk, ANIM_Toad_Blue_Idle, 0, MSG_CH8_000E)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_ToadGuard) = {
EVT_SWITCH(GF_KPA17_BombedWall)
EVT_CASE_EQ(0)
EVT_SWITCH(AB_KPA17_Toad3_Dialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Yellow_Talk, ANIM_Toad_Yellow_Idle, 0, MSG_CH8_000F)
EVT_SET(AB_KPA17_Toad3_Dialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Yellow_Talk, ANIM_Toad_Yellow_Idle, 0, MSG_CH8_0010)
EVT_SET(AB_KPA17_Toad3_Dialogue, 0)
EVT_END_SWITCH
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Toad_Yellow_Talk, ANIM_Toad_Yellow_Idle, 0, MSG_CH8_0011)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_ToadMinister) = {
EVT_SWITCH(GF_KPA17_BombedWall)
EVT_CASE_EQ(0)
EVT_SWITCH(AB_KPA17_Toad4_Dialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_ToadMinister_Talk, ANIM_ToadMinister_Idle, 0, MSG_CH8_0012)
EVT_SET(AB_KPA17_Toad4_Dialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_ToadMinister_Talk, ANIM_ToadMinister_Idle, 0, MSG_CH8_0013)
EVT_SET(AB_KPA17_Toad4_Dialogue, 2)
EVT_CASE_EQ(2)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_ToadMinister_Talk, ANIM_ToadMinister_Idle, 0, MSG_CH8_0014)
EVT_SET(AB_KPA17_Toad4_Dialogue, 1)
EVT_END_SWITCH
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_ToadMinister_Talk, ANIM_ToadMinister_Idle, 0, MSG_CH8_0015)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Toad_01) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Toad_01)))
EVT_CALL(SetNpcPos, NPC_SELF, 813, 30, -394)
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Toad_02) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Toad_02)))
EVT_CALL(SetNpcPos, NPC_SELF, 870, 30, -465)
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_ToadGuard) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_ToadGuard)))
EVT_CALL(SetNpcPos, NPC_SELF, 930, 30, -400)
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_ToadMinister) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_ToadMinister)))
EVT_CALL(SetNpcPos, NPC_SELF, 1100, 30, -450)
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 0)
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Prisoners)[] = {
{
.id = NPC_Toad_01,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 0,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.init = &N(EVS_NpcInit_Toad_01),
.drops = NPC_NO_DROPS,
.animations = TOAD_RED_ANIMS,
.tattle = MSG_NpcTattle_KPA_CaptiveToadA,
},
{
.id = NPC_Toad_02,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 0,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.init = &N(EVS_NpcInit_Toad_02),
.drops = NPC_NO_DROPS,
.animations = TOAD_BLUE_ANIMS,
.tattle = MSG_NpcTattle_KPA_CaptiveToadB,
},
{
.id = NPC_ToadGuard,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 0,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.init = &N(EVS_NpcInit_ToadGuard),
.drops = NPC_NO_DROPS,
.animations = TOAD_GUARD_YELLOW_ANIMS,
.tattle = MSG_NpcTattle_KPA_CaptiveSoldierA,
},
{
.id = NPC_ToadMinister,
.settings = &N(NpcSettings_Toad_Stationary),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 0,
.flags = ENEMY_FLAGS_1 | ENEMY_FLAGS_100 | ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.init = &N(EVS_NpcInit_ToadMinister),
.drops = NPC_NO_DROPS,
.animations = {
.idle = ANIM_ToadMinister_Idle,
.walk = ANIM_ToadMinister_Idle,
.run = ANIM_ToadMinister_Idle,
.chase = ANIM_ToadMinister_Idle,
.anim_4 = ANIM_ToadMinister_Idle,
.anim_5 = ANIM_ToadMinister_Idle,
.death = ANIM_ToadMinister_Idle,
.hit = ANIM_ToadMinister_Idle,
.anim_8 = ANIM_ToadMinister_Idle,
.anim_9 = ANIM_ToadMinister_Idle,
.anim_A = ANIM_ToadMinister_Idle,
.anim_B = ANIM_ToadMinister_Idle,
.anim_C = ANIM_ToadMinister_Idle,
.anim_D = ANIM_ToadMinister_Idle,
.anim_E = ANIM_ToadMinister_Idle,
.anim_F = ANIM_ToadMinister_Idle,
},
.tattle = MSG_NpcTattle_KPA_ToadMinister,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Prisoners)),
{}
};

View File

@ -1,9 +0,0 @@
#include "kpa_32.h"
static char* N(exit_str_0) = "kpa_81";
static char* N(exit_str_1) = "kpa_90";
static char* N(exit_str_2) = "kpa_51";
static char* N(exit_str_3) = "kpa_96";
#include "world/common/atomic/TexturePan.inc.c"

View File

@ -2,8 +2,15 @@
/// @brief Bowser's Castle - Lower Grand Hall
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_32_shape.h"
#include "mapfs/kpa_32_hit.h"
#define NAMESPACE kpa_32
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);

View File

@ -0,0 +1,16 @@
#include "kpa_32.h"
EntryList N(Entrances) = {
[kpa_32_ENTRY_0] { -575.0, -50.0, -5.0, 90.0 },
[kpa_32_ENTRY_1] { 545.0, -50.0, -5.0, 270.0 },
[kpa_32_ENTRY_2] { 535.0, 140.0, 0.0, 270.0 },
[kpa_32_ENTRY_3] { -535.0, 140.0, 0.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_kpa_32 },
};

View File

@ -0,0 +1,12 @@
#include "kpa_32.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_2)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,8 @@
#include "kpa_32.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_SavePoint), 0, 10, 0, 0, MAKE_ENTITY_END)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,116 @@
#include "kpa_32.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(EVS_ExitDoors_kpa_81_2) = EVT_EXIT_DOUBLE_DOOR(kpa_32_ENTRY_0, "kpa_81", kpa_81_ENTRY_2, COLLIDER_ttw, MODEL_b4_doa, MODEL_o1256);
EvtScript N(EVS_ExitWalk_kpa_90_0) = EVT_EXIT_WALK(60, kpa_32_ENTRY_1, "kpa_90", kpa_90_ENTRY_0);
EvtScript N(EVS_ExitDoors_kpa_51_0) = EVT_EXIT_DOUBLE_DOOR(kpa_32_ENTRY_2, "kpa_51", kpa_51_ENTRY_0, COLLIDER_tte, MODEL_o1258, MODEL_o1257);
EvtScript N(EVS_ExitDoors_kpa_96_0) = EVT_EXIT_DOUBLE_DOOR(kpa_32_ENTRY_3, "kpa_96", kpa_96_ENTRY_0, COLLIDER_tt4, MODEL_o1248, MODEL_o1254);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_81_2)), TRIGGER_WALL_PRESS_A, COLLIDER_ttw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_90_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili3, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_51_0)), TRIGGER_WALL_PRESS_A, COLLIDER_tte, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_96_0)), TRIGGER_WALL_PRESS_A, COLLIDER_tt4, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetLoadType, LVar0)
EVT_IF_EQ(LVar0, LOAD_FROM_FILE_SELECT)
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_RETURN
EVT_END_IF
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_32_ENTRY_0)
EVT_SET(LVar0, kpa_32_ENTRY_0)
EVT_SET(LVar2, MODEL_o1256)
EVT_SET(LVar3, MODEL_b4_doa)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_32_ENTRY_1)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(kpa_32_ENTRY_2)
EVT_SET(LVar0, 2)
EVT_SET(LVar2, MODEL_o1258)
EVT_SET(LVar3, MODEL_o1257)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_32_ENTRY_3)
EVT_SET(LVar0, 3)
EVT_SET(LVar2, MODEL_o1248)
EVT_SET(LVar3, MODEL_o1254)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
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_ALT_NO_LEAD()
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupMusic))
EVT_CALL(EnableTexPanning, MODEL_o1287, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1289, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1293, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1295, TRUE)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_4)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1293, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1295, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_WAIT(10)
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1293, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1295, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1293, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1295, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_WAIT(10)
EVT_END_LOOP
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -1,9 +0,0 @@
#include "kpa_33.h"
static char* N(exit_str_0) = "kpa_94";
static char* N(exit_str_1) = "kpa_61";
static char* N(exit_str_2) = "kpa_52";
static char* N(exit_str_3) = "kpa_09";
#include "world/common/atomic/TexturePan.inc.c"

View File

@ -2,8 +2,15 @@
/// @brief Bowser's Castle - Upper Grand Hall
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_33_shape.h"
#include "mapfs/kpa_33_hit.h"
#define NAMESPACE kpa_33
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);

View File

@ -0,0 +1,16 @@
#include "kpa_33.h"
EntryList N(Entrances) = {
[kpa_33_ENTRY_0] { -547.0, -50.0, -5.0, 90.0 },
[kpa_33_ENTRY_1] { 547.0, -50.0, -5.0, 270.0 },
[kpa_33_ENTRY_2] { 550.0, 140.0, 0.0, 270.0 },
[kpa_33_ENTRY_3] { -550.0, 140.0, 0.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_kpa_33 },
};

View File

@ -0,0 +1,13 @@
#include "kpa_33.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_3)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,8 @@
#include "kpa_33.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_SavePoint), 0, 10, 0, 0, MAKE_ENTITY_END)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,117 @@
#include "kpa_33.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(EVS_ExitWalk_kpa_94_1) = EVT_EXIT_WALK(60, kpa_33_ENTRY_0, "kpa_94", kpa_94_ENTRY_1);
EvtScript N(EVS_ExitDoors_kpa_61_1) = EVT_EXIT_DOUBLE_DOOR(kpa_33_ENTRY_1, "kpa_61", kpa_61_ENTRY_1, COLLIDER_tt3, MODEL_o1250, MODEL_b3_doa);
EvtScript N(EVS_ExitDoors_kpa_52_0) = EVT_EXIT_DOUBLE_DOOR(kpa_33_ENTRY_2, "kpa_52", kpa_52_ENTRY_0, COLLIDER_tte, MODEL_o1252, MODEL_o1253);
EvtScript N(EVS_ExitDoors_kpa_09_1) = EVT_EXIT_DOUBLE_DOOR(kpa_33_ENTRY_3, "kpa_09", kpa_09_ENTRY_1, COLLIDER_tt4, MODEL_o1258, MODEL_o1259);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_94_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_61_1)), TRIGGER_WALL_PRESS_A, COLLIDER_tt3, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_52_0)), TRIGGER_WALL_PRESS_A, COLLIDER_tte, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_09_1)), TRIGGER_WALL_PRESS_A, COLLIDER_tt4, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetLoadType, LVar0)
EVT_IF_EQ(LVar0, LOAD_FROM_FILE_SELECT)
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_RETURN
EVT_END_IF
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_33_ENTRY_0)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(kpa_33_ENTRY_1)
EVT_SET(LVar0, kpa_33_ENTRY_1)
EVT_SET(LVar2, MODEL_o1250)
EVT_SET(LVar3, MODEL_b3_doa)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_33_ENTRY_2)
EVT_SET(LVar0, kpa_33_ENTRY_2)
EVT_SET(LVar2, MODEL_o1252)
EVT_SET(LVar3, MODEL_o1253)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_33_ENTRY_3)
EVT_SET(LVar0, kpa_33_ENTRY_3)
EVT_SET(LVar2, MODEL_o1258)
EVT_SET(LVar3, MODEL_o1259)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
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_ALT_NO_LEAD()
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupMusic))
EVT_CALL(EnableTexPanning, MODEL_o1286, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1287, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1289, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o1290, TRUE)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_4)
TEX_PAN_PARAMS_STEP( 20, 20, -20, -20)
TEX_PAN_PARAMS_FREQ( 1, 1, 1, 1)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(ScaleModel, MODEL_o1286, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_CALL(ScaleModel, MODEL_o1290, EVT_FLOAT(1.02), 1, EVT_FLOAT(1.02))
EVT_WAIT(10)
EVT_CALL(ScaleModel, MODEL_o1286, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_CALL(ScaleModel, MODEL_o1290, EVT_FLOAT(1.0), 1, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ScaleModel, MODEL_o1286, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1287, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1289, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_CALL(ScaleModel, MODEL_o1290, EVT_FLOAT(0.98), 1, EVT_FLOAT(0.98))
EVT_WAIT(10)
EVT_END_LOOP
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -1,5 +0,0 @@
#include "kpa_40.h"
static char* N(exit_str_0) = "kpa_52";
static char* N(exit_str_1) = "kpa_40";
static char* N(exit_str_2) = "kpa_41";

View File

@ -2,8 +2,14 @@
/// @brief Bowser's Castle - Maze Guide Room
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_40_shape.h"
#include "mapfs/kpa_40_hit.h"
#define NAMESPACE kpa_40
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);

View File

@ -0,0 +1,15 @@
#include "kpa_40.h"
EntryList N(Entrances) = {
[kpa_40_ENTRY_0] { -490.0, 0.0, -80.0, 90.0 },
[kpa_40_ENTRY_1] { 490.0, 0.0, -30.0, 270.0 },
[kpa_40_ENTRY_2] { 490.0, 120.0, -130.0, 270.0 },
[kpa_40_ENTRY_3] { -430.0, 133.0, -80.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_40 },
};

View File

@ -0,0 +1,13 @@
#include "kpa_40.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_3)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,54 @@
#include "kpa_40.h"
EvtScript N(EVS_ExitDoors_kpa_52_1) = EVT_EXIT_DOUBLE_DOOR(kpa_40_ENTRY_0, "kpa_52", kpa_52_ENTRY_1, COLLIDER_ttw, MODEL_o526, MODEL_o525);
EvtScript N(EVS_ExitWalk_kpa_40_3) = EVT_EXIT_WALK(60, kpa_40_ENTRY_1, "kpa_40", kpa_40_ENTRY_3);
EvtScript N(EVS_ExitWalk_kpa_41_3) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(UseExitHeading, 60, kpa_40_ENTRY_2)
EVT_EXEC(ExitWalk)
EVT_SET(AB_KPA_MazeProgress, 1)
EVT_CALL(GotoMap, EVT_PTR("kpa_41"), kpa_41_ENTRY_3)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_52_1)), TRIGGER_WALL_PRESS_A, COLLIDER_ttw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_40_3)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie2, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_41_3)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_40_ENTRY_0)
EVT_SET(LVar0, kpa_40_ENTRY_0)
EVT_SET(LVar2, MODEL_o526)
EVT_SET(LVar3, MODEL_o525)
EVT_EXEC(EnterDoubleDoor)
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_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_BOWSERS_CASTLE)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupMusic))
EVT_RETURN
EVT_END
};

View File

@ -1,5 +0,0 @@
#include "kpa_41.h"
static char* N(exit_str_0) = "kpa_40";
static char* N(exit_str_1) = "kpa_41";
static char* N(exit_str_2) = "kpa_102";

View File

@ -2,8 +2,14 @@
/// @brief Bowser's Castle - Maze Room
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_41_shape.h"
#include "mapfs/kpa_41_hit.h"
#define NAMESPACE kpa_41
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);

View File

@ -0,0 +1,15 @@
#include "kpa_41.h"
EntryList N(Entrances) = {
[kpa_41_ENTRY_0] { -340.0, 0.0, -70.0, 90.0 },
[kpa_41_ENTRY_1] { 340.0, 0.0, -70.0, 270.0 },
[kpa_41_ENTRY_2] { 340.0, 119.0, -230.0, 270.0 },
[kpa_41_ENTRY_3] { -340.0, 119.0, -230.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_41 },
};

View File

@ -0,0 +1,12 @@
#include "kpa_41.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_3)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,84 @@
#include "kpa_41.h"
EvtScript N(EVS_ExitWalk_LowerLeft) = EVT_EXIT_WALK(60, kpa_41_ENTRY_0, "kpa_40", kpa_40_ENTRY_1);
EvtScript N(EVS_ExitWalk_LowerRight) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(UseExitHeading, 60, kpa_41_ENTRY_1)
EVT_EXEC(ExitWalk)
EVT_SWITCH(AB_KPA_MazeProgress)
EVT_CASE_OR_EQ(1)
EVT_CASE_OR_EQ(2)
EVT_CASE_OR_EQ(4)
EVT_ADD(AB_KPA_MazeProgress, 1)
EVT_CALL(GotoMap, EVT_PTR("kpa_41"), kpa_41_ENTRY_0)
EVT_END_CASE_GROUP
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(3)
EVT_CASE_OR_EQ(5)
EVT_CALL(GotoMap, EVT_PTR("kpa_40"), kpa_40_ENTRY_3)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ExitWalk_UpperLeft) = EVT_EXIT_WALK(60, kpa_41_ENTRY_3, "kpa_40", kpa_40_ENTRY_2);
EvtScript N(EVS_ExitWalk_UpperRight) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(UseExitHeading, 60, kpa_41_ENTRY_2)
EVT_EXEC(ExitWalk)
EVT_SWITCH(AB_KPA_MazeProgress)
EVT_CASE_EQ(5)
EVT_SET(AB_KPA_MazeProgress, 0)
EVT_CALL(GotoMap, EVT_PTR("kpa_102"), kpa_102_ENTRY_0)
EVT_CASE_EQ(3)
EVT_ADD(AB_KPA_MazeProgress, 1)
EVT_CALL(GotoMap, EVT_PTR("kpa_41"), kpa_41_ENTRY_3)
EVT_CASE_OR_EQ(0)
EVT_CASE_OR_EQ(1)
EVT_CASE_OR_EQ(2)
EVT_CASE_OR_EQ(4)
EVT_CALL(GotoMap, EVT_PTR("kpa_40"), kpa_40_ENTRY_3)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_LowerLeft)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_LowerRight)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_UpperLeft)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili3, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_UpperRight)), TRIGGER_FLOOR_ABOVE, COLLIDER_deili4, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_41_ENTRY_2)
EVT_SET(AB_KPA_MazeProgress, 5)
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_WAIT(1)
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_EXEC(N(EVS_EnterMap))
EVT_EXEC(N(EVS_SetupMusic))
EVT_RETURN
EVT_END
};

View File

@ -1,10 +0,0 @@
#include "kpa_50.h"
static char* N(exit_str_0) = "kpa_70";
static char* N(exit_str_1) = "kpa_81";
#include "world/common/enemy/ai/RangedAttackAI.inc.c"
#include "world/common/todo/GetEncounterEnemyIsOwner.inc.c"
#include "world/common/enemy/ai/TackleAI.inc.c"

View File

@ -2,8 +2,30 @@
/// @brief Bowser's Castle - Hall to Guard Door 1
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_50_shape.h"
#include "mapfs/kpa_50_hit.h"
#include "sprite/npc/HammerBros.h"
#include "sprite/npc/WorldKoopatrol.h"
enum {
NPC_Koopatrol_01 = 0,
NPC_Koopatrol_02 = 1,
NPC_HammerBros = 10,
NPC_HammerBros_Hammer1 = 11,
NPC_HammerBros_Hammer2 = 12,
NPC_HammerBros_Hammer3 = 13,
NPC_HammerBros_Hammer4 = 14,
NPC_HammerBros_Hammer5 = 15,
NPC_HammerBros_Hammer6 = 16,
};
#define NAMESPACE kpa_50
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,13 @@
#include "kpa_50.h"
EntryList N(Entrances) = {
[kpa_50_ENTRY_0] { -480.0, 0.0, -28.0, 90.0 },
[kpa_50_ENTRY_1] { 770.0, 0.0, -28.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_50 },
};

View File

@ -0,0 +1,13 @@
#include "kpa_50.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(ClearAmbientSounds, 250)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_1)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,43 @@
#include "kpa_50.h"
EvtScript N(EVS_ExitWalk_kpa_70_1) = EVT_EXIT_WALK(60, kpa_50_ENTRY_0, "kpa_70", kpa_70_ENTRY_1);
EvtScript N(EVS_ExitDoors_kpa_81_0) = EVT_EXIT_DOUBLE_DOOR(kpa_50_ENTRY_1, "kpa_81", kpa_81_ENTRY_0, COLLIDER_tte, MODEL_o324, MODEL_o322);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_kpa_70_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_81_0)), TRIGGER_WALL_PRESS_A, COLLIDER_tte, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_50_ENTRY_0)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(kpa_50_ENTRY_1)
EVT_SET(LVar0, kpa_50_ENTRY_1)
EVT_SET(LVar2, MODEL_o324)
EVT_SET(LVar3, MODEL_o322)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
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_CALL(SetGroupEnabled, MODEL_dw1, 0)
EVT_CALL(SetGroupEnabled, MODEL_dw2, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_tte, COLLIDER_FLAGS_UPPER_MASK)
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupMusic))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,85 @@
#include "kpa_50.h"
#include "world/common/enemy/complete/HammerBros.inc.c"
#include "world/common/enemy/complete/Koopatrol_Wander.inc.c"
StaticNpc N(NpcData_Koopatrol_01) = {
.id = NPC_Koopatrol_01,
.settings = &N(NpcSettings_Koopatrol_Wander),
.pos = { -251.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = KOOPATROL_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -251, 0, -30 },
.wanderSize = { 50 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -251, 0, -30 },
.detectSize = { 300 },
}
},
.animations = KOOPATROL_ANIMS,
};
StaticNpc N(NpcData_Koopatrol_02) = {
.id = NPC_Koopatrol_02,
.settings = &N(NpcSettings_Koopatrol_Wander),
.pos = { 100.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = KOOPATROL_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 100, 0, -30 },
.wanderSize = { 50 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 100, 0, -30 },
.detectSize = { 300 },
}
},
.animations = KOOPATROL_ANIMS,
};
StaticNpc N(NpcData_HammerBros_01)[] = {
{
.id = NPC_HammerBros,
.settings = &N(NpcSettings_HammerBros),
.pos = { 450.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = HAMMER_BROS_DROPS,
.territory = {
.wander = {
.isFlying = FALSE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 450, 0, -30 },
.wanderSize = { 50 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 450, 0, -30 },
.detectSize = { 300 },
}
},
.animations = HAMMER_BROS_ANIMS,
},
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 1),
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 2),
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 3),
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 4),
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 5),
HAMMER_BROS_HAMMER_HITBOX(NPC_HammerBros + 6),
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Koopatrol_01), BTL_KPA_FORMATION_18, BTL_KPA_STAGE_00),
NPC_GROUP(N(NpcData_Koopatrol_02), BTL_KPA_FORMATION_1A, BTL_KPA_STAGE_00),
NPC_GROUP(N(NpcData_HammerBros_01), BTL_KPA_FORMATION_0F, BTL_KPA_STAGE_00),
{}
};

View File

@ -1,10 +0,0 @@
#include "kpa_51.h"
ApiStatus func_80240000_A64090(Evt* script, s32 isInitialCall) {
sprintf(wMapShapeName, "kpa_50_shape");
sprintf(wMapHitName, "kpa_50_hit");
return ApiStatus_BLOCK;
}
const char* N(exit_str_0) = "kpa_32";
const char* N(exit_str_1) = "kpa_133";

View File

@ -1,5 +0,0 @@
#include "kpa_51.h"
#include "world/common/enemy/ai/MagikoopaAI.inc.c"
#include "world/common/enemy/ai/TackleAI.inc.c"

View File

@ -2,8 +2,26 @@
/// @brief Bowser's Castle - Hall to Water Puzzle
#include "common.h"
#include "../kpa.h"
#include "message_ids.h"
#include "map.h"
#include "../kpa.h"
#include "mapfs/kpa_50_shape.h"
#include "mapfs/kpa_50_hit.h"
#include "sprite/npc/Magikoopa.h"
#include "sprite/npc/WorldKoopatrol.h"
enum {
NPC_Magikoopa_01 = 0,
NPC_Magikoopa_01_Spell = 1,
NPC_Magikoopa_02 = 2,
NPC_Magikoopa_02_Spell = 3,
NPC_Koopatrol = 4,
};
#define NAMESPACE kpa_51
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,13 @@
#include "kpa_51.h"
EntryList N(Entrances) = {
[kpa_51_ENTRY_0] { -470.0, 0.0, -28.0, 90.0 },
[kpa_51_ENTRY_1] { 745.0, 0.0, -28.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.tattle = { MSG_MapTattle_kpa_51 },
};

View File

@ -0,0 +1,13 @@
#include "kpa_51.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(SetMusicTrack, 0, SONG_BOWSERS_CASTLE, 0, 8)
EVT_CALL(UseDoorSounds, DOOR_SOUNDS_METAL)
EVT_THREAD
EVT_WAIT(30)
EVT_CALL(SetMusicTrackVolumes, TRACK_VOLS_KPA_2)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,52 @@
#include "kpa_51.h"
s32 N(map_init)(void) {
sprintf(wMapShapeName, "kpa_50_shape");
sprintf(wMapHitName, "kpa_50_hit");
return FALSE;
}
EvtScript N(EVS_ExitDoors_kpa_32_2) = EVT_EXIT_DOUBLE_DOOR(kpa_51_ENTRY_0, "kpa_32", kpa_32_ENTRY_2, COLLIDER_ttw, MODEL_o321, MODEL_o323);
EvtScript N(EVS_ExitDoors_kpa_133_0) = EVT_EXIT_DOUBLE_DOOR(kpa_51_ENTRY_1, "kpa_133", kpa_133_ENTRY_0, COLLIDER_tte, MODEL_o324, MODEL_o322);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_32_2)), TRIGGER_WALL_PRESS_A, COLLIDER_ttw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kpa_133_0)), TRIGGER_WALL_PRESS_A, COLLIDER_tte, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(kpa_51_ENTRY_0)
EVT_SET(LVar0, kpa_51_ENTRY_0)
EVT_SET(LVar2, MODEL_o321)
EVT_SET(LVar3, MODEL_o323)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(kpa_51_ENTRY_1)
EVT_SET(LVar0, kpa_51_ENTRY_1)
EVT_SET(LVar2, MODEL_o324)
EVT_SET(LVar3, MODEL_o322)
EVT_EXEC(EnterDoubleDoor)
EVT_EXEC(N(EVS_BindExitTriggers))
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_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_ttw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_tte, COLLIDER_FLAGS_UPPER_MASK)
EVT_EXEC(N(EVS_EnterMap))
EVT_WAIT(1)
EVT_EXEC(N(EVS_SetupMusic))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,89 @@
#include "kpa_51.h"
#include "world/common/enemy/complete/Magikoopa.inc.c"
#include "world/common/enemy/complete/Koopatrol_Wander.inc.c"
StaticNpc N(NpcData_Magikoopa_01)[] = {
{
.id = NPC_Magikoopa_01,
.settings = &N(NpcSettings_Magikoopa),
.pos = { -130.0f, 0.0f, -30.0f },
.yaw = 90,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = MAGIKOOPA_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_RECT,
.centerPos = { -130, 0, -30 },
.wanderSize = { 100, 20 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -130, 0, -30 },
.detectSize = { 200 },
}
},
.animations = MAGIKOOPA_ANIMS,
.extraAnimations = N(ExtraAnims_Magikoopa),
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
},
MAGIKOOPA_SPELL_HITBOX(NPC_Magikoopa_01 + 1)
};
StaticNpc N(NpcData_Magikoopa_02)[] = {
{
.id = NPC_Magikoopa_02,
.settings = &N(NpcSettings_Magikoopa),
.pos = { 150.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = MAGIKOOPA_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_RECT,
.centerPos = { 150, 0, -30 },
.wanderSize = { 100, 20 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 150, 0, -30 },
.detectSize = { 200 },
}
},
.animations = MAGIKOOPA_ANIMS,
.extraAnimations = N(ExtraAnims_Magikoopa),
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
},
MAGIKOOPA_SPELL_HITBOX(NPC_Magikoopa_02 + 1)
};
StaticNpc N(NpcData_Koopatrol) = {
.id = NPC_Koopatrol,
.settings = &N(NpcSettings_Koopatrol_Wander),
.pos = { 0.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = ENEMY_FLAGS_400 | ENEMY_FLAGS_800,
.drops = KOOPATROL_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 0, 0, -30 },
.wanderSize = { 50 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 0, 0, -30 },
.detectSize = { 300 },
}
},
.animations = KOOPATROL_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Magikoopa_01), BTL_KPA_FORMATION_2C, BTL_KPA_STAGE_00),
NPC_GROUP(N(NpcData_Magikoopa_02), BTL_KPA_FORMATION_29, BTL_KPA_STAGE_00),
NPC_GROUP(N(NpcData_Koopatrol), BTL_KPA_FORMATION_24, BTL_KPA_STAGE_00),
{}
};

View File

@ -1,10 +0,0 @@
#include "kpa_52.h"
static char* N(exit_str_0) = "kpa_33";
static char* N(exit_str_1) = "kpa_40";
static char* N(exit_str_2) = "kpa_08";
static char* N(exit_str_3) = "";
#include "world/common/todo/RemovePadlock.inc.c"
#include "world/common/todo/GetEntityPosition.inc.c"

View File

@ -1,5 +0,0 @@
#include "kpa_52.h"
#include "world/common/enemy/ai/RangedAttackAI.inc.c"
#include "world/common/todo/GetEncounterEnemyIsOwner.inc.c"

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