DSL Script conversion (#562)

* start converting scritps to new syntax

* convert old DSL scripts to new format

* update disasm_script and disasm more DSL scripts

* .

* .

* resolve issues

* add EVT_PTR() to GotoMap calls
This commit is contained in:
Alexander Faßbender 2021-12-24 14:29:05 +01:00 committed by GitHub
parent 6667a4288f
commit f82f699188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 5696 additions and 5287 deletions

View File

@ -1544,37 +1544,6 @@ enum DamageTypes {
DAMAGE_TYPE_TRIGGER_LUCKY = 0x80000000,
};
enum damageType {
DAMAGETYPE_FIRE = 0x00000002,
DAMAGETYPE_WATER = 0x00000004,
DAMAGETYPE_ICE = 0x00000008,
DAMAGETYPE_MAGIC = 0x00000010,
DAMAGETYPE_ELECTRIC = 0x00000020,
DAMAGETYPE_SMASH = 0x00000040,
DAMAGETYPE_JUMP = 0x00000080,
DAMAGETYPE_COSMIC = 0x00000100,
DAMAGETYPE_BLAST = 0x00000200,
DAMAGETYPE_POW = 0x00000400,
DAMAGETYPE_QUAKE = 0x00000800,
DAMAGETYPE_FEAR = 0x00001000,
DAMAGETYPE_AIR_LIFT = 0x00008000,
DAMAGETYPE_SPINY_SURGE = 0x00010000,
DAMAGETYPE_SHELL_CRACK = 0x00020000,
DAMAGETYPE_THROW = 0x00040000,
DAMAGETYPE_POWER_BOUNCE = 0x00100000,
DAMAGETYPE_QUAKE_HAMMER = 0x00200000,
DAMAGETYPE_REMOVE_BUFFS = 0x00400000,
DAMAGETYPE_PEACH_BEAM = 0x00800000,
DAMAGETYPE_MULTI_BOUNCE = 0x01000000,
DAMAGETYPE_UNBLOCKABLE = 0x02000000,
DAMAGETYPE_SPIN_SMASH = 0x04000000,
DAMAGETYPE_IGNORE_DEFENSE = 0x08000000,
DAMAGETYPE_NO_CONTACT = 0x10000000,
DAMAGETYPE_NO_OTHER_DAMAGE_POPUPS = 0x20000000,
DAMAGETYPE_STATUS_ALWAYS_HITS = 0x40000000,
DAMAGETYPE_TRIGGER_LUCKY = 0x80000000,
};
enum PartnerIDs {
PARTNER_NONE = 0x00000000,
PARTNER_GOOMBARIO = 0x00000001,

View File

@ -101,7 +101,7 @@
/// An entity index. Entities are assigned indices in the order they are created with EVT_CALL(MakeEntity, ...).
/// Supported in EVT_BIND_TRIGGER and EVT_BIND_PADLOCK only.
#define EVT_ENTITY_INDEX(entityIndex) (((((entityIndex)) + 0x400)))
#define EVT_ENTITY_INDEX(entityIndex) (((((entityIndex)) + 0x4000)))
/****** INSTRUCTIONS **************************************************************************************************/

View File

@ -7,39 +7,45 @@ EvtSource N(exitWalk_802410F0) = EXIT_WALK_SCRIPT(60, 0, "arn_05", 1);
EvtSource N(exitWalk_8024114C) = EXIT_WALK_SCRIPT(60, 1, "arn_04", 0);
EvtSource N(802411A8) = SCRIPT({
bind N(exitWalk_802410F0) TRIGGER_FLOOR_ABOVE 1;
bind N(exitWalk_8024114C) TRIGGER_FLOOR_ABOVE 6;
});
EvtSource N(802411A8) = {
EVT_BIND_TRIGGER(N(exitWalk_802410F0), TRIGGER_FLOOR_ABOVE, 1, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_8024114C), TRIGGER_FLOOR_ABOVE, 6, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_GUSTY_GULCH;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80241A9C));
await N(makeEntities);
spawn N(80241040);
EVT_VAR(0) = N(802411A8);
spawn EnterWalk;
sleep 1;
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 34)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80241A9C)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80241040))
EVT_SET(EVT_VAR(0), EVT_PTR(N(802411A8)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};
static s32 N(pad_12C4)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(makeEntities) = SCRIPT({
MakeItemEntity(ITEM_DIZZY_DIAL, -248, 193, 45, 17, EVT_SAVE_FLAG(1005));
MakeItemEntity(ITEM_LETTER07, 536, 260, 227, 17, EVT_SAVE_FLAG(1006));
MakeEntity(0x802EA564, -350, 172, 170, 0, ITEM_COIN, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1002));
MakeEntity(0x802EA564, 225, 265, 30, 0, ITEM_COIN, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1003));
MakeEntity(0x802EA564, 275, 265, 150, 0, ITEM_REPEL_GEL, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1004));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeItemEntity, ITEM_DIZZY_DIAL, -248, 193, 45, 17, EVT_SAVE_FLAG(1005))
EVT_CALL(MakeItemEntity, ITEM_LETTER07, 536, 260, 227, 17, EVT_SAVE_FLAG(1006))
EVT_CALL(MakeEntity, 0x802EA564, -350, 172, 170, 0, 343, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1002))
EVT_CALL(MakeEntity, 0x802EA564, 225, 265, 30, 0, 343, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1003))
EVT_CALL(MakeEntity, 0x802EA564, 275, 265, 150, 0, 151, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1004))
EVT_RETURN
EVT_END
};
NpcAISettings N(npcAISettings_802413D0) = {
.moveSpeed = 1.8f,
@ -54,9 +60,11 @@ NpcAISettings N(npcAISettings_802413D0) = {
.unk_2C = 1,
};
EvtSource N(npcAI_80241400) = SCRIPT({
DoBasicAI(N(npcAISettings_802413D0));
});
EvtSource N(npcAI_80241400) = {
EVT_CALL(DoBasicAI, EVT_PTR(N(npcAISettings_802413D0)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80241420) = {
.height = 20,
@ -81,9 +89,11 @@ NpcAISettings N(npcAISettings_8024144C) = {
.unk_2C = 1,
};
EvtSource N(npcAI_8024147C) = SCRIPT({
N(func_80240C90_BDDE40)(N(npcAISettings_8024144C), 8);
});
EvtSource N(npcAI_8024147C) = {
EVT_CALL(N(func_80240C90_BDDE40), EVT_PTR(N(npcAISettings_8024144C)), 8)
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802414A0) = {
.height = 24,

View File

@ -14,16 +14,16 @@ MapConfig N(config) = {
.tattle = { MSG_arn_02_tattle },
};
EvtSource N(80241040) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
PlayAmbientSounds(AMBIENT_WIND);
});
EvtSource N(80241040) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_RETURN
EVT_END
};

File diff suppressed because it is too large Load Diff

View File

@ -13,16 +13,16 @@ MapConfig N(config) = {
.tattle = { MSG_arn_03_tattle },
};
EvtSource N(80241780) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
PlayAmbientSounds(AMBIENT_WIND);
});
EvtSource N(80241780) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_RETURN
EVT_END
};

View File

@ -8,24 +8,28 @@ EvtSource N(exitWalk_80243480) = EXIT_WALK_SCRIPT(60, 0, "arn_02", 1);
EvtSource N(exitWalk_802434DC) = EXIT_WALK_SCRIPT(60, 1, "dgb_00", 0);
EvtSource N(80243538) = SCRIPT({
bind N(exitWalk_80243480) TRIGGER_FLOOR_ABOVE 1;
bind N(exitWalk_802434DC) TRIGGER_FLOOR_ABOVE 6;
});
EvtSource N(80243538) = {
EVT_BIND_TRIGGER(N(exitWalk_80243480), TRIGGER_FLOOR_ABOVE, 1, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_802434DC), TRIGGER_FLOOR_ABOVE, 6, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_GUSTY_GULCH;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80244000));
await N(makeEntities);
spawn N(802433D0);
EVT_VAR(0) = N(80243538);
spawn EnterWalk;
sleep 1;
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 34)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80244000)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(802433D0))
EVT_SET(EVT_VAR(0), EVT_PTR(N(80243538)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};
static s32 N(pad_3654)[] = {
0x00000000, 0x00000000, 0x00000000,
@ -44,9 +48,11 @@ NpcAISettings N(npcAISettings_80243660) = {
.unk_2C = 1,
};
EvtSource N(npcAI_80243690) = SCRIPT({
N(func_80240B94_BE4344)(N(npcAISettings_80243660));
});
EvtSource N(npcAI_80243690) = {
EVT_CALL(N(func_80240B94_BE4344), EVT_PTR(N(npcAISettings_80243660)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802436B0) = {
.height = 20,
@ -75,13 +81,15 @@ NpcAISettings N(npcAISettings_802436F4) = {
.unk_2C = 1,
};
EvtSource N(npcAI_80243724) = SCRIPT({
SetSelfVar(0, 1);
SetSelfVar(5, -850);
SetSelfVar(6, 60);
SetSelfVar(1, 700);
N(func_8024219C_BE594C)(N(npcAISettings_802436F4));
});
EvtSource N(npcAI_80243724) = {
EVT_CALL(SetSelfVar, 0, 1)
EVT_CALL(SetSelfVar, 5, -850)
EVT_CALL(SetSelfVar, 6, 60)
EVT_CALL(SetSelfVar, 1, 700)
EVT_CALL(N(func_8024219C_BE594C), EVT_PTR(N(npcAISettings_802436F4)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243794) = {
.height = 18,
@ -107,9 +115,11 @@ NpcAISettings N(npcAISettings_802437C0) = {
.unk_2C = 1,
};
EvtSource N(npcAI_802437F0) = SCRIPT({
N(func_80243018_BE67C8)(N(npcAISettings_802437C0), 8);
});
EvtSource N(npcAI_802437F0) = {
EVT_CALL(N(func_80243018_BE67C8), EVT_PTR(N(npcAISettings_802437C0)), 8)
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243814) = {
.height = 24,
@ -266,15 +276,17 @@ static s32 N(pad_403C)[] = {
0x00000000,
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EA564, 450, 285, 120, 0, ITEM_SUPER_SHROOM, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1008));
MakeEntity(0x802EA564, 720, 333, 75, 0, ITEM_COIN, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1009));
MakeEntity(0x802EA0E8, 600, 290, 200, 0, MAKE_ENTITY_END);
AssignBlockFlag(EVT_SAVE_FLAG(1010));
MakeItemEntity(ITEM_STAR_PIECE, 540, 230, 13, 17, EVT_SAVE_FLAG(1019));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, 0x802EA564, 450, 285, 120, 0, 140, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1008))
EVT_CALL(MakeEntity, 0x802EA564, 720, 333, 75, 0, 343, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1009))
EVT_CALL(MakeEntity, 0x802EA0E8, 600, 290, 200, 0, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1010))
EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, 540, 230, 13, 17, EVT_SAVE_FLAG(1019))
EVT_RETURN
EVT_END
};
#include "world/common/UnkNpcAIFunc24.inc.c"

View File

@ -14,16 +14,16 @@ MapConfig N(config) = {
.tattle = { MSG_arn_04_tattle },
};
EvtSource N(802433D0) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
PlayAmbientSounds(AMBIENT_WIND);
});
EvtSource N(802433D0) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_RETURN
EVT_END
};

File diff suppressed because it is too large Load Diff

View File

@ -14,19 +14,18 @@ MapConfig N(config) = {
.tattle = { MSG_arn_05_tattle },
};
EvtSource N(80241360) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_SAW_TUBBA_EAT_BOO {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
PlayAmbientSounds(AMBIENT_WIND);
});
EvtSource N(80241360) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-33)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_RETURN
EVT_END
};

View File

@ -10,151 +10,157 @@ s32 N(itemList_80242040)[] = {
ITEM_NONE,
};
EvtSource N(80242048) = SCRIPT({
FadeOutMusic(0, 1000);
EVT_VAR(0) = 0;
if (EVT_VAR(0) == 0) {
DisablePlayerInput(TRUE);
UseSettingsFrom(0, 145, 65, 0);
SetCamSpeed(0, 0.6005859375);
SetPanTarget(0, 145, 30, 0);
GetCamDistance(0, EVT_VAR(1));
EVT_VAR(1) -= 100;
SetCamDistance(0, EVT_VAR(1));
if (10000 != 10000) {
GetCamPitch(0, EVT_VAR(2), EVT_VAR(3));
SetCamPitch(0, EVT_VAR(2), 10000);
}
PanToTarget(0, 0, 1);
N(StarSpiritEffectFunc2)(2, 50, 100, 31, -6, 145, 65, 0, 30, 0);
spawn {
N(StarSpiritEffectFunc3)();
}
spawn {
sleep 1;
PlaySound(0x80000067);
N(StarSpiritEffectFunc1)();
StopSound(0x80000067);
PlaySoundAt(0xB2, 0, 145, 65, 0);
}
spawn {
sleep 12;
SetPlayerAnimation(0x1002A);
}
spawn {
sleep 50;
sleep 115;
PlaySoundAt(0x137, 0, 145, 65, 0);
}
N(StarSpiritEffectFunc4)(1);
spawn {
sleep 80;
SetPlayerAnimation(ANIM_10002);
}
EVT_VAR(1) += 100;
SetCamDistance(0, EVT_VAR(1));
SetPanTarget(0, 145, 0, 0);
N(StarSpiritEffectFunc4)(2);
GetPlayerPos(EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
UseSettingsFrom(0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
SetCamSpeed(0, 1.0);
SetPanTarget(0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
WaitForCam(0, 1.0);
PanToTarget(0, 0, 0);
DisablePlayerInput(FALSE);
} else {
N(StarSpiritEffectFunc5)(2, 145, 30, 0, 0);
spawn {
N(StarSpiritEffectFunc6)();
}
sleep 1;
}
N(StarSpiritEffectFunc4)(3);
PlaySoundAtPlayer(312, 0);
DisablePlayerInput(TRUE);
EVT_STORY_PROGRESS = STORY_CH3_STAR_SPIRIT_RESCUED;
GotoMapSpecial("kmr_23", 2, 14);
sleep 100;
});
EvtSource N(80242048) = {
EVT_CALL(FadeOutMusic, 0, 1000)
EVT_SET(EVT_VAR(0), 0)
EVT_IF_EQ(EVT_VAR(0), 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseSettingsFrom, 0, 145, 65, 0)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(0.6))
EVT_CALL(SetPanTarget, 0, 145, 30, 0)
EVT_CALL(GetCamDistance, 0, EVT_VAR(1))
EVT_SUB(EVT_VAR(1), 100)
EVT_CALL(SetCamDistance, 0, EVT_VAR(1))
EVT_IF_NE(10000, 10000)
EVT_CALL(GetCamPitch, 0, EVT_VAR(2), EVT_VAR(3))
EVT_CALL(SetCamPitch, 0, EVT_VAR(2), 10000)
EVT_END_IF
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(N(StarSpiritEffectFunc2), 2, 50, 100, 31, -6, 145, 65, 0, 30, 0)
EVT_THREAD
EVT_CALL(N(StarSpiritEffectFunc3))
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySound, 0x80000067)
EVT_CALL(N(StarSpiritEffectFunc1))
EVT_CALL(StopSound, 0x80000067)
EVT_CALL(PlaySoundAt, 0xB2, 0, 145, 65, 0)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(12)
EVT_CALL(SetPlayerAnimation, 65578)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(50)
EVT_WAIT_FRAMES(115)
EVT_CALL(PlaySoundAt, 0x137, 0, 145, 65, 0)
EVT_END_THREAD
EVT_CALL(N(StarSpiritEffectFunc4), 1)
EVT_THREAD
EVT_WAIT_FRAMES(80)
EVT_CALL(SetPlayerAnimation, ANIM_10002)
EVT_END_THREAD
EVT_ADD(EVT_VAR(1), 100)
EVT_CALL(SetCamDistance, 0, EVT_VAR(1))
EVT_CALL(SetPanTarget, 0, 145, 0, 0)
EVT_CALL(N(StarSpiritEffectFunc4), 2)
EVT_CALL(GetPlayerPos, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(UseSettingsFrom, 0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(1.0))
EVT_CALL(SetPanTarget, 0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(WaitForCam, 0, EVT_FIXED(1.0))
EVT_CALL(PanToTarget, 0, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_ELSE
EVT_CALL(N(StarSpiritEffectFunc5), 2, 145, 30, 0, 0)
EVT_THREAD
EVT_CALL(N(StarSpiritEffectFunc6))
EVT_END_THREAD
EVT_WAIT_FRAMES(1)
EVT_END_IF
EVT_CALL(N(StarSpiritEffectFunc4), 3)
EVT_CALL(PlaySoundAtPlayer, 312, 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_SAVE_VAR(0), -15)
EVT_CALL(GotoMapSpecial, EVT_PTR("kmr_23"), 2, 14)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80242498) = SCRIPT({
EVT_VAR(0) = 1;
if (EVT_VAR(0) == 0) {
DisablePlayerInput(TRUE);
UseSettingsFrom(0, 145, 65, 0);
SetCamSpeed(0, 0.6005859375);
SetPanTarget(0, 145, 30, 0);
GetCamDistance(0, EVT_VAR(1));
EVT_VAR(1) -= 100;
SetCamDistance(0, EVT_VAR(1));
if (10000 != 10000) {
GetCamPitch(0, EVT_VAR(2), EVT_VAR(3));
SetCamPitch(0, EVT_VAR(2), 10000);
}
PanToTarget(0, 0, 1);
N(StarSpiritEffectFunc2)(2, 50, 100, 31, -6, 145, 65, 0, 30, 0);
spawn {
N(StarSpiritEffectFunc3)();
}
spawn {
sleep 1;
PlaySound(0x80000067);
N(StarSpiritEffectFunc1)();
StopSound(0x80000067);
PlaySoundAt(0xB2, 0, 145, 65, 0);
}
spawn {
sleep 12;
SetPlayerAnimation(0x1002A);
}
spawn {
sleep 50;
sleep 115;
PlaySoundAt(0x137, 0, 145, 65, 0);
}
N(StarSpiritEffectFunc4)(1);
spawn {
sleep 80;
SetPlayerAnimation(ANIM_10002);
}
EVT_VAR(1) += 100;
SetCamDistance(0, EVT_VAR(1));
SetPanTarget(0, 145, 0, 0);
N(StarSpiritEffectFunc4)(2);
GetPlayerPos(EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
UseSettingsFrom(0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
SetCamSpeed(0, 1.0);
SetPanTarget(0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4));
WaitForCam(0, 1.0);
PanToTarget(0, 0, 0);
DisablePlayerInput(FALSE);
} else {
N(StarSpiritEffectFunc5)(2, 145, 30, 0, 0);
spawn {
N(StarSpiritEffectFunc6)();
}
sleep 1;
}
N(StarSpiritEffectFunc4)(3);
PlaySoundAtPlayer(312, 0);
DisablePlayerInput(TRUE);
EVT_STORY_PROGRESS = STORY_CH3_STAR_SPIRIT_RESCUED;
GotoMapSpecial("kmr_23", 2, 14);
sleep 100;
});
EvtSource N(80242498) = {
EVT_SET(EVT_VAR(0), 1)
EVT_IF_EQ(EVT_VAR(0), 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseSettingsFrom, 0, 145, 65, 0)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(0.6))
EVT_CALL(SetPanTarget, 0, 145, 30, 0)
EVT_CALL(GetCamDistance, 0, EVT_VAR(1))
EVT_SUB(EVT_VAR(1), 100)
EVT_CALL(SetCamDistance, 0, EVT_VAR(1))
EVT_IF_NE(10000, 10000)
EVT_CALL(GetCamPitch, 0, EVT_VAR(2), EVT_VAR(3))
EVT_CALL(SetCamPitch, 0, EVT_VAR(2), 10000)
EVT_END_IF
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(N(StarSpiritEffectFunc2), 2, 50, 100, 31, -6, 145, 65, 0, 30, 0)
EVT_THREAD
EVT_CALL(N(StarSpiritEffectFunc3))
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySound, 0x80000067)
EVT_CALL(N(StarSpiritEffectFunc1))
EVT_CALL(StopSound, 0x80000067)
EVT_CALL(PlaySoundAt, 0xB2, 0, 145, 65, 0)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(12)
EVT_CALL(SetPlayerAnimation, 65578)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(50)
EVT_WAIT_FRAMES(115)
EVT_CALL(PlaySoundAt, 0x137, 0, 145, 65, 0)
EVT_END_THREAD
EVT_CALL(N(StarSpiritEffectFunc4), 1)
EVT_THREAD
EVT_WAIT_FRAMES(80)
EVT_CALL(SetPlayerAnimation, ANIM_10002)
EVT_END_THREAD
EVT_ADD(EVT_VAR(1), 100)
EVT_CALL(SetCamDistance, 0, EVT_VAR(1))
EVT_CALL(SetPanTarget, 0, 145, 0, 0)
EVT_CALL(N(StarSpiritEffectFunc4), 2)
EVT_CALL(GetPlayerPos, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(UseSettingsFrom, 0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(1.0))
EVT_CALL(SetPanTarget, 0, EVT_VAR(2), EVT_VAR(3), EVT_VAR(4))
EVT_CALL(WaitForCam, 0, EVT_FIXED(1.0))
EVT_CALL(PanToTarget, 0, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_ELSE
EVT_CALL(N(StarSpiritEffectFunc5), 2, 145, 30, 0, 0)
EVT_THREAD
EVT_CALL(N(StarSpiritEffectFunc6))
EVT_END_THREAD
EVT_WAIT_FRAMES(1)
EVT_END_IF
EVT_CALL(N(StarSpiritEffectFunc4), 3)
EVT_CALL(PlaySoundAtPlayer, 312, 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_SAVE_VAR(0), -15)
EVT_CALL(GotoMapSpecial, EVT_PTR("kmr_23"), 2, 14)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_802428D4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 10;
EVT_VAR(2) = 29;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_08", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_802428D4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 10)
EVT_SET(EVT_VAR(2), 29)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_08"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitWalk_80242978) = EXIT_WALK_SCRIPT(60, 1, "arn_03", 0);
@ -162,214 +168,215 @@ EvtSource N(exitWalk_802429D4) = EXIT_WALK_SCRIPT(60, 2, "mim_12", 1);
static const f64 rodata_alignment = 0.0;
EvtSource N(80242A30) = SCRIPT({
DisablePlayerInput(TRUE);
DisablePartnerAI(0);
SetPlayerPos(-28, 0, -333);
SetNpcPos(NPC_PARTNER, -28, 0, -333);
SetCamSpeed(0, 90.0);
SetCamType(0, 0, 0);
SetCamPitch(0, 25.0, -4.0);
SetCamDistance(0, 1100);
SetCamPosA(0, 500, 0);
SetCamPosB(0, 0, -500);
SetCamPosC(0, 0, 0);
SetPanTarget(0, 5, 0, -147);
PanToTarget(0, 0, 1);
RotateModel(29, 80, 0, -1, 0);
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
NpcJump0(NPC_TUBBAS_HEART, 0, 20, -120, 8);
sleep 1;
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 0, 10, -60, 12);
sleep 1;
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 0, 0, 0, 12);
sleep 1;
SetNpcVar(0, 0, 0);
spawn {
loop {
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 0, 0, 0, 10);
sleep 1;
GetNpcVar(0, 0, EVT_VAR(0));
if (EVT_VAR(0) == 1) {
break loop;
}
}
SetNpcVar(0, 0, 2);
}
spawn {
MakeLerp(80, 0, 10, 0);
loop {
UpdateLerp();
RotateModel(29, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
PlaySoundAtCollider(10, 450, 0);
}
NpcFaceNpc(NPC_TUBBAS_HEART, NPC_WORLD_TUBBA, 0);
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_A, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 5, MESSAGE_ID(0x0E, 0x00C7));
SetNpcVar(0, 0, 1);
loop {
GetNpcVar(0, 0, EVT_VAR(0));
if (EVT_VAR(0) == 2) {
break loop;
}
sleep 1;
}
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 75, 0, 10, 12);
sleep 1;
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 150, 0, 20, 12);
sleep 1;
spawn {
sleep 4;
SetCamSpeed(0, 90.0);
SetCamPitch(0, 2.0, -9.0);
SetCamDistance(0, 700);
SetCamPosA(0, 500, 0);
SetCamPosB(0, 0, -500);
SetCamPosC(0, 0, 0);
SetPanTarget(0, 65, 0, -137);
PanToTarget(0, 0, 1);
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM_world_tubba_Palette_00_Anim_22);
}
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, 298, 56, 31, 18);
SetNpcPos(NPC_TUBBAS_HEART, 0, -1000, 0);
EnableNpcShadow(NPC_TUBBAS_HEART, FALSE);
spawn {
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM_world_tubba_Palette_00_Anim_23);
sleep 20;
SetNpcAnimation(NPC_WORLD_TUBBA, NPC_ANIM_world_tubba_Palette_00_Anim_6);
}
sleep 20;
spawn {
PlaySoundAtCollider(10, 449, 0);
MakeLerp(0, 80, 10, 0);
loop {
UpdateLerp();
RotateModel(29, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
}
spawn {
sleep 30;
UseSettingsFrom(0, 236, 0, -46);
SetCamSpeed(0, 4.0);
SetCamPitch(0, 8.0, -9.0);
SetCamDistance(0, 450);
SetPanTarget(0, 250, 0, -46);
PanToTarget(0, 0, 1);
}
ModifyColliderFlags(0, 10, 0x7FFFFE00);
SetPlayerPos(0, 20, -195);
SetNpcPos(NPC_PARTNER, 0, 20, -195);
EnablePartnerAI();
PlayerMoveTo(0, 0, 45);
ModifyColliderFlags(1, 10, 0x7FFFFE00);
spawn {
MakeLerp(80, 0, 10, 0);
loop {
UpdateLerp();
RotateModel(29, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
PlaySoundAtCollider(10, 450, 0);
}
PlayerMoveTo(200, 0, 35);
sleep 5;
SpeakToPlayer(NPC_WORLD_TUBBA, NPC_ANIM_world_tubba_Palette_00_Anim_10, NPC_ANIM_world_tubba_Palette_00_Anim_6, 0, MESSAGE_ID(0x0E, 0x00C8));
SetNpcVar(1, 0, 1);
sleep 30;
DisablePlayerInput(FALSE);
});
EvtSource N(80242A30) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetPlayerPos, -28, 0, -333)
EVT_CALL(SetNpcPos, NPC_PARTNER, -28, 0, -333)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(90.0))
EVT_CALL(SetCamType, 0, 0, 0)
EVT_CALL(SetCamPitch, 0, EVT_FIXED(25.0), EVT_FIXED(-4.0))
EVT_CALL(SetCamDistance, 0, 1100)
EVT_CALL(SetCamPosA, 0, 500, 0)
EVT_CALL(SetCamPosB, 0, 0, -500)
EVT_CALL(SetCamPosC, 0, 0, 0)
EVT_CALL(SetPanTarget, 0, 5, 0, -147)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(RotateModel, 29, 80, 0, -1, 0)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(SetNpcJumpscale, 0, EVT_FIXED(2.5))
EVT_CALL(NpcJump0, 0, 0, 20, -120, 8)
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 0, 10, -60, 12)
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 0, 0, 0, 12)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcVar, 0, 0, 0)
EVT_THREAD
EVT_LOOP(0)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 0, 0, 0, 10)
EVT_WAIT_FRAMES(1)
EVT_CALL(GetNpcVar, 0, 0, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcVar, 0, 0, 2)
EVT_END_THREAD
EVT_THREAD
EVT_CALL(MakeLerp, 80, 0, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 29, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, 10, 450, 0)
EVT_END_THREAD
EVT_CALL(NpcFaceNpc, 0, 1, 0)
EVT_CALL(SpeakToPlayer, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_A, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 5, MESSAGE_ID(0x0E, 0x00C7))
EVT_CALL(SetNpcVar, 0, 0, 1)
EVT_LOOP(0)
EVT_CALL(GetNpcVar, 0, 0, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 2)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 75, 0, 10, 12)
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 150, 0, 20, 12)
EVT_WAIT_FRAMES(1)
EVT_THREAD
EVT_WAIT_FRAMES(4)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(90.0))
EVT_CALL(SetCamPitch, 0, EVT_FIXED(2.0), EVT_FIXED(-9.0))
EVT_CALL(SetCamDistance, 0, 700)
EVT_CALL(SetCamPosA, 0, 500, 0)
EVT_CALL(SetCamPosB, 0, 0, -500)
EVT_CALL(SetCamPosC, 0, 0, 0)
EVT_CALL(SetPanTarget, 0, 65, 0, -137)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(SetNpcAnimation, 1, NPC_ANIM_world_tubba_Palette_00_Anim_22)
EVT_END_THREAD
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, 298, 56, 31, 18)
EVT_CALL(SetNpcPos, 0, 0, -1000, 0)
EVT_CALL(EnableNpcShadow, 0, FALSE)
EVT_THREAD
EVT_CALL(SetNpcAnimation, 1, NPC_ANIM_world_tubba_Palette_00_Anim_23)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetNpcAnimation, 1, NPC_ANIM_world_tubba_Palette_00_Anim_6)
EVT_END_THREAD
EVT_WAIT_FRAMES(20)
EVT_THREAD
EVT_CALL(PlaySoundAtCollider, 10, 449, 0)
EVT_CALL(MakeLerp, 0, 80, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 29, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(30)
EVT_CALL(UseSettingsFrom, 0, 236, 0, -46)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(4.0))
EVT_CALL(SetCamPitch, 0, EVT_FIXED(8.0), EVT_FIXED(-9.0))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(SetPanTarget, 0, 250, 0, -46)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_END_THREAD
EVT_CALL(ModifyColliderFlags, 0, 10, 0x7FFFFE00)
EVT_CALL(SetPlayerPos, 0, 20, -195)
EVT_CALL(SetNpcPos, NPC_PARTNER, 0, 20, -195)
EVT_CALL(EnablePartnerAI)
EVT_CALL(PlayerMoveTo, 0, 0, 45)
EVT_CALL(ModifyColliderFlags, 1, 10, 0x7FFFFE00)
EVT_THREAD
EVT_CALL(MakeLerp, 80, 0, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 29, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, 10, 450, 0)
EVT_END_THREAD
EVT_CALL(PlayerMoveTo, 200, 0, 35)
EVT_WAIT_FRAMES(5)
EVT_CALL(SpeakToPlayer, 1, NPC_ANIM_world_tubba_Palette_00_Anim_10, NPC_ANIM_world_tubba_Palette_00_Anim_6, 0, MESSAGE_ID(0x0E, 0x00C8))
EVT_CALL(SetNpcVar, 1, 0, 1)
EVT_WAIT_FRAMES(30)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(802433C8) = SCRIPT({
bind N(exitWalk_80242978) TRIGGER_FLOOR_ABOVE 5;
bind N(exitWalk_802429D4) TRIGGER_FLOOR_ABOVE 1;
if (EVT_STORY_PROGRESS < STORY_CH3_UNLOCKED_WINDY_MILL) {
bind_padlock N(802439B0) TRIGGER_WALL_PRESS_A entity(0) N(itemList_80242040);
} else {
bind N(exitSingleDoor_802428D4) TRIGGER_WALL_PRESS_A 10;
}
});
EvtSource N(802433C8) = {
EVT_BIND_TRIGGER(N(exitWalk_80242978), TRIGGER_FLOOR_ABOVE, 5, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_802429D4), TRIGGER_FLOOR_ABOVE, 1, 1, 0)
EVT_IF_LT(EVT_SAVE_VAR(0), -24)
EVT_BIND_PADLOCK(N(802439B0), TRIGGER_WALL_PRESS_A, EVT_ENTITY_INDEX(0), EVT_PTR(N(itemList_80242040)), 0, 1)
EVT_ELSE
EVT_BIND_TRIGGER(N(exitSingleDoor_802428D4), TRIGGER_WALL_PRESS_A, 10, 1, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(enterWalk_8024346C) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
if (EVT_STORY_PROGRESS == STORY_CH3_HEART_ESCAPED_WINDY_MILL) {
await N(80242A30);
spawn N(802433C8);
} else {
EVT_VAR(2) = 29;
EVT_VAR(3) = 1;
await EnterSingleDoor;
spawn N(802433C8);
}
}
== 1 {
EVT_VAR(0) = N(802433C8);
spawn EnterWalk;
sleep 1;
}
== 2 {
EVT_VAR(0) = N(802433C8);
spawn EnterWalk;
sleep 1;
}
== 3 {
spawn N(802433C8);
sleep 1;
}
}
});
EvtSource N(enterWalk_8024346C) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_IF_EQ(EVT_SAVE_VAR(0), -17)
EVT_EXEC_WAIT(N(80242A30))
EVT_EXEC(N(802433C8))
EVT_ELSE
EVT_SET(EVT_VAR(2), 29)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(802433C8))
EVT_END_IF
EVT_CASE_EQ(1)
EVT_SET(EVT_VAR(0), EVT_PTR(N(802433C8)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_CASE_EQ(2)
EVT_SET(EVT_VAR(0), EVT_PTR(N(802433C8)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_CASE_EQ(3)
EVT_EXEC(N(802433C8))
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_GUSTY_GULCH;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
EVT_SAVE_FLAG(1977) = 1;
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER {
MakeNpcs(0, N(npcGroupList_802478B8));
}
< STORY_CH3_BEGAN_PEACH_MISSION {
MakeNpcs(0, N(npcGroupList_8024787C));
}
== STORY_CH3_BEGAN_PEACH_MISSION {
MakeNpcs(0, N(npcGroupList_802478E8));
} else {
MakeNpcs(0, N(npcGroupList_802478B8));
}
}
await N(makeEntities);
if (EVT_STORY_PROGRESS == STORY_CH3_DEFEATED_TUBBA_BLUBBA) {
spawn N(80242498);
}
spawn N(enterWalk_8024346C);
GetEntryID(EVT_VAR(0));
if (EVT_VAR(0) == 3) {
sleep 65;
}
spawn N(80243790);
spawn N(80241F10);
UseDoorSounds(0);
SetCamSpeed(0, 0.30078125);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 34)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_SET(EVT_SAVE_FLAG(1977), 1)
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-26)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802478B8)))
EVT_CASE_LT(-14)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_8024787C)))
EVT_CASE_EQ(-14)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802478E8)))
EVT_CASE_DEFAULT
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802478B8)))
EVT_END_SWITCH
EVT_EXEC_WAIT(N(makeEntities))
EVT_IF_EQ(EVT_SAVE_VAR(0), -16)
EVT_EXEC(N(80242498))
EVT_END_IF
EVT_EXEC(N(enterWalk_8024346C))
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 3)
EVT_WAIT_FRAMES(65)
EVT_END_IF
EVT_EXEC(N(80243790))
EVT_EXEC(N(80241F10))
EVT_CALL(UseDoorSounds, 0)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(0.3))
EVT_RETURN
EVT_END
};

File diff suppressed because it is too large Load Diff

View File

@ -16,25 +16,23 @@ MapConfig N(config) = {
.tattle = { MSG_arn_07_tattle },
};
EvtSource N(80241F10) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
PlayAmbientSounds(AMBIENT_WIND);
}
< STORY_CH3_HEART_ESCAPED_WINDY_MILL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
PlayAmbientSounds(AMBIENT_WIND);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
PlayAmbientSounds(AMBIENT_WIND);
}
== STORY_CH3_BEGAN_PEACH_MISSION {
SetMusicTrack(0, SONG_STAR_SPIRIT_THEME, 1, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
PlayAmbientSounds(AMBIENT_WIND);
}
}
});
EvtSource N(80241F10) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_CASE_LT(-17)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_CASE_EQ(-14)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SPIRIT_THEME, 1, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CALL(PlayAmbientSounds, AMBIENT_WIND)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -11,280 +11,302 @@ enum {
NPC_YAKKEY,
};
EvtSource N(802403B0) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
ClearDefeatedEnemies();
EVT_VAR(0) = 0;
EVT_VAR(1) = 6;
EVT_VAR(2) = 0;
EVT_VAR(4) = 1;
EVT_VAR(3) = -1;
spawn 0x80285DFC;
sleep 17;
GotoMap("arn_07", 0);
sleep 100;
});
EvtSource N(802403B0) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ClearDefeatedEnemies)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 6)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(4), 1)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC(0x80285DFC)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_07"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80240470) = SCRIPT({
bind N(802403B0) TRIGGER_WALL_PRESS_A 6;
});
EvtSource N(80240470) = {
EVT_BIND_TRIGGER(N(802403B0), TRIGGER_WALL_PRESS_A, 6, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(8024049C) = SCRIPT({
GetLoadType(EVT_VAR(1));
if (EVT_VAR(1) == 1) {
spawn EnterSavePoint;
spawn N(80240470);
return;
}
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(4) = 1;
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
await 0x80285E24;
EVT_AREA_FLAG(1) = 0;
spawn N(80240470);
}
== 1 {
DisablePlayerInput(TRUE);
DisablePlayerPhysics(TRUE);
if (EVT_STORY_PROGRESS == STORY_CH3_HEART_ESCAPED_WELL) {
SetPlayerPos(1000, 1000, 0);
SetNpcPos(NPC_PARTNER, 1000, 1000, 0);
RotateModel(0, 80, 0, -1, 0);
RotateModel(1, 80, 0, -1, 0);
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_6);
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, -50, 0, 50, 10);
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_7);
sleep 1;
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_6);
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, -110, 0, 110, 10);
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_7);
sleep 1;
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_6);
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, -180, 0, 180, 10);
SetNpcAnimation(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_7);
sleep 1;
MakeLerp(80, 0, 10, 0);
loop {
UpdateLerp();
RotateModel(0, EVT_VAR(0), 0, -1, 0);
RotateModel(1, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
PlaySoundAtCollider(6, 450, 0);
sleep 20;
SetPlayerPos(0, 0, 0);
SetNpcPos(NPC_PARTNER, 0, 0, 0);
EVT_STORY_PROGRESS = STORY_CH3_HEART_ESCAPED_WINDY_MILL;
}
DisablePlayerPhysics(FALSE);
SetPlayerJumpscale(2.0);
PlayerJump(-10, 0, 75, 18);
DisablePlayerInput(FALSE);
spawn N(80240470);
}
}
});
EvtSource N(8024049C) = {
EVT_CALL(GetLoadType, EVT_VAR(1))
EVT_IF_EQ(EVT_VAR(1), 1)
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(80240470))
EVT_RETURN
EVT_END_IF
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(4), 1)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC_WAIT(0x80285E24)
EVT_SET(EVT_AREA_FLAG(1), 0)
EVT_EXEC(N(80240470))
EVT_CASE_EQ(1)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_IF_EQ(EVT_SAVE_VAR(0), -18)
EVT_CALL(SetPlayerPos, 1000, 1000, 0)
EVT_CALL(SetNpcPos, NPC_PARTNER, 1000, 1000, 0)
EVT_CALL(RotateModel, 0, 80, 0, -1, 0)
EVT_CALL(RotateModel, 1, 80, 0, -1, 0)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_6)
EVT_CALL(SetNpcJumpscale, 0, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, -50, 0, 50, 10)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_7)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_6)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, -110, 0, 110, 10)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_7)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_6)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, -180, 0, 180, 10)
EVT_CALL(SetNpcAnimation, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_7)
EVT_WAIT_FRAMES(1)
EVT_CALL(MakeLerp, 80, 0, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 0, EVT_VAR(0), 0, -1, 0)
EVT_CALL(RotateModel, 1, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, 6, 450, 0)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetPlayerPos, 0, 0, 0)
EVT_CALL(SetNpcPos, NPC_PARTNER, 0, 0, 0)
EVT_SET(EVT_SAVE_VAR(0), -17)
EVT_END_IF
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(SetPlayerJumpscale, EVT_FIXED(2.0))
EVT_CALL(PlayerJump, -10, 0, 75, 18)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_EXEC(N(80240470))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
EVT_SAVE_FLAG(1979) = 1;
if (EVT_STORY_PROGRESS >= STORY_CH4_FRYING_PAN_STOLEN) {
EVT_SAVE_FLAG(1016) = 0;
EVT_SAVE_FLAG(1017) = 0;
EVT_SAVE_FLAG(1018) = 0;
}
MakeNpcs(0, N(npcGroupList_80241828));
await N(makeEntities);
spawn N(80240BA0);
GetDemoState(EVT_VAR(0));
if (EVT_VAR(0) != 0) {
await N(8024118C);
return;
}
spawn N(8024049C);
spawn N(80240B50);
spawn N(80240300);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_SET(EVT_SAVE_FLAG(1979), 1)
EVT_IF_GE(EVT_SAVE_VAR(0), -12)
EVT_SET(EVT_SAVE_FLAG(1016), 0)
EVT_SET(EVT_SAVE_FLAG(1017), 0)
EVT_SET(EVT_SAVE_FLAG(1018), 0)
EVT_END_IF
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80241828)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80240BA0))
EVT_CALL(GetDemoState, EVT_VAR(0))
EVT_IF_NE(EVT_VAR(0), 0)
EVT_EXEC_WAIT(N(8024118C))
EVT_RETURN
EVT_END_IF
EVT_EXEC(N(8024049C))
EVT_EXEC(N(80240B50))
EVT_EXEC(N(80240300))
EVT_RETURN
EVT_END
};
static s32 N(pad_A6C) = {
0x00000000,
};
EvtSource N(80240A70) = SCRIPT({
loop {
if (EVT_STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WELL) {
break loop;
}
sleep 1;
}
N(func_8024008C_BF482C)();
DisablePlayerInput(TRUE);
DisablePlayerPhysics(TRUE);
N(func_80240000_BF47A0)();
EVT_AREA_FLAG(1) = 1;
if (EVT_STORY_PROGRESS < STORY_CH3_WENT_DOWN_THE_WELL) {
EVT_STORY_PROGRESS = STORY_CH3_WENT_DOWN_THE_WELL;
}
GotoMap("arn_09", 1);
sleep 100;
});
EvtSource N(80240A70) = {
EVT_LOOP(0)
EVT_IF_NE(EVT_SAVE_VAR(0), -18)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(N(func_8024008C_BF482C))
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(N(func_80240000_BF47A0))
EVT_SET(EVT_AREA_FLAG(1), 1)
EVT_IF_LT(EVT_SAVE_VAR(0), -23)
EVT_SET(EVT_SAVE_VAR(0), -23)
EVT_END_IF
EVT_CALL(GotoMap, EVT_PTR("arn_09"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80240B50) = SCRIPT({
SetCamProperties(0, 90.0, 0, 0, 0, 470.0, 17.0, -7.0);
spawn N(80240A70);
});
EvtSource N(80240B50) = {
EVT_CALL(SetCamProperties, 0, EVT_FIXED(90.0), 0, 0, 0, EVT_FIXED(470.0), EVT_FIXED(17.0), EVT_FIXED(-7.0))
EVT_EXEC(N(80240A70))
EVT_RETURN
EVT_END
};
static s32 N(pad_B98)[] = {
0x00000000, 0x00000000,
};
EvtSource N(80240BA0) = SCRIPT({
PlaySound(0x8000004B);
spawn {
EVT_VAR(0) = 0;
10:
RotateModel(9, EVT_VAR(0), 0, 0, 1);
RotateModel(15, EVT_VAR(0), 0, 0, 1);
RotateModel(11, EVT_VAR(0), 0, 0, 1);
RotateModel(13, EVT_VAR(0), 0, 0, -1);
RotateModel(17, EVT_VAR(0), 0, 0, -1);
EVT_VAR(0) += 1;
sleep 1;
goto 10;
}
});
EvtSource N(80240BA0) = {
EVT_CALL(PlaySound, 0x8000004B)
EVT_THREAD
EVT_SET(EVT_VAR(0), 0)
EVT_LABEL(10)
EVT_CALL(RotateModel, 9, EVT_VAR(0), 0, 0, 1)
EVT_CALL(RotateModel, 15, EVT_VAR(0), 0, 0, 1)
EVT_CALL(RotateModel, 11, EVT_VAR(0), 0, 0, 1)
EVT_CALL(RotateModel, 13, EVT_VAR(0), 0, 0, -1)
EVT_CALL(RotateModel, 17, EVT_VAR(0), 0, 0, -1)
EVT_ADD(EVT_VAR(0), 1)
EVT_WAIT_FRAMES(1)
EVT_GOTO(10)
EVT_END_THREAD
EVT_RETURN
EVT_END
};
static s32 N(pad_CB4)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(80240CC0) = SCRIPT({
N(func_802400C0_BF4860)();
DemoJoystickXY(2, 0);
sleep 1;
DemoJoystickXY(12, 4);
sleep 1;
DemoJoystickXY(28, 11);
sleep 1;
DemoJoystickXY(47, 22);
sleep 1;
DemoJoystickXY(68, 38);
sleep 1;
DemoJoystickXY(67, 48);
sleep 1;
DemoJoystickXY(64, 59);
sleep 1;
DemoJoystickXY(64, 62);
sleep 4;
DemoSetButtons(32768);
sleep 10;
DemoJoystickXY(64, 58);
DemoSetButtons(0);
sleep 1;
DemoJoystickXY(70, 34);
sleep 1;
DemoJoystickXY(77, -2);
sleep 1;
DemoJoystickXY(74, -23);
sleep 1;
DemoJoystickXY(71, -36);
sleep 1;
DemoJoystickXY(69, -44);
sleep 1;
DemoJoystickXY(67, -49);
sleep 1;
DemoJoystickXY(30, -30);
sleep 1;
DemoJoystickXY(0, 0);
sleep 1;
DemoJoystickXY(0, -1);
sleep 8;
DemoSetButtons(32768);
sleep 2;
DemoJoystickXY(0, -2);
sleep 2;
DemoJoystickXY(0, -1);
sleep 2;
DemoJoystickXY(0, 0);
sleep 1;
DemoSetButtons(0);
sleep 1;
DemoJoystickXY(1, 0);
sleep 1;
DemoJoystickXY(0, 0);
N(func_802400D4_BF4874)();
DemoSetButtons(32768);
sleep 12;
DemoSetButtons(0);
sleep 20;
if (EVT_SAVE_FLAG(9) == 1) {
return;
}
EVT_SAVE_FLAG(9) = 1;
GotoMapSpecial("arn_08", 2, 2);
sleep 100;
});
EvtSource N(80240CC0) = {
EVT_CALL(N(func_802400C0_BF4860))
EVT_CALL(DemoJoystickXY, 2, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 12, 4)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 28, 11)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 47, 22)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 68, 38)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 67, 48)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 64, 59)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 64, 62)
EVT_WAIT_FRAMES(4)
EVT_CALL(DemoSetButtons, 32768)
EVT_WAIT_FRAMES(10)
EVT_CALL(DemoJoystickXY, 64, 58)
EVT_CALL(DemoSetButtons, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 70, 34)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 77, -2)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 74, -23)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 71, -36)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 69, -44)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 67, -49)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 30, -30)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 0, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 0, -1)
EVT_WAIT_FRAMES(8)
EVT_CALL(DemoSetButtons, 32768)
EVT_WAIT_FRAMES(2)
EVT_CALL(DemoJoystickXY, 0, -2)
EVT_WAIT_FRAMES(2)
EVT_CALL(DemoJoystickXY, 0, -1)
EVT_WAIT_FRAMES(2)
EVT_CALL(DemoJoystickXY, 0, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoSetButtons, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 1, 0)
EVT_WAIT_FRAMES(1)
EVT_CALL(DemoJoystickXY, 0, 0)
EVT_CALL(N(func_802400D4_BF4874))
EVT_CALL(DemoSetButtons, 32768)
EVT_WAIT_FRAMES(12)
EVT_CALL(DemoSetButtons, 0)
EVT_WAIT_FRAMES(20)
EVT_IF_EQ(EVT_SAVE_FLAG(9), 1)
EVT_RETURN
EVT_END_IF
EVT_SET(EVT_SAVE_FLAG(9), 1)
EVT_CALL(GotoMapSpecial, EVT_PTR("arn_08"), 2, 2)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(802410AC) = SCRIPT({
sleep 10;
loop {
GetDemoState(EVT_VAR(0));
if (EVT_VAR(0) == 2) {
break loop;
}
sleep 1;
}
if (EVT_SAVE_FLAG(9) == 1) {
return;
}
EVT_SAVE_FLAG(9) = 1;
GotoMapSpecial("arn_08", 2, 3);
sleep 35;
});
EvtSource N(802410AC) = {
EVT_WAIT_FRAMES(10)
EVT_LOOP(0)
EVT_CALL(GetDemoState, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 2)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_IF_EQ(EVT_SAVE_FLAG(9), 1)
EVT_RETURN
EVT_END_IF
EVT_SET(EVT_SAVE_FLAG(9), 1)
EVT_CALL(GotoMapSpecial, EVT_PTR("arn_08"), 2, 3)
EVT_WAIT_FRAMES(35)
EVT_RETURN
EVT_END
};
EvtSource N(8024116C) = SCRIPT({
N(func_802400F4_BF4894)();
});
EvtSource N(8024116C) = {
EVT_CALL(N(func_802400F4_BF4894))
EVT_RETURN
EVT_END
};
s32 N(D_80241188_BF5928) = {
0x00000000,
};
EvtSource N(8024118C) = SCRIPT({
SetCamProperties(0, 90.0, 0, 0, 0, 470.0, 17.0, -7.0);
N(func_8024019C_BF493C)();
EVT_SAVE_FLAG(9) = 0;
spawn N(802410AC);
spawn N(80240CC0);
});
EvtSource N(8024118C) = {
EVT_CALL(SetCamProperties, 0, EVT_FIXED(90.0), 0, 0, 0, EVT_FIXED(470.0), EVT_FIXED(17.0), EVT_FIXED(-7.0))
EVT_CALL(N(func_8024019C_BF493C))
EVT_SET(EVT_SAVE_FLAG(9), 0)
EVT_EXEC(N(802410AC))
EVT_EXEC(N(80240CC0))
EVT_RETURN
EVT_END
};
static s32 N(pad_11FC) = {
0x00000000,
};
EvtSource N(80241200) = SCRIPT({
EvtSource N(80241200) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(80241210) = SCRIPT({
});
EvtSource N(80241210) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80241220) = {
.height = 24,
@ -300,45 +322,47 @@ NpcSettings N(npcSettings_8024124C) = {
.level = 13,
};
EvtSource N(idle_80241278) = SCRIPT({
EvtSource N(idle_80241278) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(init_80241288) = {
EVT_IF_NE(EVT_SAVE_VAR(0), -18)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_ELSE
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_80241278)))
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(init_80241288) = SCRIPT({
if (EVT_STORY_PROGRESS != STORY_CH3_HEART_ESCAPED_WELL) {
SetNpcPos(NPC_SELF, 0, -1000, 0);
} else {
BindNpcIdle(NPC_SELF, N(idle_80241278));
}
});
EvtSource N(interact_802412E8) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(8)
EVT_CALL(SpeakToPlayer, NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BA))
EVT_CASE_LT(42)
EVT_CALL(SpeakToPlayer, NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BB))
EVT_CASE_LT(61)
EVT_CALL(SpeakToPlayer, NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BC))
EVT_CASE_LT(90)
EVT_CALL(SpeakToPlayer, NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BD))
EVT_CASE_GE(90)
EVT_CALL(SpeakToPlayer, NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BE))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(interact_802412E8) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH5_WHALE_MOUTH_OPEN {
SpeakToPlayer(NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BA));
}
< STORY_CH6_FLOWER_GATE_OPEN {
SpeakToPlayer(NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BB));
}
< STORY_CH7_INVITED_TO_STARBORN_VALLEY {
SpeakToPlayer(NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BC));
}
< STORY_CH8_OPENED_PATH_TO_STAR_WAY {
SpeakToPlayer(NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BD));
}
>= STORY_CH8_OPENED_PATH_TO_STAR_WAY {
SpeakToPlayer(NPC_SELF, NPC_ANIM_yakkey_Palette_00_Anim_2, NPC_ANIM_yakkey_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BE));
}
}
});
EvtSource N(init_802413E8) = SCRIPT({
if (EVT_STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) {
SetNpcPos(NPC_SELF, 0, -1000, 0);
} else {
BindNpcInteract(NPC_SELF, N(interact_802412E8));
}
});
EvtSource N(init_802413E8) = {
EVT_IF_LT(EVT_SAVE_VAR(0), -12)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_ELSE
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(interact_802412E8)))
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80241448) = {
.id = NPC_TUBBAS_HEART,
@ -411,11 +435,13 @@ static s32 N(pad_184C) = {
0x00000000,
};
EvtSource N(makeEntities) = SCRIPT({
if (EVT_STORY_PROGRESS < STORY_CH3_WENT_DOWN_THE_WELL) {
MakeEntity(0x802BCE84, 0, 30, 0, 0, MAKE_ENTITY_END);
}
});
EvtSource N(makeEntities) = {
EVT_IF_LT(EVT_SAVE_VAR(0), -23)
EVT_CALL(MakeEntity, 0x802BCE84, 0, 30, 0, 0, MAKE_ENTITY_END)
EVT_END_IF
EVT_RETURN
EVT_END
};
ApiStatus N(func_802400C0_BF4860)(Evt* script, s32 isInitialCall) {
gPlayerData.bootsLevel = 1;

View File

@ -14,16 +14,16 @@ MapConfig N(config) = {
.tattle = { MSG_arn_08_tattle },
};
EvtSource N(80240300) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_HEART_FLED_FIRST_TUNNEL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
ClearAmbientSounds(250);
});
EvtSource N(80240300) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-22)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(ClearAmbientSounds, 250)
EVT_RETURN
EVT_END
};

View File

@ -3,111 +3,125 @@
extern s32 D_000001E4;
EvtSource N(80240140) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 5;
EVT_VAR(2) = 0;
EVT_VAR(4) = 1;
EVT_VAR(3) = 1;
spawn 0x80285DFC;
sleep 17;
GotoMap("arn_10", 0);
sleep 100;
});
EvtSource N(80240140) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 5)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(4), 1)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(0x80285DFC)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_10"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(802401F4) = SCRIPT({
bind N(80240140) TRIGGER_WALL_PRESS_A 5;
});
EvtSource N(802401F4) = {
EVT_BIND_TRIGGER(N(80240140), TRIGGER_WALL_PRESS_A, 5, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(80240220) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(2) = 0;
EVT_VAR(4) = 1;
EVT_VAR(3) = 1;
await 0x80285E24;
spawn N(802401F4);
}
== 1 {
spawn N(802401F4);
}
}
});
EvtSource N(80240220) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(4), 1)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(0x80285E24)
EVT_EXEC(N(802401F4))
EVT_CASE_EQ(1)
EVT_EXEC(N(802401F4))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(524288);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80240974));
await N(makeEntities);
spawn N(80240220);
spawn N(802404D0);
spawn N(802400A0);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, 524288)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80240974)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80240220))
EVT_EXEC(N(802404D0))
EVT_EXEC(N(802400A0))
EVT_RETURN
EVT_END
};
static s32 N(pad_398)[] = {
0x00000000, 0x00000000,
};
EvtSource N(802403A0) = SCRIPT({
if (EVT_AREA_FLAG(1) == 1) {
return;
}
EVT_AREA_FLAG(1) = 1;
DisablePlayerInput(TRUE);
DisablePlayerPhysics(TRUE);
SetPlayerActionState(6);
sleep 1;
SetPlayerJumpscale(1.0);
PlayerJump(0, 200, 0, 30);
GotoMap("arn_08", 1);
sleep 100;
DisablePlayerInput(FALSE);
DisablePlayerPhysics(FALSE);
});
EvtSource N(802403A0) = {
EVT_IF_EQ(EVT_AREA_FLAG(1), 1)
EVT_RETURN
EVT_END_IF
EVT_SET(EVT_AREA_FLAG(1), 1)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerActionState, 6)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetPlayerJumpscale, EVT_FIXED(1.0))
EVT_CALL(PlayerJump, 0, 200, 0, 30)
EVT_CALL(GotoMap, EVT_PTR("arn_08"), 1)
EVT_WAIT_FRAMES(100)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EAA30, 0, 0, 0, 0, MAKE_ENTITY_END);
AssignScript(N(802403A0));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, 0x802EAA30, 0, 0, 0, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(802403A0)))
EVT_RETURN
EVT_END
};
static s32 N(pad_4CC)[] = {
0x00000000,
};
EvtSource N(802404D0) = SCRIPT({
if (EVT_AREA_FLAG(1) == 0) {
return;
}
EVT_AREA_FLAG(1) = 1;
DisablePlayerInput(TRUE);
SetPlayerActionState(8);
func_802D2484();
SetPlayerActionState(6);
SetPlayerJumpscale(1.5);
PlayerJump(50, 0, 0, 16);
SetPlayerAnimation(ANIM_10002);
EVT_AREA_FLAG(1) = 0;
DisablePlayerInput(FALSE);
});
EvtSource N(802404D0) = {
EVT_IF_EQ(EVT_AREA_FLAG(1), 0)
EVT_RETURN
EVT_END_IF
EVT_SET(EVT_AREA_FLAG(1), 1)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetPlayerActionState, 8)
EVT_CALL(func_802D2484)
EVT_CALL(SetPlayerActionState, 6)
EVT_CALL(SetPlayerJumpscale, EVT_FIXED(1.5))
EVT_CALL(PlayerJump, 50, 0, 0, 16)
EVT_CALL(SetPlayerAnimation, ANIM_10002)
EVT_SET(EVT_AREA_FLAG(1), 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
static s32 N(pad_5A8)[] = {
0x00000000, 0x00000000,
};
EvtSource N(802405B0) = SCRIPT({
EvtSource N(802405B0) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(802405C0) = SCRIPT({
});
EvtSource N(802405C0) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802405D0) = {
.height = 24,
@ -117,29 +131,33 @@ NpcSettings N(npcSettings_802405D0) = {
.level = 13,
};
EvtSource N(idle_802405FC) = SCRIPT({
EnableNpcShadow(NPC_SELF, FALSE);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, 0, 25, -10, 6);
PlaySoundAtNpc(NPC_SELF, 0x2086, 0);
N(func_80240000_BF6060)();
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, 0, 200, 0, 15);
SetNpcPos(NPC_SELF, 0, -1000, 0);
EVT_STORY_PROGRESS = STORY_CH3_HEART_ESCAPED_WELL;
});
EvtSource N(idle_802405FC) = {
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, 0, 25, -10, 6)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x2086, 0)
EVT_CALL(N(func_80240000_BF6060))
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, 0, 200, 0, 15)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_SET(EVT_SAVE_VAR(0), -18)
EVT_RETURN
EVT_END
};
EvtSource N(init_80240730) = SCRIPT({
if (EVT_STORY_PROGRESS != STORY_CH3_HEART_FLED_SECOND_TUNNEL) {
RemoveNpc(NPC_SELF);
} else {
BindNpcIdle(NPC_SELF, N(idle_802405FC));
}
});
EvtSource N(init_80240730) = {
EVT_IF_NE(EVT_SAVE_VAR(0), -19)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_ELSE
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_802405FC)))
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80240784) = {
.id = 0,

View File

@ -13,15 +13,15 @@ MapConfig N(config) = {
.tattle = { MSG_arn_09_tattle },
};
EvtSource N(802400A0) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_HEART_FLED_FIRST_TUNNEL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
});
EvtSource N(802400A0) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-22)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -2,80 +2,90 @@
#include "sprite/npc/tubbas_heart.h"
#include "sprite/npc/goomba.h"
EvtSource N(exitSingleDoor_80240100) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 6;
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_09", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_80240100) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 6)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_09"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_802401A4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 1;
EVT_VAR(1) = 11;
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_12", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_802401A4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 11)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_12"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80240248) = SCRIPT({
bind N(exitSingleDoor_80240100) TRIGGER_WALL_PRESS_A 6;
bind N(exitSingleDoor_802401A4) TRIGGER_WALL_PRESS_A 11;
});
EvtSource N(80240248) = {
EVT_BIND_TRIGGER(N(exitSingleDoor_80240100), TRIGGER_WALL_PRESS_A, 6, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_802401A4), TRIGGER_WALL_PRESS_A, 11, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_80240290) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
await EnterSingleDoor;
spawn N(80240248);
}
== 1 {
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
await EnterSingleDoor;
spawn N(80240248);
}
}
});
EvtSource N(enterSingleDoor_80240290) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_CASE_EQ(1)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(524289);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80240BB8));
await N(makeEntities);
spawn N(80240060);
spawn N(enterSingleDoor_80240290);
sleep 1;
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, 524289)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80240BB8)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80240060))
EVT_EXEC(N(enterSingleDoor_80240290))
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};
static s32 N(pad_424)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(80240430) = SCRIPT({
EvtSource N(80240430) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(80240440) = SCRIPT({
});
EvtSource N(80240440) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80240450) = {
.height = 24,
@ -98,9 +108,11 @@ NpcAISettings N(npcAISettings_8024047C) = {
.unk_2C = 1,
};
EvtSource N(npcAI_802404AC) = SCRIPT({
DoBasicAI(N(npcAISettings_8024047C));
});
EvtSource N(npcAI_802404AC) = {
EVT_CALL(DoBasicAI, EVT_PTR(N(npcAISettings_8024047C)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802404CC) = {
.height = 20,
@ -111,53 +123,61 @@ NpcSettings N(npcSettings_802404CC) = {
.level = 12,
};
EvtSource N(idle_802404F8) = SCRIPT({
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
SetNpcJumpscale(NPC_SELF, 3.0);
GetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) -= 30;
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
EnableNpcShadow(NPC_SELF, FALSE);
SetNpcPos(NPC_SELF, 0, -1000, 0);
EVT_STORY_PROGRESS = STORY_CH3_HEART_FLED_SECOND_TUNNEL;
});
EvtSource N(idle_802404F8) = {
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_SUB(EVT_VAR(0), 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_SET(EVT_SAVE_VAR(0), -19)
EVT_RETURN
EVT_END
};
EvtSource N(defeat_802406F4) = SCRIPT({
EVT_SAVE_FLAG(1016) = 1;
DoNpcDefeat();
});
EvtSource N(defeat_802406F4) = {
EVT_SET(EVT_SAVE_FLAG(1016), 1)
EVT_CALL(DoNpcDefeat)
EVT_RETURN
EVT_END
};
EvtSource N(init_80240720) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_802404F8));
if (EVT_STORY_PROGRESS != STORY_UNUSED_FFFFFFEC) {
RemoveNpc(NPC_SELF);
}
});
EvtSource N(init_80240720) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_802404F8)))
EVT_IF_NE(EVT_SAVE_VAR(0), -20)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(init_8024076C) = SCRIPT({
if (EVT_STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) {
if (EVT_SAVE_FLAG(1016) == 1) {
RemoveNpc(NPC_SELF);
return;
}
BindNpcDefeat(NPC_SELF, N(defeat_802406F4));
}
});
EvtSource N(init_8024076C) = {
EVT_IF_LT(EVT_SAVE_VAR(0), -12)
EVT_IF_EQ(EVT_SAVE_FLAG(1016), 1)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_RETURN
EVT_END_IF
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802406F4)))
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_802407D8) = {
.id = 0,
@ -233,13 +253,17 @@ static s32 N(pad_BDC)[] = {
0x00000000,
};
EvtSource N(80240BE0) = SCRIPT({
DisablePlayerInput(TRUE);
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0182), 160, 40);
DisablePlayerInput(FALSE);
});
EvtSource N(80240BE0) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x0182), 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END);
AssignScript(N(80240BE0));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, 0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(80240BE0)))
EVT_RETURN
EVT_END
};

View File

@ -13,15 +13,15 @@ MapConfig N(config) = {
.tattle = { MSG_arn_10_tattle },
};
EvtSource N(80240060) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_HEART_FLED_FIRST_TUNNEL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
});
EvtSource N(80240060) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-22)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -5,108 +5,122 @@ enum {
NPC_TUBBAS_HEART,
};
EvtSource N(802400F0) = SCRIPT({
SetCamType(0, 6, 1);
SetCamSpeed(0, 3.0);
UseSettingsFrom(0, 60, 30, 0);
SetPanTarget(0, 60, 30, 0);
SetCamPitch(0, 20.0, -13.0);
SetCamDistance(0, 275);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
});
EvtSource N(802400F0) = {
EVT_CALL(SetCamType, 0, 6, 1)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(3.0))
EVT_CALL(UseSettingsFrom, 0, 60, 30, 0)
EVT_CALL(SetPanTarget, 0, 60, 30, 0)
EVT_CALL(SetCamPitch, 0, EVT_FIXED(20.0), EVT_FIXED(-13.0))
EVT_CALL(SetCamDistance, 0, 275)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FIXED(1.0))
EVT_RETURN
EVT_END
};
EvtSource N(802401BC) = SCRIPT({
DisablePlayerInput(TRUE);
sleep 30;
SetPlayerSpeed(3.0);
PlayerMoveTo(6, 0, 0);
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BF));
sleep 10;
SetPlayerAnimation(ANIM_80007);
sleep 40;
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C0));
SetPlayerAnimation(ANIM_10002);
sleep 10;
SetPlayerAnimation(0x90000);
sleep 30;
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C1));
SetPlayerAnimation(ANIM_10002);
sleep 20;
SetPlayerAnimation(0x90000);
spawn {
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
GetNpcPos(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
sleep 1;
PlaySoundAtNpc(NPC_TUBBAS_HEART, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
}
sleep 40;
SpeakToPlayer(NPC_TUBBAS_HEART, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C2));
SetPlayerAnimation(0x90000);
sleep 10;
SetNpcVar(0, 0, 1);
DisablePlayerInput(FALSE);
});
EvtSource N(802401BC) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT_FRAMES(30)
EVT_CALL(SetPlayerSpeed, EVT_FIXED(3.0))
EVT_CALL(PlayerMoveTo, 6, 0, 0)
EVT_CALL(SpeakToPlayer, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00BF))
EVT_WAIT_FRAMES(10)
EVT_CALL(SetPlayerAnimation, ANIM_80007)
EVT_WAIT_FRAMES(40)
EVT_CALL(SpeakToPlayer, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C0))
EVT_CALL(SetPlayerAnimation, ANIM_10002)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetPlayerAnimation, 589824)
EVT_WAIT_FRAMES(30)
EVT_CALL(SpeakToPlayer, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C1))
EVT_CALL(SetPlayerAnimation, ANIM_10002)
EVT_WAIT_FRAMES(20)
EVT_CALL(SetPlayerAnimation, 589824)
EVT_THREAD
EVT_CALL(SetNpcJumpscale, 0, EVT_FIXED(2.5))
EVT_CALL(GetNpcPos, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_WAIT_FRAMES(1)
EVT_CALL(PlaySoundAtNpc, 0, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_END_THREAD
EVT_WAIT_FRAMES(40)
EVT_CALL(SpeakToPlayer, 0, NPC_ANIM_tubbas_heart_Palette_00_Anim_B, NPC_ANIM_tubbas_heart_Palette_00_Anim_1, 0, MESSAGE_ID(0x0E, 0x00C2))
EVT_CALL(SetPlayerAnimation, 589824)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetNpcVar, 0, 0, 1)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_80240428) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 2;
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_13", 1);
sleep 100;
});
EvtSource N(exitSingleDoor_80240428) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 2)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_13"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(802404CC) = SCRIPT({
bind N(exitSingleDoor_80240428) TRIGGER_WALL_PRESS_A 2;
});
EvtSource N(802404CC) = {
EVT_BIND_TRIGGER(N(exitSingleDoor_80240428), TRIGGER_WALL_PRESS_A, 2, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_802404F8) = SCRIPT({
DisablePlayerInput(TRUE);
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
await EnterSingleDoor;
spawn N(802404CC);
if (EVT_STORY_PROGRESS < STORY_CH3_HEART_FLED_FIRST_TUNNEL) {
sleep 10;
spawn N(802400F0);
spawn N(802401BC);
sleep 1;
}
DisablePlayerInput(FALSE);
});
EvtSource N(enterSingleDoor_802404F8) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(802404CC))
EVT_IF_LT(EVT_SAVE_VAR(0), -22)
EVT_WAIT_FRAMES(10)
EVT_EXEC(N(802400F0))
EVT_EXEC(N(802401BC))
EVT_WAIT_FRAMES(1)
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(524290);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_802410DC));
spawn N(80240050);
spawn N(enterSingleDoor_802404F8);
sleep 1;
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, 524290)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802410DC)))
EVT_EXEC(N(80240050))
EVT_EXEC(N(enterSingleDoor_802404F8))
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};
static s32 N(pad_674)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(80240680) = SCRIPT({
EvtSource N(80240680) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(80240690) = SCRIPT({
});
EvtSource N(80240690) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802406A0) = {
.height = 24,
@ -116,54 +130,60 @@ NpcSettings N(npcSettings_802406A0) = {
.level = 13,
};
EvtSource N(idle_802406CC) = SCRIPT({
loop {
GetSelfVar(0, EVT_VAR(0));
if (EVT_VAR(0) != 0) {
break loop;
}
sleep 1;
}
spawn {
SetCamType(0, 6, 1);
SetCamSpeed(0, 4.0);
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) += 50;
UseSettingsFrom(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetPanTarget(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetCamDistance(0, 3000);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
}
StartBossBattle(11);
});
EvtSource N(idle_802406CC) = {
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, EVT_VAR(0))
EVT_IF_NE(EVT_VAR(0), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_THREAD
EVT_CALL(SetCamType, 0, 6, 1)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(4.0))
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(0), 50)
EVT_CALL(UseSettingsFrom, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetPanTarget, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetCamDistance, 0, 3000)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FIXED(1.0))
EVT_END_THREAD
EVT_CALL(StartBossBattle, 11)
EVT_RETURN
EVT_END
};
EvtSource N(8024081C) = SCRIPT({
sleep 15;
PlaySoundAtCollider(2, 449, 0);
MakeLerp(0, 80, 10, 0);
loop {
UpdateLerp();
RotateModel(0, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
});
EvtSource N(8024081C) = {
EVT_WAIT_FRAMES(15)
EVT_CALL(PlaySoundAtCollider, 2, 449, 0)
EVT_CALL(MakeLerp, 0, 80, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 0, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtSource N(802408D8) = SCRIPT({
MakeLerp(80, 0, 10, 0);
loop {
UpdateLerp();
RotateModel(0, EVT_VAR(0), 0, -1, 0);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
PlaySoundAtCollider(2, 450, 0);
});
EvtSource N(802408D8) = {
EVT_CALL(MakeLerp, 80, 0, 10, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, 0, EVT_VAR(0), 0, -1, 0)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, 2, 450, 0)
EVT_RETURN
EVT_END
};
s32 N(intTable_80240988)[] = {
0x00000064, 0x0000001E, 0x00000046, 0x00000019, 0x0000001E, 0x00000050, 0xFFFFD8F0, 0x00000000,
@ -171,81 +191,85 @@ s32 N(intTable_80240988)[] = {
0x00000000, 0x00000000, 0xFFFFD8F0, 0x00000000, 0x00000000,
};
EvtSource N(defeat_802409DC) = SCRIPT({
spawn {
SetCamType(0, 6, 1);
SetCamSpeed(0, 90.0);
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) += 50;
UseSettingsFrom(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetPanTarget(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetCamDistance(0, 450);
PanToTarget(0, 0, 1);
}
sleep 10;
PlayerFaceNpc(0, 1);
loop 2 {
GetNpcPos(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetNpcJumpscale(NPC_TUBBAS_HEART, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12);
sleep 1;
}
spawn {
sleep 10;
SetCamType(0, 4, 1);
SetCamSpeed(0, 2.0);
SetCamPitch(0, 17.0, -7.0);
SetCamDistance(0, 450);
SetCamPosA(0, -56, 70);
SetCamPosB(0, -90, 40);
SetCamPosC(0, 0, 0);
PanToTarget(0, 0, 1);
}
PlayerFaceNpc(0, 1);
buf_use N(intTable_80240988);
loop {
buf_read EVT_VAR(0) EVT_VAR(1) EVT_VAR(2);
if (EVT_VAR(0) == -10000) {
break loop;
}
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12);
sleep 1;
}
spawn N(8024081C);
loop {
buf_read EVT_VAR(0) EVT_VAR(1) EVT_VAR(2);
if (EVT_VAR(0) == -10000) {
break loop;
}
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_TUBBAS_HEART, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12);
sleep 1;
}
spawn N(802408D8);
sleep 30;
SetCamType(0, 6, 1);
SetCamSpeed(0, 90.0);
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
UseSettingsFrom(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetPanTarget(0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
SetCamDistance(0, 450);
PanToTarget(0, 0, 1);
WaitForCam(0, 1.0);
PanToTarget(0, 0, 0);
EVT_STORY_PROGRESS = STORY_CH3_HEART_FLED_FIRST_TUNNEL;
});
EvtSource N(defeat_802409DC) = {
EVT_THREAD
EVT_CALL(SetCamType, 0, 6, 1)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(90.0))
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(0), 50)
EVT_CALL(UseSettingsFrom, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetPanTarget, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_END_THREAD
EVT_WAIT_FRAMES(10)
EVT_CALL(PlayerFaceNpc, 0, 1)
EVT_LOOP(2)
EVT_CALL(GetNpcPos, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetNpcJumpscale, 0, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_THREAD
EVT_WAIT_FRAMES(10)
EVT_CALL(SetCamType, 0, 4, 1)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(2.0))
EVT_CALL(SetCamPitch, 0, EVT_FIXED(17.0), EVT_FIXED(-7.0))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(SetCamPosA, 0, -56, 70)
EVT_CALL(SetCamPosB, 0, -90, 40)
EVT_CALL(SetCamPosC, 0, 0, 0)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_END_THREAD
EVT_CALL(PlayerFaceNpc, 0, 1)
EVT_USE_BUF(EVT_PTR(N(intTable_80240988)))
EVT_LOOP(0)
EVT_BUF_READ3(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_IF_EQ(EVT_VAR(0), -10000)
EVT_BREAK_LOOP
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_EXEC(N(8024081C))
EVT_LOOP(0)
EVT_BUF_READ3(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_IF_EQ(EVT_VAR(0), -10000)
EVT_BREAK_LOOP
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 12)
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_EXEC(N(802408D8))
EVT_WAIT_FRAMES(30)
EVT_CALL(SetCamType, 0, 6, 1)
EVT_CALL(SetCamSpeed, 0, EVT_FIXED(90.0))
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(UseSettingsFrom, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetPanTarget, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FIXED(1.0))
EVT_CALL(PanToTarget, 0, 0, 0)
EVT_SET(EVT_SAVE_VAR(0), -22)
EVT_RETURN
EVT_END
};
EvtSource N(init_80240E70) = SCRIPT({
if (EVT_STORY_PROGRESS >= STORY_CH3_HEART_FLED_FIRST_TUNNEL) {
RemoveNpc(NPC_SELF);
} else {
SetSelfVar(0, 0);
BindNpcIdle(NPC_SELF, N(idle_802406CC));
BindNpcDefeat(NPC_SELF, N(defeat_802409DC));
}
});
EvtSource N(init_80240E70) = {
EVT_IF_GE(EVT_SAVE_VAR(0), -22)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_ELSE
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_802406CC)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802409DC)))
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80240EEC) = {
.id = NPC_TUBBAS_HEART,

View File

@ -12,15 +12,15 @@ MapConfig N(config) = {
.tattle = { MSG_arn_11_tattle },
};
EvtSource N(80240050) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_WENT_DOWN_THE_WELL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
});
EvtSource N(80240050) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-23)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -7,6 +7,8 @@
#define NAMESPACE arn_12
extern s32 D_802EAFDC;
extern EvtSource N(main);
extern EvtSource N(80240060);
extern NpcGroupList N(npcGroupList_80240BBC);

View File

@ -2,79 +2,89 @@
#include "sprite/npc/tubbas_heart.h"
#include "sprite/npc/goomba.h"
EvtSource N(exitSingleDoor_80240100) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 2;
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_10", 1);
sleep 100;
});
EvtSource N(exitSingleDoor_80240100) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 2)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_10"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_802401A4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 1;
EVT_VAR(1) = 7;
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_13", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_802401A4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 7)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_13"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80240248) = SCRIPT({
bind N(exitSingleDoor_80240100) TRIGGER_WALL_PRESS_A 2;
bind N(exitSingleDoor_802401A4) TRIGGER_WALL_PRESS_A 7;
});
EvtSource N(80240248) = {
EVT_BIND_TRIGGER(N(exitSingleDoor_80240100), TRIGGER_WALL_PRESS_A, 2, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_802401A4), TRIGGER_WALL_PRESS_A, 7, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_80240290) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
await EnterSingleDoor;
spawn N(80240248);
}
== 1 {
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
await EnterSingleDoor;
spawn N(80240248);
}
}
});
EvtSource N(enterSingleDoor_80240290) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_CASE_EQ(1)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(524291);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80240BBC));
await N(makeEntities);
spawn N(enterSingleDoor_80240290);
spawn N(80240060);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, 524291)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80240BBC)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(enterSingleDoor_80240290))
EVT_EXEC(N(80240060))
EVT_RETURN
EVT_END
};
static s32 N(pad_418)[] = {
0x00000000, 0x00000000,
};
EvtSource N(80240420) = SCRIPT({
EvtSource N(80240420) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(80240430) = SCRIPT({
});
EvtSource N(80240430) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80240440) = {
.height = 24,
@ -97,9 +107,11 @@ NpcAISettings N(npcAISettings_8024046C) = {
.unk_2C = 1,
};
EvtSource N(npcAI_8024049C) = SCRIPT({
DoBasicAI(N(npcAISettings_8024046C));
});
EvtSource N(npcAI_8024049C) = {
EVT_CALL(DoBasicAI, EVT_PTR(N(npcAISettings_8024046C)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802404BC) = {
.height = 20,
@ -110,54 +122,62 @@ NpcSettings N(npcSettings_802404BC) = {
.level = 12,
};
EvtSource N(idle_802404E8) = SCRIPT({
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
SetNpcJumpscale(NPC_SELF, 3.0);
GetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) -= 30;
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
EnableNpcShadow(NPC_SELF, FALSE);
SetNpcPos(NPC_SELF, 0, -1000, 0);
EVT_STORY_PROGRESS = STORY_UNUSED_FFFFFFEC;
});
EvtSource N(idle_802404E8) = {
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_SUB(EVT_VAR(0), 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_SET(EVT_SAVE_VAR(0), -20)
EVT_RETURN
EVT_END
};
EvtSource N(defeat_802406E4) = SCRIPT({
EVT_SAVE_FLAG(1017) = 1;
DoNpcDefeat();
});
EvtSource N(defeat_802406E4) = {
EVT_SET(EVT_SAVE_FLAG(1017), 1)
EVT_CALL(DoNpcDefeat)
EVT_RETURN
EVT_END
};
EvtSource N(init_80240710) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_802404E8));
if (EVT_STORY_PROGRESS != STORY_UNUSED_FFFFFFEB) {
RemoveNpc(NPC_SELF);
}
});
EvtSource N(init_80240710) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_802404E8)))
EVT_IF_NE(EVT_SAVE_VAR(0), -21)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(init_8024075C) = SCRIPT({
if (EVT_STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) {
if (EVT_SAVE_FLAG(1017) == 1) {
RemoveNpc(NPC_SELF);
return;
}
BindNpcDefeat(NPC_SELF, N(defeat_802406E4));
}
BindNpcDefeat(NPC_SELF, N(defeat_802406E4));
});
EvtSource N(init_8024075C) = {
EVT_IF_LT(EVT_SAVE_VAR(0), -12)
EVT_IF_EQ(EVT_SAVE_FLAG(1017), 1)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_RETURN
EVT_END_IF
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802406E4)))
EVT_END_IF
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802406E4)))
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_802407DC) = {
.id = 0,
@ -229,13 +249,17 @@ NpcGroupList N(npcGroupList_80240BBC) = {
{},
};
EvtSource N(80240BE0) = SCRIPT({
DisablePlayerInput(TRUE);
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0183), 160, 40);
DisablePlayerInput(FALSE);
});
EvtSource N(80240BE0) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x0183), 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END);
AssignScript(N(80240BE0));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(D_802EAFDC), 200, 0, -40, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(80240BE0)))
EVT_RETURN
EVT_END
};

View File

@ -13,15 +13,15 @@ MapConfig N(config) = {
.tattle = { MSG_arn_12_tattle },
};
EvtSource N(80240060) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_HEART_FLED_FIRST_TUNNEL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
});
EvtSource N(80240060) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-22)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -7,6 +7,8 @@
#define NAMESPACE arn_13
extern s32 D_802EAFDC;
extern EvtSource N(main);
extern EvtSource N(80240060);
extern NpcGroupList N(npcGroupList_80240BCC);

View File

@ -2,80 +2,90 @@
#include "sprite/npc/goomba.h"
#include "sprite/npc/tubbas_heart.h"
EvtSource N(exitSingleDoor_80240100) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 0;
EVT_VAR(1) = 2;
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_12", 1);
sleep 100;
});
EvtSource N(exitSingleDoor_80240100) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 2)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_12"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_802401A4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
EVT_VAR(0) = 1;
EVT_VAR(1) = 7;
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("arn_11", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_802401A4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 7)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("arn_11"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80240248) = SCRIPT({
bind N(exitSingleDoor_80240100) TRIGGER_WALL_PRESS_A 2;
bind N(exitSingleDoor_802401A4) TRIGGER_WALL_PRESS_A 7;
});
EvtSource N(80240248) = {
EVT_BIND_TRIGGER(N(exitSingleDoor_80240100), TRIGGER_WALL_PRESS_A, 2, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_802401A4), TRIGGER_WALL_PRESS_A, 7, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_80240290) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(2) = 0;
EVT_VAR(3) = -1;
await EnterSingleDoor;
spawn N(80240248);
}
== 1 {
EVT_VAR(2) = 2;
EVT_VAR(3) = 1;
await EnterSingleDoor;
spawn N(80240248);
}
}
});
EvtSource N(enterSingleDoor_80240290) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(2), 0)
EVT_SET(EVT_VAR(3), -1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_CASE_EQ(1)
EVT_SET(EVT_VAR(2), 2)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80240248))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_WINDY_MILL;
SetSpriteShading(524292);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
MakeNpcs(0, N(npcGroupList_80240BCC));
await N(makeEntities);
spawn N(80240060);
spawn N(enterSingleDoor_80240290);
sleep 1;
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 35)
EVT_CALL(SetSpriteShading, 524292)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80240BCC)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80240060))
EVT_EXEC(N(enterSingleDoor_80240290))
EVT_WAIT_FRAMES(1)
EVT_RETURN
EVT_END
};
static s32 N(pad_424)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(80240430) = SCRIPT({
EvtSource N(80240430) = {
EVT_RETURN
EVT_END
};
});
EvtSource N(80240440) = SCRIPT({
});
EvtSource N(80240440) = {
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80240450) = {
.height = 24,
@ -98,9 +108,11 @@ NpcAISettings N(npcAISettings_8024047C) = {
.unk_2C = 1,
};
EvtSource N(npcAI_802404AC) = SCRIPT({
DoBasicAI(N(npcAISettings_8024047C));
});
EvtSource N(npcAI_802404AC) = {
EVT_CALL(DoBasicAI, EVT_PTR(N(npcAISettings_8024047C)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802404CC) = {
.height = 20,
@ -111,54 +123,62 @@ NpcSettings N(npcSettings_802404CC) = {
.level = 12,
};
EvtSource N(idle_802404F8) = SCRIPT({
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
SetNpcJumpscale(NPC_SELF, 3.0);
GetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) -= 30;
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14);
sleep 1;
SetNpcAnimation(NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13);
EVT_VAR(0) -= 80;
SetNpcJumpscale(NPC_SELF, 2.5);
PlaySoundAtNpc(NPC_SELF, 0x20C8, 0);
NpcJump0(NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12);
EnableNpcShadow(NPC_SELF, FALSE);
SetNpcPos(NPC_SELF, 0, -1000, 0);
EVT_STORY_PROGRESS = STORY_CH3_HEART_FLED_SECOND_TUNNEL;
});
EvtSource N(idle_802404F8) = {
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(3.0))
EVT_CALL(GetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_SUB(EVT_VAR(0), 30)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 8)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_14)
EVT_WAIT_FRAMES(1)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_tubbas_heart_Palette_00_Anim_13)
EVT_SUB(EVT_VAR(0), 80)
EVT_CALL(SetNpcJumpscale, NPC_SELF, EVT_FIXED(2.5))
EVT_CALL(PlaySoundAtNpc, NPC_SELF, 0x20C8, 0)
EVT_CALL(NpcJump0, NPC_SELF, EVT_VAR(0), 0, EVT_VAR(2), 12)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_SET(EVT_SAVE_VAR(0), -19)
EVT_RETURN
EVT_END
};
EvtSource N(defeat_802406F4) = SCRIPT({
EVT_SAVE_FLAG(1018) = 1;
DoNpcDefeat();
});
EvtSource N(defeat_802406F4) = {
EVT_SET(EVT_SAVE_FLAG(1018), 1)
EVT_CALL(DoNpcDefeat)
EVT_RETURN
EVT_END
};
EvtSource N(init_80240720) = SCRIPT({
BindNpcIdle(NPC_SELF, N(idle_802404F8));
if (EVT_STORY_PROGRESS != STORY_CH3_HEART_FLED_FIRST_TUNNEL) {
RemoveNpc(NPC_SELF);
}
});
EvtSource N(init_80240720) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_802404F8)))
EVT_IF_NE(EVT_SAVE_VAR(0), -22)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(init_8024076C) = SCRIPT({
if (EVT_STORY_PROGRESS < STORY_CH4_FRYING_PAN_STOLEN) {
if (EVT_SAVE_FLAG(1018) == 1) {
RemoveNpc(NPC_SELF);
return;
}
BindNpcDefeat(NPC_SELF, N(defeat_802406F4));
}
BindNpcDefeat(NPC_SELF, N(defeat_802406F4));
});
EvtSource N(init_8024076C) = {
EVT_IF_LT(EVT_SAVE_VAR(0), -12)
EVT_IF_EQ(EVT_SAVE_FLAG(1018), 1)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_RETURN
EVT_END_IF
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802406F4)))
EVT_END_IF
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802406F4)))
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_802407EC) = {
.id = 0,
@ -230,13 +250,17 @@ NpcGroupList N(npcGroupList_80240BCC) = {
{},
};
EvtSource N(80240BF0) = SCRIPT({
DisablePlayerInput(TRUE);
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x0184), 160, 40);
DisablePlayerInput(FALSE);
});
EvtSource N(80240BF0) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x0184), 160, 40)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EAFDC, 200, 0, -40, 0, MAKE_ENTITY_END);
AssignScript(N(80240BF0));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(D_802EAFDC), 200, 0, -40, 0, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(80240BF0)))
EVT_RETURN
EVT_END
};

View File

@ -13,15 +13,15 @@ MapConfig N(config) = {
.tattle = { MSG_arn_13_tattle },
};
EvtSource N(80240060) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_HEART_FLED_FIRST_TUNNEL {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
});
EvtSource N(80240060) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-22)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_BLUBBA_THEME, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -21,19 +21,19 @@ MapConfig N(config) = {
.tattle = { MSG_dgb_00_tattle },
};
EvtSource N(80240110) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8);
}
}
ClearAmbientSounds(250);
});
EvtSource N(80240110) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_GUSTY_GULCH, 0, 8)
EVT_END_SWITCH
EVT_CALL(ClearAmbientSounds, 250)
EVT_RETURN
EVT_END
};
static s32 N(pad_1B8)[] = {
0x00000000, 0x00000000,
@ -41,89 +41,92 @@ static s32 N(pad_1B8)[] = {
EvtSource N(exitWalk_802401C0) = EXIT_WALK_SCRIPT(60, 0, "arn_04", 1);
EvtSource N(exitDoubleDoor_8024021C) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 1;
EVT_VAR(1) = 18;
EVT_VAR(2) = 5;
EVT_VAR(3) = 7;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_01", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_8024021C) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 18)
EVT_SET(EVT_VAR(2), 5)
EVT_SET(EVT_VAR(3), 7)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_01"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(802402D0) = SCRIPT({
bind N(exitWalk_802401C0) TRIGGER_FLOOR_ABOVE 15;
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_SMASHED_THE_BRIDGES {
bind N(exitDoubleDoor_8024021C) TRIGGER_WALL_PRESS_A 18;
}
< STORY_CH3_ESCAPED_TUBBAS_MANOR {}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
spawn N(80240F50);
await N(80241AA0);
} else {
bind N(exitDoubleDoor_8024021C) TRIGGER_WALL_PRESS_A 18;
}
}
});
EvtSource N(802402D0) = {
EVT_BIND_TRIGGER(N(exitWalk_802401C0), TRIGGER_FLOOR_ABOVE, 15, 1, 0)
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-28)
EVT_BIND_TRIGGER(N(exitDoubleDoor_8024021C), TRIGGER_WALL_PRESS_A, 18, 1, 0)
EVT_CASE_LT(-25)
EVT_CASE_LT(-16)
EVT_EXEC(N(80240F50))
EVT_EXEC_WAIT(N(80241AA0))
EVT_CASE_DEFAULT
EVT_BIND_TRIGGER(N(exitDoubleDoor_8024021C), TRIGGER_WALL_PRESS_A, 18, 1, 0)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(enterDoubleDoor_8024038C) = SCRIPT({
GetLoadType(EVT_VAR(1));
if (EVT_VAR(1) == 1) {
spawn EnterSavePoint;
spawn N(802402D0);
return;
}
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
EVT_VAR(0) = N(802402D0);
spawn EnterWalk;
sleep 1;
}
== 1 {
if (EVT_STORY_PROGRESS >= STORY_CH3_TUBBA_SMASHED_THE_BRIDGES) {
if (EVT_STORY_PROGRESS < STORY_CH3_ESCAPED_TUBBAS_MANOR) {
spawn N(802402D0);
spawn {
await N(8024103C);
await N(802413F4);
}
return;
}
}
UseDoorSounds(3);
EVT_VAR(2) = 5;
EVT_VAR(3) = 7;
await EnterDoubleDoor;
spawn N(802402D0);
}
== 2 {
spawn N(802402D0);
spawn N(80242B84);
}
}
});
EvtSource N(enterDoubleDoor_8024038C) = {
EVT_CALL(GetLoadType, EVT_VAR(1))
EVT_IF_EQ(EVT_VAR(1), 1)
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(802402D0))
EVT_RETURN
EVT_END_IF
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_SET(EVT_VAR(0), EVT_PTR(N(802402D0)))
EVT_EXEC(EnterWalk)
EVT_WAIT_FRAMES(1)
EVT_CASE_EQ(1)
EVT_IF_GE(EVT_SAVE_VAR(0), -28)
EVT_IF_LT(EVT_SAVE_VAR(0), -25)
EVT_EXEC(N(802402D0))
EVT_THREAD
EVT_EXEC_WAIT(N(8024103C))
EVT_EXEC_WAIT(N(802413F4))
EVT_END_THREAD
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 5)
EVT_SET(EVT_VAR(3), 7)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_EXEC(N(802402D0))
EVT_CASE_EQ(2)
EVT_EXEC(N(802402D0))
EVT_EXEC(N(80242B84))
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
EVT_SAVE_FLAG(1978) = 1;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
GetEntryID(EVT_VAR(0));
if (EVT_VAR(0) == 2) {
MakeNpcs(0, N(npcGroupList_80243740));
} else {
MakeNpcs(0, N(npcGroupList_802436EC));
}
await N(makeEntities);
spawn N(80240110);
spawn N(enterDoubleDoor_8024038C);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 15)
EVT_SET(EVT_SAVE_FLAG(1978), 1)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 2)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80243740)))
EVT_ELSE
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802436EC)))
EVT_END_IF
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80240110))
EVT_EXEC(N(enterDoubleDoor_8024038C))
EVT_RETURN
EVT_END
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,146 +25,153 @@ MapConfig N(config) = {
.tattle = 0x1900C2,
};
EvtSource N(802414B0) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
});
EvtSource N(802414B0) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
static s32 N(pad_1548)[] = {
0x00000000, 0x00000000,
};
EvtSource N(exitDoubleDoor_80241550) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 0;
EVT_VAR(1) = 5;
EVT_VAR(2) = 11;
EVT_VAR(3) = 13;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_03", 1);
sleep 100;
});
EvtSource N(exitDoubleDoor_80241550) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 5)
EVT_SET(EVT_VAR(2), 11)
EVT_SET(EVT_VAR(3), 13)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_03"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitDoubleDoor_80241604) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 1;
EVT_VAR(1) = 17;
EVT_VAR(2) = 18;
EVT_VAR(3) = 16;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_01", 1);
sleep 100;
});
EvtSource N(exitDoubleDoor_80241604) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 17)
EVT_SET(EVT_VAR(2), 18)
EVT_SET(EVT_VAR(3), 16)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_01"), 1)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_802416B8) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(0);
EVT_VAR(0) = 2;
EVT_VAR(1) = 9;
EVT_VAR(2) = 21;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("dgb_07", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_802416B8) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(0), 2)
EVT_SET(EVT_VAR(1), 9)
EVT_SET(EVT_VAR(2), 21)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_07"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitSingleDoor_8024176C) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(0);
EVT_VAR(0) = 3;
EVT_VAR(1) = 13;
EVT_VAR(2) = 23;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("dgb_11", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_8024176C) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(0), 3)
EVT_SET(EVT_VAR(1), 13)
EVT_SET(EVT_VAR(2), 23)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_11"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_80241820) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
UseDoorSounds(3);
EVT_VAR(2) = 11;
EVT_VAR(3) = 13;
await EnterDoubleDoor;
}
== 1 {
UseDoorSounds(3);
EVT_VAR(2) = 18;
EVT_VAR(3) = 16;
await EnterDoubleDoor;
}
== 2 {
UseDoorSounds(0);
EVT_VAR(2) = 21;
EVT_VAR(3) = 1;
await EnterSingleDoor;
}
== 3 {
UseDoorSounds(0);
EVT_VAR(2) = 23;
EVT_VAR(3) = 1;
await EnterSingleDoor;
}
}
});
EvtSource N(enterSingleDoor_80241820) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 11)
EVT_SET(EVT_VAR(3), 13)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_CASE_EQ(1)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 18)
EVT_SET(EVT_VAR(3), 16)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_CASE_EQ(2)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(2), 21)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_CASE_EQ(3)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(2), 23)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamEnabled(0, 1);
if (EVT_STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
MakeNpcs(1, N(npcGroupList_802425C8));
}
bind N(exitDoubleDoor_80241550) TRIGGER_WALL_PRESS_A 5;
bind N(exitDoubleDoor_80241604) TRIGGER_WALL_PRESS_A 17;
bind N(exitSingleDoor_802416B8) TRIGGER_WALL_PRESS_A 9;
bind N(exitSingleDoor_8024176C) TRIGGER_WALL_PRESS_A 13;
spawn N(802414B0);
spawn N(enterSingleDoor_80241820);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 15)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_IF_LT(EVT_SAVE_VAR(0), -15)
EVT_CALL(MakeNpcs, 1, EVT_PTR(N(npcGroupList_802425C8)))
EVT_END_IF
EVT_BIND_TRIGGER(N(exitDoubleDoor_80241550), TRIGGER_WALL_PRESS_A, 5, 1, 0)
EVT_BIND_TRIGGER(N(exitDoubleDoor_80241604), TRIGGER_WALL_PRESS_A, 17, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_802416B8), TRIGGER_WALL_PRESS_A, 9, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_8024176C), TRIGGER_WALL_PRESS_A, 13, 1, 0)
EVT_EXEC(N(802414B0))
EVT_EXEC(N(enterSingleDoor_80241820))
EVT_RETURN
EVT_END
};
static s32 N(pad_1AA8)[] = {
0x00000000, 0x00000000,
};
EvtSource N(80241AB0) = SCRIPT({
GetBattleOutcome(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
RemoveNpc(NPC_SELF);
}
== 2 {
SetNpcPos(NPC_SELF, 0, -1000, 0);
func_80045900(1);
}
== 3 {
SetEnemyFlagBits(-1, 16, 1);
RemoveNpc(NPC_SELF);
}
}
});
EvtSource N(80241AB0) = {
EVT_CALL(GetBattleOutcome, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_CASE_EQ(2)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(func_80045900, 1)
EVT_CASE_EQ(3)
EVT_CALL(SetEnemyFlagBits, -1, 16, 1)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
s32 N(extraAnimationList_80241B6C)[] = {
NPC_ANIM_world_clubba_Palette_00_Anim_0,
@ -199,13 +206,15 @@ NpcAISettings N(npcAISettings_80241B9C) = {
.unk_2C = 3,
};
EvtSource N(npcAI_80241BCC) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(1, 5);
SetSelfVar(2, 8);
SetSelfVar(3, 12);
N(func_8024061C_C2F1BC)(N(npcAISettings_80241B9C));
});
EvtSource N(npcAI_80241BCC) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 1, 5)
EVT_CALL(SetSelfVar, 2, 8)
EVT_CALL(SetSelfVar, 3, 12)
EVT_CALL(N(func_8024061C_C2F1BC), EVT_PTR(N(npcAISettings_80241B9C)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80241C3C) = {
.height = 36,
@ -231,13 +240,15 @@ NpcAISettings N(npcAISettings_80241C68) = {
.unk_2C = 1,
};
EvtSource N(npcAI_80241C98) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(1, 10);
SetSelfVar(2, 14);
SetSelfVar(3, 18);
N(func_802410D4_C2FC74)(N(npcAISettings_80241C68));
});
EvtSource N(npcAI_80241C98) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 1, 10)
EVT_CALL(SetSelfVar, 2, 14)
EVT_CALL(SetSelfVar, 3, 18)
EVT_CALL(N(func_802410D4_C2FC74), EVT_PTR(N(npcAISettings_80241C68)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80241D08) = {
.height = 36,
@ -248,16 +259,18 @@ NpcSettings N(npcSettings_80241D08) = {
.level = 13,
};
EvtSource N(npcAI_80241D34) = SCRIPT({
EnableNpcShadow(NPC_SELF, FALSE);
SetSelfVar(0, 4);
SetSelfVar(1, 32);
SetSelfVar(2, 50);
SetSelfVar(3, 32);
SetSelfVar(4, 3);
SetSelfVar(15, 8389);
N(UnkFunc7)();
});
EvtSource N(npcAI_80241D34) = {
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetSelfVar, 0, 4)
EVT_CALL(SetSelfVar, 1, 32)
EVT_CALL(SetSelfVar, 2, 50)
EVT_CALL(SetSelfVar, 3, 32)
EVT_CALL(SetSelfVar, 4, 3)
EVT_CALL(SetSelfVar, 15, 8389)
EVT_CALL(N(UnkFunc7))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80241DDC) = {
.height = 14,

View File

@ -29,363 +29,386 @@ MapConfig N(config) = {
.tattle = { MSG_dgb_03_tattle },
};
EvtSource N(80242870) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
});
EvtSource N(80242870) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
static s32 N(pad_2908)[] = {
0x00000000, 0x00000000,
};
EvtSource N(exitDoubleDoor_80242910) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 1;
EVT_VAR(1) = 25;
EVT_VAR(2) = 36;
EVT_VAR(3) = 34;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_02", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_80242910) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 25)
EVT_SET(EVT_VAR(2), 36)
EVT_SET(EVT_VAR(3), 34)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_02"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitDoubleDoor_802429C4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 4;
EVT_VAR(1) = 21;
EVT_VAR(2) = 46;
EVT_VAR(3) = 44;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_09", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_802429C4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 4)
EVT_SET(EVT_VAR(1), 21)
EVT_SET(EVT_VAR(2), 46)
EVT_SET(EVT_VAR(3), 44)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_09"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitDoubleDoor_80242A78) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 0;
EVT_VAR(1) = 13;
EVT_VAR(2) = 29;
EVT_VAR(3) = 31;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_04", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_80242A78) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 13)
EVT_SET(EVT_VAR(2), 29)
EVT_SET(EVT_VAR(3), 31)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_04"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitWalk_80242B2C) = EXIT_WALK_SCRIPT(26, 2, "dgb_13", 0);
EvtSource N(exitSingleDoor_80242B88) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(0);
EVT_VAR(0) = 2;
EVT_VAR(1) = 33;
EVT_VAR(2) = 49;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("dgb_05", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_80242B88) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(0), 2)
EVT_SET(EVT_VAR(1), 33)
EVT_SET(EVT_VAR(2), 49)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_05"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitDoubleDoor_80242C3C) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 3;
EVT_VAR(1) = 17;
EVT_VAR(2) = 39;
EVT_VAR(3) = 41;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_14", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_80242C3C) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 3)
EVT_SET(EVT_VAR(1), 17)
EVT_SET(EVT_VAR(2), 39)
EVT_SET(EVT_VAR(3), 41)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_14"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80242CF0) = SCRIPT({
bind N(exitWalk_80242B2C) TRIGGER_FLOOR_ABOVE 35;
});
EvtSource N(80242CF0) = {
EVT_BIND_TRIGGER(N(exitWalk_80242B2C), TRIGGER_FLOOR_ABOVE, 35, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(enterDoubleDoor_80242D1C) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
UseDoorSounds(3);
EVT_VAR(2) = 29;
EVT_VAR(3) = 31;
await EnterDoubleDoor;
spawn N(80242CF0);
}
== 1 {
UseDoorSounds(3);
EVT_VAR(2) = 36;
EVT_VAR(3) = 34;
await EnterDoubleDoor;
spawn N(80242CF0);
}
== 2 {
UseDoorSounds(0);
EVT_VAR(2) = 49;
EVT_VAR(3) = 1;
await EnterSingleDoor;
spawn N(80242CF0);
}
== 3 {
UseDoorSounds(3);
EVT_VAR(2) = 39;
EVT_VAR(3) = 41;
await EnterDoubleDoor;
spawn N(80242CF0);
}
== 4 {
UseDoorSounds(3);
EVT_VAR(2) = 46;
EVT_VAR(3) = 44;
await EnterDoubleDoor;
spawn N(80242CF0);
}
== 5 {
EVT_VAR(0) = N(80242CF0);
spawn EnterWalkShort;
sleep 1;
}
}
});
EvtSource N(enterDoubleDoor_80242D1C) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 29)
EVT_SET(EVT_VAR(3), 31)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_EXEC(N(80242CF0))
EVT_CASE_EQ(1)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 36)
EVT_SET(EVT_VAR(3), 34)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_EXEC(N(80242CF0))
EVT_CASE_EQ(2)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(2), 49)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_EXEC(N(80242CF0))
EVT_CASE_EQ(3)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 39)
EVT_SET(EVT_VAR(3), 41)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_EXEC(N(80242CF0))
EVT_CASE_EQ(4)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 46)
EVT_SET(EVT_VAR(3), 44)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_EXEC(N(80242CF0))
EVT_CASE_EQ(5)
EVT_SET(EVT_VAR(0), EVT_PTR(N(80242CF0)))
EVT_EXEC(EnterWalkShort)
EVT_WAIT_FRAMES(1)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
s32 N(itemList_80242F28)[] = {
ITEM_TUBBA_CASTLE_KEY,
ITEM_NONE,
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamEnabled(0, 1);
if (EVT_STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
MakeNpcs(1, N(npcGroupList_80244988));
}
await N(makeEntities);
spawn N(80243608);
bind N(exitDoubleDoor_80242910) TRIGGER_WALL_PRESS_A 25;
bind N(exitDoubleDoor_802429C4) TRIGGER_WALL_PRESS_A 21;
bind N(exitDoubleDoor_80242A78) TRIGGER_WALL_PRESS_A 13;
bind N(exitSingleDoor_80242B88) TRIGGER_WALL_PRESS_A 33;
if (EVT_SAVE_FLAG(1043) == 0) {
bind_padlock N(80243740) TRIGGER_WALL_PRESS_A entity(0) N(itemList_80242F28);
} else {
bind N(exitDoubleDoor_80242C3C) TRIGGER_WALL_PRESS_A 17;
}
spawn N(80242870);
spawn N(enterDoubleDoor_80242D1C);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 15)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_IF_LT(EVT_SAVE_VAR(0), -15)
EVT_CALL(MakeNpcs, 1, EVT_PTR(N(npcGroupList_80244988)))
EVT_END_IF
EVT_EXEC_WAIT(N(makeEntities))
EVT_EXEC(N(80243608))
EVT_BIND_TRIGGER(N(exitDoubleDoor_80242910), TRIGGER_WALL_PRESS_A, 25, 1, 0)
EVT_BIND_TRIGGER(N(exitDoubleDoor_802429C4), TRIGGER_WALL_PRESS_A, 21, 1, 0)
EVT_BIND_TRIGGER(N(exitDoubleDoor_80242A78), TRIGGER_WALL_PRESS_A, 13, 1, 0)
EVT_BIND_TRIGGER(N(exitSingleDoor_80242B88), TRIGGER_WALL_PRESS_A, 33, 1, 0)
EVT_IF_EQ(EVT_SAVE_FLAG(1043), 0)
EVT_BIND_PADLOCK(N(80243740), TRIGGER_WALL_PRESS_A, EVT_ENTITY_INDEX(0), EVT_PTR(N(itemList_80242F28)), 0, 1)
EVT_ELSE
EVT_BIND_TRIGGER(N(exitDoubleDoor_80242C3C), TRIGGER_WALL_PRESS_A, 17, 1, 0)
EVT_END_IF
EVT_EXEC(N(80242870))
EVT_EXEC(N(enterDoubleDoor_80242D1C))
EVT_RETURN
EVT_END
};
static s32 N(pad_30D8)[] = {
0x00000000, 0x00000000,
};
EvtSource N(802430E0) = SCRIPT({
group 0;
loop 20 {
GetCurrentPartner(EVT_VAR(10));
if (EVT_VAR(10) != 0) {
EVT_VAR(8) = -1;
return;
}
N(UnkFunc11)(EVT_VAR(9));
if (EVT_VAR(0) == 0) {
EVT_VAR(8) = -1;
return;
} else {
SetPlayerActionState(20);
}
sleep 1;
}
GetCurrentPartner(EVT_VAR(10));
if (EVT_VAR(10) != 0) {
EVT_VAR(8) = -1;
return;
}
DisablePlayerInput(TRUE);
spawn {
ShakeCam(0, 0, 100, 0.6005859375);
}
spawn {
if (EVT_VAR(6) >= EVT_VAR(7)) {
InterpPlayerYaw(270, 0);
} else {
InterpPlayerYaw(90, 0);
}
SetPlayerActionState(20);
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(1) = EVT_VAR(0);
EVT_VAR(2) = EVT_VAR(7);
EVT_VAR(2) -= EVT_VAR(6);
EVT_VAR(1) += EVT_VAR(2);
MakeLerp(EVT_VAR(0), EVT_VAR(1), 100, 0);
loop {
SetPlayerActionState(20);
UpdateLerp();
N(UnkFunc12)();
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
SetPlayerActionState(0);
DisablePlayerInput(FALSE);
}
MakeLerp(EVT_VAR(6), EVT_VAR(7), 100, 0);
PlaySoundAtCollider(27, 0x80000010, 0);
loop {
UpdateLerp();
TranslateModel(51, EVT_VAR(0), 0, 0);
UpdateColliderTransform(27);
UpdateColliderTransform(28);
UpdateColliderTransform(29);
sleep 1;
if (EVT_VAR(1) == 0) {
break loop;
}
}
StopSound(0x80000010);
});
EvtSource N(802430E0) = {
EVT_SET_GROUP(0)
EVT_LOOP(20)
EVT_CALL(GetCurrentPartner, EVT_VAR(10))
EVT_IF_NE(EVT_VAR(10), 0)
EVT_SET(EVT_VAR(8), -1)
EVT_RETURN
EVT_END_IF
EVT_CALL(N(UnkFunc11), EVT_VAR(9))
EVT_IF_EQ(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(8), -1)
EVT_RETURN
EVT_ELSE
EVT_CALL(SetPlayerActionState, 20)
EVT_END_IF
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_CALL(GetCurrentPartner, EVT_VAR(10))
EVT_IF_NE(EVT_VAR(10), 0)
EVT_SET(EVT_VAR(8), -1)
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD
EVT_CALL(ShakeCam, 0, 0, 100, EVT_FIXED(0.6))
EVT_END_THREAD
EVT_THREAD
EVT_IF_GE(EVT_VAR(6), EVT_VAR(7))
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_ELSE
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_END_IF
EVT_CALL(SetPlayerActionState, 20)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_SET(EVT_VAR(1), EVT_VAR(0))
EVT_SET(EVT_VAR(2), EVT_VAR(7))
EVT_SUB(EVT_VAR(2), EVT_VAR(6))
EVT_ADD(EVT_VAR(1), EVT_VAR(2))
EVT_CALL(MakeLerp, EVT_VAR(0), EVT_VAR(1), 100, 0)
EVT_LOOP(0)
EVT_CALL(SetPlayerActionState, 20)
EVT_CALL(UpdateLerp)
EVT_CALL(N(UnkFunc12))
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetPlayerActionState, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_THREAD
EVT_CALL(MakeLerp, EVT_VAR(6), EVT_VAR(7), 100, 0)
EVT_CALL(PlaySoundAtCollider, 27, 0x80000010, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateModel, 51, EVT_VAR(0), 0, 0)
EVT_CALL(UpdateColliderTransform, 27)
EVT_CALL(UpdateColliderTransform, 28)
EVT_CALL(UpdateColliderTransform, 29)
EVT_WAIT_FRAMES(1)
EVT_IF_EQ(EVT_VAR(1), 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(StopSound, 0x80000010)
EVT_RETURN
EVT_END
};
EvtSource N(80243470) = SCRIPT({
if (EVT_SAVE_FLAG(1044) != 0) {
goto 90;
}
EVT_VAR(6) = 0;
EVT_VAR(7) = 48;
EVT_VAR(8) = 0;
EVT_VAR(9) = 27;
await N(802430E0);
90:
if (EVT_VAR(8) != -1) {
EVT_SAVE_FLAG(1045) = 0;
EVT_SAVE_FLAG(1044) = 1;
unbind;
}
});
EvtSource N(80243470) = {
EVT_IF_NE(EVT_SAVE_FLAG(1044), 0)
EVT_GOTO(90)
EVT_END_IF
EVT_SET(EVT_VAR(6), 0)
EVT_SET(EVT_VAR(7), 48)
EVT_SET(EVT_VAR(8), 0)
EVT_SET(EVT_VAR(9), 27)
EVT_EXEC_WAIT(N(802430E0))
EVT_LABEL(90)
EVT_IF_NE(EVT_VAR(8), -1)
EVT_SET(EVT_SAVE_FLAG(1045), 0)
EVT_SET(EVT_SAVE_FLAG(1044), 1)
EVT_UNBIND
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(8024353C) = SCRIPT({
if (EVT_SAVE_FLAG(1044) != 0) {
goto 90;
}
EVT_VAR(6) = 0;
EVT_VAR(7) = -48;
EVT_VAR(8) = 0;
EVT_VAR(9) = 28;
await N(802430E0);
90:
if (EVT_VAR(8) != -1) {
EVT_SAVE_FLAG(1045) = 1;
EVT_SAVE_FLAG(1044) = 1;
unbind;
}
});
EvtSource N(8024353C) = {
EVT_IF_NE(EVT_SAVE_FLAG(1044), 0)
EVT_GOTO(90)
EVT_END_IF
EVT_SET(EVT_VAR(6), 0)
EVT_SET(EVT_VAR(7), -48)
EVT_SET(EVT_VAR(8), 0)
EVT_SET(EVT_VAR(9), 28)
EVT_EXEC_WAIT(N(802430E0))
EVT_LABEL(90)
EVT_IF_NE(EVT_VAR(8), -1)
EVT_SET(EVT_SAVE_FLAG(1045), 1)
EVT_SET(EVT_SAVE_FLAG(1044), 1)
EVT_UNBIND
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtSource N(80243608) = SCRIPT({
ParentColliderToModel(27, 51);
ParentColliderToModel(28, 51);
ParentColliderToModel(29, 51);
if (EVT_SAVE_FLAG(1044) == 0) {
bind N(80243470) TRIGGER_WALL_PUSH 27;
bind N(8024353C) TRIGGER_WALL_PUSH 28;
} else {
if (EVT_SAVE_FLAG(1045) == 0) {
EVT_VAR(0) = 48;
} else {
EVT_VAR(0) = -48;
}
TranslateModel(51, EVT_VAR(0), 0, 0);
UpdateColliderTransform(27);
UpdateColliderTransform(28);
UpdateColliderTransform(29);
}
});
EvtSource N(80243608) = {
EVT_CALL(ParentColliderToModel, 27, 51)
EVT_CALL(ParentColliderToModel, 28, 51)
EVT_CALL(ParentColliderToModel, 29, 51)
EVT_IF_EQ(EVT_SAVE_FLAG(1044), 0)
EVT_BIND_TRIGGER(N(80243470), TRIGGER_WALL_PUSH, 27, 1, 0)
EVT_BIND_TRIGGER(N(8024353C), TRIGGER_WALL_PUSH, 28, 1, 0)
EVT_ELSE
EVT_IF_EQ(EVT_SAVE_FLAG(1045), 0)
EVT_SET(EVT_VAR(0), 48)
EVT_ELSE
EVT_SET(EVT_VAR(0), -48)
EVT_END_IF
EVT_CALL(TranslateModel, 51, EVT_VAR(0), 0, 0)
EVT_CALL(UpdateColliderTransform, 27)
EVT_CALL(UpdateColliderTransform, 28)
EVT_CALL(UpdateColliderTransform, 29)
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_3738)[] = {
0x00000000, 0x00000000,
};
EvtSource N(80243740) = SCRIPT({
group 0;
suspend group 1;
ShowKeyChoicePopup();
if (EVT_VAR(0) == 0) {
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00D8), 160, 40);
CloseChoicePopup();
resume group 1;
return;
}
if (EVT_VAR(0) == -1) {
CloseChoicePopup();
resume group 1;
return;
}
FindKeyItem(19, EVT_VAR(0));
RemoveKeyItemAt(EVT_VAR(0));
CloseChoicePopup();
EVT_SAVE_FLAG(1043) = 1;
N(GetEntityPosition)(EVT_MAP_VAR(0), EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
PlaySoundAt(0x269, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(0) = EVT_MAP_VAR(0);
N(SetEntityFlags100000)();
resume group 1;
unbind;
});
EvtSource N(80243740) = {
EVT_SET_GROUP(0)
EVT_SUSPEND_GROUP(1)
EVT_CALL(ShowKeyChoicePopup)
EVT_IF_EQ(EVT_VAR(0), 0)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00D8), 160, 40)
EVT_CALL(CloseChoicePopup)
EVT_RESUME_GROUP(1)
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(EVT_VAR(0), -1)
EVT_CALL(CloseChoicePopup)
EVT_RESUME_GROUP(1)
EVT_RETURN
EVT_END_IF
EVT_CALL(FindKeyItem, ITEM_TUBBA_CASTLE_KEY, EVT_VAR(0))
EVT_CALL(RemoveKeyItemAt, EVT_VAR(0))
EVT_CALL(CloseChoicePopup)
EVT_SET(EVT_SAVE_FLAG(1043), 1)
EVT_CALL(N(GetEntityPosition), EVT_MAP_VAR(0), EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(PlaySoundAt, 0x269, 0, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_SET(EVT_VAR(0), EVT_MAP_VAR(0))
EVT_CALL(N(SetEntityFlags100000))
EVT_RESUME_GROUP(1)
EVT_UNBIND
EVT_RETURN
EVT_END
};
EvtSource N(802438A8) = SCRIPT({
bind N(exitDoubleDoor_80242C3C) TRIGGER_WALL_PRESS_A 17;
});
EvtSource N(802438A8) = {
EVT_BIND_TRIGGER(N(exitDoubleDoor_80242C3C), TRIGGER_WALL_PRESS_A, 17, 1, 0)
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
if (EVT_SAVE_FLAG(1043) == 0) {
MakeEntity(0x802BCD68, -355, 218, 75, 80, MAKE_ENTITY_END);
AssignScript(N(802438A8));
EVT_MAP_VAR(0) = EVT_VAR(0);
}
MakeItemEntity(ITEM_STAR_PIECE, 0, 75, 100, 17, EVT_SAVE_FLAG(1042));
});
EvtSource N(makeEntities) = {
EVT_IF_EQ(EVT_SAVE_FLAG(1043), 0)
EVT_CALL(MakeEntity, 0x802BCD68, -355, 218, 75, 80, MAKE_ENTITY_END)
EVT_CALL(AssignScript, EVT_PTR(N(802438A8)))
EVT_SET(EVT_MAP_VAR(0), EVT_VAR(0))
EVT_END_IF
EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, 0, 75, 100, 17, EVT_SAVE_FLAG(1042))
EVT_RETURN
EVT_END
};
static s32 N(pad_3964)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtSource N(80243970) = SCRIPT({
GetBattleOutcome(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
RemoveNpc(NPC_SELF);
}
== 2 {
SetNpcPos(NPC_SELF, 0, -1000, 0);
func_80045900(1);
}
== 3 {
SetEnemyFlagBits(-1, 16, 1);
RemoveNpc(NPC_SELF);
}
}
});
EvtSource N(80243970) = {
EVT_CALL(GetBattleOutcome, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_CASE_EQ(2)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(func_80045900, 1)
EVT_CASE_EQ(3)
EVT_CALL(SetEnemyFlagBits, -1, 16, 1)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
s32 N(unk_missing_80243A2C)[] = {
0x00390000, 0x00390002, 0x00390003, 0x00390004, 0x0039000C, 0x00390007, 0x00390008, 0x00390011,
@ -412,13 +435,15 @@ NpcAISettings N(npcAISettings_80243A5C) = {
.unk_2C = 3,
};
EvtSource N(npcAI_80243A8C) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(1, 5);
SetSelfVar(2, 8);
SetSelfVar(3, 12);
N(func_8024086C_C31D4C)(N(npcAISettings_80243A5C));
});
EvtSource N(npcAI_80243A8C) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 1, 5)
EVT_CALL(SetSelfVar, 2, 8)
EVT_CALL(SetSelfVar, 3, 12)
EVT_CALL(N(func_8024086C_C31D4C), EVT_PTR(N(npcAISettings_80243A5C)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243AFC) = {
.height = 36,
@ -444,13 +469,15 @@ NpcAISettings N(npcAISettings_80243B28) = {
.unk_2C = 3,
};
EvtSource N(npcAI_80243B58) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(1, 5);
SetSelfVar(2, 8);
SetSelfVar(3, 12);
N(func_802419B0_C32E90)(N(npcAISettings_80243B28));
});
EvtSource N(npcAI_80243B58) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 1, 5)
EVT_CALL(SetSelfVar, 2, 8)
EVT_CALL(SetSelfVar, 3, 12)
EVT_CALL(N(func_802419B0_C32E90), EVT_PTR(N(npcAISettings_80243B28)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243BC8) = {
.height = 36,
@ -476,13 +503,15 @@ NpcAISettings N(npcAISettings_80243BF4) = {
.unk_2C = 1,
};
EvtSource N(npcAI_80243C24) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(1, 10);
SetSelfVar(2, 14);
SetSelfVar(3, 18);
N(func_80242480_C33960)(N(npcAISettings_80243BF4));
});
EvtSource N(npcAI_80243C24) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 1, 10)
EVT_CALL(SetSelfVar, 2, 14)
EVT_CALL(SetSelfVar, 3, 18)
EVT_CALL(N(func_80242480_C33960), EVT_PTR(N(npcAISettings_80243BF4)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243C94) = {
.height = 36,
@ -493,16 +522,18 @@ NpcSettings N(npcSettings_80243C94) = {
.level = 13,
};
EvtSource N(npcAI_80243CC0) = SCRIPT({
EnableNpcShadow(NPC_SELF, FALSE);
SetSelfVar(0, 4);
SetSelfVar(1, 32);
SetSelfVar(2, 50);
SetSelfVar(3, 32);
SetSelfVar(4, 3);
SetSelfVar(15, 8389);
N(UnkFunc7)();
});
EvtSource N(npcAI_80243CC0) = {
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_CALL(SetSelfVar, 0, 4)
EVT_CALL(SetSelfVar, 1, 32)
EVT_CALL(SetSelfVar, 2, 50)
EVT_CALL(SetSelfVar, 3, 32)
EVT_CALL(SetSelfVar, 4, 3)
EVT_CALL(SetSelfVar, 15, 8389)
EVT_CALL(N(UnkFunc7))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243D68) = {
.height = 14,
@ -513,12 +544,14 @@ NpcSettings N(npcSettings_80243D68) = {
.unk_2A = 8,
};
EvtSource N(init_80243D94) = SCRIPT({
GetEntryID(EVT_VAR(0));
if (EVT_VAR(0) == 3) {
SetNpcPos(NPC_SELF, -330, 210, -20);
}
});
EvtSource N(init_80243D94) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 3)
EVT_CALL(SetNpcPos, NPC_SELF, -330, 210, -20)
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80243DE8)[] = {
{

View File

@ -21,85 +21,91 @@ MapConfig N(config) = {
.tattle = { MSG_dgb_04_tattle },
};
EvtSource N(80243170) = SCRIPT({
match EVT_STORY_PROGRESS {
< STORY_CH3_TUBBA_WOKE_UP {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
< STORY_CH3_DEFEATED_TUBBA_BLUBBA {
SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8);
} else {
SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8);
}
}
});
EvtSource N(80243170) = {
EVT_SWITCH(EVT_SAVE_VAR(0))
EVT_CASE_LT(-29)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_CASE_LT(-16)
EVT_CALL(SetMusicTrack, 0, SONG_TUBBA_ESCAPE, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_TUBBAS_MANOR, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
static s32 N(pad_3208)[] = {
0x00000000, 0x00000000,
};
EvtSource N(exitSingleDoor_80243210) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(0);
EVT_VAR(0) = 0;
EVT_VAR(1) = 16;
EVT_VAR(2) = 16;
EVT_VAR(3) = 1;
spawn ExitSingleDoor;
sleep 17;
GotoMap("dgb_06", 0);
sleep 100;
});
EvtSource N(exitSingleDoor_80243210) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(0), 0)
EVT_SET(EVT_VAR(1), 16)
EVT_SET(EVT_VAR(2), 16)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC(ExitSingleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_06"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(exitDoubleDoor_802432C4) = SCRIPT({
group 27;
DisablePlayerInput(TRUE);
UseDoorSounds(3);
EVT_VAR(0) = 1;
EVT_VAR(1) = 20;
EVT_VAR(2) = 13;
EVT_VAR(3) = 11;
spawn ExitDoubleDoor;
sleep 17;
GotoMap("dgb_03", 0);
sleep 100;
});
EvtSource N(exitDoubleDoor_802432C4) = {
EVT_SET_GROUP(27)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(0), 1)
EVT_SET(EVT_VAR(1), 20)
EVT_SET(EVT_VAR(2), 13)
EVT_SET(EVT_VAR(3), 11)
EVT_EXEC(ExitDoubleDoor)
EVT_WAIT_FRAMES(17)
EVT_CALL(GotoMap, EVT_PTR("dgb_03"), 0)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(enterSingleDoor_80243378) = SCRIPT({
GetEntryID(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
UseDoorSounds(3);
EVT_VAR(2) = 13;
EVT_VAR(3) = 11;
await EnterDoubleDoor;
}
== 1 {
UseDoorSounds(0);
EVT_VAR(2) = 16;
EVT_VAR(3) = 1;
await EnterSingleDoor;
}
}
});
EvtSource N(enterSingleDoor_80243378) = {
EVT_CALL(GetEntryID, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(UseDoorSounds, 3)
EVT_SET(EVT_VAR(2), 13)
EVT_SET(EVT_VAR(3), 11)
EVT_EXEC_WAIT(EnterDoubleDoor)
EVT_CASE_EQ(1)
EVT_CALL(UseDoorSounds, 0)
EVT_SET(EVT_VAR(2), 16)
EVT_SET(EVT_VAR(3), 1)
EVT_EXEC_WAIT(EnterSingleDoor)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(main) = SCRIPT({
EVT_WORLD_LOCATION = LOCATION_TUBBAS_MANOR;
SetSpriteShading(-1);
SetCamPerspective(0, 3, 25, 16, 4096);
SetCamBGColor(0, 0, 0, 0);
SetCamLeadPlayer(0, 0);
SetCamEnabled(0, 1);
if (EVT_STORY_PROGRESS < STORY_CH3_STAR_SPIRIT_RESCUED) {
MakeNpcs(1, N(npcGroupList_80243D18));
}
await N(makeEntities);
bind N(exitSingleDoor_80243210) TRIGGER_WALL_PRESS_A 16;
bind N(exitDoubleDoor_802432C4) TRIGGER_WALL_PRESS_A 20;
spawn N(80243170);
spawn N(enterSingleDoor_80243378);
});
EvtSource N(main) = {
EVT_SET(EVT_SAVE_VAR(425), 15)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_IF_LT(EVT_SAVE_VAR(0), -15)
EVT_CALL(MakeNpcs, 1, EVT_PTR(N(npcGroupList_80243D18)))
EVT_END_IF
EVT_EXEC_WAIT(N(makeEntities))
EVT_BIND_TRIGGER(N(exitSingleDoor_80243210), TRIGGER_WALL_PRESS_A, 16, 1, 0)
EVT_BIND_TRIGGER(N(exitDoubleDoor_802432C4), TRIGGER_WALL_PRESS_A, 20, 1, 0)
EVT_EXEC(N(80243170))
EVT_EXEC(N(enterSingleDoor_80243378))
EVT_RETURN
EVT_END
};
static s32 N(pad_3558)[] = {
0x00000000, 0x00000000,
@ -110,10 +116,12 @@ f32 N(D_80243560_C39A90)[] = {
1.5f, 20.0f,
};
EvtSource N(80243578) = SCRIPT({
SetSelfEnemyFlagBits(((0x00100000 | 0x01000000 | 0x02000000 | 0x04000000 | 0x08000000 | 0x10000000 | 0x20000000)), TRUE);
SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE);
});
EvtSource N(80243578) = {
EVT_CALL(SetSelfEnemyFlagBits, ((NPC_FLAG_MOTION_BLUR | NPC_FLAG_1000000 | NPC_FLAG_SIMPLIFIED_PHYSICS | NPC_FLAG_PARTICLE | NPC_FLAG_8000000 | NPC_FLAG_10000000 | NPC_FLAG_20000000)), TRUE)
EVT_CALL(SetNpcFlagBits, NPC_SELF, ((NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_NO_Y_MOVEMENT)), TRUE)
EVT_RETURN
EVT_END
};
NpcAISettings N(npcAISettings_802435B4) = {
.moveSpeed = 1.5f,
@ -130,86 +138,93 @@ NpcAISettings N(npcAISettings_802435B4) = {
extern const char N(dgb_00_name_hack)[];
EvtSource N(npcAI_802435E4) = SCRIPT({
SetSelfVar(0, 0);
SetSelfVar(5, -650);
SetSelfVar(6, 30);
SetSelfVar(1, 600);
N(func_80242154_C38684)(N(npcAISettings_802435B4));
DisablePlayerInput(TRUE);
sleep 2;
20:
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
GetNpcPos(NPC_SELF, EVT_VAR(3), EVT_VAR(4), EVT_VAR(5));
SetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(4), EVT_VAR(2));
GetPlayerActionState(EVT_VAR(0));
if (EVT_VAR(0) != 0) {
sleep 1;
goto 20;
}
DisablePlayerPhysics(TRUE);
func_802D2B6C();
DisablePartnerAI(0);
group 0;
SetTimeFreezeMode(1);
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(1) += 20;
EVT_VAR(2) += 2;
SetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
func_80045838(-1, 759, 0);
SetNpcAnimation(NPC_SELF, NPC_ANIM_sentinel_Palette_00_Anim_8);
sleep 10;
SetPlayerAnimation(ANIM_80017);
sleep 10;
func_80045838(-1, 1838, 0);
spawn {
loop 100 {
GetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(1) += 1;
SetNpcPos(NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
GetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
EVT_VAR(1) += 1;
SetPlayerPos(EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
sleep 1;
}
}
spawn {
SetNpcAnimation(NPC_PARTNER, 0x108);
GetNpcPos(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
NpcJump0(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
GetNpcPos(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
NpcJump0(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
GetNpcPos(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
NpcJump0(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
GetNpcPos(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2));
NpcJump0(NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10);
}
sleep 30;
GotoMap(N(dgb_00_name_hack), 2);
sleep 100;
});
EvtSource N(npcAI_802435E4) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 5, -650)
EVT_CALL(SetSelfVar, 6, 30)
EVT_CALL(SetSelfVar, 1, 600)
EVT_CALL(N(func_80242154_C38684), EVT_PTR(N(npcAISettings_802435B4)))
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT_FRAMES(2)
EVT_LABEL(20)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(GetNpcPos, NPC_SELF, EVT_VAR(3), EVT_VAR(4), EVT_VAR(5))
EVT_CALL(SetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(4), EVT_VAR(2))
EVT_CALL(GetPlayerActionState, EVT_VAR(0))
EVT_IF_NE(EVT_VAR(0), 0)
EVT_WAIT_FRAMES(1)
EVT_GOTO(20)
EVT_END_IF
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(func_802D2B6C)
EVT_CALL(DisablePartnerAI, 0)
EVT_SET_GROUP(0)
EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 20)
EVT_ADD(EVT_VAR(2), 2)
EVT_CALL(SetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(func_80045838, -1, 759, 0)
EVT_CALL(SetNpcAnimation, NPC_SELF, NPC_ANIM_sentinel_Palette_00_Anim_8)
EVT_WAIT_FRAMES(10)
EVT_CALL(SetPlayerAnimation, ANIM_80017)
EVT_WAIT_FRAMES(10)
EVT_CALL(func_80045838, -1, 1838, 0)
EVT_THREAD
EVT_LOOP(100)
EVT_CALL(GetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 1)
EVT_CALL(SetNpcPos, NPC_SELF, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(GetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_ADD(EVT_VAR(1), 1)
EVT_CALL(SetPlayerPos, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_WAIT_FRAMES(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_CALL(SetNpcAnimation, NPC_PARTNER, 0x108)
EVT_CALL(GetNpcPos, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(NpcJump0, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_CALL(GetNpcPos, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(NpcJump0, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_CALL(GetNpcPos, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(NpcJump0, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_CALL(GetNpcPos, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2))
EVT_CALL(NpcJump0, NPC_PARTNER, EVT_VAR(0), EVT_VAR(1), EVT_VAR(2), 10)
EVT_END_THREAD
EVT_WAIT_FRAMES(30)
EVT_CALL(GotoMap, EVT_PTR(N(dgb_00_name_hack)), 2)
EVT_WAIT_FRAMES(100)
EVT_RETURN
EVT_END
};
EvtSource N(80243A0C) = SCRIPT({
GetOwnerEncounterTrigger(EVT_VAR(0));
match EVT_VAR(0) {
== 1, 2, 4, 6 {
GetSelfAnimationFromTable(7, EVT_VAR(0));
await 0x800936DC;
}
}
});
EvtSource N(80243A0C) = {
EVT_CALL(GetOwnerEncounterTrigger, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(1)
EVT_CASE_OR_EQ(2)
EVT_CASE_OR_EQ(4)
EVT_CASE_OR_EQ(6)
EVT_CALL(GetSelfAnimationFromTable, 7, EVT_VAR(0))
EVT_EXEC_WAIT(0x800936DC)
EVT_END_CASE_GROUP
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtSource N(80243A98) = SCRIPT({
GetBattleOutcome(EVT_VAR(0));
match EVT_VAR(0) {
== 0 {
DoNpcDefeat();
}
== 1 {}
== 2 {
}
}
});
EvtSource N(80243A98) = {
EVT_CALL(GetBattleOutcome, EVT_VAR(0))
EVT_SWITCH(EVT_VAR(0))
EVT_CASE_EQ(0)
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(1)
EVT_CASE_EQ(2)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243AFC) = {
.height = 38,
@ -275,124 +290,130 @@ f32 N(D_80243D88_C3A2B8)[] = {
140.0f, 180.0f, 220.0f
};
EvtSource N(80243D94) = SCRIPT({
sleep 10;
PlaySound(0x212D);
N(UnkFunc21)(EVT_MAP_VAR(0));
sleep 85;
spawn {
PlaySound(0x212E);
N(func_80242F08_C39438)(70, 70);
sleep 27;
PlaySound(SOUND_208E);
N(func_80242F08_C39438)(50, 50);
}
spawn {
sleep 3;
N(func_8024240C_C3893C)(EVT_MAP_VAR(0));
}
spawn {
sleep 47;
N(UnkFunc22)();
N(UnkPartnerPosFunc)();
sleep 5;
N(UnkPartnerPosFunc2)();
sleep 5;
N(UnkPartnerPosFunc)();
}
sleep 3;
N(func_802429D0_C38F00)(EVT_MAP_VAR(0));
sleep 30;
});
EvtSource N(80243D94) = {
EVT_WAIT_FRAMES(10)
EVT_CALL(PlaySound, 0x212D)
EVT_CALL(N(UnkFunc21), EVT_MAP_VAR(0))
EVT_WAIT_FRAMES(85)
EVT_THREAD
EVT_CALL(PlaySound, 0x212E)
EVT_CALL(N(func_80242F08_C39438), 70, 70)
EVT_WAIT_FRAMES(27)
EVT_CALL(PlaySound, SOUND_208E)
EVT_CALL(N(func_80242F08_C39438), 50, 50)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(N(func_8024240C_C3893C), EVT_MAP_VAR(0))
EVT_END_THREAD
EVT_THREAD
EVT_WAIT_FRAMES(47)
EVT_CALL(N(UnkFunc22))
EVT_CALL(N(UnkPartnerPosFunc))
EVT_WAIT_FRAMES(5)
EVT_CALL(N(UnkPartnerPosFunc2))
EVT_WAIT_FRAMES(5)
EVT_CALL(N(UnkPartnerPosFunc))
EVT_END_THREAD
EVT_WAIT_FRAMES(3)
EVT_CALL(N(func_802429D0_C38F00), EVT_MAP_VAR(0))
EVT_WAIT_FRAMES(30)
EVT_RETURN
EVT_END
};
EvtSource N(80243EF8) = SCRIPT({
if (EVT_SAVE_FLAG(1046) == 1) {
return;
}
IsStartingConversation(EVT_VAR(0));
if (EVT_VAR(0) == 1) {
return;
}
N(UnkFunc24)();
if (EVT_VAR(0) == 1) {
return;
}
ModifyGlobalOverrideFlags(1, 2097152);
N(SetOverrideFlags_40)();
DisablePlayerInput(TRUE);
DisablePartnerAI(0);
SetNpcFlagBits(NPC_PARTNER, ((NPC_FLAG_100)), TRUE);
N(UnkFunc20)(EVT_MAP_VAR(0), EVT_VAR(9));
FindKeyItem(15, EVT_VAR(12));
N(UnkFunc38)();
if (EVT_VAR(0) == -1) {
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DC), 160, 40);
sleep 10;
N(UnkFunc39)(EVT_VAR(9));
DisablePlayerInput(FALSE);
EnablePartnerAI();
ModifyGlobalOverrideFlags(0, 2097152);
N(UnkFunc17)();
return;
}
if (EVT_SAVE_FLAG(438) == 0) {
EVT_SAVE_FLAG(438) = 1;
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DA), 160, 40);
} else {
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DB), 160, 40);
}
N(func_8024259C_C38ACC)();
if (EVT_VAR(0) == -1) {
N(UnkFunc39)(EVT_VAR(9));
DisablePlayerInput(FALSE);
EnablePartnerAI();
ModifyGlobalOverrideFlags(0, 2097152);
N(UnkFunc17)();
return;
}
EVT_VAR(10) = EVT_VAR(0);
EVT_VAR(11) = EVT_VAR(1);
EnablePartnerAI();
GetCurrentPartnerID(EVT_VAR(0));
if (EVT_VAR(0) != EVT_VAR(11)) {
N(SwitchToPartner)(EVT_VAR(11));
} else {
func_802CF56C(2);
}
sleep 10;
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DF), 160, 40);
ShowChoice(1966093);
CloseMessage();
if (EVT_VAR(0) != 0) {
N(UnkFunc39)(EVT_VAR(9));
DisablePlayerInput(FALSE);
EnablePartnerAI();
ModifyGlobalOverrideFlags(0, 2097152);
N(UnkFunc17)();
return;
}
await N(80243D94);
N(UnkFunc18)(EVT_VAR(11), EVT_VAR(13));
EVT_SAVE_FLAG(1046) = 1;
N(UnkFunc39)(EVT_VAR(9));
N(UnkFunc19)();
if (EVT_VAR(13) == 1) {
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DD), 160, 40);
} else {
ShowMessageAtScreenPos(MESSAGE_ID(0x1D, 0x00DE), 160, 40);
}
DisablePlayerInput(FALSE);
EnablePartnerAI();
ModifyGlobalOverrideFlags(0, 2097152);
N(UnkFunc17)();
});
EvtSource N(80243EF8) = {
EVT_IF_EQ(EVT_SAVE_FLAG(1046), 1)
EVT_RETURN
EVT_END_IF
EVT_CALL(IsStartingConversation, EVT_VAR(0))
EVT_IF_EQ(EVT_VAR(0), 1)
EVT_RETURN
EVT_END_IF
EVT_CALL(N(UnkFunc24))
EVT_IF_EQ(EVT_VAR(0), 1)
EVT_RETURN
EVT_END_IF
EVT_CALL(ModifyGlobalOverrideFlags, 1, 2097152)
EVT_CALL(N(SetOverrideFlags_40))
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SetNpcFlagBits, NPC_PARTNER, ((NPC_FLAG_100)), TRUE)
EVT_CALL(N(UnkFunc20), EVT_MAP_VAR(0), EVT_VAR(9))
EVT_CALL(FindKeyItem, ITEM_ULTRA_STONE, EVT_VAR(12))
EVT_CALL(N(UnkFunc38))
EVT_IF_EQ(EVT_VAR(0), -1)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DC), 160, 40)
EVT_WAIT_FRAMES(10)
EVT_CALL(N(UnkFunc39), EVT_VAR(9))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ModifyGlobalOverrideFlags, 0, 2097152)
EVT_CALL(N(UnkFunc17))
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(EVT_SAVE_FLAG(438), 0)
EVT_SET(EVT_SAVE_FLAG(438), 1)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DA), 160, 40)
EVT_ELSE
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DB), 160, 40)
EVT_END_IF
EVT_CALL(N(func_8024259C_C38ACC))
EVT_IF_EQ(EVT_VAR(0), -1)
EVT_CALL(N(UnkFunc39), EVT_VAR(9))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ModifyGlobalOverrideFlags, 0, 2097152)
EVT_CALL(N(UnkFunc17))
EVT_RETURN
EVT_END_IF
EVT_SET(EVT_VAR(10), EVT_VAR(0))
EVT_SET(EVT_VAR(11), EVT_VAR(1))
EVT_CALL(EnablePartnerAI)
EVT_CALL(GetCurrentPartnerID, EVT_VAR(0))
EVT_IF_NE(EVT_VAR(0), EVT_VAR(11))
EVT_CALL(N(SwitchToPartner), EVT_VAR(11))
EVT_ELSE
EVT_CALL(func_802CF56C, 2)
EVT_END_IF
EVT_WAIT_FRAMES(10)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DF), 160, 40)
EVT_CALL(ShowChoice, MESSAGE_ID(0x1E, 0x000D))
EVT_CALL(CloseMessage)
EVT_IF_NE(EVT_VAR(0), 0)
EVT_CALL(N(UnkFunc39), EVT_VAR(9))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ModifyGlobalOverrideFlags, 0, 2097152)
EVT_CALL(N(UnkFunc17))
EVT_RETURN
EVT_END_IF
EVT_EXEC_WAIT(N(80243D94))
EVT_CALL(N(UnkFunc18), EVT_VAR(11), EVT_VAR(13))
EVT_SET(EVT_SAVE_FLAG(1046), 1)
EVT_CALL(N(UnkFunc39), EVT_VAR(9))
EVT_CALL(N(UnkFunc19))
EVT_IF_EQ(EVT_VAR(13), 1)
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DD), 160, 40)
EVT_ELSE
EVT_CALL(ShowMessageAtScreenPos, MESSAGE_ID(0x1D, 0x00DE), 160, 40)
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ModifyGlobalOverrideFlags, 0, 2097152)
EVT_CALL(N(UnkFunc17))
EVT_RETURN
EVT_END
};
EvtSource N(makeEntities) = SCRIPT({
MakeEntity(0x802EA910, 500, -360, 110, 0, MAKE_ENTITY_END);
EVT_MAP_VAR(0) = EVT_VAR(0);
AssignBlockFlag(EVT_SAVE_FLAG(1046));
AssignScript(N(80243EF8));
});
EvtSource N(makeEntities) = {
EVT_CALL(MakeEntity, 0x802EA910, 500, -360, 110, 0, MAKE_ENTITY_END)
EVT_SET(EVT_MAP_VAR(0), EVT_VAR(0))
EVT_CALL(AssignBlockFlag, EVT_SAVE_FLAG(1046))
EVT_CALL(AssignScript, EVT_PTR(N(80243EF8)))
EVT_RETURN
EVT_END
};
#include "world/common/UnkNpcAIFunc23.inc.c"

View File

@ -86,9 +86,11 @@ def get_constants():
valid_enums = { "StoryProgress", "ItemIDs", "PlayerAnims",
"ActorIDs", "Events", "SoundIDs", "SongIDs", "Locations",
"AmbientSounds", "NpcIDs", "Emotes", "NpcFlags",
"Events", "Statuses", "Elements", "DamageTypes", "HitResults",
"ActorFlags", "ActorPartFlags", "ActorEventFlags", "ElementFlags" }
"AmbientSounds", "NpcIDs", "Emotes", "NpcFlags", "Statuses", "Elements",
"DamageTypes", "HitResults", "ActorFlags", "ActorPartFlags",
"ActorEventFlags", "ElementFlags", "EncounterTriggers", "Abilities",
"Easings", "DecorationIDs", "HitResults", "Phases", "ItemSpawnModes",
"ActionStates", "Triggers", "Buttons", "ActionCommand", "MoveIDs" }
for enum in valid_enums:
CONSTANTS[enum] = {}
CONSTANTS["NPC_SPRITE"] = {}
@ -274,6 +276,17 @@ def fix_args(self, func, args, info):
if not enabled:
enabled.append(f"0")
new_args.append("((" + " | ".join(enabled) + "))")
elif info[i] == "SoundIDs":
if argNum in CONSTANTS["SoundIDs"]:
new_args.append(CONSTANTS["SoundIDs"][argNum])
else:
new_args.append("0x%X" % argNum)
elif info[i] == "StoryProgress":
print(info[i])
if argNum in CONSTANTS["StoryProgress"]:
new_args.append(CONSTANTS["StoryProgress"][argNum])
else:
new_args.append(str(argNum))
elif argNum in CONSTANTS[info[i]]:
new_args.append(f"{CONSTANTS[info[i]][argNum]}")
else:
@ -589,7 +602,7 @@ class ScriptDisassembler:
self.indent -= 1
if self.prelude:
self.prefix_line(f"EvtSource {self.script_name}= {{")
self.prefix_line(f"EvtSource {self.script_name} = {{")
self.write_line("};")
self.done = True
@ -741,13 +754,19 @@ class ScriptDisassembler:
elif opcode == 0x43:
func = self.addr_ref(argv[0])
args = [self.var(a, use_evt_ptr=True) for a in argv[1:]]
args_str = ', '.join(args)
args_str = ', '.join(args)
args_str = replace_constants(self, func, args_str)
if func.startswith("evt_"):
# use func-specific macro
self.write_line(f"{func}({args_str})")
# Since the map ascii for map transitions is global, and several of them share the same RAM address,
# or ar not migrated, we have to create a placeholder
elif func == "GotoMap" or func == "GotoMapSpecial":
args = [self.var(a, use_evt_ptr=True) for a in argv[2:]]
args_str = ', '.join(args)
self.write_line(f"EVT_CALL({func}, EVT_PTR(UNK_STR_{argv[1]:X}), {args_str})")
elif args_str:
self.write_line(f"EVT_CALL({func}, {args_str})")
else:
@ -846,7 +865,7 @@ if __name__ == "__main__":
while offset < args.end:
f.seek(offset)
script = ScriptDisassembler(f, "", {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED)
script = ScriptDisassembler(f, args.offset, {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED)
try:
script_text = script.disassemble()
@ -892,10 +911,10 @@ if __name__ == "__main__":
f.seek(offset)
script = ScriptDisassembler(f, "", {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED)
script = ScriptDisassembler(f, args.offset, {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED)
if args.si:
print(ScriptDisassembler(f, "", {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED).disassemble(), end="")
print(ScriptDisassembler(f, args.offset, {}, 0x978DE0, INCLUDES_NEEDED, INCLUDED).disassemble(), end="")
else:
try:
script_text = script.disassemble()

View File

@ -1,7 +1,9 @@
#!/usr/bin/env python3
import re
from disasm_script import ScriptDisassembler, get_constants
from glob import glob
import os
NAMESPACES = {
"src/battle/area_kmr_part_1/stage/clouds.inc.c": "b_area_kmr_part_1_kmr_03",
@ -19,9 +21,11 @@ for filename in glob("src/world/*/*/*.c"):
map_name = filename.split("/")[3]
NAMESPACES[filename] = map_name
class UserException(Exception):
pass
class Range:
def __init__(self, start: int, end: int, symbol_name: str, namespace: str):
self.start = start
@ -29,11 +33,13 @@ class Range:
self.symbol_name = symbol_name
self.namespace = namespace
class Symbol:
def __init__(self, ram_addr, rom_addr):
self.ram_addr = ram_addr
self.rom_addr = rom_addr
def parse_symbol_addrs():
with open("ver/us/symbol_addrs.txt", "r") as f:
lines = f.readlines()
@ -51,6 +57,7 @@ def parse_symbol_addrs():
return symbol_addrs
def find_old_script_ranges(lines, filename):
"""
Finds all ranges that contain the old SCRIPT macro.
@ -61,8 +68,15 @@ def find_old_script_ranges(lines, filename):
namespace = NAMESPACES.get(filename, filename.split("/")[-1].split(".")[0])
for line_no, line_content in enumerate(lines):
r = re.compile(r".*\.h")
namespace_temp = list(filter(r.match, os.listdir(os.path.dirname(os.path.abspath(filename)))))
if "#define NAMESPACE " in line_content:
namespace = line_content.split(" ")[2].strip()
#elif namespace == "events" or namespace == "header":
# namespace = NAMESPACES.get(filename, filename.split("/")[-2].split(".")[0])
elif namespace_temp is not None:
namespace = namespace_temp[0][:-2]
if "SCRIPT({" in line_content:
start_line_no = line_no
@ -71,12 +85,14 @@ def find_old_script_ranges(lines, filename):
yield Range(start_line_no, line_no, symbol_name, namespace)
start_line_no = None
def eval_namespace(sym, namespace):
if sym.startswith("N("):
return namespace + "_" + sym[2:-1]
else:
return sym
def replace_old_script_macros(filename, symbol_addrs):
with open(filename, "r") as f:
lines = f.readlines()
@ -143,6 +159,7 @@ def replace_old_script_macros(filename, symbol_addrs):
return num_scripts_replaced
if __name__ == "__main__":
import sys