* some reorg

* minor stuff

* flo_03

* flo_08

* flo_09

* flo_00

* flo_11/12

* flo_10

* flo 24/25

* flo 22/23

* flo 21

* flo_19

* flo 17/23

* flo 16

* flo 15

* flo_14

* flo_13

* area flo

* tik_06

* couple missed things

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2022-10-30 11:23:13 -04:00 committed by GitHub
parent 480257bceb
commit b656ab90b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
362 changed files with 16448 additions and 19088 deletions

View File

@ -111,6 +111,19 @@ typedef struct Color4f {
/* 0x0C */ f32 a;
} Color4f; // size = 0x10
typedef struct Color3i {
/* 0x00 */ s32 r;
/* 0x04 */ s32 g;
/* 0x08 */ s32 b;
} Color3i; // size = 0xC
typedef struct Color4i {
/* 0x00 */ s32 r;
/* 0x04 */ s32 g;
/* 0x08 */ s32 b;
/* 0x0C */ s32 a;
} Color4i; // size = 0x10
typedef f32 Matrix4f[4][4]; // size = 0x40
typedef struct Matrix4s {

View File

@ -1647,25 +1647,14 @@ typedef struct UnderwaterFXData {
} UnderwaterFXData; // size = unknown
typedef struct LightningBoltFXData {
/* 0x000 */ s32 unk_00;
/* 0x004 */ f32 unk_04;
/* 0x008 */ f32 unk_08;
/* 0x00C */ f32 unk_0C;
/* 0x010 */ f32 unk_10;
/* 0x014 */ f32 unk_14;
/* 0x018 */ f32 unk_18;
/* 0x01C */ f32 unk_1C;
/* 0x020 */ f32 unk_20;
/* 0x024 */ f32 unk_24;
/* 0x028 */ s32 unk_28;
/* 0x02C */ s32 unk_2C;
/* 0x030 */ s32 unk_30;
/* 0x034 */ s32 unk_34;
/* 0x038 */ s32 unk_38;
/* 0x03C */ s32 unk_3C;
/* 0x040 */ s32 unk_40;
/* 0x044 */ s32 unk_44;
/* 0x048 */ s32 unk_48;
/* 0x000 */ s32 type;
/* 0x004 */ Vec3f tipPos;
/* 0x010 */ Vec3f startPos;
/* 0x01C */ Vec3f endPos;
/* 0x028 */ s32 timeLeft;
/* 0x02C */ s32 lifetime;
/* 0x030 */ Color4i outerColor;
/* 0x040 */ Color3i innerColor;
/* 0x04C */ f32 unk_4C;
/* 0x050 */ f32 unk_50[12];
/* 0x080 */ f32 unk_80[12];
@ -2052,7 +2041,7 @@ typedef struct HieroglyphsFXData {
} HieroglyphsFXData; // size = 0x3C
typedef struct MiscParticlesFXData {
/* 0x00 */ s32 unk_00;
/* 0x00 */ s32 variation;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 scaleX;
/* 0x14 */ f32 scaleY;
@ -2061,18 +2050,12 @@ typedef struct MiscParticlesFXData {
/* 0x20 */ char unk_20[4];
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x30 */ s32 unk_30;
/* 0x34 */ s32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ s32 unk_40;
/* 0x44 */ s32 unk_44;
/* 0x48 */ s32 unk_48;
/* 0x4C */ s32 unk_4C;
/* 0x50 */ s32 unk_50;
/* 0x54 */ s32 unk_54;
/* 0x58 */ f32 unk_58;
/* 0x2C */ s32 animTime;
/* 0x30 */ s32 timeLeft;
/* 0x34 */ s32 lifetime;
/* 0x38 */ Color4i innerColor;
/* 0x48 */ Color4i glowColor;
/* 0x58 */ f32 scale;
/* 0x5C */ f32 unk_5C;
/* 0x60 */ f32 unk_60;
} MiscParticlesFXData; // size = 0x64
@ -2354,6 +2337,12 @@ typedef struct IcePillarFXData {
/* 0x24 */ char todo[0];
} IcePillarFXData; // size = unknown
// sun shine directions
enum {
FX_SUN_FROM_LEFT = 0,
FX_SUN_FROM_RIGHT = 1,
};
typedef struct SunFXData {
/* 0x00 */ s32 shineFromRight;
/* 0x04 */ Vec3f pos; // does nothing

View File

@ -1461,6 +1461,21 @@ enum SoundInstanceFlags {
SOUND_INSTANCE_FLAG_4 = 0x00000004,
};
enum SoundSpatializationFlags {
SOUND_SPACE_MODE_MASK = 0x0000FFFF,
SOUND_SPACE_MODE_0 = 0x00000000,
SOUND_SPACE_MODE_1 = 0x00000001,
SOUND_SPACE_FULL = 0x00000002,
SOUND_SPACE_PARAMS_MASK = 0xFFFF0000,
SOUND_PARAM_MUTE = 0x00010000,
SOUND_PARAM_CLIP_OFFSCREEN_ANY = 0x00020000,
SOUND_PARAM_CLIP_OFFSCREEN_X = 0x00040000,
SOUND_PARAM_CLIP_OFFSCREEN_Y = 0x00080000,
SOUND_PARAM_MOST_QUIET = 0x00100000,
SOUND_PARAM_MORE_QUIET = 0x00200000,
SOUND_PARAM_QUIET = 0x00400000,
};
enum SoundType {
SOUND_TYPE_SPECIAL = 0x80000000,
SOUND_TYPE_LOOPING = 0,
@ -2654,6 +2669,8 @@ enum VisibilityGroup {
VIS_GROUP_1 = 1,
VIS_GROUP_2 = 2,
VIS_GROUP_3 = 3,
VIS_GROUP_4 = 4,
VIS_GROUP_5 = 5,
};
enum ItemSpawnModes {

View File

@ -1381,7 +1381,7 @@ enum GameFlags {
GF_FLO11_Defeated_Lakitus = GameFlag(0x561),
GF_FLO12_Met_Rosie = GameFlag(0x562),
GF_FLO12_RosieRequestedSomethingBeautiful = GameFlag(0x563),
GF_Unused_FLO_12 = GameFlag(0x564),
GF_FLO12_HeldItemPickup = GameFlag(0x564),
GF_FLO08_Item_StarPiece = GameFlag(0x565),
GF_FLO09_Item_HappyFlowerB = GameFlag(0x566),
GF_FLO10_Tree1_JamminJelly = GameFlag(0x567),

View File

@ -571,6 +571,9 @@
/****** COMMON SCRIPTS ************************************************************************************************/
#define EVT_IF_TRUE(b) EVT_IF_NE(b, 0)
#define EVT_IF_FALSE(b) EVT_IF_EQ(b, 0)
#define EVT_SET_VEC2(baseVar, x, y, z) \
EVT_SET(baseVar + 0, x) \
EVT_SET(baseVar + 1, y)

View File

@ -816,7 +816,7 @@ s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pic
ASSERT(itemEntity != NULL);
itemEntity->renderGroup = ((u32)itemID >> 0x10) & 0xF;
if (itemEntity->renderGroup == 5) {
if (itemEntity->renderGroup == VIS_GROUP_5) {
itemEntity->renderGroup = -1;
}

View File

@ -322,5 +322,5 @@ void sfx_play_sound_at_position(s32 soundID, s32 flags, f32 posX, f32 posY, f32
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
void sfx_compute_spatialized_sound_params_0(f32 x, f32 y, f32 z, s16* volume, s16* pan);
void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s16* pan);
void sfx_compute_spatialized_sound_params_2(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
*/

View File

@ -92,6 +92,6 @@ void sfx_play_sound_at_position(s32 soundID, s32 flags, f32 posX, f32 posY, f32
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
void sfx_compute_spatialized_sound_params_0(f32 x, f32 y, f32 z, s16* volume, s16* pan);
void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s16* pan);
void sfx_compute_spatialized_sound_params_2(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags);
#endif

View File

@ -210,10 +210,10 @@ extern SoundInstance D_801599B8[MAX_SOUND_INSTANCES];
extern SoundInstance* D_80159AD0;
extern s32 D_80159AD4;
void sfx_compute_spatialized_sound_params_2(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) {
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) {
s32 screenX, screenY, screenZ;
f32 f1, f2, f3;
f32 lerp1, lerp2, lerp3;
f32 volAmtOffsetX, volAmtDeltaY, volAmtDepth;
f32 offsetX, offsetY, depth;
f32 volTemp, panTemp;
s32 phi_v0;
@ -225,63 +225,57 @@ void sfx_compute_spatialized_sound_params_2(f32 x, f32 y, f32 z, s16* volume, s1
return;
}
if (flags & 0x20000) {
if (screenX < -30 || screenX > 350 || screenY < -30) {
if (flags & SOUND_PARAM_CLIP_OFFSCREEN_ANY) {
if (screenX < -30 || screenX > SCREEN_WIDTH + 30 || screenY < -30 || screenY > SCREEN_HEIGHT + 30) {
*volume = -1;
*pan = 0;
return;
}
if (screenY > 270) {
} else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_X) {
if (screenX < -30 || screenX > SCREEN_WIDTH + 30) {
*volume = -1;
*pan = 0;
return;
}
} else if (flags & 0x40000) {
if (screenX < -30 || screenX > 350) {
*volume = -1;
*pan = 0;
return;
}
} else if (flags & 0x80000) {
if (screenY < -30 || screenY > 270) {
} else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_Y) {
if (screenY < -30 || screenY > SCREEN_HEIGHT + 30) {
*volume = -1;
*pan = 0;
return;
}
}
lerp1 = abs(160 - screenX) - 145;
if (lerp1 < 0.0) {
lerp1 = 0.0f;
offsetX = abs((SCREEN_WIDTH / 2) - screenX) - 145;
if (offsetX < 0.0) {
offsetX = 0.0f;
}
f1 = update_lerp(0, 1.0f, 0.0f, lerp1, 200);
if (f1 < 0.0) {
f1 = 0.0f;
volAmtOffsetX = update_lerp(0, 1.0f, 0.0f, offsetX, 200);
if (volAmtOffsetX < 0.0) {
volAmtOffsetX = 0.0f;
}
lerp2 = abs(120 - screenY) - 105;
if (lerp2 < 0.0) {
lerp2 = 0.0f;
offsetY = abs((SCREEN_HEIGHT / 2) - screenY) - 105;
if (offsetY < 0.0) {
offsetY = 0.0f;
}
f2 = update_lerp(0, 1.0f, 0.0f, lerp2, 130);
if (f2 < 0.0) {
f2 = 0.0f;
volAmtDeltaY = update_lerp(0, 1.0f, 0.0f, offsetY, 130);
if (volAmtDeltaY < 0.0) {
volAmtDeltaY = 0.0f;
}
lerp3 = screenZ - 5550.0;
if (lerp3 < 0.0) {
lerp3 = 0.0f;
depth = screenZ - 5550.0;
if (depth < 0.0) {
depth = 0.0f;
}
f3 = update_lerp(0, 1.0f, 0.0f, lerp3, 250);
if (f3 < 0.0) {
f3 = 0.0f;
volAmtDepth = update_lerp(0, 1.0f, 0.0f, depth, 250);
if (volAmtDepth < 0.0) {
volAmtDepth = 0.0f;
}
volTemp = (f1 * f2 * f3) * 127.0;
volTemp = (volAmtOffsetX * volAmtDeltaY * volAmtDepth) * 127.0;
if (volTemp < 15.0) {
volTemp = 15.0f;
} else if (volTemp > 127.0) {
@ -549,38 +543,38 @@ void sfx_play_sound_at_position(s32 soundID, s32 flags, f32 posX, f32 posY, f32
}
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16* volume, s16* pan, s32 flags) {
u32 upperFlags;
u32 lowerFlags;
u32 paramFlags;
u32 spaceMode;
upperFlags = flags & 0xFFFF0000;
paramFlags = flags & SOUND_SPACE_PARAMS_MASK;
do {
lowerFlags = flags & 0xFFFF;
spaceMode = flags & SOUND_SPACE_MODE_MASK;
} while (0); // required to match
switch (lowerFlags) {
case 0:
switch (spaceMode) {
case SOUND_SPACE_MODE_0:
sfx_compute_spatialized_sound_params_0(x, y, z, volume, pan);
break;
case 1:
case SOUND_SPACE_MODE_1:
sfx_compute_spatialized_sound_params_1(x, y, z, volume, pan);
break;
case 2:
sfx_compute_spatialized_sound_params_2(x, y, z, volume, pan, upperFlags);
case SOUND_SPACE_FULL:
sfx_compute_spatialized_sound_params_full(x, y, z, volume, pan, paramFlags);
break;
}
if (upperFlags & 0x10000) {
if (paramFlags & SOUND_PARAM_MUTE) {
*volume = 0;
} else if (upperFlags & 0x400000) {
} else if (paramFlags & SOUND_PARAM_QUIET) {
if (*volume < 80) {
*volume = 80;
}
} else if (upperFlags & 0x200000) {
} else if (paramFlags & SOUND_PARAM_MORE_QUIET) {
if (*volume < 60) {
*volume = 60;
}
} else if (upperFlags & 0x100000) {
} else if (paramFlags & SOUND_PARAM_MOST_QUIET) {
if (*volume < 40) {
*volume = 40;
}
@ -622,7 +616,7 @@ void sfx_compute_spatialized_sound_params_0(f32 x, f32 y, f32 z, s16* volume, s1
if (!gGameStatusPtr->isBattle) {
*pan = (screenX * 0.2f) + 32.0f;
} else {
f32 temp_f20 = ((screenX * 127.0) / 320.0) - 64.0;
f32 temp_f20 = ((screenX * 127.0) / SCREEN_WIDTH) - 64.0;
*pan = (s32) (temp_f20 * sin_rad(DEG_TO_RAD(fabs(temp_f20) * 90.0 / 64.0))) + 64;
}
}
@ -630,7 +624,7 @@ void sfx_compute_spatialized_sound_params_0(f32 x, f32 y, f32 z, s16* volume, s1
void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s16* pan) {
Camera* camera = &gCameras[gCurrentCameraID];
s32 screenX, screenY, screenZ;
f32 temp_f0;
f32 depth;
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
@ -651,12 +645,12 @@ void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s1
screenX = camera->viewportW;
}
temp_f0 = fabsf(5000 - screenZ);
if (temp_f0 > 1000.0f) {
temp_f0 = 1000.0f;
depth = fabsf(5000 - screenZ);
if (depth > 1000.0f) {
depth = 1000.0f;
}
*volume = *volume * (1500.0f - temp_f0) * 0.001f;
*volume = *volume * (1500.0f - depth) * 0.001f;
if (*volume > 127) {
*volume = 127;
}

View File

@ -188,13 +188,13 @@ ApiStatus N(MakeLightnings)(Evt* script, s32 isInitialCall) {
s32 y1 = cos_deg(angle) * 200.0f + y;
s32 z1 = z + 20;
EffectInstance* effect = fx_lightning_bolt(1, x, y, z, x1, y1, z1, scale, 11);
s32 temp1 = rand_int(256);
s32 temp2 = rand_int(256);
s32 temp3 = rand_int(256);
s32 r = rand_int(256);
s32 g = rand_int(256);
s32 b = rand_int(256);
effect->data.lightningBolt->unk_30 = temp1;
effect->data.lightningBolt->unk_34 = temp2;
effect->data.lightningBolt->unk_38 = temp3;
effect->data.lightningBolt->outerColor.r = r;
effect->data.lightningBolt->outerColor.g = g;
effect->data.lightningBolt->outerColor.b = b;
}
return ApiStatus_DONE2;
}

View File

@ -184,12 +184,12 @@ ApiStatus func_802182E4_660A34(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args);
effect->data.lightningBolt->unk_30 = 0xFF;
effect->data.lightningBolt->unk_34 = 0xFF;
effect->data.lightningBolt->unk_38 = 0xFF;
effect->data.lightningBolt->unk_40 = 0xC8;
effect->data.lightningBolt->unk_44 = 0xF0;
effect->data.lightningBolt->unk_48 = 0xFF;
effect->data.lightningBolt->outerColor.r = 255;
effect->data.lightningBolt->outerColor.g = 255;
effect->data.lightningBolt->outerColor.b = 255;
effect->data.lightningBolt->innerColor.r = 200;
effect->data.lightningBolt->innerColor.g = 240;
effect->data.lightningBolt->innerColor.b = 255;
return ApiStatus_DONE2;
}

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects.h"
char* N(sunny_areas)[] = {
char* N(RightSunMaps)[] = {
"flo_03",
"flo_08",
"flo_09",
@ -15,25 +15,24 @@ char* N(sunny_areas)[] = {
"flo_24",
};
ApiStatus N(make_sun)(Evt* script, s32 isInitialCall) {
s32 var1 = FALSE;
API_CALLABLE(N(SpawnSunEffect)) {
s32 direction = FX_SUN_FROM_LEFT;
u32 i;
for (i = 0; i < ARRAY_COUNT(N(sunny_areas)); i++) {
if (strcmp(gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID].id, N(sunny_areas)[i]) == 0) {
var1 = TRUE;
for (i = 0; i < ARRAY_COUNT(N(RightSunMaps)); i++) {
if (strcmp(gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID].id, N(RightSunMaps)[i]) == 0) {
direction = FX_SUN_FROM_RIGHT;
break;
}
}
fx_sun(var1, 0, 0, 0, 0, 0);
fx_sun(direction, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(MakeSun) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(make_sun))
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END

View File

@ -54,13 +54,13 @@ ApiStatus N(UnkLightningBoltFxFunc1)(Evt* script, s32 isInitialCall) {
f32 x = effectState->pos.x + cos_deg(effectState->yaw) * effectState->radius;
f32 z = effectState->pos.z + sin_deg(effectState->yaw) * effectState->radius;
effectState->effect->data.lightningBolt->unk_04 = x;
effectState->effect->data.lightningBolt->unk_10 = x;
effectState->effect->data.lightningBolt->unk_1C = x;
effectState->effect->data.lightningBolt->tipPos.x = x;
effectState->effect->data.lightningBolt->startPos.x = x;
effectState->effect->data.lightningBolt->endPos.x = x;
effectState->effect->data.lightningBolt->unk_0C = z;
effectState->effect->data.lightningBolt->unk_18 = z;
effectState->effect->data.lightningBolt->unk_24 = z;
effectState->effect->data.lightningBolt->tipPos.z = z;
effectState->effect->data.lightningBolt->startPos.z = z;
effectState->effect->data.lightningBolt->endPos.z = z;
if (effectState->duration > 10) {
effectState->radius += 1.5;

View File

@ -13,15 +13,15 @@ void lightning_bolt_render(EffectInstance* effect);
void lightning_bolt_appendGfx(void* effect);
EffectInstance* lightning_bolt_main(
s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
f32 arg5,
f32 arg6,
f32 arg7,
s32 arg8)
s32 type,
f32 startX,
f32 startY,
f32 startZ,
f32 endX,
f32 endY,
f32 endZ,
f32 scale,
s32 duration)
{
EffectBlueprint bp;
EffectInstance* effect;
@ -41,35 +41,35 @@ EffectInstance* lightning_bolt_main(
data = effect->data.lightningBolt = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.lightningBolt != NULL);
data->unk_00 = arg0;
data->unk_2C = 0;
if (arg8 <= 0) {
data->unk_28 = 1000;
data->type = type;
data->lifetime = 0;
if (duration <= 0) {
data->timeLeft = 1000;
} else {
data->unk_28 = arg8;
data->timeLeft = duration;
}
data->unk_3C = 255;
data->unk_10 = arg1;
data->unk_14 = arg2;
data->unk_18 = arg3;
data->unk_1C = arg4;
data->unk_20 = arg5;
data->unk_24 = arg6;
data->unk_04 = arg1;
data->unk_08 = arg2;
data->unk_0C = arg3;
data->unk_4C = arg7;
data->outerColor.a = 255;
data->startPos.x = startX;
data->startPos.y = startY;
data->startPos.z = startZ;
data->endPos.x = endX;
data->endPos.y = endY;
data->endPos.z = endZ;
data->tipPos.x = startX;
data->tipPos.y = startY;
data->tipPos.z = startZ;
data->unk_4C = scale;
temp = SQ(arg1 - arg4) + SQ(arg2 - arg5) + SQ(arg3 - arg6);
temp = SQ(startX - endX) + SQ(startY - endY) + SQ(startZ - endZ);
if (temp != 0.0f) {
data->unk_114 = shim_sqrtf(temp) * 0.005;
data->unk_30 = 255;
data->unk_34 = 220;
data->unk_38 = 20;
data->unk_40 = 255;
data->unk_44 = 255;
data->unk_48 = 255;
data->outerColor.r = 255;
data->outerColor.g = 220;
data->outerColor.b = 20;
data->innerColor.r = 255;
data->innerColor.g = 255;
data->innerColor.b = 255;
data->unk_110 = shim_rand_int(359);
return effect;
@ -81,43 +81,43 @@ EffectInstance* lightning_bolt_main(
void lightning_bolt_init(EffectInstance* effect) {
}
f32 func_E00BC1D8(f32 arg0) {
return (f32)shim_rand_int(arg0) - arg0 * 0.5;
f32 lightning_bolt_get_rand_symmetric(f32 interval) {
return (f32)shim_rand_int(interval) - interval * 0.5;
}
void lightning_bolt_update(EffectInstance* effect) {
LightningBoltFXData* data = effect->data.lightningBolt;
s32 unk_00 = data->unk_00;
s32 type = data->type;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
data->unk_28 = 16;
if (effect->flags & EFFECT_INSTANCE_FLAGS_10) {
effect->flags &= ~EFFECT_INSTANCE_FLAGS_10;
data->timeLeft = 16;
}
if (data->unk_28 < 1000) {
data->unk_28--;
if (data->timeLeft < 1000) {
data->timeLeft--;
}
data->unk_2C++;
data->lifetime++;
if (data->unk_28 < 0) {
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (unk_00 == 2) {
if (data->unk_2C >= 40) {
data->unk_3C *= 0.5;
if (type == 2) {
if (data->lifetime >= 40) {
data->outerColor.a *= 0.5;
}
} else {
if (data->unk_2C >= 11) {
data->unk_3C *= 0.5;
if (data->lifetime >= 11) {
data->outerColor.a *= 0.5;
}
}
}
void lightning_bolt_render(EffectInstance *effect) {
LightningBoltFXData* effect94 = effect->data.lightningBolt;
LightningBoltFXData* data = effect->data.lightningBolt;
RenderTask renderTask;
RenderTask* retTask;
RenderTask* renderTaskPointer = &renderTask;
@ -125,7 +125,7 @@ void lightning_bolt_render(EffectInstance *effect) {
renderTask.appendGfx = lightning_bolt_appendGfx;
renderTask.appendGfxArg = effect;
if (gGameStatusPtr->isBattle == TRUE) {
renderTask.distance = effect94->unk_0C + 1000.0f;
renderTask.distance = data->tipPos.z + 1000.0f;
} else {
renderTask.distance = 10;
}

View File

@ -21,15 +21,21 @@ Gfx* D_E00E4DA8[] = {
};
u8 D_E00E4DC0[] = {
0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03, 0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03, 0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03, 0x00, 0x00
0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03,
0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03,
0x02, 0x04, 0x08, 0x0D, 0x0F, 0x0D, 0x09, 0x06, 0x04, 0x03
};
u8 D_E00E4DE0[] = {
0x28, 0x5A, 0x51, 0x48, 0x41, 0x3B, 0x35, 0x2F, 0x2B, 0x26, 0x22, 0x1F, 0x1C, 0x19, 0x16, 0x14, 0x12, 0x10, 0x0F, 0x0D, 0x0C, 0x0A, 0x09, 0x08, 0x07, 0x07, 0x06, 0x05, 0x05, 0x04, 0x00, 0x00
0x28, 0x5A, 0x51, 0x48, 0x41, 0x3B, 0x35, 0x2F, 0x2B, 0x26,
0x22, 0x1F, 0x1C, 0x19, 0x16, 0x14, 0x12, 0x10, 0x0F, 0x0D,
0x0C, 0x0A, 0x09, 0x08, 0x07, 0x07, 0x06, 0x05, 0x05, 0x04
};
u8 D_E00E4E00[] = {
0xC8, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xC8, 0x00, 0x00
0xC8, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xC8
};
void misc_particles_init(EffectInstance* effect);
@ -38,23 +44,23 @@ void misc_particles_render(EffectInstance* effect);
void misc_particles_appendGfx(void* effect);
EffectInstance* misc_particles_main(
s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
f32 arg5,
s32 variation,
f32 posX,
f32 posY,
f32 posZ,
f32 scaleX,
f32 scaleY,
f32 arg6,
s32 arg7,
s32 arg8
s32 numParticles,
s32 duration
) {
EffectBlueprint bp;
EffectInstance* effect;
MiscParticlesFXData* part;
f32 temp;
f32 interval;
s32 i;
arg7++;
numParticles++;
bp.init = misc_particles_init;
bp.update = misc_particles_update;
@ -64,69 +70,72 @@ EffectInstance* misc_particles_main(
bp.effectID = EFFECT_MISC_PARTICLES;
effect = shim_create_effect_instance(&bp);
effect->numParts = arg7;
part = effect->data.miscParticles = shim_general_heap_malloc(arg7 * sizeof(*part));
effect->numParts = numParticles;
part = effect->data.miscParticles = shim_general_heap_malloc(numParticles * sizeof(*part));
ASSERT(effect->data.miscParticles != NULL);
part->unk_00 = arg0;
part->unk_34 = 0;
if (arg8 <= 0) {
part->unk_30 = 1000;
part->variation = variation;
part->lifetime = 0;
if (duration <= 0) {
part->timeLeft = 1000;
} else {
part->unk_30 = arg8;
part->timeLeft = duration;
}
part->unk_44 = 255;
part->pos.x = arg1;
part->pos.y = arg2;
part->pos.z = arg3;
part->unk_58 = arg6;
part->scaleX = arg4;
part->scaleY = arg5;
part->unk_38 = 255;
part->unk_3C = 255;
part->unk_40 = 255;
part->innerColor.a = 255;
part->pos.x = posX;
part->pos.y = posY;
part->pos.z = posZ;
part->scale = arg6;
part->scaleX = scaleX;
part->scaleY = scaleY;
part->innerColor.r = 255;
part->innerColor.g = 255;
part->innerColor.b = 255;
switch (arg0) {
switch (variation) {
case 0:
part->unk_48 = 255;
part->unk_4C = 255;
part->unk_50 = 255;
part->unk_54 = 255;
part->glowColor.r = 255;
part->glowColor.g = 255;
part->glowColor.b = 255;
part->glowColor.a = 255;
break;
case 1:
part->unk_48 = 0;
part->unk_4C = 127;
part->unk_50 = 255;
part->unk_54 = 255;
part->glowColor.r = 0;
part->glowColor.g = 127;
part->glowColor.b = 255;
part->glowColor.a = 255;
break;
case 2:
case 3:
part->unk_48 = 255;
part->unk_4C = 255;
part->unk_50 = 128;
part->unk_54 = 255;
part->glowColor.r = 255;
part->glowColor.g = 255;
part->glowColor.b = 128;
part->glowColor.a = 255;
break;
default:
part->unk_38 = shim_rand_int(127) + 128;
part->unk_3C = shim_rand_int(255 - part->unk_38) + 128;
part->unk_40 = shim_rand_int(383 - part->unk_38 - part->unk_3C) + 128;
part->unk_48 = 127;
part->unk_4C = 127;
part->unk_50 = 127;
part->unk_54 = 127;
part->innerColor.r = shim_rand_int(127) + 128;
part->innerColor.g = shim_rand_int(255 - part->innerColor.r) + 128;
part->innerColor.b = shim_rand_int(383 - part->innerColor.r - part->innerColor.g) + 128;
part->glowColor.r = 127;
part->glowColor.g = 127;
part->glowColor.b = 127;
part->glowColor.a = 127;
break;
}
if (part->unk_30 < 30) {
temp = (f32) part->unk_30 / (arg7 - 1);
// determine delay for particles to appear
if (part->timeLeft < 30) {
interval = (f32) part->timeLeft / (numParticles - 1);
} else {
temp = 30.0f / (arg7 - 1);
interval = 30.0f / (numParticles - 1);
}
// skip delay for first particle
part++;
for (i = 1; i < arg7; i++, part++) {
s32 temp_f0 = -(f32) i * temp;
part->unk_2C = temp_f0 - 1;
// set initial delay for each particle after the first
for (i = 1; i < numParticles; i++, part++) {
part->animTime = (s32)(-1.0f * i * interval) - 1;
}
return effect;
@ -136,134 +145,136 @@ void misc_particles_init(EffectInstance* effect) {
}
void misc_particles_update(EffectInstance* effect) {
MiscParticlesFXData* part = ((EffectInstance*)effect)->data.miscParticles;
s32 unk_00 = part->unk_00;
MiscParticlesFXData* particle = effect->data.miscParticles;
s32 variation = particle->variation;
f32 scaleX;
f32 scaleY;
f32 posX;
f32 posY;
f32 posZ;
s32 unk_30;
s32 unk_38;
s32 unk_3C;
s32 unk_40;
s32 timeLeft;
s32 innerColorR;
s32 innerColorG;
s32 innerColorB;
f32 temp_sin;
f32 temp_cos;
s32 i;
if (effect->flags & 0x10) {
effect->flags &= ~0x10;
part->unk_30 = 16;
if (effect->flags & EFFECT_INSTANCE_FLAGS_10) {
effect->flags &= ~EFFECT_INSTANCE_FLAGS_10;
particle->timeLeft = 16;
}
if (part->unk_30 < 1000) {
part->unk_30--;
if (particle->timeLeft < 1000) {
particle->timeLeft--;
}
part->unk_34++;
particle->lifetime++;
if (part->unk_30 < 0) {
if (particle->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
unk_30 = part->unk_30;
timeLeft = particle->timeLeft;
if (unk_30 < 8) {
part->unk_44 = unk_30 * 32;
if (particle->timeLeft < 8) {
particle->innerColor.a = particle->timeLeft * 32;
}
scaleX = part->scaleX;
scaleY = part->scaleY;
posX = part->pos.x;
posY = part->pos.y;
posZ = part->pos.z;
scaleX = particle->scaleX;
scaleY = particle->scaleY;
posX = particle->pos.x;
posY = particle->pos.y;
posZ = particle->pos.z;
temp_cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw);
temp_sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw);
unk_38 = part->unk_38;
unk_3C = part->unk_3C;
unk_40 = part->unk_40;
innerColorR = particle->innerColor.r;
innerColorG = particle->innerColor.g;
innerColorB = particle->innerColor.b;
part++;
for (i = 1; i < effect->numParts; i++, part++) {
part->unk_2C++;
if (part->unk_2C >= 30) {
if (unk_30 < 30) {
part->unk_2C = 20;
particle++;
for (i = 1; i < effect->numParts; i++, particle++) {
particle->animTime++;
if (particle->animTime >= 30) {
if (timeLeft < 30) {
// perform final fadeout
particle->animTime = 20;
} else {
part->unk_2C = 0;
// recycle the particle
particle->animTime = 0;
}
}
if (part->unk_2C >= 0) {
if (part->unk_2C == 0) {
f32 temp_f20 = shim_rand_int(scaleX) - scaleX * 0.5;
part->pos.x = posX + temp_f20 * temp_cos - temp_sin;
part->pos.y = posY + shim_rand_int(scaleY);
part->pos.z = posZ + temp_f20 * temp_sin + temp_cos;
part->unk_38 = unk_38;
part->unk_3C = unk_3C;
part->unk_40 = unk_40;
if (particle->animTime >= 0) {
if (particle->animTime == 0) {
f32 randMag = shim_rand_int(scaleX) - scaleX * 0.5;
particle->pos.x = posX + randMag * temp_cos - temp_sin;
particle->pos.y = posY + shim_rand_int(scaleY);
particle->pos.z = posZ + randMag * temp_sin + temp_cos;
particle->innerColor.r = innerColorR;
particle->innerColor.g = innerColorG;
particle->innerColor.b = innerColorB;
}
switch (unk_00) {
switch (variation) {
case 0:
case 1:
if (part->unk_2C == 0) {
part->unk_18 = 0.0f;
part->unk_1C = 0.0f;
part->unk_24 = 0.0f;
part->unk_28 = (f32) (-shim_rand_int(10) - 2) * 0.05;
part->unk_5C = 0.0f;
part->unk_60 = 0.0f;
part->unk_58 = (f32) shim_rand_int(10) * 0.05 + 0.5;
if (particle->animTime == 0) {
particle->unk_18 = 0.0f;
particle->unk_1C = 0.0f;
particle->unk_24 = 0.0f;
particle->unk_28 = (f32) (-shim_rand_int(10) - 2) * 0.05;
particle->unk_5C = 0.0f;
particle->unk_60 = 0.0f;
particle->scale = (f32) shim_rand_int(10) * 0.05 + 0.5;
}
part->unk_44 = D_E00E4E00[part->unk_2C];
part->pos.x += part->unk_18;
part->pos.y += part->unk_1C;
part->unk_5C += 0.2;
part->unk_60 += 0.6;
part->unk_18 += (part->unk_24 - part->unk_18) * 0.04;
part->unk_1C += (part->unk_28 - part->unk_1C) * 0.04;
particle->innerColor.a = D_E00E4E00[particle->animTime];
particle->pos.x += particle->unk_18;
particle->pos.y += particle->unk_1C;
particle->unk_5C += 0.2;
particle->unk_60 += 0.6;
particle->unk_18 += (particle->unk_24 - particle->unk_18) * 0.04;
particle->unk_1C += (particle->unk_28 - particle->unk_1C) * 0.04;
break;
case 2:
case 3:
if (part->unk_2C == 0) {
if (unk_00 == 2) {
part->unk_18 = (f32) (shim_rand_int(20) - 10) * 0.05;
part->unk_1C = (f32) (shim_rand_int(20) - 10) * 0.05;
if (particle->animTime == 0) {
if (variation == 2) {
particle->unk_18 = (f32) (shim_rand_int(20) - 10) * 0.05;
particle->unk_1C = (f32) (shim_rand_int(20) - 10) * 0.05;
} else {
part->unk_18 = 0.0f;
part->unk_1C = 0.0f;
particle->unk_18 = 0.0f;
particle->unk_1C = 0.0f;
}
part->unk_24 = 0.0f;
part->unk_28 = 0.0f;
part->unk_5C = shim_rand_int(15);
part->unk_60 = shim_rand_int(15);
part->unk_44 = 255;
particle->unk_24 = 0.0f;
particle->unk_28 = 0.0f;
particle->unk_5C = shim_rand_int(15);
particle->unk_60 = shim_rand_int(15);
particle->innerColor.a = 255;
}
part->unk_58 = (f32) D_E00E4DC0[part->unk_2C] * 0.1;
part->pos.x += part->unk_18;
part->pos.y += part->unk_1C;
part->unk_5C += 0.2;
part->unk_60 += 0.6;
part->unk_18 += (part->unk_24 - part->unk_18) * 0.04;
part->unk_1C += (part->unk_28 - part->unk_1C) * 0.04;
particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.1;
particle->pos.x += particle->unk_18;
particle->pos.y += particle->unk_1C;
particle->unk_5C += 0.2;
particle->unk_60 += 0.6;
particle->unk_18 += (particle->unk_24 - particle->unk_18) * 0.04;
particle->unk_1C += (particle->unk_28 - particle->unk_1C) * 0.04;
break;
default:
if (part->unk_2C == 0) {
part->unk_5C = 0.0f;
part->unk_60 = 0.0f;
part->unk_44 = 255;
part->unk_58 = 1.0f;
part->unk_38 = shim_rand_int(127) + 128;
part->unk_3C = shim_rand_int(255 - part->unk_38) + 128;
part->unk_40 = shim_rand_int(383 - part->unk_38 - part->unk_3C) + 128;
if (particle->animTime == 0) {
particle->unk_5C = 0.0f;
particle->unk_60 = 0.0f;
particle->innerColor.a = 255;
particle->scale = 1.0f;
particle->innerColor.r = shim_rand_int(127) + 128;
particle->innerColor.g = shim_rand_int(255 - particle->innerColor.r) + 128;
particle->innerColor.b = shim_rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128;
}
if (unk_00 == 4) {
part->unk_58 = (f32) D_E00E4DE0[part->unk_2C] * 0.01;
if (variation == 4) {
particle->scale = (f32) D_E00E4DE0[particle->animTime] * 0.01;
} else {
part->unk_58 = (f32) D_E00E4DC0[part->unk_2C] * 0.01;
particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.01;
}
break;
}
@ -288,39 +299,39 @@ void func_E00E4954(void) {
}
void misc_particles_appendGfx(void* effect) {
MiscParticlesFXData* part = ((EffectInstance*)effect)->data.miscParticles;
s32 unk_00 = part->unk_00;
f32 temp_f20 = (part->unk_44 / 255.0f) * part->unk_58;
Matrix4f sp20;
MiscParticlesFXData* particle = ((EffectInstance*)effect)->data.miscParticles;
s32 variation = particle->variation;
f32 alphaScale = (particle->innerColor.a / 255.0f) * particle->scale;
Matrix4f mtxTransform;
Matrix4f unused;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gDPSetEnvColor(gMasterGfxPos++, part->unk_48, part->unk_4C, part->unk_50, part->unk_54);
gSPDisplayList(gMasterGfxPos++, D_E00E4DA8[unk_00]);
gDPSetEnvColor(gMasterGfxPos++, particle->glowColor.r, particle->glowColor.g, particle->glowColor.b, particle->glowColor.a);
gSPDisplayList(gMasterGfxPos++, D_E00E4DA8[variation]);
part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_2C >= 0) {
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, part->unk_58 * temp_f20, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
particle++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) {
if (particle->animTime >= 0) {
shim_guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMasterGfxPos++, 0, 80 - part->unk_2C, part->unk_38, part->unk_3C, part->unk_40, temp_f20 * part->unk_44);
gDPSetPrimColor(gMasterGfxPos++, 0, 80 - particle->animTime, particle->innerColor.r, particle->innerColor.g, particle->innerColor.b, alphaScale * particle->innerColor.a);
gDPSetTileSize(gMasterGfxPos++, 1,
(s32) part->unk_5C * 4,
(s32) part->unk_60 * 4,
((s32) part->unk_5C + 15) * 4,
((s32) part->unk_60 + 15) * 4);
(s32) particle->unk_5C * 4,
(s32) particle->unk_60 * 4,
((s32) particle->unk_5C + 15) * 4,
((s32) particle->unk_60 + 15) * 4);
if (unk_00 == 2) {
if (variation == 2) {
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE,
((i & 0x1F) * 32 ) * 4, 31 * 4,
((i & 0x1F) * 32 + 31) * 4, 31 * 4);
}
gSPDisplayList(gMasterGfxPos++, D_E00E4D90[unk_00]);
gSPDisplayList(gMasterGfxPos++, D_E00E4D90[variation]);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
}

View File

@ -216,12 +216,12 @@ ApiStatus PlaySoundWithVolume(Evt* script, s32 isInitialCall) {
ApiStatus PlaySoundAt(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 soundID = evt_get_variable(script, *args++);
s32 value2 = evt_get_variable(script, *args++);
s32 flags = evt_get_variable(script, *args++);
s32 x = evt_get_variable(script, *args++);
s32 y = evt_get_variable(script, *args++);
s32 z = evt_get_variable(script, *args++);
sfx_play_sound_at_position(soundID, value2, x, y, z);
sfx_play_sound_at_position(soundID, flags, x, y, z);
return ApiStatus_DONE2;
}

View File

@ -15,13 +15,7 @@ EvtScript N(EVS_SpawnStarCard) = {
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 145, 65, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.6))
EVT_CALL(SetPanTarget, CAM_DEFAULT, 145, 30, 0)
EVT_CALL(GetCamDistance, CAM_DEFAULT, LVar1)
EVT_SUB(LVar1, 100)
EVT_CALL(SetCamDistance, CAM_DEFAULT, LVar1)
EVT_IF_NE(10000, 10000)
EVT_CALL(GetCamPitch, CAM_DEFAULT, LVar2, LVar3)
EVT_CALL(SetCamPitch, CAM_DEFAULT, LVar2, 10000)
EVT_END_IF
EVT_SPIRIT_ADJUST_CAM(10000)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(N(StarSpiritEffectFunc2), 2, 50, 100, 31, -6, 145, 65, 0, 30, 0)
EVT_THREAD
@ -83,13 +77,7 @@ EvtScript N(EVS_RespawnStarCard) = {
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 145, 65, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.6))
EVT_CALL(SetPanTarget, CAM_DEFAULT, 145, 30, 0)
EVT_CALL(GetCamDistance, CAM_DEFAULT, LVar1)
EVT_SUB(LVar1, 100)
EVT_CALL(SetCamDistance, CAM_DEFAULT, LVar1)
EVT_IF_NE(10000, 10000)
EVT_CALL(GetCamPitch, CAM_DEFAULT, LVar2, LVar3)
EVT_CALL(SetCamPitch, CAM_DEFAULT, LVar2, 10000)
EVT_END_IF
EVT_SPIRIT_ADJUST_CAM(10000)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(N(StarSpiritEffectFunc2), 2, 50, 100, 31, -6, 145, 65, 0, 30, 0)
EVT_THREAD

View File

@ -8,11 +8,9 @@
#include "world/common/npc/StarSpirit.inc.c"
API_CALLABLE(N(UpgradeStarPower)) {
PlayerData* playerData = &gPlayerData;
set_max_SP(3);
playerData->curHP = playerData->curMaxHP;
playerData->curFP = playerData->curMaxFP;
gPlayerData.curHP = gPlayerData.curMaxHP;
gPlayerData.curFP = gPlayerData.curMaxFP;
sync_status_menu();
return ApiStatus_DONE2;
}

View File

@ -156,7 +156,7 @@ s32 N(InteriorNPCs_RightHouse)[] = {
EvtScript N(EVS_SetupBuildings) = {
EVT_CALL(MakeDoorAdvanced,
VIS_GROUP_PAIR(0, 5),
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_5),
EVT_PTR(N(EVS_SetDoorRot_LeftHouse)),
EVT_PTR(N(EVS_MoveWalls_LeftHouse)),
EVT_PTR(N(EVS_DropDoor_LeftHouse)),
@ -166,7 +166,7 @@ EvtScript N(EVS_SetupBuildings) = {
MODEL_k_i1,
EVT_PTR(N(InteriorNPCs_LeftHouse)))
EVT_CALL(MakeDoorAdvanced,
VIS_GROUP_PAIR(0, 5),
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_5),
EVT_PTR(N(EVS_SetDoorRot_Shop)),
EVT_PTR(N(EVS_MoveWalls_Shop)),
NULL,
@ -176,7 +176,7 @@ EvtScript N(EVS_SetupBuildings) = {
MODEL_k_m1,
EVT_PTR(N(InteriorNPCs_Shop)))
EVT_CALL(MakeDoorAdvanced,
VIS_GROUP_PAIR(0, 5),
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_5),
EVT_PTR(N(EVS_SetDoorRot_RightHouse)),
EVT_PTR(N(EVS_MoveWalls_RightHouse)),
EVT_PTR(N(EVS_DropDoor_RightHouse)),

View File

@ -4,21 +4,21 @@ API_CALLABLE(N(GetRunToPos)) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc = get_npc_safe(script->owner2.npcID);
s32 rand;
f32 temp_f22;
f32 temp_f24;
f32 npcAngle;
f32 angle;
temp_f24 = atan2(183.0f, -75.0f, playerStatus->position.x, playerStatus->position.z);
temp_f22 = atan2(183.0f, -75.0f, npc->pos.x, npc->pos.z);
temp_f24 = get_clamped_angle_diff(temp_f22, temp_f24);
angle = atan2(183.0f, -75.0f, playerStatus->position.x, playerStatus->position.z);
npcAngle = atan2(183.0f, -75.0f, npc->pos.x, npc->pos.z);
angle = get_clamped_angle_diff(npcAngle, angle);
rand = rand_int(10) + 30;
if (temp_f24 < 0.0f) {
temp_f22 += rand;
if (angle < 0.0f) {
npcAngle += rand;
} else {
temp_f22 -= rand;
npcAngle -= rand;
}
rand = rand_int(20) + 30;
script->varTable[0] = 183.0f + (sin_deg(temp_f22) * rand);
script->varTable[1] = -75.0f - (cos_deg(temp_f22) * rand);
script->varTable[0] = 183.0f + (sin_deg(npcAngle) * rand);
script->varTable[1] = -75.0f - (cos_deg(npcAngle) * rand);
return ApiStatus_DONE2;
}

View File

@ -215,7 +215,7 @@ EvtScript N(EVS_SetupBuildings) = {
EVT_CALL(UpdateColliderTransform, COLLIDER_o1287)
EVT_END_IF
EVT_CALL(MakeDoorAdvanced,
VIS_GROUP_PAIR(0, 4),
VIS_GROUP_PAIR(VIS_GROUP_0, VIS_GROUP_4),
EVT_PTR(N(EVS_OpenDoor_Hideout)),
EVT_PTR(N(EVS_MoveWalls_Hideout)),
EVT_PTR(N(EVS_DropDoor_Hideout)),
@ -229,7 +229,7 @@ EvtScript N(EVS_SetupBuildings) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_OpenSecretDoor_FromInside)), TRIGGER_WALL_PRESS_A, COLLIDER_o1289, 1, 0)
EVT_END_IF
EVT_CALL(MakeDoorAdvanced,
VIS_GROUP_PAIR(1, 5),
VIS_GROUP_PAIR(VIS_GROUP_1, VIS_GROUP_5),
EVT_PTR(N(EVS_OpenDoor_ToadHouse)),
EVT_PTR(N(EVS_MoveWalls_ToadHouse)),
NULL,

View File

@ -3,8 +3,6 @@
extern EvtScript N(EVS_SetNpcShadowScale);
API_CALLABLE(N(AddScrollToNpcPos));
EvtScript N(EVS_HoldPosition_Yoshis) = {
EVT_CALL(GetNpcPos, NPC_YoshiKidGreen, LVar0, LVar1, LVar2)
EVT_SETF(LVar0, LVar0)

View File

@ -2,24 +2,82 @@
#define _WORLD_AREA_FLO_FLO_H_
enum {
AB_FLO_0 = AreaByte(0),
AB_FLO_1 = AreaByte(1),
AB_FLO_2 = AreaByte(2),
AB_FLO_3 = AreaByte(3),
AB_FLO_4 = AreaByte(4),
AB_FLO_5 = AreaByte(5),
AB_FLO_6 = AreaByte(6),
AB_FLO_7 = AreaByte(7),
AB_FLO_8 = AreaByte(8),
AB_FLO_9 = AreaByte(9),
AB_FLO_A = AreaByte(10),
AB_FLO_B = AreaByte(11),
AB_FLO_C = AreaByte(12),
AB_FLO_D = AreaByte(13),
AB_FLO_E = AreaByte(14),
AB_FLO_F = AreaByte(15),
AB_FLO_TolielupDialogue = AreaByte(0),
AB_FLO_PetuniaDialogue = AreaByte(1),
AB_FLO_CrystalTreeHitCount = AreaByte(2),
AB_FLO_PoiseKickedOutCount = AreaByte(3),
AB_FLO_TreePuzzle_FirstCorrect = AreaByte(4),
AB_FLO_TreePuzzle_SecondCorrect = AreaByte(5),
AB_FLO_GuardLakituTalkCount = AreaByte(6),
AB_FLO_GuardedMachineHitCount = AreaByte(7),
};
#define AF_FLO(index) AreaFlag(index)
enum {
// flo_07
AF_FLO_PoiseHintDialogue = AreaFlag(5),
AF_FLO_MadeCrystalBerry = AreaFlag(6),
// flo_00
AF_FLO_BeanstalkFacingRight = AreaFlag(16),
AF_FLO_PlatingInstructionsToggle = AreaFlag(17),
AF_FLO_PinkBubulbDialogueToggle = AreaFlag(18),
AF_FLO_PurpleBubulbDialogueToggle = AreaFlag(19),
AF_FLO_GreenBubulbDialogueToggle = AreaFlag(20),
AF_FLO_YellowBubulbDialogueToggle = AreaFlag(21),
// flo_12
AF_FLO_GivenCrystalBerry = AreaFlag(22),
// flo_03
AF_FLO_IsUnderground_Mole_01 = AreaFlag(23),
AF_FLO_IsUnderground_Mole_02 = AreaFlag(24),
AF_FLO_IsUnderground_Mole_03 = AreaFlag(25),
AF_FLO_IsUnderground_Mole_04 = AreaFlag(26),
AF_FLO_TreeDrop_RedBerry1 = AreaFlag(27),
AF_FLO_TreeDrop_RedBerry2 = AreaFlag(28),
// flo_08
AF_FLO_TreeDrop_BlueBerry1 = AreaFlag(29),
AF_FLO_TreeDrop_BlueBerry2 = AreaFlag(30),
// flo_24
AF_FLO_TreeDrop_BubbleBerry1 = AreaFlag(31),
AF_FLO_TreeDrop_BubbleBerry2 = AreaFlag(32),
// flo_25
AF_FLO_TreeDrop_YellowBerry1 = AreaFlag(33),
AF_FLO_TreeDrop_YellowBerry2 = AreaFlag(34),
// flo_14
AF_FLO_PauseBlowingBubbles = AreaFlag(35),
AF_FLO_BlowingBigBubble = AreaFlag(36),
AF_FLO_BigBubbleReady = AreaFlag(37),
// flo_15
AF_FLO_MetTheSun = AreaFlag(38),
// flo_16
AF_FLO16_FoundHiddenStarPiece = AreaFlag(39),
// flo_19
AF_FLO_BeanstalkGrowing = AreaFlag(40),
// flo_16
AF_FLO_RaisedRedPillar = AreaFlag(41),
AF_FLO_RaisedGreenPillar = AreaFlag(42),
AF_FLO_LoweredPurplePillar = AreaFlag(43),
AF_FLO_RidingBeanstalk = AreaFlag(44),
AF_FLO_BeanstalkFadedOut = AreaFlag(45),
};
#endif
extern MapSettings flo_00_settings;
extern MapSettings flo_03_settings;
extern MapSettings flo_07_settings;
extern MapSettings flo_08_settings;
extern MapSettings flo_09_settings;
extern MapSettings flo_10_settings;
extern MapSettings flo_11_settings;
extern MapSettings flo_12_settings;
extern MapSettings flo_13_settings;
extern MapSettings flo_14_settings;
extern MapSettings flo_15_settings;
extern MapSettings flo_16_settings;
extern MapSettings flo_17_settings;
extern MapSettings flo_18_settings;
extern MapSettings flo_19_settings;
extern MapSettings flo_21_settings;
extern MapSettings flo_22_settings;
extern MapSettings flo_23_settings;
extern MapSettings flo_24_settings;
extern MapSettings flo_25_settings;

View File

@ -1,8 +0,0 @@
#include "flo_00.h"
#include "effects.h"
// Same as SpawnSunEffect, but doesn't touch float regs like SpawnSunEffect does
ApiStatus N(func_80240000_C9DF20)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
#include "flo_00.h"
ApiStatus N(func_80240F10_C9EE30)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = *args++;
s32 var2 = *args++;
evt_set_variable(script, var1, gPlayerStatus.spriteFacingAngle);
evt_set_variable(script, var2, gPlayerStatus.targetYaw);
return ApiStatus_DONE2;
}
ApiStatus N(func_80240F80_C9EEA0)(Evt* script, s32 isInitialCall) {
f32 var1 = evt_get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(-83.0f, 87.0f, script->varTable[9], script->varTable[11]);
f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[9], script->varTable[11]) - var1);
var1 = sin_deg(clamped);
gPlayerStatus.position.x = (dist * var1) + -83.0f;
gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]);
var1 = cos_deg(clamped);
gPlayerStatus.position.z = 87.0f - (dist * var1);
return ApiStatus_DONE2;
}
ApiStatus N(func_802410B4_C9EFD4)(Evt* script, s32 isInitialCall) {
Npc* npc = get_npc_by_index(0);
f32 temp_f20 = evt_get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(-83.0f, 87.0f, script->varTable[12], script->varTable[14]);
f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[12], script->varTable[14]) - temp_f20);
temp_f20 = sin_deg(clamped);
npc->pos.x = (dist * temp_f20) + -83.0f;
npc->pos.y = evt_get_variable(NULL, script->varTable[13]) + evt_get_variable(NULL, script->varTable[3]);
temp_f20 = cos_deg(clamped);
npc->pos.z = 87.0f - (dist * temp_f20);
return ApiStatus_DONE2;
}
#include "common/CosInterpMinMax.inc.c"
#include "world/common/todo/SyncStatusMenu.inc.c"
ApiStatus N(func_8024139C_C9F2BC)(Evt* script, s32 isInitialCall) {
increment_status_menu_disabled();
return ApiStatus_DONE2;
}
ApiStatus N(func_802413BC_C9F2DC)(Evt* script, s32 isInitialCall) {
decrement_status_menu_disabled();
return ApiStatus_DONE2;
}

View File

@ -2,34 +2,50 @@
/// @brief Flower Fields - Center
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_00_shape.h"
#include "mapfs/flo_00_hit.h"
#include "sprite/npc/Lakilulu.h"
#include "sprite/npc/WorldLakilester.h"
#include "sprite/npc/WorldParakarry.h"
enum {
NPC_Dummy_Wisterwood = 0,
NPC_Bubulb_01 = 1,
NPC_Bubulb_02 = 2,
NPC_Bubulb_03 = 3,
NPC_Bubulb_04 = 4,
NPC_Tolielup = 5,
NPC_Klevar = 6,
NPC_Lakilulu = 7,
NPC_Lakilester_Epilogue = 0,
NPC_Lakilulu_Epilogue = 1,
NPC_Parakarry_Epilogue = 2,
};
enum {
MV_BeanstalkSceneSync = MapVar(10),
MV_BeanstalkItemEntity = MapVar(11),
};
#define NAMESPACE flo_00
ApiStatus N(SyncStatusMenu)(Evt* script, s32 isInitialCall);
ApiStatus N(PostChapter6StatUpdate)(Evt* script, s32 isInitialCall);
ApiStatus N(CosInterpMinMax)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240000_C9DF20)(Evt* script, s32 isInitialCall);
ApiStatus N(PatrolNoAttackAI_Main)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240ED0_C9EDF0)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240F10_C9EE30)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240F80_C9EEA0)(Evt* script, s32 isInitialCall);
ApiStatus N(func_802410B4_C9EFD4)(Evt* script, s32 isInitialCall);
ApiStatus N(func_802411EC_C9F10C)(Evt* script, s32 isInitialCall);
ApiStatus N(func_8024137C_C9F29C)(Evt* script, s32 isInitialCall);
ApiStatus N(func_8024139C_C9F2BC)(Evt* script, s32 isInitialCall);
ApiStatus N(func_802413BC_C9F2DC)(Evt* script, s32 isInitialCall);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_Scene_Epilogue);
extern EvtScript N(EVS_Interact_Wisterwood);
extern EvtScript N(EVS_Wisterwood_Exit);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);
extern NpcGroupList N(npcGroupList_80245DE4);
extern NpcGroupList N(npcGroupList_80246834);
extern EvtScript N(80242998);
extern EvtScript N(80242FCC);
extern EvtScript N(80245EB8);
extern EvtScript N(80247BCC);
extern EvtScript N(8024834C);
extern EvtScript N(80248E30);
extern EvtScript N(80248F48);
extern EvtScript N(main);
extern EvtScript N(makeEntities);
extern EvtScript N(EVS_Scene_SunReturns);
extern EvtScript N(EVS_SetupBeanPatch);
extern EvtScript N(EVS_SetupBeanstalk);
extern EvtScript N(EVS_Enter_Beanstalk);
extern EvtScript N(EVS_Scene_BeanstalkGrewRemark);
extern NpcGroupList N(DefaultNPCs);
extern NpcGroupList N(EpilogueNPCs);

View File

@ -0,0 +1,23 @@
#include "flo_00.h"
EntryList N(Entrances) = {
[flo_00_ENTRY_0] { 0.0, 0.0, -310.0, 170.0 },
[flo_00_ENTRY_1] { -320.0, 0.0, -335.0, 135.0 },
[flo_00_ENTRY_2] { -470.0, 0.0, 0.0, 90.0 },
[flo_00_ENTRY_3] { -320.0, 0.0, 335.0, 45.0 },
[flo_00_ENTRY_4] { 320.0, 0.0, -335.0, 225.0 },
[flo_00_ENTRY_5] { 465.0, 0.0, 0.0, 270.0 },
[flo_00_ENTRY_6] { 320.0, 0.0, 335.0, 315.0 },
[flo_00_ENTRY_7] { -30.0, 0.0, 120.0, 270.0 },
[flo_00_ENTRY_8] { -30.0, 0.0, 120.0, 270.0 },
[flo_00_ENTRY_9] { -470.0, 0.0, 0.0, 90.0 },
[flo_00_ENTRY_A] { 40.0, 0.0, -30.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_00 },
};

View File

@ -0,0 +1,37 @@
#include "flo_00.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(flo_00_ENTRY_8)
EVT_IF_NE(AF_FLO_RidingBeanstalk, FALSE)
EVT_CALL(SetMusicTrack, 0, SONG_MAGIC_BEANSTALK, 1, 8)
EVT_ELSE
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_IF
EVT_CASE_EQ(flo_00_ENTRY_9)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_CASE_EQ(flo_00_ENTRY_A)
EVT_CALL(SetMusicTrack, 0, SONG_STAR_SPIRIT_THEME, 1, 8)
EVT_THREAD
EVT_LOOP(0)
EVT_WAIT(1)
EVT_IF_GE(GB_StoryProgress, STORY_CH6_STAR_SPRIT_DEPARTED)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_THREAD
EVT_CASE_EQ(flo_00_ENTRY_B)
EVT_CALL(FadeInMusic, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 3000, 0, 127)
EVT_CASE_DEFAULT
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,219 @@
#include "flo_00.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_Wisterwood_Exit) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilittn, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(PlayerMoveTo, 30, -170, 10)
EVT_CALL(InterpPlayerYaw, 0, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittn, SOUND_1CF, 0)
EVT_CALL(MakeLerp, 0, -100, 20, EASING_QUADRATIC_OUT)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateGroup, MODEL_g27, LVar0, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(func_802D2C14, 1)
EVT_CALL(PlayerMoveTo, 0, -310, 30)
EVT_CALL(func_802D2C14, 0)
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_STAR_SPRIT_DEPARTED)
EVT_SET(GB_StoryProgress, STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_END_IF
EVT_CALL(MakeLerp, -100, 0, 30, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateGroup, MODEL_g27, LVar0, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittn, SOUND_1D0, 0)
EVT_CALL(GotoMap, EVT_PTR("mac_01"), mac_01_ENTRY_5)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Wisterwood_Enter) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilittn, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(InterpPlayerYaw, 180, 0)
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittn, SOUND_1CF, 0)
EVT_CALL(MakeLerp, 0, -100, 30, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateGroup, MODEL_g27, LVar0, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(func_802D2C14, 1)
EVT_CALL(PlayerMoveTo, 0, -135, 30)
EVT_CALL(func_802D2C14, 0)
EVT_CALL(MakeLerp, -100, 0, 30, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateGroup, MODEL_g27, LVar0, 0, 1, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(PlaySoundAtCollider, COLLIDER_deilittn, SOUND_1D0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_deilittn, COLLIDER_FLAGS_UPPER_MASK)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ExitWalk_flo_14_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_1, "flo_14", flo_14_ENTRY_0);
EvtScript N(EVS_ExitWalk_flo_23_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_2, "flo_23", flo_23_ENTRY_0);
EvtScript N(EVS_ExitWalk_flo_25_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_3, "flo_25", flo_25_ENTRY_0);
EvtScript N(EVS_ExitWalk_flo_16_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_4, "flo_16", flo_16_ENTRY_0);
EvtScript N(EVS_ExitWalk_flo_09_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_5, "flo_09", flo_09_ENTRY_0);
EvtScript N(EVS_ExitWalk_flo_08_0) = EVT_EXIT_WALK(60, flo_00_ENTRY_6, "flo_08", flo_08_ENTRY_0);
MAP_RODATA_PAD(1, exits)
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_14_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilinw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_23_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_25_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilisw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_16_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiline, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_09_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_08_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilise, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnterMap) = {
EVT_CALL(GetLoadType, LVar1)
EVT_IF_EQ(LVar1, LOAD_FROM_FILE_SELECT)
EVT_EXEC(EnterSavePoint)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_ELSE
EVT_CALL(GetEntryID, LVar0)
EVT_IF_NE(LVar0, flo_00_ENTRY_8)
EVT_SET(AF_FLO_RidingBeanstalk, FALSE)
EVT_END_IF
EVT_SWITCH(LVar0)
EVT_CASE_EQ(flo_00_ENTRY_0)
EVT_THREAD
EVT_EXEC_WAIT(N(EVS_Wisterwood_Enter))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_END_THREAD
EVT_CASE_RANGE(flo_00_ENTRY_1, flo_00_ENTRY_6)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(flo_00_ENTRY_7)
EVT_THREAD
EVT_EXEC_WAIT(N(EVS_Scene_BeanstalkGrewRemark))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_END_THREAD
EVT_CASE_EQ(flo_00_ENTRY_8)
EVT_THREAD
EVT_EXEC_WAIT(N(EVS_Enter_Beanstalk))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_END_THREAD
EVT_CASE_EQ(flo_00_ENTRY_9)
EVT_EXEC(N(EVS_Scene_SunReturns))
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_CASE_EQ(flo_00_ENTRY_A)
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_EQ(flo_00_ENTRY_B)
EVT_EXEC(N(EVS_Scene_Epilogue))
EVT_END_SWITCH
EVT_END_IF
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Interact_Wisterwood)), TRIGGER_WALL_PRESS_A, COLLIDER_deilittn, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_SET(GF_MAP_FlowerFields, TRUE)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_GREW_MAGIC_BEANSTALK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o351, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_SET(GF_MAC01_RowfBadgesChosen, FALSE)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_00_ENTRY_B)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(EpilogueNPCs)))
EVT_ELSE
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_CALL(ParentColliderToModel, COLLIDER_o240, MODEL_o142)
EVT_EXEC(N(EVS_SetupBeanstalk))
EVT_EXEC(N(EVS_SetupBeanPatch))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o129, SURFACE_TYPE_FLOWERS)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o363, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( 150, -270, 410, 170, 0)
EVT_FLOWER_SPAWN_REGION( 115, -450, 250, -270, 0)
EVT_FLOWER_SPAWN_REGION( -330, 220, 45, 410, 0)
EVT_FLOWER_SPAWN_REGION( -420, -260, -140, 160, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitse, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitne, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitsw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitnw, COLLIDER_FLAGS_UPPER_MASK)
EVT_EXEC(N(EVS_EnterMap))
EVT_CALL(GetLoadType, LVar1)
EVT_IF_NE(LVar1, LOAD_FROM_FILE_SELECT)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_00_ENTRY_A)
EVT_WAIT(65)
EVT_END_IF
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
// thread to manage wisterwood blinking
EVT_THREAD
EVT_CALL(EnableTexPanning, MODEL_o47, TRUE)
EVT_SET(LVar0, 0)
EVT_LABEL(0)
EVT_CALL(RandInt, 300, LVar1)
EVT_ADD(LVar1, 100)
EVT_CALL(RandInt, 1, LVar2)
EVT_ADD(LVar2, 1)
EVT_WAIT(LVar1)
EVT_LOOP(LVar2)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, -0x8000, 0)
EVT_WAIT(2)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, -0x10000, 0)
EVT_WAIT(2)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, -0x18000, 0)
EVT_CALL(RandInt, 5, LVar3)
EVT_ADD(LVar3, 2)
EVT_WAIT(LVar3)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, -0x10000, 0)
EVT_WAIT(2)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, -0x8000, 0)
EVT_WAIT(2)
EVT_CALL(SetTexPanOffset, TEX_PANNER_C, TEX_PANNER_MAIN, 0, 0)
EVT_CALL(RandInt, 5, LVar3)
EVT_ADD(LVar3, 2)
EVT_WAIT(LVar3)
EVT_END_LOOP
EVT_GOTO(0)
EVT_END_THREAD
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,798 @@
#include "flo_00.h"
NpcSettings N(NpcSettings_Dummy) = {
.height = 24,
.radius = 24,
.level = 99,
};
#include "world/common/npc/Bubulb_Patrol.inc.c"
#include "world/common/npc/Tolielup.inc.c"
#include "world/common/npc/StarSpirit.inc.c"
API_CALLABLE(N(UpgradeStarPower)) {
set_max_SP(6);
gPlayerData.curHP = gPlayerData.curMaxHP;
gPlayerData.curFP = gPlayerData.curMaxFP;
sync_status_menu();
return ApiStatus_DONE2;
}
EvtScript N(EVS_Scene_SunReturns) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 50, 0, -200)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 50, 0, -200)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 700)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(10.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -27, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_00C4, 0, 50, -200)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_07"), flo_07_ENTRY_1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Wisterwood_Introduction) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 0, 0, -170)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 0, -170)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-8.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(75)
EVT_CALL(ShowMessageAtScreenPos, MSG_CH6_0000, 160, 40)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(1.5))
EVT_CALL(PlayerJump1, LVar0, LVar1, LVar2, 12)
EVT_WAIT(10)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 270, 0)
EVT_WAIT(15)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 90, 0)
EVT_WAIT(15)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 800)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(15.0), EVT_FLOAT(-5.8))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -2, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(15)
EVT_CALL(SpeakToPlayer, NPC_Dummy_Wisterwood, -1, -1, 5, MSG_CH6_0001)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(InterpPlayerYaw, 350, 0)
EVT_WAIT(15)
EVT_CALL(ContinueSpeech, NPC_Dummy_Wisterwood, -1, -1, 5, MSG_CH6_0002)
EVT_WAIT(10)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 333)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(9.0), EVT_FLOAT(-22.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -2, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(EnablePartnerAI)
EVT_CALL(func_802D2C14, 1)
EVT_WAIT(10)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0003, 0, 70, -200)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(16.5), EVT_FLOAT(-11.8))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 525)
EVT_CALL(SetCamPosA, CAM_DEFAULT, -14, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80007)
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0004, 0, 50, -200)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(9.0), EVT_FLOAT(-22.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 333)
EVT_CALL(SetCamPosA, CAM_DEFAULT, -2, 0)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0005, 0, 70, -200)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_SET(GB_StoryProgress, STORY_CH6_ARRIVED_AT_FLOWER_FIELDS)
EVT_CALL(func_802D2C14, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Interact_Wisterwood) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(2)
EVT_CALL(GetPlayerActionState, LVar3)
EVT_SET(LVar4, 0)
EVT_IF_EQ(LVar3, ACTION_STATE_IDLE)
EVT_ADD(LVar4, 1)
EVT_END_IF
EVT_IF_EQ(LVar3, ACTION_STATE_WALK)
EVT_ADD(LVar4, 1)
EVT_END_IF
EVT_IF_EQ(LVar3, ACTION_STATE_RUN)
EVT_ADD(LVar4, 1)
EVT_END_IF
EVT_IF_EQ(LVar4, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0006, 0, 50, -200)
EVT_SET(GB_StoryProgress, STORY_CH6_WISTERWOOD_GAVE_HINT)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END_IF
EVT_IF_LT(GB_StoryProgress, STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_000D, 0, 50, -200)
EVT_CALL(ShowChoice, MSG_Choice_001F)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_CALL(SwitchMessage, MSG_CH6_000E)
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SwitchMessage, MSG_CH6_000F)
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SwitchMessage, MSG_CH6_0010)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SwitchMessage, MSG_CH6_0011)
EVT_CASE_LT(STORY_CH6_GREW_MAGIC_BEANSTALK)
EVT_CALL(SwitchMessage, MSG_CH6_0007)
EVT_CASE_LT(STORY_CH6_BEGAN_PEACH_MISSION)
EVT_CALL(SwitchMessage, MSG_CH6_0012)
EVT_CASE_DEFAULT
EVT_CALL(SwitchMessage, MSG_CH6_0013)
EVT_END_SWITCH
EVT_CASE_EQ(1)
EVT_CALL(CloseMessage)
EVT_EXEC(N(EVS_Wisterwood_Exit))
EVT_RETURN
EVT_CASE_EQ(2)
EVT_CALL(CloseMessage)
EVT_END_SWITCH
EVT_ELSE
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0014, 0, 50, -200)
EVT_CALL(ShowChoice, MSG_Choice_001F)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(SwitchMessage, MSG_CH6_0015)
EVT_CASE_EQ(1)
EVT_CALL(CloseMessage)
EVT_EXEC(N(EVS_Wisterwood_Exit))
EVT_RETURN
EVT_CASE_EQ(2)
EVT_CALL(CloseMessage)
EVT_END_SWITCH
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Wisterwood_Farewell) = {
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(90.0), 0, 600, EVT_FLOAT(21.0), EVT_FLOAT(-12.0))
EVT_WAIT(20)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_000B, 0, 50, -200)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 0, -30)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 250)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(25.0), EVT_FLOAT(-25.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_000C, 0, 50, -200)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Wisterwood) = {
EVT_CALL(EnableGroup, MODEL_ha, FALSE)
EVT_CALL(EnableGroup, MODEL_tuta, FALSE)
EVT_CALL(EnableGroup, MODEL_g54, FALSE)
EVT_CALL(SetNpcPos, NPC_SELF, 50, 70, -230)
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2, TRUE)
EVT_CALL(EnableNpcShadow, NPC_SELF, FALSE)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_ARRIVED_AT_FLOWER_FIELDS)
EVT_EXEC(N(EVS_Wisterwood_Introduction))
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Bubulb1) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_Talk, ANIM_Bubulb_Pink_Idle, 0, MSG_CH6_0016)
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_Talk, ANIM_Bubulb_Pink_Idle, 0, MSG_CH6_0017)
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_Talk, ANIM_Bubulb_Pink_Idle, 0, MSG_CH6_0018)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_Talk, ANIM_Bubulb_Pink_Idle, 0, MSG_CH6_0019)
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_SWITCH(AF_FLO_PinkBubulbDialogueToggle)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_HappyTalk, ANIM_Bubulb_Pink_HappyGentle, 0, MSG_CH6_001A)
EVT_SET(AF_FLO_PinkBubulbDialogueToggle, TRUE)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_HappyTalk, ANIM_Bubulb_Pink_HappyGentle, 0, MSG_CH6_001B)
EVT_SET(AF_FLO_PinkBubulbDialogueToggle, FALSE)
EVT_END_SWITCH
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Pink_HappyTalk, ANIM_Bubulb_Pink_HappyGentle, 0, MSG_CH6_001C)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Bubulb2) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_001D)
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_001E)
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_001F)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_0020)
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_SWITCH(AF_FLO_PurpleBubulbDialogueToggle)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_0021)
EVT_SET(AF_FLO_PurpleBubulbDialogueToggle, TRUE)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_0022)
EVT_SET(AF_FLO_PurpleBubulbDialogueToggle, FALSE)
EVT_END_SWITCH
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Purple_Talk, ANIM_Bubulb_Purple_Idle, 0, MSG_CH6_0023)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Bubulb_03) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_Talk, ANIM_Bubulb_Green_Idle, 0, MSG_CH6_0024)
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_Talk, ANIM_Bubulb_Green_Idle, 0, MSG_CH6_0025)
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_Talk, ANIM_Bubulb_Green_Idle, 0, MSG_CH6_0026)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_Talk, ANIM_Bubulb_Green_Idle, 0, MSG_CH6_0027)
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_SWITCH(AF_FLO_GreenBubulbDialogueToggle)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_HappyTalk, ANIM_Bubulb_Green_HappyGentle, 0, MSG_CH6_0028)
EVT_SET(AF_FLO_GreenBubulbDialogueToggle, TRUE)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_HappyTalk, ANIM_Bubulb_Green_HappyGentle, 0, MSG_CH6_0029)
EVT_SET(AF_FLO_GreenBubulbDialogueToggle, FALSE)
EVT_END_SWITCH
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Green_HappyTalk, ANIM_Bubulb_Green_HappyGentle, 0, MSG_CH6_002A)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Bubulb_04) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_Talk, ANIM_Bubulb_Yellow_Idle, 0, MSG_CH6_002B)
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_Talk, ANIM_Bubulb_Yellow_Idle, 0, MSG_CH6_002C)
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_Talk, ANIM_Bubulb_Yellow_Idle, 0, MSG_CH6_002D)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_Talk, ANIM_Bubulb_Yellow_Idle, 0, MSG_CH6_002E)
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_SWITCH(AF_FLO_YellowBubulbDialogueToggle)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_HappyTalk, ANIM_Bubulb_Yellow_HappyGentle, 0, MSG_CH6_002F)
EVT_SET(AF_FLO_YellowBubulbDialogueToggle, TRUE)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_HappyTalk, ANIM_Bubulb_Yellow_HappyGentle, 0, MSG_CH6_0030)
EVT_SET(AF_FLO_YellowBubulbDialogueToggle, FALSE)
EVT_END_SWITCH
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Bubulb_Yellow_HappyTalk, ANIM_Bubulb_Yellow_HappyGentle, 0, MSG_CH6_0031)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Bubulb_01) = {
EVT_SET(AF_FLO_PinkBubulbDialogueToggle, FALSE)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Bubulb1)))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Bubulb_02) = {
EVT_SET(AF_FLO_PurpleBubulbDialogueToggle, FALSE)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Bubulb2)))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Bubulb_03) = {
EVT_SET(AF_FLO_GreenBubulbDialogueToggle, FALSE)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Bubulb_03)))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Bubulb_04) = {
EVT_SET(AF_FLO_YellowBubulbDialogueToggle, FALSE)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Bubulb_04)))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Tolielup) = {
EVT_IF_EQ(GF_FLO00_Met_Tolielup, FALSE)
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(4.0), -30, 300, EVT_FLOAT(20.0), EVT_FLOAT(-9.5))
EVT_SET(GF_FLO00_Met_Tolielup, TRUE)
EVT_END_IF
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_SWITCH(AB_FLO_TolielupDialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0035)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0038)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 2)
EVT_CASE_EQ(2)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0039)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 0)
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_SWITCH(AB_FLO_TolielupDialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0036)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0038)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 2)
EVT_CASE_EQ(2)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0039)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 0)
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_SWITCH(AB_FLO_TolielupDialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0037)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0038)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 2)
EVT_CASE_EQ(2)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0039)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 0)
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_SWITCH(AB_FLO_TolielupDialogue)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0039)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_SET(AB_FLO_TolielupDialogue, 1)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_0038)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_END_SWITCH
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Tolielup_Talk, ANIM_Tolielup_Idle, 0, MSG_CH6_003A)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Tolielup_Laugh, ANIM_Tolielup_Laugh, 0)
EVT_END_SWITCH
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Tolielup) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Tolielup)))
EVT_CALL(SetNpcCollisionSize, NPC_SELF, 65, 50)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_Klevar) = {
EVT_LOOP(0)
EVT_LOOP(10)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_SUB(LVar1, 1)
EVT_CALL(SetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_WAIT(1)
EVT_END_LOOP
EVT_LOOP(10)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 1)
EVT_CALL(SetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_RescuedKlevar) = {
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(func_802CF56C, 2)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_SET(LVar3, LVar0)
EVT_ADD(LVar3, -50)
EVT_SET(LVar4, LVar1)
EVT_ADD(LVar4, 26)
EVT_CALL(SetNpcPos, NPC_Klevar, LVar3, LVar4, LVar2)
EVT_CALL(PlayerFaceNpc, NPC_Klevar, FALSE)
EVT_CALL(NpcFaceNpc, NPC_PARTNER, NPC_Klevar, 0)
EVT_ADD(LVar0, -25)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(475.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, 18, -8)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_WAIT(1)
EVT_CALL(WaitForPlayerInputEnabled)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(40)
EVT_CALL(SpeakToPlayer, NPC_Klevar, ANIM_WorldKlevar_Talk, ANIM_WorldKlevar_Idle, SPEECH_FLAG_200, MSG_CH6_00D8)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, 18, -9)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(MakeLerp, 0, 360, 10, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, NPC_Klevar, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(EnableNpcAI, NPC_Klevar, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Leap)
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_GotItem)
EVT_CALL(PlaySoundAtPlayer, SOUND_139, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_SET(LVar3, LVar1)
EVT_ADD(LVar1, 50)
EVT_ADD(LVar2, 10)
EVT_ADD(LVar3, 30)
EVT_LOOP(5)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 3, LVar0, LVar1, LVar2, 20)
EVT_WAIT(6)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 1, LVar0, LVar3, LVar2, 20)
EVT_WAIT(6)
EVT_END_LOOP
EVT_WAIT(20)
EVT_CALL(PlaySoundAtPlayer, SOUND_188, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar1, 20)
EVT_PLAY_EFFECT(EFFECT_ENERGY_ORB_WAVE, 4, LVar0, LVar1, LVar2, 1, 30)
EVT_WAIT(30)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SetNpcAnimation, NPC_Klevar, ANIM_WorldKlevar_Idle)
EVT_CALL(EnableNpcAI, NPC_Klevar, TRUE)
EVT_CALL(N(UpgradeStarPower))
EVT_CALL(ShowMessageAtScreenPos, MSG_Menus_0196, 160, 40)
EVT_WAIT(10)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(250.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Klevar, ANIM_WorldKlevar_Talk, ANIM_WorldKlevar_Idle, SPEECH_FLAG_200, MSG_CH6_00D9)
EVT_WAIT(10)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, -25)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Klevar, ANIM_WorldKlevar_Talk, ANIM_WorldKlevar_Idle, SPEECH_FLAG_200, MSG_CH6_00DA)
EVT_CALL(SetNpcFlagBits, NPC_Klevar, NPC_FLAG_40000, TRUE)
EVT_THREAD
EVT_LOOP(25)
EVT_CALL(GetNpcPos, NPC_Klevar, LVar0, LVar1, LVar2)
EVT_PLAY_EFFECT(EFFECT_SPARKLES, 4, LVar0, LVar1, LVar2, 20)
EVT_WAIT(4)
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 1800)
EVT_CALL(MakeLerp, LVar2, LVar3, 100, EASING_CUBIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcRotation, NPC_Klevar, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_THREAD
EVT_CALL(GetNpcPos, NPC_Klevar, LVar2, LVar3, LVar4)
EVT_SET(LVar5, LVar3)
EVT_ADD(LVar5, 180)
EVT_CALL(MakeLerp, LVar3, LVar5, 100, EASING_CUBIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetNpcPos, NPC_Klevar, LVar2, LVar0, LVar4)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_Klevar, NPC_DISPOSE_LOCATION)
EVT_END_THREAD
EVT_THREAD
EVT_WAIT(15)
EVT_CALL(PlaySoundAtNpc, NPC_Klevar, SOUND_2045, 0)
EVT_END_THREAD
EVT_WAIT(10)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)
EVT_WAIT(110)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_SET(GB_StoryProgress, STORY_CH6_STAR_SPRIT_DEPARTED)
EVT_EXEC_WAIT(N(EVS_Wisterwood_Farewell))
EVT_CALL(EnablePartnerAI)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Klevar) = {
EVT_CALL(GetLoadType, LVar1)
EVT_IF_NE(LVar1, 1)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_00_ENTRY_A)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Klevar)))
EVT_EXEC(N(EVS_Scene_RescuedKlevar))
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Lakilulu) = {
EVT_IF_LE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_Lakilulu, ANIM_Lakilulu_Talk, ANIM_Lakilulu_Idle, 0, MSG_CH6_0032)
EVT_ELSE
EVT_CALL(GetCurrentPartnerID, LVar0)
EVT_IF_EQ(LVar0, PARTNER_LAKILESTER)
EVT_CALL(SpeakToPlayer, NPC_Lakilulu, ANIM_Lakilulu_Talk, ANIM_Lakilulu_Idle, 0, MSG_CH6_0032)
EVT_WAIT(10)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(SpeakToPlayer, NPC_PARTNER, ANIM_WorldLakilester_Shout, ANIM_WorldLakilester_IdleTough, 5, MSG_CH6_0033)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, ANIM_WorldLakilester_Idle)
EVT_CALL(EndSpeech, NPC_PARTNER, ANIM_WorldLakilester_Talk, ANIM_WorldLakilester_Idle, 5)
EVT_CALL(EnablePartnerAI)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_Lakilulu, ANIM_Lakilulu_Talk, ANIM_Lakilulu_Idle, 0, MSG_CH6_0034)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lakilulu) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH6_BEGAN_PEACH_MISSION)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Lakilulu)))
EVT_CALL(SetNpcCollisionSize, NPC_SELF, 36, 28)
EVT_CALL(SetNpcPos, NPC_SELF, -200, 15, -300)
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Wisterwood) = {
.id = NPC_Dummy_Wisterwood,
.settings = &N(NpcSettings_Dummy),
.pos = { -72.0f, 60.0f, -100.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_GRAVITY | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Wisterwood),
.drops = BUBULB_DROPS,
.animations = BUBULB_PINK_ANIMS,
};
StaticNpc N(NpcData_Bubulbs)[] = {
{
.id = NPC_Bubulb_01,
.settings = &N(NpcSettings_Bubulb_Patrol),
.pos = { -59.0f, 0.0f, -40.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_Bubulb_01),
.drops = BUBULB_DROPS,
.territory = {
.patrol = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.numPoints = 2,
.points = {
{ -59, 0, -40 },
{ -80, 0, -40 },
},
.detectShape = SHAPE_CYLINDER,
.detectPos = { -59, 0, -40 },
.detectSize = { 100 },
}
},
.animations = BUBULB_PINK_ANIMS,
.tattle = MSG_NpcTattle_FLO_BubulbA,
},
{
.id = NPC_Bubulb_02,
.settings = &N(NpcSettings_Bubulb_Patrol),
.pos = { 67.0f, 0.0f, 85.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_Bubulb_02),
.drops = BUBULB_DROPS,
.territory = {
.patrol = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.numPoints = 2,
.points = {
{ 67, 0, 85 },
{ 97, 0, 85 },
},
.detectShape = SHAPE_CYLINDER,
.detectPos = { -59, 0, -40 },
.detectSize = { 100 },
}
},
.animations = BUBULB_PURPLE_ANIMS,
.tattle = MSG_NpcTattle_FLO_BubulbB,
},
{
.id = NPC_Bubulb_03,
.settings = &N(NpcSettings_Bubulb_Patrol),
.pos = { 90.0f, 0.0f, 410.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_Bubulb_03),
.drops = BUBULB_DROPS,
.territory = {
.patrol = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.numPoints = 2,
.points = {
{ 90, 0, 410 },
{ 120, 0, 410 },
},
.detectShape = SHAPE_CYLINDER,
.detectPos = { -59, 0, -40 },
.detectSize = { 100 },
}
},
.animations = BUBULB_GREEN_ANIMS,
.tattle = MSG_NpcTattle_FLO_BubulbC,
},
{
.id = NPC_Bubulb_04,
.settings = &N(NpcSettings_Bubulb_Patrol),
.pos = { 200.0f, 0.0f, 430.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_Bubulb_04),
.drops = BUBULB_DROPS,
.territory = {
.patrol = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.numPoints = 2,
.points = {
{ 200, 0, 430 },
{ 240, 0, 430 },
},
.detectShape = SHAPE_CYLINDER,
.detectPos = { -59, 0, -40 },
.detectSize = { 100 },
}
},
.animations = BUBULB_YELLOW_ANIMS,
.tattle = MSG_NpcTattle_FLO_BubulbD,
},
};
StaticNpc N(NpcData_Tolielup) = {
.id = NPC_Tolielup,
.settings = &N(NpcSettings_Tolielup),
.pos = { -400.0f, 0.0f, 190.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(EVS_NpcInit_Tolielup),
.drops = TOLIELUP_DROPS,
.animations = TOLIELUP_ANIMS,
.tattle = MSG_NpcTattle_Tolielup,
};
StaticNpc N(NpcData_Klevar) = {
.id = NPC_Klevar,
.settings = &N(NpcSettings_StarSpirit),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 0,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Klevar),
.drops = KLEVAR_DROPS,
.animations = KLEVAR_ANIMS,
};
StaticNpc N(NpcData_Lakilulu) = {
.id = NPC_Lakilulu,
.settings = &N(NpcSettings_Dummy),
.pos = { 198.0f, 0.0f, 363.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Lakilulu),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_Lakilulu_Idle,
.walk = ANIM_Lakilulu_Idle,
.run = ANIM_Lakilulu_Idle,
.chase = ANIM_Lakilulu_Idle,
.anim_4 = ANIM_Lakilulu_Idle,
.anim_5 = ANIM_Lakilulu_Idle,
.death = ANIM_Lakilulu_Idle,
.hit = ANIM_Lakilulu_Idle,
.anim_8 = ANIM_Lakilulu_Idle,
.anim_9 = ANIM_Lakilulu_Idle,
.anim_A = ANIM_Lakilulu_Idle,
.anim_B = ANIM_Lakilulu_Idle,
.anim_C = ANIM_Lakilulu_Idle,
.anim_D = ANIM_Lakilulu_Idle,
.anim_E = ANIM_Lakilulu_Idle,
.anim_F = ANIM_Lakilulu_Idle,
},
.tattle = MSG_NpcTattle_Lakilulu,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Wisterwood)),
NPC_GROUP(N(NpcData_Bubulbs)),
NPC_GROUP(N(NpcData_Tolielup)),
NPC_GROUP(N(NpcData_Klevar)),
NPC_GROUP(N(NpcData_Lakilulu)),
{}
};

View File

@ -0,0 +1,182 @@
#include "flo_00.h"
NpcSettings N(NpcSettings_Lakilester_Epilogue) = {
.height = 24,
.radius = 24,
.level = 99,
};
NpcSettings N(NpcSettings_Parakarry_Epilogue) = {
.height = 35,
.radius = 24,
.level = 99,
.actionFlags = AI_ACTION_LOOK_AROUND_DURING_LOITER,
};
Vec3f N(D_80245E88_CA3DA8)[] = {
{ 266.0f, 20.0f, 322.0f },
{ 310.0f, 30.0f, 312.0f },
{ 346.0f, 90.0f, 300.0f },
{ 400.0f, 200.0f, 287.0f },
};
EvtScript N(EVS_Scene_Epilogue) = {
EVT_CALL(SetPlayerPos, -400, 0, 200)
EVT_CALL(SetNpcPos, NPC_PARTNER, -380, 0, 200)
EVT_CALL(func_802CF56C, 2)
EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_SET_VEC3(LVar0, 230, 0, 350)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-10.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 350)
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(17.5), EVT_FLOAT(35.0))
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(70)
EVT_CALL(InterpNpcYaw, NPC_Lakilester_Epilogue, 90, 0)
EVT_WAIT(10)
EVT_CALL(SetNpcAnimation, NPC_Lakilester_Epilogue, ANIM_WorldLakilester_Talk)
EVT_WAIT(40)
EVT_CALL(SetNpcAnimation, NPC_Lakilester_Epilogue, ANIM_WorldLakilester_Idle)
EVT_CALL(SetNpcAnimation, NPC_Parakarry_Epilogue, ANIM_WorldParakarry_Talk)
EVT_WAIT(40)
EVT_CALL(SetNpcAnimation, NPC_Parakarry_Epilogue, ANIM_WorldParakarry_Idle)
EVT_CALL(InterpNpcYaw, NPC_Parakarry_Epilogue, 90, 0)
EVT_CALL(NpcFlyTo, NPC_Parakarry_Epilogue, 400, 200, 287, 80, -5, EASING_LINEAR)
EVT_CALL(InterpNpcYaw, NPC_Lakilester_Epilogue, 270, 0)
EVT_WAIT(40)
EVT_CALL(FadeOutMusic, 0, 1000)
EVT_CALL(GotoMap, EVT_PTR("sam_11"), sam_11_ENTRY_2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lakilester_Epilogue) = {
EVT_CALL(SetPlayerPos, -400, 0, 200)
EVT_CALL(SetNpcPos, NPC_PARTNER, -380, 0, 200)
EVT_CALL(SetNpcPos, NPC_Lakilester_Epilogue, 196, 20, 354)
EVT_CALL(SetNpcYaw, NPC_Lakilester_Epilogue, 270)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lakilulu_Epilogue) = {
EVT_CALL(SetNpcPos, NPC_Lakilulu_Epilogue, 163, 20, 370)
EVT_CALL(SetNpcYaw, NPC_Lakilulu_Epilogue, 90)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Parakarry_Epilogue) = {
EVT_CALL(SetNpcPos, NPC_Parakarry_Epilogue, 266, 20, 322)
EVT_CALL(SetNpcYaw, NPC_Parakarry_Epilogue, 270)
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Lakilester_Epilogue)[] = {
{
.id = NPC_Lakilester_Epilogue,
.settings = &N(NpcSettings_Lakilester_Epilogue),
.pos = { 144.0f, 0.0f, 374.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Lakilester_Epilogue),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_WorldLakilester_Idle,
.walk = ANIM_WorldLakilester_Idle,
.run = ANIM_WorldLakilester_Idle,
.chase = ANIM_WorldLakilester_Idle,
.anim_4 = ANIM_WorldLakilester_Idle,
.anim_5 = ANIM_WorldLakilester_Idle,
.death = ANIM_WorldLakilester_Idle,
.hit = ANIM_WorldLakilester_Idle,
.anim_8 = ANIM_WorldLakilester_Idle,
.anim_9 = ANIM_WorldLakilester_Idle,
.anim_A = ANIM_WorldLakilester_Idle,
.anim_B = ANIM_WorldLakilester_Idle,
.anim_C = ANIM_WorldLakilester_Idle,
.anim_D = ANIM_WorldLakilester_Idle,
.anim_E = ANIM_WorldLakilester_Idle,
.anim_F = ANIM_WorldLakilester_Idle,
},
},
{
.id = NPC_Lakilulu_Epilogue,
.settings = &N(NpcSettings_Lakilester_Epilogue),
.pos = { 198.0f, 0.0f, 363.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Lakilulu_Epilogue),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_Lakilulu_Idle,
.walk = ANIM_Lakilulu_Idle,
.run = ANIM_Lakilulu_Idle,
.chase = ANIM_Lakilulu_Idle,
.anim_4 = ANIM_Lakilulu_Idle,
.anim_5 = ANIM_Lakilulu_Idle,
.death = ANIM_Lakilulu_Idle,
.hit = ANIM_Lakilulu_Idle,
.anim_8 = ANIM_Lakilulu_Idle,
.anim_9 = ANIM_Lakilulu_Idle,
.anim_A = ANIM_Lakilulu_Idle,
.anim_B = ANIM_Lakilulu_Idle,
.anim_C = ANIM_Lakilulu_Idle,
.anim_D = ANIM_Lakilulu_Idle,
.anim_E = ANIM_Lakilulu_Idle,
.anim_F = ANIM_Lakilulu_Idle,
},
},
{
.id = NPC_Parakarry_Epilogue,
.settings = &N(NpcSettings_Parakarry_Epilogue),
.pos = { 266.0f, 0.0f, 322.0f },
.yaw = 0,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Parakarry_Epilogue),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_WorldParakarry_Idle,
.walk = ANIM_WorldParakarry_Walk,
.run = ANIM_WorldParakarry_Run,
.chase = ANIM_WorldParakarry_Run,
.anim_4 = ANIM_WorldParakarry_Idle,
.anim_5 = ANIM_WorldParakarry_Idle,
.death = ANIM_WorldParakarry_Still,
.hit = ANIM_WorldParakarry_Still,
.anim_8 = ANIM_WorldParakarry_Idle,
.anim_9 = ANIM_WorldParakarry_Idle,
.anim_A = ANIM_WorldParakarry_Idle,
.anim_B = ANIM_WorldParakarry_Idle,
.anim_C = ANIM_WorldParakarry_Idle,
.anim_D = ANIM_WorldParakarry_Idle,
.anim_E = ANIM_WorldParakarry_Idle,
.anim_F = ANIM_WorldParakarry_Idle,
},
},
};
NpcGroupList N(EpilogueNPCs) = {
NPC_GROUP(N(NpcData_Lakilester_Epilogue)),
{}
};

View File

@ -0,0 +1,668 @@
#include "flo_00.h"
#define BEANSTALK_BASE_X -83
#define BEANSTALK_BASE_Z 87
API_CALLABLE(N(GetPlayerAngles)) {
Bytecode* args = script->ptrReadPos;
s32 var1 = *args++;
s32 var2 = *args++;
evt_set_variable(script, var1, gPlayerStatus.spriteFacingAngle);
evt_set_variable(script, var2, gPlayerStatus.targetYaw);
return ApiStatus_DONE2;
}
API_CALLABLE(N(PlayerRideBeanstalk)) {
f32 temp = evt_get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(BEANSTALK_BASE_X, BEANSTALK_BASE_Z, script->varTable[9], script->varTable[11]);
f32 angle = atan2(BEANSTALK_BASE_X, BEANSTALK_BASE_Z, script->varTable[9], script->varTable[11]);
f32 clamped = clamp_angle(angle - temp);
temp = sin_deg(clamped);
gPlayerStatus.position.x = BEANSTALK_BASE_X + (dist * temp);
gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]);
temp = cos_deg(clamped);
gPlayerStatus.position.z = BEANSTALK_BASE_Z - (dist * temp);
return ApiStatus_DONE2;
}
API_CALLABLE(N(PartnerRideBeanstalk)) {
Npc* npc = get_npc_by_index(NPC_Dummy_Wisterwood);
f32 temp = evt_get_variable(NULL, script->varTable[2]);
f32 dist = dist2D(BEANSTALK_BASE_X, BEANSTALK_BASE_Z, script->varTable[12], script->varTable[14]);
f32 angle = atan2(BEANSTALK_BASE_X, BEANSTALK_BASE_Z, script->varTable[12], script->varTable[14]);
f32 clamped = clamp_angle(angle - temp);
temp = sin_deg(clamped);
npc->pos.x = BEANSTALK_BASE_X + (dist * temp);
npc->pos.y = evt_get_variable(NULL, script->varTable[13]) + evt_get_variable(NULL, script->varTable[3]);
temp = cos_deg(clamped);
npc->pos.z = BEANSTALK_BASE_Z - (dist * temp);
return ApiStatus_DONE2;
}
#include "common/CosInterpMinMax.inc.c"
#include "world/common/todo/SyncStatusMenu.inc.c"
API_CALLABLE(N(DisableStatusMenu)) {
increment_status_menu_disabled();
return ApiStatus_DONE2;
}
API_CALLABLE(N(EnableStatusMenu)) {
decrement_status_menu_disabled();
return ApiStatus_DONE2;
}
EvtScript N(EVS_SetExteriorVineGrowth) = {
EVT_SETF(LVar1, LVar0) // input: expect range from -700 (no growth) to 0 (fully grown)
EVT_SUBF(LVar1, EVT_FLOAT(-700.0))
EVT_DIVF(LVar1, EVT_FLOAT(100.0))
EVT_SETF(LVar2, LVar1)
EVT_MULF(LVar2, EVT_FLOAT(100.0))
EVT_IF_GT(LVar2, 100)
EVT_SETF(LVar1, EVT_FLOAT(1.0))
EVT_END_IF
EVT_CALL(ScaleGroup, MODEL_g35, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o117, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o141, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o140, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o138, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o139, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o143, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o144, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o145, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o146, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o188, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o187, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o186, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o185, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o182, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o183, LVar1, 1, LVar1)
EVT_CALL(ScaleModel, MODEL_o181, LVar1, 1, LVar1)
EVT_CALL(TranslateGroup, MODEL_g35, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o117, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o141, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o140, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o138, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o139, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o143, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o144, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o145, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o146, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o188, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o187, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o186, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o185, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o182, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o183, 0, LVar0, 0)
EVT_CALL(TranslateModel, MODEL_o181, 0, LVar0, 0)
EVT_SETF(LVar1, LVar0)
EVT_MULF(LVar1, EVT_FLOAT(-12.0))
EVT_CALL(RotateGroup, MODEL_g35, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o117, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o141, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o140, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o138, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o139, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o143, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o144, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o145, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o146, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o188, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o187, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o186, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o185, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o182, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o183, LVar1, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o181, LVar1, 0, 1, 0)
EVT_CALL(TranslateModel, MODEL_o117, EVT_FLOAT(8.1220703125), EVT_FLOAT(56.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o141, EVT_FLOAT(-6.8779296875), EVT_FLOAT(91.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o140, EVT_FLOAT(13.1220703125), EVT_FLOAT(106.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o138, EVT_FLOAT(-9.8779296875), EVT_FLOAT(136.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o139, EVT_FLOAT(-7.8779296875), EVT_FLOAT(201.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o143, EVT_FLOAT(13.1220703125), EVT_FLOAT(221.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o144, EVT_FLOAT(8.126953125), EVT_FLOAT(261.2294921875), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o145, EVT_FLOAT(-12.8779296875), EVT_FLOAT(266.1533203125), EVT_FLOAT(1.166015625))
EVT_CALL(TranslateModel, MODEL_o146, EVT_FLOAT(8.1220703125), EVT_FLOAT(316.1533203125), EVT_FLOAT(-13.833984375))
EVT_CALL(TranslateModel, MODEL_o188, EVT_FLOAT(-10.943359375), EVT_FLOAT(391.1533203125), EVT_FLOAT(10.56640625))
EVT_CALL(TranslateModel, MODEL_o187, EVT_FLOAT(-7.001953125), EVT_FLOAT(456.1533203125), EVT_FLOAT(0.947265625))
EVT_CALL(TranslateModel, MODEL_o186, EVT_FLOAT(12.998046875), EVT_FLOAT(471.1533203125), EVT_FLOAT(0.947265625))
EVT_CALL(TranslateModel, MODEL_o185, EVT_FLOAT(-10.001953125), EVT_FLOAT(501.1533203125), EVT_FLOAT(0.947265625))
EVT_CALL(TranslateModel, MODEL_o182, EVT_FLOAT(8.0029296875), EVT_FLOAT(536.2294921875), EVT_FLOAT(0.947265625))
EVT_CALL(TranslateModel, MODEL_o183, EVT_FLOAT(12.998046875), EVT_FLOAT(586.1533203125), EVT_FLOAT(0.947265625))
EVT_CALL(TranslateModel, MODEL_o181, EVT_FLOAT(-13.001953125), EVT_FLOAT(631.1533203125), EVT_FLOAT(0.947265625))
EVT_SETF(LVar1, LVar0)
EVT_SUBF(LVar1, EVT_FLOAT(-700.0))
EVT_DIVF(LVar1, EVT_FLOAT(300.0))
EVT_SETF(LVar2, LVar1)
EVT_MULF(LVar2, EVT_FLOAT(100.0))
EVT_IF_GT(LVar2, 100)
EVT_SETF(LVar1, EVT_FLOAT(1.0))
EVT_END_IF
EVT_CALL(ScaleModel, MODEL_o117, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o141, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o140, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o138, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o139, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o143, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o144, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o145, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o146, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o188, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o187, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o186, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o185, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o182, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o183, LVar1, LVar1, LVar1)
EVT_CALL(ScaleModel, MODEL_o181, LVar1, LVar1, LVar1)
EVT_CALL(TranslateModel, MODEL_o117, EVT_FLOAT(-8.12109375), EVT_FLOAT(-56.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o141, EVT_FLOAT(6.87890625), EVT_FLOAT(-91.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o140, EVT_FLOAT(-13.12109375), EVT_FLOAT(-106.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o138, EVT_FLOAT(9.87890625), EVT_FLOAT(-136.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o139, EVT_FLOAT(7.87890625), EVT_FLOAT(-201.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o143, EVT_FLOAT(-13.12109375), EVT_FLOAT(-221.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o144, EVT_FLOAT(-8.1259765625), EVT_FLOAT(-261.228515625), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o145, EVT_FLOAT(12.87890625), EVT_FLOAT(-266.15234375), EVT_FLOAT(-1.1650390625))
EVT_CALL(TranslateModel, MODEL_o146, EVT_FLOAT(-8.12109375), EVT_FLOAT(-316.15234375), EVT_FLOAT(13.8349609375))
EVT_CALL(TranslateModel, MODEL_o188, EVT_FLOAT(10.9443359375), EVT_FLOAT(-391.15234375), EVT_FLOAT(-10.5654296875))
EVT_CALL(TranslateModel, MODEL_o187, EVT_FLOAT(7.0029296875), EVT_FLOAT(-456.15234375), EVT_FLOAT(-0.9462890625))
EVT_CALL(TranslateModel, MODEL_o186, EVT_FLOAT(-12.9970703125), EVT_FLOAT(-471.15234375), EVT_FLOAT(-0.9462890625))
EVT_CALL(TranslateModel, MODEL_o185, EVT_FLOAT(10.0029296875), EVT_FLOAT(-501.15234375), EVT_FLOAT(-0.9462890625))
EVT_CALL(TranslateModel, MODEL_o182, EVT_FLOAT(-8.001953125), EVT_FLOAT(-536.228515625), EVT_FLOAT(-0.9462890625))
EVT_CALL(TranslateModel, MODEL_o183, EVT_FLOAT(-12.9970703125), EVT_FLOAT(-586.15234375), EVT_FLOAT(-0.9462890625))
EVT_CALL(TranslateModel, MODEL_o181, EVT_FLOAT(13.0029296875), EVT_FLOAT(-631.15234375), EVT_FLOAT(-0.9462890625))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetInteriorVineGrowth) = {
EVT_SETF(LVar1, LVar0) // input: expect range from -700 (no growth) to 0 (fully grown)
EVT_SUBF(LVar1, EVT_FLOAT(-700.0))
EVT_DIVF(LVar1, EVT_FLOAT(100.0))
EVT_SETF(LVar2, LVar1)
EVT_MULF(LVar2, EVT_FLOAT(100.0))
EVT_IF_GT(LVar2, 100)
EVT_SETF(LVar1, EVT_FLOAT(1.0))
EVT_END_IF
EVT_CALL(ScaleGroup, MODEL_g37, LVar1, 1, LVar1)
EVT_CALL(TranslateGroup, MODEL_g37, 0, LVar0, 0)
EVT_SETF(LVar1, LVar0)
EVT_MULF(LVar1, EVT_FLOAT(-12.0))
EVT_CALL(RotateGroup, MODEL_g37, LVar1, 0, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetSproutGrowth) = {
EVT_CALL(TranslateModel, MODEL_o147, EVT_FLOAT(9.5), EVT_FLOAT(12.0), EVT_FLOAT(15.0))
EVT_CALL(TranslateModel, MODEL_o149, EVT_FLOAT(-9.5), EVT_FLOAT(12.0), EVT_FLOAT(15.0))
EVT_CALL(TranslateModel, MODEL_o148, EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(17.0))
EVT_SETF(LVar1, LVar0)
EVT_MULF(LVar1, EVT_FLOAT(90.0))
EVT_CALL(RotateModel, MODEL_o147, LVar1, 0, 0, -1)
EVT_CALL(RotateModel, MODEL_o149, LVar1, 0, 0, 1)
EVT_CALL(TranslateModel, MODEL_o147, EVT_FLOAT(-9.5), EVT_FLOAT(-12.0), EVT_FLOAT(-15.0))
EVT_CALL(TranslateModel, MODEL_o149, EVT_FLOAT(9.5), EVT_FLOAT(-12.0), EVT_FLOAT(-15.0))
EVT_CALL(TranslateModel, MODEL_o148, EVT_FLOAT(0.0), EVT_FLOAT(0.0), EVT_FLOAT(-17.0))
EVT_CALL(ScaleModel, MODEL_o147, LVar0, LVar0, LVar0)
EVT_CALL(ScaleModel, MODEL_o149, LVar0, LVar0, LVar0)
EVT_CALL(ScaleModel, MODEL_o148, LVar0, LVar0, LVar0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetBigLeafGrowth) = {
EVT_CALL(ScaleModel, MODEL_o142, LVar0, LVar0, LVar0)
EVT_SETF(LVar1, LVar0)
EVT_MULF(LVar1, EVT_FLOAT(90.0))
EVT_ADDF(LVar1, EVT_FLOAT(-90.0))
EVT_CALL(RotateModel, MODEL_o142, LVar1, 1, 0, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetBigLeafPosition) = {
EVT_SETF(LVar1, LVar0)
EVT_MULF(LVar1, EVT_FLOAT(-3.0))
EVT_CALL(TranslateModel, MODEL_o142, EVT_FLOAT(-0.26), LVar0, EVT_FLOAT(1.4775391))
EVT_CALL(RotateModel, MODEL_o142, LVar1, 0, 1, 0)
EVT_CALL(UpdateColliderTransform, COLLIDER_o240)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Exit_Beanstalk) = {
EVT_IF_EQ(AF_FLO_RidingBeanstalk, FALSE)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(InterruptUsePartner)
EVT_WAIT(15)
EVT_CALL(DisablePartnerAI, 0)
EVT_SET(AF_FLO_RidingBeanstalk, TRUE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o351, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET_VEC3(LVar9, EVT_FLOAT(-59.0), EVT_FLOAT(22.0), EVT_FLOAT(125.0)) // target player pos
EVT_SET_VEC3(LVarC, EVT_FLOAT(-55.0), EVT_FLOAT(24.0), EVT_FLOAT(145.0)) // target partner pos
EVT_CALL(PlayerMoveTo, LVar9, LVarB, 8)
EVT_CALL(SetNpcJumpscale, NPC_PARTNER, EVT_FLOAT(0.0))
EVT_CALL(NpcJump0, NPC_PARTNER, LVarC, LVarD, LVarE, 5)
EVT_CALL(PlaySound, SOUND_19C)
EVT_CALL(SetMusicTrack, 0, SONG_MAGIC_BEANSTALK, 1, 8)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_RUN)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_Walking)
EVT_CALL(N(GetPlayerAngles), LVar3, LVar4)
EVT_SWITCH(LVar4)
EVT_CASE_LT(90)
EVT_SET(AF_FLO_BeanstalkFacingRight, FALSE)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 90, 0)
EVT_CASE_GE(270)
EVT_SET(AF_FLO_BeanstalkFacingRight, TRUE)
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 270, 0)
EVT_END_SWITCH
EVT_CALL(TranslateModel, MODEL_o142, EVT_FLOAT(-0.26), EVT_FLOAT(2.0), EVT_FLOAT(1.4775391))
EVT_CALL(UpdateColliderTransform, COLLIDER_o240)
EVT_SET(MV_BeanstalkSceneSync, FALSE)
EVT_THREAD
EVT_SET(LVarF, 0)
EVT_LOOP(0)
EVT_ADD(LVarF, 1)
EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, 0, 700, 800, 0, 0)
EVT_EXEC(N(EVS_SetBigLeafPosition))
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(-3.0))
EVT_SETF(LVar3, LVar0)
EVT_CALL(N(PlayerRideBeanstalk))
EVT_CALL(N(PartnerRideBeanstalk))
EVT_IF_EQ(LVarF, 350)
EVT_SET(MV_BeanstalkSceneSync, TRUE)
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_LABEL(10)
EVT_IF_EQ(MV_BeanstalkSceneSync, FALSE)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(GotoMap, EVT_PTR("flo_19"), flo_19_ENTRY_3)
EVT_WAIT(100)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Enter_Beanstalk) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o351, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_SET(LVar9, EVT_FLOAT(-59.0))
EVT_SET(LVarA, EVT_FLOAT(22.0))
EVT_SET(LVarB, EVT_FLOAT(125.0))
EVT_SET(LVarC, EVT_FLOAT(-55.0))
EVT_SET(LVarD, EVT_FLOAT(23.0))
EVT_SET(LVarE, EVT_FLOAT(145.0))
EVT_THREAD
EVT_WAIT(5)
EVT_CALL(SetNpcAnimation, NPC_PARTNER, PARTNER_ANIM_RUN)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_Walking)
EVT_SWITCH(AF_FLO_BeanstalkFacingRight)
EVT_CASE_EQ(0)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 90, 0)
EVT_CASE_EQ(1)
EVT_CALL(InterpPlayerYaw, 270, 0)
EVT_CALL(InterpNpcYaw, NPC_PARTNER, 270, 0)
EVT_END_SWITCH
EVT_END_THREAD
EVT_CALL(TranslateModel, MODEL_o142, EVT_FLOAT(-0.26), EVT_FLOAT(2.0), EVT_FLOAT(1.4775391))
EVT_CALL(UpdateColliderTransform, COLLIDER_o240)
EVT_SET(LVarF, 0)
EVT_LOOP(120)
EVT_ADD(LVarF, 1)
EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, 70, 0, 120, 0, 0)
EVT_EXEC(N(EVS_SetBigLeafPosition))
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(-3.0))
EVT_SETF(LVar3, LVar0)
EVT_CALL(N(PlayerRideBeanstalk))
EVT_CALL(N(PartnerRideBeanstalk))
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(EnablePartnerAI)
EVT_CALL(ClearPartnerMoveHistory, NPC_PARTNER)
EVT_CALL(SetPlayerJumpscale, 1)
EVT_CALL(PlayerJump, 10, 0, 110, 20)
EVT_CALL(SetPlayerActionState, ACTION_STATE_LAND)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_WAIT(5)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o351, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(AF_FLO_RidingBeanstalk, FALSE)
EVT_CALL(StopSound, SOUND_19D)
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_BeanstalkGrowing) = {
EVT_CALL(PlaySoundAtCollider, COLLIDER_o261, SOUND_19B, 0)
EVT_SET(LVarF, 0)
EVT_LOOP(100)
EVT_ADD(LVarF, 1)
EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, 0, EVT_FLOAT(1.0), 100, 0, 0)
EVT_EXEC(N(EVS_SetSproutGrowth))
EVT_WAIT(1)
EVT_END_LOOP
EVT_SET(MV_BeanstalkSceneSync, FALSE)
EVT_THREAD
EVT_SET(LVarF, 0)
EVT_LOOP(1200)
EVT_ADD(LVarF, 1)
EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, -700, 0, 1200, 0, 0)
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(1.0))
EVT_SETF(LVar0, LVar2)
EVT_EXEC(N(EVS_SetExteriorVineGrowth))
EVT_SETF(LVar2, LVar0)
EVT_MULF(LVar2, EVT_FLOAT(1.0))
EVT_SETF(LVar0, LVar2)
EVT_EXEC(N(EVS_SetInteriorVineGrowth))
EVT_SWITCH(LVarF)
EVT_CASE_EQ(200)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_1002A)
EVT_CASE_EQ(250)
EVT_SET(LVar0, -60)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, 65)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(12.5), EVT_FLOAT(-7.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 800)
EVT_CALL(SetCamPosA, CAM_DEFAULT, -200, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -300)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CASE_DEFAULT
EVT_END_SWITCH
EVT_IF_GT(LVarF, 550)
EVT_SET(MV_BeanstalkSceneSync, TRUE)
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_END_THREAD
EVT_LABEL(10)
EVT_IF_EQ(MV_BeanstalkSceneSync, FALSE)
EVT_WAIT(1)
EVT_GOTO(10)
EVT_END_IF
EVT_CALL(FadeInMusic, 0, SONG_CLOUDY_CLIMB, 0, 3000, 0, 127)
EVT_CALL(FadeOutMusic, 1, 3000)
EVT_CALL(GotoMap, EVT_PTR("flo_19"), flo_19_ENTRY_2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_BeanstalkGrewRemark) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(InterpPlayerYaw, 200, 0)
EVT_CALL(SetPlayerPos, -60, 0, 30)
EVT_CALL(NpcFacePlayer, NPC_PARTNER, 1)
EVT_CALL(SetNpcPos, NPC_PARTNER, -20, 0, 10)
EVT_SET(LVar0, -60)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, 65)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(12.5), EVT_FLOAT(-7.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 800)
EVT_CALL(SetCamPosA, CAM_DEFAULT, -200, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -300)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_SET(LVarF, 0)
EVT_LOOP(5)
EVT_ADD(LVarF, 20)
EVT_CALL(N(CosInterpMinMax), LVarF, LVar0, EVT_FLOAT(0.0), EVT_FLOAT(1.0), 100, 0, 0)
EVT_EXEC(N(EVS_SetBigLeafGrowth))
EVT_WAIT(1)
EVT_END_LOOP
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o240, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_000A, 0, 50, -200)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
s32 N(BeanstalkIngredients)[] = {
ITEM_FERTILE_SOIL,
ITEM_MAGICAL_BEAN,
ITEM_MIRACLE_WATER,
ITEM_NONE
};
EvtScript N(EVS_BeanPatch_ItemPrompt) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(func_802D2884, -85, 85, 0)
EVT_CALL(func_802CF56C, 2)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_IF_EQ(GF_FLO00_PlacedFertileSoil, FALSE)
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_LABEL(10)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVar2, LVar0)
EVT_SWITCH(LVar2)
EVT_CASE_LE(ITEM_NONE)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_CALL(AwaitPlayerLeave, -85, 85, 28)
EVT_RETURN
EVT_CASE_EQ(ITEM_FERTILE_SOIL)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60006)
EVT_WAIT(5)
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(MakeItemEntity, ITEM_FERTILE_SOIL, BEANSTALK_BASE_X, 0, BEANSTALK_BASE_Z, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(MV_BeanstalkItemEntity, LVar0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_WAIT(20)
EVT_CASE_DEFAULT
EVT_SWITCH(AF_FLO_PlatingInstructionsToggle)
EVT_CASE_EQ(0)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0008, 0, 10, -200)
EVT_SET(AF_FLO_PlatingInstructionsToggle, TRUE)
EVT_CASE_DEFAULT
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0009, 0, 10, -200)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_IF_NE(LVar2, 89)
EVT_GOTO(10)
EVT_END_IF
EVT_SET(GF_FLO00_PlacedFertileSoil, TRUE)
EVT_END_IF
EVT_IF_EQ(GF_FLO00_PlacedMagicalBean, FALSE)
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_LABEL(20)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVar2, LVar0)
EVT_SWITCH(LVar2)
EVT_CASE_LE(ITEM_NONE)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_CALL(AwaitPlayerLeave, -85, 85, 28)
EVT_RETURN
EVT_CASE_EQ(ITEM_MAGICAL_BEAN)
EVT_CALL(RemoveItemEntity, MV_BeanstalkItemEntity)
EVT_WAIT(5)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60006)
EVT_WAIT(5)
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(MakeItemEntity, ITEM_MAGICAL_BEAN, BEANSTALK_BASE_X, 0, BEANSTALK_BASE_Z, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(MV_BeanstalkItemEntity, LVar0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_WAIT(20)
EVT_CASE_DEFAULT
EVT_SWITCH(AF_FLO_PlatingInstructionsToggle)
EVT_CASE_EQ(0)
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0008, 0, 10, -200)
EVT_SET(AF_FLO_PlatingInstructionsToggle, TRUE)
EVT_CASE_DEFAULT
EVT_CALL(ShowMessageAtWorldPos, MSG_CH6_0009, 0, 10, -200)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_IF_NE(LVar2, 88)
EVT_GOTO(20)
EVT_END_IF
EVT_SET(GF_FLO00_PlacedMagicalBean, TRUE)
EVT_END_IF
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_LABEL(30)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVar2, LVar0)
EVT_SWITCH(LVar2)
EVT_CASE_LE(ITEM_NONE)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_CALL(AwaitPlayerLeave, -85, 85, 28)
EVT_RETURN
EVT_CASE_EQ(ITEM_MIRACLE_WATER)
EVT_CALL(RemoveItemEntity, MV_BeanstalkItemEntity)
EVT_WAIT(5)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60006)
EVT_WAIT(5)
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(N(SyncStatusMenu))
EVT_CALL(MakeItemEntity, ITEM_MIRACLE_WATER, BEANSTALK_BASE_X, 0, BEANSTALK_BASE_Z, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(MV_BeanstalkItemEntity, LVar0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_WAIT(30)
EVT_CALL(RemoveItemEntity, MV_BeanstalkItemEntity)
EVT_WAIT(30)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(PlayerMoveTo, -60, 30, 20)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_o351, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(InterpPlayerYaw, 200, 0)
EVT_CALL(func_802CF56C, 2)
EVT_WAIT(60)
EVT_CALL(FadeInMusic, 1, SONG_MAGIC_BEANSTALK, 0, 3000, 0, 127)
EVT_CALL(FadeOutMusic, 0, 3000)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -85, 0, 75)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -85, 0, 75)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-6.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 250)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_EXEC_WAIT(N(EVS_Scene_BeanstalkGrowing))
EVT_END_SWITCH
EVT_IF_NE(LVar2, 90)
EVT_GOTO(30)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BeanPatch_TryInteract) = {
EVT_LABEL(0)
EVT_CALL(IsPlayerWithin, -85, 85, 20, LVar0)
EVT_IF_EQ(LVar0, 0)
EVT_RETURN
EVT_ELSE
EVT_CALL(IsPlayerOnValidFloor, LVar0)
EVT_IF_EQ(LVar0, FALSE)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar0)
EVT_IF_NE(LVar0, PARTNER_NONE)
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_CALL(N(DisableStatusMenu))
EVT_EXEC_WAIT(N(EVS_BeanPatch_ItemPrompt))
EVT_CALL(N(EnableStatusMenu))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupBeanPatch) = {
EVT_IF_LT(GB_StoryProgress, STORY_CH6_GREW_MAGIC_BEANSTALK)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_WISTERWOOD_GAVE_HINT)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_IF_EQ(GF_FLO00_PlacedFertileSoil, TRUE)
EVT_IF_EQ(GF_FLO00_PlacedMagicalBean, FALSE)
EVT_CALL(MakeItemEntity, ITEM_FERTILE_SOIL, BEANSTALK_BASE_X, 0, BEANSTALK_BASE_Z, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_ELSE
EVT_CALL(MakeItemEntity, ITEM_MAGICAL_BEAN, BEANSTALK_BASE_X, 0, BEANSTALK_BASE_Z, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_END_IF
EVT_SET(MV_BeanstalkItemEntity, LVar0)
EVT_END_IF
EVT_BIND_PADLOCK(EVT_PTR(N(EVS_BeanPatch_TryInteract)), TRIGGER_FORCE_ACTIVATE, 0, EVT_PTR(N(BeanstalkIngredients)), 0, 1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupBeanstalk) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_Exit_Beanstalk)), TRIGGER_FLOOR_TOUCH, COLLIDER_o240, 1, 0)
EVT_CALL(EnableGroup, MODEL_ha, TRUE)
EVT_CALL(EnableGroup, MODEL_tuta, TRUE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_EQ(STORY_CH6_WISTERWOOD_GAVE_HINT)
EVT_SET(LVar0, -700)
EVT_EXEC(N(EVS_SetExteriorVineGrowth))
EVT_EXEC(N(EVS_SetInteriorVineGrowth))
EVT_SET(LVar0, 0)
EVT_EXEC(N(EVS_SetSproutGrowth))
EVT_SET(LVar0, 0)
EVT_EXEC(N(EVS_SetBigLeafGrowth))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o240, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_CASE_GE(STORY_CH6_GREW_MAGIC_BEANSTALK)
EVT_SET(LVar0, 1)
EVT_EXEC(N(EVS_SetSproutGrowth))
EVT_SET(LVar0, 1)
EVT_EXEC(N(EVS_SetBigLeafGrowth))
EVT_CASE_DEFAULT
EVT_SET(LVar0, -700)
EVT_EXEC(N(EVS_SetExteriorVineGrowth))
EVT_EXEC(N(EVS_SetInteriorVineGrowth))
EVT_SET(LVar0, 0)
EVT_EXEC(N(EVS_SetSproutGrowth))
EVT_SET(LVar0, 0)
EVT_EXEC(N(EVS_SetBigLeafGrowth))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o240, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o261, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,10 @@
#include "flo_00.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_IF_LT(GB_StoryProgress, STORY_EPILOGUE)
EVT_CALL(MakeEntity, EVT_PTR(Entity_SavePoint), 110, 60, -100, 0, MAKE_ENTITY_END)
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -1,7 +0,0 @@
#include "flo_03.h"
#include "effects.h"
ApiStatus N(func_80240000_CA72A0)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(1, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,45 @@
/// @brief Flower Fields - (East) Petunia's Field
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_03_shape.h"
#include "mapfs/flo_03_hit.h"
#include "sprite/npc/Petunia.h"
#include "sprite/npc/MontyMole.h"
#include "sprite/npc/Dayzee.h"
enum {
NPC_Petunia = 0,
NPC_Dayzee = 1,
NPC_MontyMole_01 = 2,
NPC_MontyMole_02 = 3,
NPC_MontyMole_03 = 4,
NPC_MontyMole_04 = 5,
};
enum {
MV_NextBurrowTime_Mole_01 = MapVar(10),
MV_NextBurrowTime_Mole_02 = MapVar(11),
MV_NextBurrowTime_Mole_03 = MapVar(12),
MV_NextBurrowTime_Mole_04 = MapVar(13),
MV_PauseBurrowing = MapVar(14),
MV_NextBurrowTriggerRadius = MapVar(15),
};
#define NAMESPACE flo_03
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240000_CA72A0)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240158_CA73F8)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240460_CA7700)(Evt* script, s32 isInitialCall);
extern EvtScript N(EVS_Main);
extern NpcGroupList N(DefaultNPCs);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_PushFlowerSong);
extern EvtScript N(EVS_PopSong);
extern EvtScript N(EVS_SetupFoliage);
extern EvtScript N(EVS_MakeEntities);
extern NpcGroupList N(npcGroupList_8024442C);
extern EvtScript N(80240FFC);
extern EvtScript N(80241EF4);
extern EvtScript N(80244E54);
extern EvtScript N(80244ED0);
extern EvtScript N(main);
extern EvtScript N(makeEntities);
extern EvtScript N(EVS_Scene_SunReturns);
extern EvtScript N(EVS_SetupMoles);
extern EvtScript N(EVS_EmptyEntityHandler);

View File

@ -0,0 +1,15 @@
#include "flo_03.h"
EntryList N(Entrances) = {
[flo_03_ENTRY_0] { -325.0, 0.0, 0.0, 90.0 },
[flo_03_ENTRY_1] { 325.0, 0.0, 0.0, 270.0 },
[flo_03_ENTRY_2] { -325.0, 0.0, 0.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_03 },
};

View File

@ -0,0 +1,45 @@
#include "flo_03.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_03_ENTRY_2)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LE(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_DefeatedAll_MontyMoles, FALSE)
EVT_CALL(SetMusicTrack, 0, SONG_MONTY_MOLE_ASSAULT, 0, 8)
EVT_ELSE
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PushFlowerSong) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_DefeatedAll_MontyMoles, TRUE)
EVT_CALL(PushSong, SONG_FLOWER_NPC_THEME, 0)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PopSong) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_DefeatedAll_MontyMoles, TRUE)
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,51 @@
#include "flo_03.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_09_1) = EVT_EXIT_WALK(60, flo_03_ENTRY_0, "flo_09", flo_09_ENTRY_1);
EvtScript N(EVS_ExitWalk_flo_22_0) = EVT_EXIT_WALK(60, flo_03_ENTRY_1, "flo_22", flo_22_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_09_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_22_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_SET(AF_FLO_TreeDrop_RedBerry1, FALSE)
EVT_SET(AF_FLO_TreeDrop_RedBerry2, FALSE)
EVT_SET(AB_FLO_PetuniaDialogue, 0)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC_WAIT(N(EVS_SetupMoles))
EVT_EXEC(N(EVS_SetupFoliage))
EVT_EXEC(N(EVS_EmptyEntityHandler))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o160, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( -145, -335, 182, -180, 0)
EVT_FLOWER_SPAWN_REGION( 200, -170, 310, 150, 0)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_03_ENTRY_2)
EVT_EXEC(N(EVS_Scene_SunReturns))
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,980 @@
#include "flo_03.h"
NpcSettings N(NpcSettings_Dayzee) = {
.height = 24,
.radius = 24,
.level = 99,
};
NpcSettings N(NpcSettings_Petunia) = {
.height = 56,
.radius = 40,
.level = 99,
};
#include "world/common/complete/GiveReward.inc.c"
Vec3i N(BurrowLocations_Mole_01)[] = {
{ -100, 0, 210 },
{ -160, 0, 285 },
{ -35, 0, 305 },
};
Vec3i N(BurrowLocations_Mole_02)[] = {
{ -190, 0, 80 },
{ -130, 0, 0 },
{ -70, 0, -60 },
};
Vec3i N(BurrowLocations_Mole_03)[] = {
{ 75, 0, -15 },
{ 35, 0, -100 },
{ 130, 0, 0 },
};
Vec3i N(BurrowLocations_Mole_04)[] = {
{ 115, 0, 180 },
{ 85, 0, 290 },
{ 145, 0, 140 },
};
EvtScript N(EVS_Scene_SunReturns) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetNpcYaw, NPC_Petunia, 90)
EVT_CALL(GetNpcPos, NPC_Petunia, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.5))
EVT_CALL(SetCamPosA, CAM_DEFAULT, -27, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Petunia, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_00C8)
EVT_CALL(SetNpcAnimation, NPC_Petunia, ANIM_Petunia_Dance)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_18"), flo_18_ENTRY_1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
API_CALLABLE(N(HideBehindTree)) {
Enemy* enemy = script->owner1.enemy;
Npc* npc = get_npc_unsafe(enemy->npcID);
f32 posX, posZ, yaw, angle;
f64 dist;
// get a point 46 units away from the tree on the side opposite the player
yaw = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) + 180.0f);
posX = -210.0f;
posZ = -183.0f;
add_vec2D_polar(&posX, &posZ, 46.0f, yaw);
// run or walk to target position, based on the distance from current position
dist = dist2D(npc->pos.x, npc->pos.z, posX, posZ);
if (dist > 2.0) {
f32 curAngle = clamp_angle(atan2(-210.0f, -183.0f, npc->pos.x, npc->pos.z));
f32 targetAngle = clamp_angle(atan2(-210.0f, -183.0f, posX, posZ));
f32 deltaAngle = curAngle - targetAngle;
if (abs(deltaAngle) > 20) {
angle = deltaAngle;
if (angle >= 180.0f) {
angle -= 360.0f;
}
if (angle <= -180.0f) {
angle += 360.0f;
}
if (deltaAngle == angle) {
posX = -210.0f;
posZ = -183.0f;
if (deltaAngle >= 0.0f) {
yaw = clamp_angle(curAngle - 20.0f);
} else {
yaw = clamp_angle(curAngle + 20.0f);
}
add_vec2D_polar(&posX, &posZ, 46.0f, yaw);
}
}
npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN];
npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ);
npc_move_heading(npc, 2.0f, npc->yaw);
} else if (dist > 0.2) {
npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ);
npc->pos.x = posX;
npc->pos.z = posZ;
npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK];
} else {
npc->pos.x = posX;
npc->pos.z = posZ;
npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE];
}
return ApiStatus_BLOCK;
}
EvtScript N(EVS_NpcAI_Dayzee) = {
EVT_CALL(N(HideBehindTree))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Dayzee) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_SET(GF_FLO03_Defeated_Dayzee, TRUE)
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_FocusCamBetween) = {
EVT_CALL(GetPlayerPos, LVar3, LVar1, LVar2)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, LVar3)
EVT_DIV(LVar0, 2)
EVT_CALL(SetCamProperties, CAM_DEFAULT, LVar4, LVar0, LVar1, LVar2, 300, EVT_FLOAT(20.0), EVT_FLOAT(-9.5))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Petunia) = {
EVT_EXEC_WAIT(N(EVS_PushFlowerSong))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_SET(MV_PauseBurrowing, TRUE)
EVT_SET(LVar4, EVT_FLOAT(3.5))
EVT_EXEC_WAIT(N(EVS_FocusCamBetween))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0050)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Petunia_Angry)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_NodYes)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0051)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim12)
EVT_CALL(SetNpcYaw, NPC_MontyMole_01, 270)
EVT_CALL(GetNpcPos, NPC_MontyMole_01, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-8.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 200)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_01, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim16)
EVT_WAIT(10)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_01, SOUND_263, 0)
EVT_CALL(ShowEmote, NPC_MontyMole_01, EMOTE_QUESTION, -45, 30, TRUE, 0, 0, 0, 0)
EVT_CALL(GetNpcPos, NPC_MontyMole_02, LVar0, LVar1, LVar2)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0052)
EVT_CALL(SetNpcYaw, NPC_MontyMole_02, 90)
EVT_CALL(SetNpcPos, NPC_MontyMole_02, NPC_DISPOSE_LOCATION)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 200)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-8.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim00)
EVT_WAIT(20)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_02, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcPos, NPC_MontyMole_02, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim10)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0053)
EVT_CALL(SetNpcYaw, NPC_MontyMole_03, 270)
EVT_CALL(GetNpcPos, NPC_MontyMole_03, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 200)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-8.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_03, ANIM_MontyMole_Dark_Anim14)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0054)
EVT_CALL(SetNpcYaw, NPC_MontyMole_04, 270)
EVT_CALL(GetNpcPos, NPC_MontyMole_04, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 200)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim06)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim07)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim08)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim16)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0055)
EVT_CALL(SetNpcPos, NPC_Dayzee, -233, 0, -217)
EVT_CALL(GetNpcPos, NPC_Dayzee, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetNpcAnimation, NPC_Dayzee, ANIM_Dayzee_Anim0D)
EVT_CALL(PlaySoundAtNpc, NPC_Dayzee, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_Dayzee, EMOTE_EXCLAMATION, 45, 30, TRUE, 0, 0, 0, 0)
EVT_WAIT(15)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0056)
EVT_SET(LVar4, EVT_FLOAT(90.0))
EVT_EXEC_WAIT(N(EVS_FocusCamBetween))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0057)
EVT_CALL(SetEnemyFlagBits, NPC_Dayzee, ENEMY_FLAGS_1, 0)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_01, ENEMY_FLAGS_1, 0)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_02, ENEMY_FLAGS_1, 0)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_03, ENEMY_FLAGS_1, 0)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_04, ENEMY_FLAGS_1, 0)
EVT_CALL(BindNpcAI, NPC_Dayzee, EVT_PTR(N(EVS_NpcAI_Dayzee)))
EVT_SET(MV_PauseBurrowing, FALSE)
EVT_SET(MV_NextBurrowTriggerRadius, 60)
EVT_SET(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CASE_EQ(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_DefeatedAll_MontyMoles, FALSE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0, MSG_CH6_0058)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Petunia_Angry)
EVT_ELSE
EVT_SET(LVar4, EVT_FLOAT(3.5))
EVT_EXEC_WAIT(N(EVS_FocusCamBetween))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_HappyTalk, ANIM_Petunia_Dance, 0, MSG_CH6_0059)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Petunia_GiveItem)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Petunia_Idle)
EVT_GIVE_KEY_REWARD(ITEM_MAGICAL_BEAN)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_005A)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Petunia_AngryTalk, ANIM_Petunia_Angry, 0)
EVT_SET(GB_StoryProgress, STORY_CH6_GOT_MAGICAL_BEAN)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_005B)
EVT_CASE_LT(STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_005C)
EVT_CASE_DEFAULT
EVT_IF_EQ(AB_FLO_PetuniaDialogue, 0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_005D)
EVT_SET(AB_FLO_PetuniaDialogue, 1)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Petunia_Talk, ANIM_Petunia_Idle, 0, MSG_CH6_005E)
EVT_END_IF
EVT_END_SWITCH
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(8.0))
EVT_EXEC_WAIT(N(EVS_PopSong))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Petunia) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Petunia)))
EVT_IF_EQ(GF_FLO03_DefeatedAll_MontyMoles, FALSE)
EVT_CALL(SetNpcAnimation, NPC_Petunia, ANIM_Petunia_Angry)
EVT_ELSE
EVT_CALL(SetNpcAnimation, NPC_Petunia, ANIM_Petunia_Idle)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Dayzee) = {
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Dayzee)))
EVT_CALL(EnableNpcShadow, NPC_Dayzee, FALSE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(SetNpcPos, NPC_Dayzee, NPC_DISPOSE_LOCATION)
EVT_CASE_DEFAULT
EVT_IF_EQ(GF_FLO03_Defeated_Dayzee, FALSE)
EVT_CALL(SetEnemyFlagBits, NPC_Dayzee, ENEMY_FLAGS_1, 0)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcAI_Dayzee)))
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_Dayzee, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupMoles) = {
EVT_SET(MV_PauseBurrowing, FALSE)
EVT_SET(MV_NextBurrowTime_Mole_01, 0)
EVT_SET(MV_NextBurrowTime_Mole_02, 0)
EVT_SET(MV_NextBurrowTime_Mole_03, 0)
EVT_SET(MV_NextBurrowTime_Mole_04, 0)
EVT_SET(MV_NextBurrowTriggerRadius, 100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_MontyMole) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
// record defeat
EVT_CALL(GetSelfNpcID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(NPC_MontyMole_01)
EVT_SET(GF_FLO03_Defeated_MontyMoleA, TRUE)
EVT_CASE_EQ(NPC_MontyMole_02)
EVT_SET(GF_FLO03_Defeated_MontyMoleB, TRUE)
EVT_CASE_EQ(NPC_MontyMole_03)
EVT_SET(GF_FLO03_Defeated_MontyMoleC, TRUE)
EVT_CASE_EQ(NPC_MontyMole_04)
EVT_SET(GF_FLO03_Defeated_MontyMoleD, TRUE)
EVT_END_SWITCH
// count number of defeated moles
EVT_SET(LVar0, 0)
EVT_ADD(LVar0, GF_FLO03_Defeated_MontyMoleA)
EVT_ADD(LVar0, GF_FLO03_Defeated_MontyMoleB)
EVT_ADD(LVar0, GF_FLO03_Defeated_MontyMoleC)
EVT_ADD(LVar0, GF_FLO03_Defeated_MontyMoleD)
// end the mole-hunting minigame if all 4 are defeated
EVT_IF_NE(LVar0, 4)
EVT_CALL(SetNpcAnimation, NPC_Petunia, ANIM_Petunia_Angry)
EVT_ELSE
EVT_CALL(SetNpcAnimation, NPC_Petunia, ANIM_Petunia_Idle)
EVT_SET(GF_FLO03_DefeatedAll_MontyMoles, TRUE)
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_END_IF
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Dark_Anim01)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Dark_Anim01)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcHit_MontyMole) = {
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(GetOwnerEncounterTrigger, LVar0)
EVT_IF_NE(LVar0, ENCOUNTER_TRIGGER_NONE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_MontyMole_Dark_Anim05)
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_MontyMole_01) = {
#define LV_ShouldBurrow LVar3
EVT_LOOP(0)
EVT_IF_EQ(MV_NextBurrowTime_Mole_01, 0)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_01, TRUE)
EVT_GOTO(0)
EVT_END_IF
EVT_SET(LV_ShouldBurrow, TRUE)
EVT_ELSE
EVT_LABEL(0)
EVT_CALL(GetNpcPos, NPC_MontyMole_01, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LVar3, FALSE)
EVT_END_IF
EVT_IF_EQ(MV_PauseBurrowing, TRUE)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(LV_ShouldBurrow, TRUE)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_01, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_01, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_01, 1)
EVT_WAIT(1)
EVT_SET(AF_FLO_IsUnderground_Mole_01, TRUE)
EVT_IF_NE(MV_NextBurrowTime_Mole_01, 0)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_SET(LVar1, 4)
EVT_ELSE
EVT_SET(LVar1, 10)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_01, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_MontyMole_01, EMOTE_EXCLAMATION, 0, LVar1, TRUE, 0, 0, 0, 0)
EVT_WAIT(LVar1)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 1)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_01, SOUND_BURROW_DIG, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim11)
EVT_WAIT(20)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleA, FALSE)
EVT_CALL(SetNpcPos, NPC_MontyMole_01, 0, -50, 0)
EVT_END_IF
EVT_WAIT(45)
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_01, TRUE)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleA, FALSE)
EVT_CALL(RandInt, ARRAY_COUNT(N(BurrowLocations_Mole_01)) - 1, LVar0)
EVT_ADD(LVar0, 1)
EVT_USE_BUF(EVT_PTR(N(BurrowLocations_Mole_01)))
EVT_LOOP(LVar0)
EVT_BUF_READ3(LVar1, LVar2, LVar3)
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_MontyMole_01, LVar1, LVar2, LVar3)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_01, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_SET(AF_FLO_IsUnderground_Mole_01, FALSE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_01, 1)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_01, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim10)
EVT_WAIT(10)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 0)
EVT_CALL(RandInt, 30, LVar0)
EVT_ADD(LVar0, 60)
EVT_SET(MV_NextBurrowTime_Mole_01, LVar0)
EVT_ELSE
EVT_IF_GT(MV_NextBurrowTime_Mole_01, 0)
EVT_SUB(MV_NextBurrowTime_Mole_01, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_MontyMole_02) = {
#define LV_ShouldBurrow LVar3
EVT_LOOP(0)
EVT_IF_EQ(MV_NextBurrowTime_Mole_02, 0)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_02, TRUE)
EVT_GOTO(0)
EVT_END_IF
EVT_SET(LV_ShouldBurrow, TRUE)
EVT_ELSE
EVT_LABEL(0)
EVT_CALL(GetNpcPos, NPC_MontyMole_02, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(MV_PauseBurrowing, TRUE)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(LV_ShouldBurrow, TRUE)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_02, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_02, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_02, 1)
EVT_WAIT(1)
EVT_SET(AF_FLO_IsUnderground_Mole_02, TRUE)
EVT_IF_NE(MV_NextBurrowTime_Mole_02, 0)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_SET(LVar1, 4)
EVT_ELSE
EVT_SET(LVar1, 10)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_02, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_MontyMole_02, EMOTE_EXCLAMATION, 0, LVar1, TRUE, 0, 0, 0, 0)
EVT_WAIT(LVar1)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 1)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_02, SOUND_BURROW_DIG, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim11)
EVT_WAIT(20)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleB, FALSE)
EVT_CALL(SetNpcPos, NPC_MontyMole_02, 0, -50, 0)
EVT_END_IF
EVT_WAIT(45)
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_02, TRUE)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleB, FALSE)
EVT_CALL(RandInt, ARRAY_COUNT(N(BurrowLocations_Mole_02)) - 1, LVar0)
EVT_ADD(LVar0, 1)
EVT_USE_BUF(EVT_PTR(N(BurrowLocations_Mole_02)))
EVT_LOOP(LVar0)
EVT_BUF_READ3(LVar1, LVar2, LVar3)
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_MontyMole_02, LVar1, LVar2, LVar3)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_02, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_SET(AF_FLO_IsUnderground_Mole_02, FALSE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_02, 1)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_02, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim10)
EVT_WAIT(10)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 0)
EVT_CALL(RandInt, 35, LVar0)
EVT_ADD(LVar0, 55)
EVT_SET(MV_NextBurrowTime_Mole_02, LVar0)
EVT_ELSE
EVT_IF_GT(MV_NextBurrowTime_Mole_02, 0)
EVT_SUB(MV_NextBurrowTime_Mole_02, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_MontyMole_03) = {
#define LV_ShouldBurrow LVar3
EVT_LOOP(0)
EVT_IF_EQ(MV_NextBurrowTime_Mole_03, 0)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_03, TRUE)
EVT_GOTO(0)
EVT_END_IF
EVT_SET(LV_ShouldBurrow, TRUE)
EVT_ELSE
EVT_LABEL(0)
EVT_CALL(GetNpcPos, NPC_MontyMole_03, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(MV_PauseBurrowing, TRUE)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(LV_ShouldBurrow, TRUE)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_03, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_03, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_03, 1)
EVT_WAIT(1)
EVT_SET(AF_FLO_IsUnderground_Mole_03, TRUE)
EVT_IF_NE(MV_NextBurrowTime_Mole_03, 0)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_SET(LVar1, 4)
EVT_ELSE
EVT_SET(LVar1, 10)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_03, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_MontyMole_03, EMOTE_EXCLAMATION, 0, LVar1, TRUE, 0, 0, 0, 0)
EVT_WAIT(LVar1)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 1)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_03, SOUND_BURROW_DIG, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_03, ANIM_MontyMole_Dark_Anim11)
EVT_WAIT(20)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleC, FALSE)
EVT_CALL(SetNpcPos, NPC_MontyMole_03, 0, -50, 0)
EVT_END_IF
EVT_WAIT(45)
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_03, TRUE)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleC, FALSE)
EVT_CALL(RandInt, ARRAY_COUNT(N(BurrowLocations_Mole_03)) - 1, LVar0)
EVT_ADD(LVar0, 1)
EVT_USE_BUF(EVT_PTR(N(BurrowLocations_Mole_03)))
EVT_LOOP(LVar0)
EVT_BUF_READ3(LVar1, LVar2, LVar3)
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_MontyMole_03, LVar1, LVar2, LVar3)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_03, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_SET(AF_FLO_IsUnderground_Mole_03, FALSE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_03, 1)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_03, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_03, ANIM_MontyMole_Dark_Anim10)
EVT_WAIT(10)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 0)
EVT_CALL(RandInt, 40, LVar0)
EVT_ADD(LVar0, 50)
EVT_SET(MV_NextBurrowTime_Mole_03, LVar0)
EVT_ELSE
EVT_IF_GT(MV_NextBurrowTime_Mole_03, 0)
EVT_SUB(MV_NextBurrowTime_Mole_03, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_MontyMole_04) = {
#define LV_ShouldBurrow LVar3
EVT_LOOP(0)
EVT_IF_EQ(MV_NextBurrowTime_Mole_04, 0)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_04, TRUE)
EVT_GOTO(0)
EVT_END_IF
EVT_SET(LV_ShouldBurrow, TRUE)
EVT_ELSE
EVT_LABEL(0)
EVT_CALL(GetNpcPos, NPC_MontyMole_04, LVar0, LVar1, LVar2)
EVT_CALL(IsPlayerWithin, LVar0, LVar2, MV_NextBurrowTriggerRadius, LV_ShouldBurrow)
EVT_END_IF
EVT_CALL(GetCurrentPartner, LVar9)
EVT_IF_EQ(LVar9, PARTNER_BOW)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(MV_PauseBurrowing, TRUE)
EVT_SET(LV_ShouldBurrow, FALSE)
EVT_END_IF
EVT_IF_EQ(LV_ShouldBurrow, TRUE)
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_04, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_04, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_04, 1)
EVT_WAIT(1)
EVT_SET(AF_FLO_IsUnderground_Mole_04, TRUE)
EVT_IF_NE(MV_NextBurrowTime_Mole_04, 0)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_SET(LVar1, 4)
EVT_ELSE
EVT_SET(LVar1, 10)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_04, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_MontyMole_04, EMOTE_EXCLAMATION, 0, LVar1, TRUE, 0, 0, 0, 0)
EVT_WAIT(LVar1)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 1)
EVT_END_IF
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_04, SOUND_BURROW_DIG, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim11)
EVT_WAIT(20)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleD, FALSE)
EVT_CALL(SetNpcPos, NPC_MontyMole_04, 0, -50, 0)
EVT_END_IF
EVT_WAIT(45)
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(AF_FLO_IsUnderground_Mole_04, TRUE)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleD, FALSE)
EVT_CALL(RandInt, ARRAY_COUNT(N(BurrowLocations_Mole_04)) - 1, LVar0)
EVT_ADD(LVar0, 1)
EVT_USE_BUF(EVT_PTR(N(BurrowLocations_Mole_04)))
EVT_LOOP(LVar0)
EVT_BUF_READ3(LVar1, LVar2, LVar3)
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_MontyMole_04, LVar1, LVar2, LVar3)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_MontyMole_04, NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_40 | NPC_FLAG_8000, TRUE)
EVT_SET(AF_FLO_IsUnderground_Mole_04, FALSE)
EVT_CALL(NpcFacePlayer, NPC_MontyMole_04, 1)
EVT_WAIT(1)
EVT_CALL(PlaySoundAtNpc, NPC_MontyMole_04, SOUND_BURROW_SURFACE, 0)
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim10)
EVT_WAIT(10)
EVT_CALL(SetSelfEnemyFlagBits, ENEMY_FLAGS_100000 | ENEMY_FLAGS_IGNORE_TOUCH | ENEMY_FLAGS_IGNORE_JUMP | ENEMY_FLAGS_IGNORE_HAMMER | ENEMY_FLAGS_10000000, 0)
EVT_CALL(RandInt, 45, LVar0)
EVT_ADD(LVar0, 45)
EVT_SET(MV_NextBurrowTime_Mole_04, LVar0)
EVT_ELSE
EVT_IF_GT(MV_NextBurrowTime_Mole_04, 0)
EVT_SUB(MV_NextBurrowTime_Mole_04, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_MontyMole_01) = {
EVT_CALL(BindNpcHit, NPC_SELF, EVT_PTR(N(EVS_NpcHit_MontyMole)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_MontyMole)))
EVT_CALL(EnableNpcShadow, NPC_MontyMole_01, FALSE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_01)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim10)
EVT_CASE_EQ(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleA, FALSE)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_01)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_01, ANIM_MontyMole_Dark_Anim10)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_01, ENEMY_FLAGS_1, 0)
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_MontyMole_01, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_CASE_DEFAULT
EVT_CALL(SetNpcPos, NPC_MontyMole_01, NPC_DISPOSE_LOCATION)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_MontyMole_02) = {
EVT_CALL(BindNpcHit, NPC_SELF, EVT_PTR(N(EVS_NpcHit_MontyMole)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_MontyMole)))
EVT_CALL(EnableNpcShadow, NPC_MontyMole_02, FALSE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_02)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim10)
EVT_CASE_EQ(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleB, FALSE)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_02)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_02, ANIM_MontyMole_Dark_Anim10)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_02, ENEMY_FLAGS_1, 0)
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_MontyMole_02, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_CASE_DEFAULT
EVT_CALL(SetNpcPos, NPC_MontyMole_02, NPC_DISPOSE_LOCATION)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_MontyMole_03) = {
EVT_CALL(BindNpcHit, NPC_SELF, EVT_PTR(N(EVS_NpcHit_MontyMole)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_MontyMole)))
EVT_CALL(EnableNpcShadow, NPC_MontyMole_03, FALSE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_03)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_03, ANIM_MontyMole_Dark_Anim10)
EVT_CASE_EQ(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleC, FALSE)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_03)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_03, ANIM_MontyMole_Dark_Anim10)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_03, ENEMY_FLAGS_1, 0)
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_MontyMole_03, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_CASE_DEFAULT
EVT_CALL(SetNpcPos, NPC_MontyMole_03, NPC_DISPOSE_LOCATION)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_MontyMole_04) = {
EVT_CALL(BindNpcHit, NPC_SELF, EVT_PTR(N(EVS_NpcHit_MontyMole)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_MontyMole)))
EVT_CALL(EnableNpcShadow, NPC_MontyMole_04, FALSE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_04)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim10)
EVT_CASE_EQ(STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES)
EVT_IF_EQ(GF_FLO03_Defeated_MontyMoleD, FALSE)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_MontyMole_04)))
EVT_CALL(SetNpcAnimation, NPC_MontyMole_04, ANIM_MontyMole_Dark_Anim10)
EVT_CALL(SetEnemyFlagBits, NPC_MontyMole_04, ENEMY_FLAGS_1, 0)
EVT_ELSE
EVT_CALL(SetNpcPos, NPC_MontyMole_04, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_CASE_DEFAULT
EVT_CALL(SetNpcPos, NPC_MontyMole_04, NPC_DISPOSE_LOCATION)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Petunia) = {
.id = NPC_Petunia,
.settings = &N(NpcSettings_Petunia),
.pos = { -30.0f, 0.0f, 100.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Petunia),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_Petunia_Idle,
.walk = ANIM_Petunia_Idle,
.run = ANIM_Petunia_Idle,
.chase = ANIM_Petunia_Idle,
.anim_4 = ANIM_Petunia_Idle,
.anim_5 = ANIM_Petunia_Idle,
.death = ANIM_Petunia_Idle,
.hit = ANIM_Petunia_Idle,
.anim_8 = ANIM_Petunia_Idle,
.anim_9 = ANIM_Petunia_Idle,
.anim_A = ANIM_Petunia_Idle,
.anim_B = ANIM_Petunia_Idle,
.anim_C = ANIM_Petunia_Idle,
.anim_D = ANIM_Petunia_Idle,
.anim_E = ANIM_Petunia_Idle,
.anim_F = ANIM_Petunia_Idle,
},
.tattle = MSG_NpcTattle_Petunia,
};
StaticNpc N(NpcData_Dayzee) = {
.id = NPC_Dayzee,
.settings = &N(NpcSettings_Dayzee),
.pos = { -233.0f, 0.0f, -217.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Dayzee),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_Dayzee_Anim01,
.walk = ANIM_Dayzee_Anim02,
.run = ANIM_Dayzee_Anim03,
.chase = ANIM_Dayzee_Anim03,
.anim_4 = ANIM_Dayzee_Anim01,
.anim_5 = ANIM_Dayzee_Anim01,
.death = ANIM_Dayzee_Anim08,
.hit = ANIM_Dayzee_Anim08,
.anim_8 = ANIM_Dayzee_Anim06,
.anim_9 = ANIM_Dayzee_Anim07,
.anim_A = ANIM_Dayzee_Anim01,
.anim_B = ANIM_Dayzee_Anim01,
.anim_C = ANIM_Dayzee_Anim01,
.anim_D = ANIM_Dayzee_Anim01,
.anim_E = ANIM_Dayzee_Anim01,
.anim_F = ANIM_Dayzee_Anim01,
},
};
StaticNpc N(NpcData_MontyMole_01) = {
.id = NPC_MontyMole_01,
.settings = &N(NpcSettings_Dayzee),
.pos = { -100.0f, 0.0f, 210.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_MontyMole_01),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_MontyMole_Dark_Anim01,
.walk = ANIM_MontyMole_Dark_Anim02,
.run = ANIM_MontyMole_Dark_Anim03,
.chase = ANIM_MontyMole_Dark_Anim03,
.anim_4 = ANIM_MontyMole_Dark_Anim01,
.anim_5 = ANIM_MontyMole_Dark_Anim01,
.death = ANIM_MontyMole_Dark_Anim05,
.hit = ANIM_MontyMole_Dark_Anim05,
.anim_8 = ANIM_MontyMole_Dark_Anim00,
.anim_9 = ANIM_MontyMole_Dark_Anim00,
.anim_A = ANIM_MontyMole_Dark_Anim00,
.anim_B = ANIM_MontyMole_Dark_Anim00,
.anim_C = ANIM_MontyMole_Dark_Anim00,
.anim_D = ANIM_MontyMole_Dark_Anim00,
.anim_E = ANIM_MontyMole_Dark_Anim00,
.anim_F = ANIM_MontyMole_Dark_Anim00,
},
};
StaticNpc N(NpcData_MontyMole_02) = {
.id = NPC_MontyMole_02,
.settings = &N(NpcSettings_Dayzee),
.pos = { -130.0f, 0.0f, 0.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_MontyMole_02),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_MontyMole_Dark_Anim01,
.walk = ANIM_MontyMole_Dark_Anim02,
.run = ANIM_MontyMole_Dark_Anim03,
.chase = ANIM_MontyMole_Dark_Anim03,
.anim_4 = ANIM_MontyMole_Dark_Anim01,
.anim_5 = ANIM_MontyMole_Dark_Anim01,
.death = ANIM_MontyMole_Dark_Anim05,
.hit = ANIM_MontyMole_Dark_Anim05,
.anim_8 = ANIM_MontyMole_Dark_Anim00,
.anim_9 = ANIM_MontyMole_Dark_Anim00,
.anim_A = ANIM_MontyMole_Dark_Anim00,
.anim_B = ANIM_MontyMole_Dark_Anim00,
.anim_C = ANIM_MontyMole_Dark_Anim00,
.anim_D = ANIM_MontyMole_Dark_Anim00,
.anim_E = ANIM_MontyMole_Dark_Anim00,
.anim_F = ANIM_MontyMole_Dark_Anim00,
},
};
StaticNpc N(NpcData_MontyMole_03) = {
.id = NPC_MontyMole_03,
.settings = &N(NpcSettings_Dayzee),
.pos = { 75.0f, 0.0f, 20.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_MontyMole_03),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_MontyMole_Dark_Anim01,
.walk = ANIM_MontyMole_Dark_Anim02,
.run = ANIM_MontyMole_Dark_Anim03,
.chase = ANIM_MontyMole_Dark_Anim03,
.anim_4 = ANIM_MontyMole_Dark_Anim01,
.anim_5 = ANIM_MontyMole_Dark_Anim01,
.death = ANIM_MontyMole_Dark_Anim05,
.hit = ANIM_MontyMole_Dark_Anim05,
.anim_8 = ANIM_MontyMole_Dark_Anim00,
.anim_9 = ANIM_MontyMole_Dark_Anim00,
.anim_A = ANIM_MontyMole_Dark_Anim00,
.anim_B = ANIM_MontyMole_Dark_Anim00,
.anim_C = ANIM_MontyMole_Dark_Anim00,
.anim_D = ANIM_MontyMole_Dark_Anim00,
.anim_E = ANIM_MontyMole_Dark_Anim00,
.anim_F = ANIM_MontyMole_Dark_Anim00,
},
};
StaticNpc N(NpcData_MontyMole_04) = {
.id = NPC_MontyMole_04,
.settings = &N(NpcSettings_Dayzee),
.pos = { 71.0f, 0.0f, 200.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_GRAVITY | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_MontyMole_04),
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
.idle = ANIM_MontyMole_Dark_Anim01,
.walk = ANIM_MontyMole_Dark_Anim02,
.run = ANIM_MontyMole_Dark_Anim03,
.chase = ANIM_MontyMole_Dark_Anim03,
.anim_4 = ANIM_MontyMole_Dark_Anim01,
.anim_5 = ANIM_MontyMole_Dark_Anim01,
.death = ANIM_MontyMole_Dark_Anim05,
.hit = ANIM_MontyMole_Dark_Anim05,
.anim_8 = ANIM_MontyMole_Dark_Anim00,
.anim_9 = ANIM_MontyMole_Dark_Anim00,
.anim_A = ANIM_MontyMole_Dark_Anim00,
.anim_B = ANIM_MontyMole_Dark_Anim00,
.anim_C = ANIM_MontyMole_Dark_Anim00,
.anim_D = ANIM_MontyMole_Dark_Anim00,
.anim_E = ANIM_MontyMole_Dark_Anim00,
.anim_F = ANIM_MontyMole_Dark_Anim00,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Petunia)),
NPC_GROUP(N(NpcData_Dayzee), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_MontyMole_01), BTL_FLO2_FORMATION_02, BTL_FLO2_STAGE_01),
NPC_GROUP(N(NpcData_MontyMole_02), BTL_FLO2_FORMATION_01, BTL_FLO2_STAGE_01),
NPC_GROUP(N(NpcData_MontyMole_03), BTL_FLO2_FORMATION_03, BTL_FLO2_STAGE_01),
NPC_GROUP(N(NpcData_MontyMole_04), BTL_FLO2_FORMATION_04, BTL_FLO2_STAGE_01),
{}
};

View File

@ -0,0 +1,56 @@
#include "flo_03.h"
#include "common/foliage.inc.c"
FoliageModelList N(Tree1_LeafModels) = {
.count = 1,
.models = {
MODEL_o170,
}
};
FoliageModelList N(Tree1_TrunkModels) = {
.count = 1,
.models = {
MODEL_o157,
}
};
FoliageDropList N(Tree1_Drops) = {
.count = 2,
.drops = {
{
.itemID = ITEM_RED_BERRY,
.pos = { -256, 102, -169 },
.spawnMode = ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS,
.spawnFlag = AF_FLO_TreeDrop_RedBerry1,
},
{
.itemID = ITEM_RED_BERRY,
.pos = { -156, 102, -169 },
.spawnMode = ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS,
.spawnFlag = AF_FLO_TreeDrop_RedBerry2,
},
}
};
ShakeTreeConfig N(ShakeTree_Tree1) = {
.leaves = &N(Tree1_LeafModels),
.trunk = &N(Tree1_TrunkModels),
.drops = &N(Tree1_Drops),
};
BombTrigger N(BombPos_Tree1) = {
.pos = { -208.0f, 0.0f, -182.0f },
.radius = 0.0f
};
EvtScript N(EVS_SetupFoliage) = {
EVT_SET(AF_FLO_TreeDrop_RedBerry1, FALSE)
EVT_SET(AF_FLO_TreeDrop_RedBerry2, FALSE)
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o242, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,14 @@
#include "flo_03.h"
#include "entity.h"
EvtScript N(EVS_EmptyEntityHandler) = {
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_HiddenPanel), -175, 0, 150, 0, MODEL_o56, MAKE_ENTITY_END)
EVT_CALL(AssignPanelFlag, GF_FLO03_HiddenPanel)
EVT_RETURN
EVT_END
};

View File

@ -1,18 +0,0 @@
#include "flo_07.h"
#include "effects.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/todo/SpawnSunEffect.inc.c"
ApiStatus N(func_80240344_CAC534)(Evt* script, s32 isInitialCall) {
EffectInstance* effect = fx_misc_particles(3, -272.0f, 80.0f, 20.0f, 200.0f, 120.0f, 4.0f, 8, 0);
effect->data.miscParticles->unk_38 = 240;
effect->data.miscParticles->unk_3C = 240;
effect->data.miscParticles->unk_40 = 240;
effect->data.miscParticles->unk_48 = 230;
effect->data.miscParticles->unk_4C = 230;
effect->data.miscParticles->unk_50 = 240;
return ApiStatus_DONE2;
}

View File

@ -1,521 +0,0 @@
#include "flo_07.h"
#include "message_ids.h"
#include "sprite/npc/Posie.h"
enum {
NPC_POSIE,
};
EntryList N(entryList) = {
{ 375.0f, 0.0f, 0.0f, 270.0f },
{ 325.0f, 0.0f, 0.0f, 270.0f },
};
MapSettings N(settings) = {
.main = &N(main),
.entryList = &N(entryList),
.entryCount = ENTRY_COUNT(N(entryList)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_07 },
};
EvtScript N(802407A0) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(53)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_CALL(PlaySound, 0x80000021)
EVT_RETURN
EVT_END
};
EvtScript N(8024086C) = {
EVT_CALL(PushSong, 137, 1)
EVT_RETURN
EVT_END
};
EvtScript N(80240890) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};
static s32 N(pad_8CC) = {
0x00000000,
};
EvtScript N(updateTexturePan_802408D0) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_IF_EQ(LVar5, 1)
EVT_IF_EQ(LVar6, 1)
EVT_IF_EQ(LVar7, 1)
EVT_IF_EQ(LVar8, 1)
EVT_CALL(N(UpdateTexturePanSmooth))
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_CALL(N(UpdateTexturePanStepped))
EVT_RETURN
EVT_END
};
EvtScript N(8024096C) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, 0xD, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, 0xD, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(exitWalk_80240C18) = EVT_EXIT_WALK(60, 0, "flo_25", 1);
EvtScript N(80240C74) = {
EVT_BIND_TRIGGER(N(exitWalk_80240C18), TRIGGER_FLOOR_ABOVE, 0, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(main) = {
EVT_SET(GB_WorldLocation, 38)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_SET(AreaFlag(6), 0)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_80242B0C)))
EVT_EXEC_WAIT(N(802428C4))
EVT_CALL(ModifyColliderFlags, 3, 6, 0x00000006)
EVT_SET(LVar0, 297)
EVT_SET(LVar1, -95)
EVT_SET(LVar2, 383)
EVT_SET(LVar3, -65)
EVT_SET(LVar4, 0)
EVT_EXEC(N(8024096C))
EVT_SET(LVar0, 293)
EVT_SET(LVar1, 71)
EVT_SET(LVar2, 378)
EVT_SET(LVar3, 113)
EVT_SET(LVar4, 0)
EVT_EXEC(N(8024096C))
EVT_SET(LVar0, 21)
EVT_SET(LVar1, -346)
EVT_SET(LVar2, 147)
EVT_SET(LVar3, -242)
EVT_SET(LVar4, 20)
EVT_EXEC(N(8024096C))
EVT_SET(LVar0, -350)
EVT_SET(LVar1, -190)
EVT_SET(LVar2, -81)
EVT_SET(LVar3, -106)
EVT_SET(LVar4, 0)
EVT_EXEC(N(8024096C))
EVT_SET(LVar0, -380)
EVT_SET(LVar1, 85)
EVT_SET(LVar2, -95)
EVT_SET(LVar3, 150)
EVT_SET(LVar4, 0)
EVT_EXEC(N(8024096C))
EVT_CALL(EnableTexPanning, 51, 1)
EVT_CALL(EnableTexPanning, 49, 1)
EVT_CALL(EnableTexPanning, 50, 1)
EVT_THREAD
EVT_SET(LVar0, 2)
EVT_SET(LVar1, -100)
EVT_SET(LVar2, 100)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 1)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_802408D0))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 3)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, -1200)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_802408D0))
EVT_END_THREAD
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_EXEC(N(80241C14))
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 1, 0x7FFFFE00)
EVT_SET(LVar0, EVT_PTR(N(80240C74)))
EVT_EXEC(EnterWalk)
EVT_EXEC(N(802424F4))
EVT_END_IF
EVT_EXEC_WAIT(N(802407A0))
EVT_IF_GE(GB_StoryProgress, 53)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_CALL(N(func_80240344_CAC534))
EVT_RETURN
EVT_END
};
static s32 N(pad_1214)[] = {
0x00000000, 0x00000000, 0x00000000,
};
NpcSettings N(npcSettings_80241220) = {
.height = 56,
.radius = 40,
.level = 99,
};
#include "common/foliage.inc.c"
s32** N(varStash) = NULL;
EvtScript N(80241BB4) = {
EVT_CALL(ShowGotItem, LVar0, 1, 0)
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtScript N(80241BE4) = {
EVT_CALL(ShowGotItem, LVar0, 1, 16)
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtScript N(80241C14) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(GetNpcPos, 0, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, 0, 300)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(11.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_00C5)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_10"), 1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(80241D6C) = {
EVT_LABEL(0)
EVT_CALL(ShakeCam, 0, 0, 1, EVT_FLOAT(1.0))
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(80241DBC) = {
EVT_IF_EQ(AreaFlag(6), 1)
EVT_RETURN
EVT_END_IF
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0068)
EVT_THREAD
EVT_CALL(SetCamDistance, 0, 300)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(0.5))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_END_THREAD
EVT_CALL(PlaySound, 0x8000006B)
EVT_EXEC_GET_TID(N(80241D6C), MapVar(0))
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Strain, ANIM_Posie_Strain, 0, MSG_CH6_0069)
EVT_KILL_THREAD(MapVar(0))
EVT_CALL(SetCamDistance, 0, 350)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(8.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, LVar2)
EVT_IF_LT(LVar0, -250)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -225, 100, -25, 13, GF_FLO07_Item_CrystalBerry)
EVT_ELSE
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -265, 100, 54, 13, GF_FLO07_Item_CrystalBerry)
EVT_SET(GF_FLO07_CrystalBerryFellOnLeftSide, 1)
EVT_END_IF
EVT_CALL(PlaySound, 0x7BC)
EVT_CALL(func_802D62E4, 956)
EVT_SET(AreaFlag(6), 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006A)
EVT_SET(GB_StoryProgress, 47)
EVT_RETURN
EVT_END
};
EvtScript N(interact_80242044) = {
EVT_EXEC_WAIT(N(8024086C))
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(45)
EVT_IF_EQ(AreaFlag(5), 0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0070)
EVT_SET(AreaFlag(5), 1)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0071)
EVT_END_IF
EVT_CASE_LT(46)
EVT_CALL(AdjustCam, 0, EVT_FLOAT(4.0), 0, EVT_FLOAT(350.0), EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0065)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Posie_GiveItem)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Posie_Still)
EVT_SET(LVar0, 89)
EVT_SET(LVar1, 1)
EVT_EXEC_WAIT(N(80241BB4))
EVT_CALL(AddKeyItem, ITEM_FERTILE_SOIL)
EVT_SET(GB_StoryProgress, 46)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0066)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, 1)
EVT_EXEC_WAIT(N(80241DBC))
EVT_END_IF
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_CASE_LT(47)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, 1)
EVT_IF_EQ(AreaFlag(6), 0)
EVT_CALL(AdjustCam, 0, EVT_FLOAT(4.0), 0, EVT_FLOAT(350.0), EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_EXEC_WAIT(N(80241DBC))
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_END_IF
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_END_IF
EVT_CASE_LT(53)
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, 0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_ELSE
EVT_IF_LT(GB_StoryProgress, 48)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0073)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0074)
EVT_END_IF
EVT_CALL(ContinueSpeech, -1, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0075)
EVT_END_IF
EVT_CASE_LT(60)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0076)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0077)
EVT_END_SWITCH
EVT_EXEC_WAIT(N(80240890))
EVT_RETURN
EVT_END
};
EvtScript N(init_80242428) = {
EVT_IF_EQ(GB_StoryProgress, 47)
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, 0)
EVT_IF_EQ(GF_FLO07_CrystalBerryFellOnLeftSide, 0)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -225, 0, -25, 17, GF_FLO07_Item_CrystalBerry)
EVT_ELSE
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -265, 0, 54, 17, GF_FLO07_Item_CrystalBerry)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_SET(AreaFlag(5), 0)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(interact_80242044)))
EVT_RETURN
EVT_END
};
EvtScript N(802424F4) = {
EVT_IF_NE(AreaByte(3), 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(10)
EVT_IF_LT(AreaByte(3), 5)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006E)
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_CALL(PlayerMoveTo, 410, LVar3, 10)
EVT_ADD(AreaByte(3), 1)
EVT_ELSE
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006F)
EVT_SET(AreaByte(3), 0)
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_IF
EVT_RETURN
EVT_END
};
extern const char N(flo_25_name_hack)[];
EvtScript N(tree1_Callback) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_IF_LT(GB_StoryProgress, 47)
EVT_CALL(NpcFacePlayer, 0, 1)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Confused, ANIM_Posie_Idle, 0, MSG_CH6_0067)
EVT_IF_EQ(GB_StoryProgress, 46)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, 1)
EVT_CALL(UseSettingsFrom, 0, -250, 0, 0)
EVT_CALL(SetPanTarget, 0, -250, 0, 0)
EVT_CALL(SetCamDistance, 0, 350)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_EXEC_WAIT(N(80241DBC))
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_END_IF
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, 0)
EVT_CALL(NpcFacePlayer, 0, 1)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_Confused, ANIM_Posie_Idle, 0, MSG_CH6_0067)
EVT_ELSE
EVT_ADD(AreaByte(2), 1)
EVT_SWITCH(AreaByte(2))
EVT_CASE_LT(2)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006B)
EVT_CASE_LT(5)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006C)
EVT_CASE_GE(5)
EVT_CALL(SpeakToPlayer, 0, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006D)
EVT_SET(AreaByte(3), 1)
EVT_CALL(GotoMap, EVT_PTR(N(flo_25_name_hack)), 1)
EVT_WAIT(100)
EVT_END_SWITCH
EVT_END_IF
EVT_END_IF
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
FoliageModelList N(tree1_Leaves) = {
.count = 3,
.models = { 19, 20, 21 }
};
FoliageModelList N(tree1_Trunk) = {
.count = 1,
.models = { 18 }
};
ShakeTreeConfig N(tree1) = {
.leaves = &N(tree1_Leaves),
.trunk = &N(tree1_Trunk),
.callback = &N(tree1_Callback),
};
Vec4f N(triggerCoord_802428B4) = { -309.0f, 0.0f, 31.0f, 0.0f };
EvtScript N(802428C4) = {
EVT_SET(LVar0, EVT_PTR(N(tree1)))
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_WALL_HAMMER, 4, 1, 0)
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_POINT_BOMB, EVT_PTR(N(triggerCoord_802428B4)), 1, 0)
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_8024291C) = {
.id = NPC_POSIE,
.settings = &N(npcSettings_80241220),
.pos = { -260.0f, 0.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(init_80242428),
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
ANIM_Posie_Idle,
},
.tattle = MSG_NpcTattle_Posie,
};
NpcGroupList N(npcGroupList_80242B0C) = {
NPC_GROUP(N(npcGroup_8024291C)),
{},
};
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
const char N(flo_25_name_hack)[] = "flo_25";

View File

@ -2,20 +2,29 @@
/// @brief Flower Fields - (SW) Posie and Crystal Tree
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_07_shape.h"
#include "mapfs/flo_07_hit.h"
enum {
NPC_Posie = 0,
};
enum {
MV_GroundShakingScript = MapVar(0),
};
#define NAMESPACE flo_07
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(SpawnSunEffect)(Evt* script, s32 isInitialCall);
ApiStatus N(UpdateTexturePanSmooth)(Evt* script, s32 isInitialCall);
ApiStatus N(UpdateTexturePanStepped)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240344_CAC534)(Evt* script, s32 isInitialCall);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_PushFlowerSong);
extern EvtScript N(EVS_PopSong);
extern EvtScript N(EVS_Scene_SunReturns);
extern EvtScript N(EVS_TryKickingPlayerOut);
extern EvtScript N(EVS_SetupFoliage);
extern NpcGroupList N(npcGroupList_80242B0C);
extern EvtScript N(80241C14);
extern EvtScript N(802424F4);
extern EvtScript N(802428C4);
extern EvtScript N(main);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,14 @@
#include "flo_07.h"
EntryList N(Entrances) = {
[flo_07_ENTRY_0] { 375.0, 0.0, 0.0, 270.0 },
[flo_07_ENTRY_1] { 325.0, 0.0, 0.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_07 },
};

View File

@ -0,0 +1,32 @@
#include "flo_07.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_07_ENTRY_1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_CALL(PlaySound, SOUND_80000021)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PushFlowerSong) = {
EVT_CALL(PushSong, SONG_FLOWER_NPC_THEME, 1)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PopSong) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,77 @@
#include "flo_07.h"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
#include "world/common/todo/SpawnSunEffect.inc.c"
EvtScript N(EVS_ExitWalk_flo_25_1) = EVT_EXIT_WALK(60, flo_07_ENTRY_0, "flo_25", flo_25_ENTRY_1);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_25_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
API_CALLABLE(N(CreateCrystalTreeSparkles)) {
EffectInstance* effect = fx_misc_particles(3, -272.0f, 80.0f, 20.0f, 200.0f, 120.0f, 4.0f, 8, 0);
effect->data.miscParticles->innerColor.r = 240;
effect->data.miscParticles->innerColor.g = 240;
effect->data.miscParticles->innerColor.b = 240;
effect->data.miscParticles->glowColor.r = 230;
effect->data.miscParticles->glowColor.g = 230;
effect->data.miscParticles->glowColor.b = 240;
return ApiStatus_DONE2;
}
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_SET(AF_FLO_MadeCrystalBerry, FALSE)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_SetupFoliage))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o76, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( 297, -95, 383, -65, 0 )
EVT_FLOWER_SPAWN_REGION( 293, 71, 378, 113, 0 )
EVT_FLOWER_SPAWN_REGION( 21, -346, 147, -242, 20 )
EVT_FLOWER_SPAWN_REGION( -350, -190, -81, -106, 0 )
EVT_FLOWER_SPAWN_REGION( -380, 85, -95, 150, 0 )
EVT_CALL(EnableTexPanning, MODEL_o51, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o36, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o37, TRUE)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( -100, 100, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( 0,-1200, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_07_ENTRY_1)
EVT_EXEC(N(EVS_Scene_SunReturns))
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilite, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_EXEC(N(EVS_TryKickingPlayerOut))
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_CALL(N(CreateCrystalTreeSparkles))
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,262 @@
#include "flo_07.h"
#include "world/common/npc/Posie.inc.c"
#include "common/foliage.inc.c"
#include "world/common/complete/GiveReward.inc.c"
EvtScript N(EVS_Scene_SunReturns) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(GetNpcPos, NPC_Posie, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(11.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_00C5)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_10"), flo_10_ENTRY_1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ShakeGround) = {
EVT_LABEL(0)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 1, EVT_FLOAT(1.0))
EVT_WAIT(1)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MakeCrystalBerry) = {
EVT_IF_EQ(AF_FLO_MadeCrystalBerry, TRUE)
EVT_RETURN
EVT_END_IF
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0068)
EVT_THREAD
EVT_CALL(SetCamDistance, CAM_DEFAULT, 300)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_END_THREAD
EVT_CALL(PlaySound, SOUND_8000006B)
EVT_EXEC_GET_TID(N(EVS_ShakeGround), MV_GroundShakingScript)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Strain, ANIM_Posie_Strain, 0, MSG_CH6_0069)
EVT_KILL_THREAD(MV_GroundShakingScript)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 350)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(8.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_SUB(LVar0, LVar2)
EVT_IF_LT(LVar0, -250)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -225, 100, -25, ITEM_SPAWN_MODE_FALL_NEVER_VANISH, GF_FLO07_Item_CrystalBerry)
EVT_ELSE
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -265, 100, 54, ITEM_SPAWN_MODE_FALL_NEVER_VANISH, GF_FLO07_Item_CrystalBerry)
EVT_SET(GF_FLO07_CrystalBerryFellOnLeftSide, TRUE)
EVT_END_IF
EVT_CALL(PlaySound, SOUND_7BC)
EVT_CALL(func_802D62E4, 956)
EVT_SET(AF_FLO_MadeCrystalBerry, TRUE)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006A)
EVT_SET(GB_StoryProgress, STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Posie) = {
EVT_EXEC_WAIT(N(EVS_PushFlowerSong))
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_IF_EQ(AF_FLO_PoiseHintDialogue, FALSE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0070)
EVT_SET(AF_FLO_PoiseHintDialogue, TRUE)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0071)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(4.0), 0, EVT_FLOAT(350.0), EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0065)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Posie_GiveItem)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Posie_Still)
EVT_GIVE_KEY_REWARD(ITEM_FERTILE_SOIL)
EVT_SET(GB_StoryProgress, STORY_CH6_GOT_FERTILE_SOIL)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0066)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, TRUE)
EVT_EXEC_WAIT(N(EVS_MakeCrystalBerry))
EVT_END_IF
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CASE_LT(STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, TRUE)
EVT_IF_EQ(AF_FLO_MadeCrystalBerry, FALSE)
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(4.0), 0, EVT_FLOAT(350.0), EVT_FLOAT(18.0), EVT_FLOAT(-7.5))
EVT_EXEC_WAIT(N(EVS_MakeCrystalBerry))
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_END_IF
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, FALSE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0072)
EVT_ELSE
EVT_IF_LT(GB_StoryProgress, STORY_CH6_GOT_WATER_STONE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0073)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0074)
EVT_END_IF
EVT_CALL(ContinueSpeech, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0075)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0076)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_0077)
EVT_END_SWITCH
EVT_EXEC_WAIT(N(EVS_PopSong))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Posie) = {
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, FALSE)
EVT_IF_EQ(GF_FLO07_CrystalBerryFellOnLeftSide, FALSE)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -225, 0, -25, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_FLO07_Item_CrystalBerry)
EVT_ELSE
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -265, 0, 54, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_FLO07_Item_CrystalBerry)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_SET(AF_FLO_PoiseHintDialogue, FALSE)
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Posie)))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TryKickingPlayerOut) = {
EVT_IF_NE(AB_FLO_PoiseKickedOutCount, 0)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(10)
EVT_IF_LT(AB_FLO_PoiseKickedOutCount, 5)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006E)
EVT_CALL(GetPlayerPos, LVar1, LVar2, LVar3)
EVT_CALL(PlayerMoveTo, 410, LVar3, 10)
EVT_ADD(AB_FLO_PoiseKickedOutCount, 1)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Talk, ANIM_Posie_Idle, 0, MSG_CH6_006F)
EVT_SET(AB_FLO_PoiseKickedOutCount, 0)
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_OnHit_CrystalTree) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_IF_LT(GB_StoryProgress, STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_CALL(NpcFacePlayer, NPC_Posie, 1)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Confused, ANIM_Posie_Idle, 0, MSG_CH6_0067)
EVT_IF_EQ(GB_StoryProgress, STORY_CH6_GOT_FERTILE_SOIL)
EVT_IF_EQ(GF_FLO12_RosieRequestedSomethingBeautiful, TRUE)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, -250, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, -250, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 350)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_EXEC_WAIT(N(EVS_MakeCrystalBerry))
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_END_IF
EVT_END_IF
EVT_ELSE
EVT_IF_EQ(GF_FLO07_Item_CrystalBerry, FALSE)
EVT_CALL(NpcFacePlayer, NPC_Posie, 1)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_Confused, ANIM_Posie_Idle, 0, MSG_CH6_0067)
EVT_ELSE
EVT_ADD(AB_FLO_CrystalTreeHitCount, 1)
EVT_SWITCH(AB_FLO_CrystalTreeHitCount)
EVT_CASE_LT(2)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006B)
EVT_CASE_LT(5)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006C)
EVT_CASE_GE(5)
EVT_CALL(SpeakToPlayer, NPC_Posie, ANIM_Posie_TalkAngry, ANIM_Posie_Idle, 0, MSG_CH6_006D)
EVT_SET(AB_FLO_PoiseKickedOutCount, 1)
EVT_CALL(GotoMap, EVT_PTR("flo_25"), flo_25_ENTRY_1)
EVT_WAIT(100)
EVT_END_SWITCH
EVT_END_IF
EVT_END_IF
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
FoliageModelList N(CrystalTree_LeafModels) = {
.count = 3,
.models = {
MODEL_o6,
MODEL_o7,
MODEL_o8,
}
};
FoliageModelList N(CrystalTree_TrunkModels) = {
.count = 1,
.models = {
MODEL_o5,
}
};
ShakeTreeConfig N(ShakeTree_CrystalTree) = {
.leaves = &N(CrystalTree_LeafModels),
.trunk = &N(CrystalTree_TrunkModels),
.callback = &N(EVS_OnHit_CrystalTree),
};
BombTrigger N(BombPos_CrystalTree) = {
.pos = { -309.0f, 0.0f, 31.0f },
.radius = 0.0f
};
EvtScript N(EVS_SetupFoliage) = {
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_CrystalTree)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o5, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_CrystalTree)), 1, 0)
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Posie) = {
.id = NPC_Posie,
.settings = &N(NpcSettings_Posie),
.pos = { -260.0f, 0.0f, 0.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Posie),
.drops = POSIE_DROPS,
.animations = POSIE_ANIMS,
.tattle = MSG_NpcTattle_Posie,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Posie)),
{}
};

View File

@ -1,3 +0,0 @@
#include "flo_08.h"
#include "world/common/entity/SuperBlock.inc.c"

View File

@ -1,14 +0,0 @@
#include "flo_08.h"
// It seems like fx_sun was not properly defined for this file. Having a proper
// declaration makes it not match.
#ifdef AVOID_UB
void fx_sun(s32, f32, f32, f32, f32, s32);
#else
void fx_sun(s32, s32, s32, s32, s32, s32);
#endif
ApiStatus N(func_80240D40_CAFA80)(Evt* script, s32 isInitialCall) {
fx_sun(1, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
#include "flo_08.h"
#include "world/common/todo/UnkFunc43.inc.c"

View File

@ -2,25 +2,34 @@
/// @brief Flower Fields - (SE) Briar Platforming
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_08_shape.h"
#include "mapfs/flo_08_hit.h"
enum {
NPC_GateFlower = 0,
NPC_Dayzee_01 = 1,
NPC_Dayzee_02 = 2,
NPC_Dayzee_03 = 3,
NPC_Dayzee_04 = 4,
NPC_Dayzee_05 = 5,
NPC_Dayzee_06 = 6,
NPC_Dayzee_07 = 7,
NPC_AmazyDayzee = 8,
};
enum {
MV_SuperBlock = MapVar(0),
};
#define NAMESPACE flo_08
ApiStatus N(AddPlayerHandsOffset)(Evt* script, s32 isInitialCall);
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240D40_CAFA80)(Evt* script, s32 isInitialCall);
ApiStatus N(UnkFloAI_Main)(Evt* script, s32 isInitialCall);
ApiStatus N(ItemChoice_WaitForSelection)(Evt* script, s32 isInitialCall);
ApiStatus N(ItemChoice_SaveSelected)(Evt* script, s32 isInitialCall);
ApiStatus N(BuildItemChoiceList)(Evt* script, s32 isInitialCall);
ApiStatus N(FlowerGuard_SetItemEntityPosition)(Evt* script, s32 isInitialCall);
ApiStatus N(FlowerGuard_JudgeItemTastiness)(Evt* script, s32 isInitialCall);
ApiStatus N(FlowerGuard_MakeItemList)(Evt* script, s32 isInitialCall);
ApiStatus N(UnkFunc43)(Evt* script, s32 isInitialCall);
extern NpcGroupList N(npcGroupList_80244EC4);
extern EvtScript N(80245914);
extern EvtScript N(80245F5C);
extern EvtScript N(main);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);
extern EvtScript N(EVS_SetupFoliage);
extern EvtScript N(EVS_SetupVines);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,14 @@
#include "flo_08.h"
EntryList N(Entrances) = {
[flo_08_ENTRY_0] { -870.0, 0.0, 0.0, 90.0 },
[flo_08_ENTRY_1] { 570.0, 0.0, 0.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_08 },
};

View File

@ -0,0 +1,12 @@
#include "flo_08.h"
EvtScript N(EVS_SetupMusic) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,14 @@
#include "flo_08.h"
#include "entity.h"
#define SUPER_BLOCK_MAPVAR MV_SuperBlock
#define SUPER_BLOCK_GAMEFLAG GF_FLO08_SuperBlock
#include "world/common/entity/SuperBlock.inc.c"
#include "world/common/entity/SuperBlock.data.inc.c"
EvtScript N(EVS_MakeEntities) = {
EVT_MAKE_SUPER_BLOCK(-780, 120, -110, 0)
EVT_CALL(MakeItemEntity, ITEM_STAR_PIECE, 510, 0, -90, ITEM_SPAWN_MODE_FIXED_NEVER_VANISH, GF_FLO08_Item_StarPiece)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,83 @@
#include "flo_08.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_00_6) = EVT_EXIT_WALK(60, flo_08_ENTRY_0, "flo_00", flo_00_ENTRY_6);
EvtScript N(EVS_ExitWalk_flo_24_0) = EVT_EXIT_WALK(60, flo_08_ENTRY_1, "flo_24", flo_24_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_00_6)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_24_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
LavaReset N(SafeFloorColliders)[] = {
{ .colliderID = COLLIDER_o158, .pos = { -540.0, 0.0, 50.0 }},
{ .colliderID = COLLIDER_o132, .pos = { 60.0, 0.0, 50.0 }},
{ .colliderID = COLLIDER_o223, .pos = { 60.0, 0.0, 50.0 }},
{ .colliderID = -1 }
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_SetupVines))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o114, SURFACE_TYPE_SPIKES)
EVT_THREAD
EVT_CALL(ResetFromLava, EVT_PTR(N(SafeFloorColliders)))
EVT_END_THREAD
EVT_CALL(EnableTexPanning, MODEL_o25, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o27, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o31, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o33, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o35, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o37, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o55, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o28, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o32, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o34, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o36, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o38, TRUE)
EVT_THREAD
EVT_SET(LVar0, 0)
EVT_SET(LVar1, 0)
EVT_LABEL(0)
EVT_ADD(LVar0, 140)
EVT_IF_GT(LVar0, 0x10000)
EVT_ADD(LVar0, -0x10000)
EVT_END_IF
EVT_CALL(SetTexPanOffset, 1, 0, LVar0, 0)
EVT_ADD(LVar1, -200)
EVT_IF_LT(LVar1, 0)
EVT_ADD(LVar1, 0x10000)
EVT_END_IF
EVT_CALL(SetTexPanOffset, 2, 0, LVar1, 0)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_THREAD
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o129, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION(140, -137, 340, -60, 0)
EVT_FLOWER_SPAWN_REGION(450, -137, 590, -60, 0)
EVT_EXEC(N(EVS_SetupFoliage))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilite, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,389 @@
#include "flo_08.h"
#include "world/common/enemy/complete/AmazyDayzee.inc.c"
#include "world/common/npc/GateFlower.inc.c"
#include "world/common/enemy/complete/CrazyDayzee.inc.c"
#include "world/common/complete/NormalItemChoice.inc.c"
static s32 N(FlowerGuard_ItemChoiceList)[ITEM_NUM_CONSUMABLES + 1];
#include "world/common/atomic/ItemChoice_FlowerGuard.inc.c"
EvtScript N(EVS_NpcInteract_GateFlower) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_IF_EQ(GF_FLO08_GaveYellowBerry, FALSE)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 350)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(18.5), EVT_FLOAT(-7.5))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Talk, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0042)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_Thinking)
EVT_CALL(N(FlowerGuard_MakeItemList))
EVT_CHOOSE_CONSUMABLE_FROM(N(FlowerGuard_ItemChoiceList), 0)
EVT_SWITCH(LVar0)
EVT_CASE_LE(0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Talk, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0043)
EVT_CASE_DEFAULT
EVT_SET(LVar8, LVar0)
EVT_CALL(N(FlowerGuard_JudgeItemTastiness), LVar0)
EVT_CALL(MakeItemEntity, LVar8, -695, 20, -29, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(LVar7, LVar0)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2095, 0)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Eat)
EVT_WAIT(20)
EVT_CALL(RemoveItemEntity, LVar7)
EVT_SWITCH(LVar8)
EVT_CASE_EQ(160)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Chew, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0046)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_21C, 0)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_GateFlower_Yellow_HappyTalk, ANIM_GateFlower_Yellow_HappyIdle, 0)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_OpenGate)
EVT_CALL(PlaySoundAtCollider, COLLIDER_o96, SOUND_METAL_GATE_OPEN, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o96, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(MakeLerp, 0, 100, 30, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar8, LVar0)
EVT_SETF(LVar9, LVar0)
EVT_MULF(LVar8, EVT_FLOAT(0.5))
EVT_MULF(LVar9, EVT_FLOAT(1.2))
EVT_CALL(RotateModel, MODEL_o69, LVar8, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o70, LVar8, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o71, LVar8, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o148, LVar9, 0, -1, 0)
EVT_CALL(RotateModel, MODEL_o149, LVar9, 0, -1, 0)
EVT_CALL(RotateModel, MODEL_o150, LVar9, 0, -1, 0)
EVT_WAIT(1)
EVT_IF_NE(LVar1, 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_HappyDance)
EVT_SET(GF_FLO08_GaveYellowBerry, TRUE)
EVT_CASE_EQ(159)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Chew, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0045)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Idle)
EVT_CASE_EQ(158)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Chew, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0045)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Idle)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_Chew, ANIM_GateFlower_Yellow_Idle, 0, MSG_CH6_0044)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Disgust)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_2096, 0)
EVT_CALL(MakeItemEntity, LVar8, 125, 20, 0, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(LVar7, LVar0)
EVT_WAIT(5)
EVT_CALL(GetAngleToPlayer, NPC_SELF, LVar0)
EVT_IF_LT(LVar0, 180)
EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, EVT_FLOAT(-0.5))
EVT_SETF(LVar3, EVT_FLOAT(-0.2))
EVT_SETF(LVar4, EVT_FLOAT(0.9))
EVT_MULF(LVar2, LVar0)
EVT_MULF(LVar3, LVar0)
EVT_MULF(LVar4, LVar0)
EVT_ADDF(LVar2, EVT_FLOAT(-700.0))
EVT_ADDF(LVar3, EVT_FLOAT(15.0))
EVT_ADDF(LVar4, EVT_FLOAT(-25.0))
EVT_CALL(N(FlowerGuard_SetItemEntityPosition), LVar7, LVar2, LVar3, LVar4)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_ELSE
EVT_CALL(MakeLerp, 0, 100, 7, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, EVT_FLOAT(0.5))
EVT_SETF(LVar3, EVT_FLOAT(-0.2))
EVT_SETF(LVar4, EVT_FLOAT(0.9))
EVT_MULF(LVar2, LVar0)
EVT_MULF(LVar3, LVar0)
EVT_MULF(LVar4, LVar0)
EVT_ADDF(LVar2, EVT_FLOAT(-690.0))
EVT_ADDF(LVar3, EVT_FLOAT(15.0))
EVT_ADDF(LVar4, EVT_FLOAT(-25.0))
EVT_CALL(N(FlowerGuard_SetItemEntityPosition), LVar7, LVar2, LVar3, LVar4)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_IF
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Idle)
EVT_CALL(RemoveItemEntity, LVar7)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_Idle)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_GateFlower_Yellow_Talk, ANIM_GateFlower_Yellow_Idle, 0)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_THREAD
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(6.0))
EVT_END_THREAD
EVT_WAIT(10)
EVT_ELSE
EVT_IF_LT(GB_StoryProgress, STORY_CH6_STAR_SPIRIT_RESCUED)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_HappyTalk, ANIM_GateFlower_Yellow_HappyIdle, 0, MSG_CH6_0047)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_GateFlower_Yellow_HappyTalk, ANIM_GateFlower_Yellow_HappyIdle, 0, MSG_CH6_0048)
EVT_END_IF
EVT_END_IF
EVT_CALL(DisablePlayerInput, FALSE)
EVT_UNBIND
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_GateFlower) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_GateFlower)))
EVT_IF_EQ(GF_FLO08_GaveYellowBerry, TRUE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_GateFlower_Yellow_HappyDance)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o96, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(RotateModel, MODEL_o69, 50, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o70, 50, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o71, 50, 0, 1, 0)
EVT_CALL(RotateModel, MODEL_o148, 120, 0, -1, 0)
EVT_CALL(RotateModel, MODEL_o149, 120, 0, -1, 0)
EVT_CALL(RotateModel, MODEL_o150, 120, 0, -1, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_GateFlower) = {
.id = NPC_GateFlower,
.settings = &N(NpcSettings_GateFlower),
.pos = { -695.0f, 0.0f, -30.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_ENABLE_HIT_SCRIPT | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_400000,
.init = &N(EVS_NpcInit_GateFlower),
.drops = GATE_FLOWER_DROPS,
.animations = GATE_FLOWER_YELLOW_ANIMS,
.tattle = MSG_NpcTattle_YellowGateFlower,
};
StaticNpc N(NpcData_Dayzee_01) = {
.id = NPC_Dayzee_01,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { 205.0f, 0.0f, -80.0f },
.yaw = 90,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 205, 0, -80 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 205, 0, -80 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_02) = {
.id = NPC_Dayzee_02,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { 275.0f, 0.0f, -115.0f },
.yaw = 270,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 275, 0, -115 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 275, 0, -115 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_03) = {
.id = NPC_Dayzee_03,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -230.0f, 60.0f, -110.0f },
.yaw = 90,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -230, 60, -110 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -230, 60, -110 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_04) = {
.id = NPC_Dayzee_04,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -330.0f, 60.0f, -110.0f },
.yaw = 270,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -330, 60, -110 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -330, 60, -110 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_05) = {
.id = NPC_Dayzee_05,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -430.0f, 60.0f, -110.0f },
.yaw = 90,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -430, 60, -110 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -430, 60, -110 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_06) = {
.id = NPC_Dayzee_06,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -530.0f, 60.0f, -110.0f },
.yaw = 270,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -530, 60, -110 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -530, 60, -110 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_07) = {
.id = NPC_Dayzee_07,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -630.0f, 60.0f, -110.0f },
.yaw = 90,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -630, 60, -110 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -630, 60, -110 },
.detectSize = { 150 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
EvtScript N(EVS_NpcInit_AmazyDayzee) = {
EVT_THREAD
EVT_WAIT(2)
EVT_CALL(GetNpcPointer, NPC_Dayzee_02, LVar0)
EVT_IF_EQ(LVar0, 0)
EVT_CALL(RemoveNpc, NPC_SELF)
EVT_RETURN
EVT_END_IF
EVT_CALL(RandInt, 100, LVar0)
EVT_IF_LT(LVar0, 30)
EVT_CALL(SetNpcFlagBits, NPC_Dayzee_02, NPC_FLAG_2 | NPC_FLAG_4, TRUE)
EVT_CALL(SetNpcPos, NPC_Dayzee_02, NPC_DISPOSE_LOCATION)
EVT_ELSE
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2 | NPC_FLAG_4, TRUE)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_END_IF
EVT_END_THREAD
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_AmazyDayzee) = {
.id = NPC_AmazyDayzee,
.settings = &N(NpcSettings_AmazyDayzee),
.pos = { 240.0f, 0.0f, -90.0f },
.yaw = 270,
.flags = NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_AmazyDayzee),
.drops = AMAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 240, 0, -90 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 240, 0, -90 },
.detectSize = { 200 },
}
},
.animations = AMAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SENSITIVE_MOTION,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_GateFlower)),
NPC_GROUP(N(NpcData_Dayzee_01), BTL_FLO_FORMATION_14, BTL_FLO_STAGE_00),
NPC_GROUP(N(NpcData_Dayzee_02), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_00),
NPC_GROUP(N(NpcData_Dayzee_03), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_Dayzee_04), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_Dayzee_05), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_Dayzee_06), BTL_FLO_FORMATION_0F, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_Dayzee_07), BTL_FLO_FORMATION_12, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_AmazyDayzee), BTL_FLO_FORMATION_1C, BTL_FLO_STAGE_00),
{}
};

View File

@ -0,0 +1,56 @@
#include "flo_08.h"
#include "common/foliage.inc.c"
FoliageModelList N(Tree1_LeafModels) = {
.count = 1,
.models = {
MODEL_o133,
}
};
FoliageModelList N(Tree1_TrunkModels) = {
.count = 1,
.models = {
MODEL_o132,
}
};
FoliageDropList N(Tree1_Drops) = {
.count = 2,
.drops = {
{
.itemID = ITEM_BLUE_BERRY,
.pos = { 340, 102, -89 },
.spawnMode = ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS,
.spawnFlag = AF_FLO_TreeDrop_BlueBerry1,
},
{
.itemID = ITEM_BLUE_BERRY,
.pos = { 440, 102, -89 },
.spawnMode = ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS,
.spawnFlag = AF_FLO_TreeDrop_BlueBerry2,
},
}
};
ShakeTreeConfig N(ShakeTree_Tree1) = {
.leaves = &N(Tree1_LeafModels),
.trunk = &N(Tree1_TrunkModels),
.drops = &N(Tree1_Drops),
};
BombTrigger N(BombPos_Tree1) = {
.pos = { 391.0f, 0.0f, -102.0f },
.radius = 0.0f
};
EvtScript N(EVS_SetupFoliage) = {
EVT_SET(AF_FLO_TreeDrop_BlueBerry1, FALSE)
EVT_SET(AF_FLO_TreeDrop_BlueBerry2, FALSE)
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o172, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,17 @@
#include "flo_08.h"
// unused extra import for flower-spawning regions
#define NAMESPACE flo_08_vines
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
#define NAMESPACE flo_08
#include "world/common/atomic/flo_DroppingVine.inc.c"
EvtScript N(EVS_SetupVines) = {
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o78, MODEL_o79, MODEL_o80, MODEL_o81)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o82, MODEL_o83, MODEL_o84, MODEL_o85)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o88, MODEL_o89, MODEL_o90, MODEL_o91)
EVT_DROPPING_VINE(ITEM_STINKY_HERB, MODEL_o159, MODEL_o158, MODEL_o160, MODEL_o161)
EVT_RETURN
EVT_END
};

View File

@ -1,7 +0,0 @@
#include "flo_09.h"
#include "effects.h"
ApiStatus N(func_80240000_CB5000)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(1, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,3 +0,0 @@
#include "flo_09.h"
#include "world/common/todo/UnkFunc43.inc.c"

View File

@ -1,708 +0,0 @@
#include "flo_09.h"
#include "message_ids.h"
#include "sprite/npc/Bzzap.h"
#include "sprite/npc/Dayzee.h"
enum {
NPC_DAYZEE0,
NPC_DAYZEE1,
NPC_BZZAP0,
NPC_BZZAP1,
};
EntryList N(entryList) = {
{ -520.0f, 0.0f, 0.0f, 90.0f },
{ 520.0f, 0.0f, 0.0f, 270.0f },
};
MapSettings N(settings) = {
.main = &N(main),
.entryList = &N(entryList),
.entryCount = ENTRY_COUNT(N(entryList)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_09 },
};
EvtScript N(80241880) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(53)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(802418F0) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, 0xD, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, 0xD, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(exitWalk_80241B9C) = EVT_EXIT_WALK(60, 0, "flo_00", 5);
EvtScript N(exitWalk_80241BF8) = EVT_EXIT_WALK(60, 1, "flo_03", 0);
EvtScript N(80241C54) = {
EVT_BIND_TRIGGER(N(exitWalk_80241B9C), TRIGGER_FLOOR_ABOVE, 0, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_80241BF8), TRIGGER_FLOOR_ABOVE, 4, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(main) = {
EVT_SET(GB_WorldLocation, 38)
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_8024414C)))
EVT_EXEC(N(802425DC))
EVT_EXEC(N(802434A8))
EVT_CALL(ModifyColliderFlags, 3, 9, 0x00000006)
EVT_SET(LVar0, -511)
EVT_SET(LVar1, -4)
EVT_SET(LVar2, -319)
EVT_SET(LVar3, 10)
EVT_SET(LVar4, 0)
EVT_EXEC(N(802418F0))
EVT_SET(LVar0, -302)
EVT_SET(LVar1, 77)
EVT_SET(LVar2, -32)
EVT_SET(LVar3, 116)
EVT_SET(LVar4, 0)
EVT_EXEC(N(802418F0))
EVT_SET(LVar0, 51)
EVT_SET(LVar1, 18)
EVT_SET(LVar2, 141)
EVT_SET(LVar3, 127)
EVT_SET(LVar4, 0)
EVT_EXEC(N(802418F0))
EVT_SET(LVar0, 234)
EVT_SET(LVar1, 38)
EVT_SET(LVar2, 502)
EVT_SET(LVar3, 98)
EVT_SET(LVar4, 0)
EVT_EXEC(N(802418F0))
EVT_SET(LVar0, -525)
EVT_SET(LVar1, -163)
EVT_SET(LVar2, -400)
EVT_SET(LVar3, -80)
EVT_SET(LVar4, 60)
EVT_EXEC(N(802418F0))
EVT_SET(LVar0, -346)
EVT_SET(LVar1, -148)
EVT_SET(LVar2, 517)
EVT_SET(LVar3, -91)
EVT_SET(LVar4, 60)
EVT_EXEC(N(802418F0))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 1, 0x7FFFFE00)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 5, 0x7FFFFE00)
EVT_SET(LVar0, EVT_PTR(N(80241C54)))
EVT_EXEC(EnterWalk)
EVT_EXEC_WAIT(N(80241880))
EVT_IF_GE(GB_StoryProgress, 53)
EVT_CALL(N(func_80240000_CB5000))
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_2004)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtScript N(80242010) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, 0xD, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, 0xD, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(802422BC) = {
EVT_SET(LVar9, LVar6)
EVT_SET(LVar8, LVar5)
EVT_SET(LVar7, LVar4)
EVT_SET(LVar6, LVar3)
EVT_SET(LVar5, LVar2)
EVT_SET(LVar4, LVar1)
EVT_SET(LVar3, LVar0)
EVT_CALL(EnableModel, LVar6, 0)
EVT_LABEL(0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(N(UnkFunc43))
EVT_IF_EQ(LVar0, 0)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_THREAD
EVT_WAIT(5)
EVT_CALL(EnableModel, LVar6, 1)
EVT_END_THREAD
EVT_IF_NE(LVarA, 0)
EVT_THREAD
EVT_WAIT(5)
EVT_SET(LVar0, LVar3)
EVT_SET(LVar1, LVar4)
EVT_SET(LVar2, LVar5)
EVT_ADD(LVar1, 10)
EVT_ADD(LVar2, 8)
EVT_CALL(PlayEffect, 0x11, 4, LVar0, LVar1, LVar2, 15, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(15)
EVT_SUB(LVar1, 10)
EVT_CALL(MakeItemEntity, LVarA, LVar0, LVar1, LVar2, 14, 0)
EVT_END_THREAD
EVT_END_IF
EVT_THREAD
EVT_WAIT(10)
EVT_CALL(PlaySoundAt, 0xF8, 0, LVar3, LVar4, LVar5)
EVT_END_THREAD
EVT_CALL(MakeLerp, 0, 180, 20, 2)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_CALL(RotateModel, LVar8, LVar0, 1, 0, 0)
EVT_CALL(RotateModel, LVar9, LVar0, 1, 0, 0)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_CALL(EnableModel, LVar7, 0)
EVT_RETURN
EVT_END
};
EvtScript N(802425DC) = {
EVT_CALL(GetModelCenter, 69)
EVT_SET(LVar3, 69)
EVT_SET(LVar4, 70)
EVT_SET(LVar5, 71)
EVT_SET(LVar6, 72)
EVT_SET(LVarA, 0)
EVT_EXEC(N(802422BC))
EVT_CALL(GetModelCenter, 75)
EVT_SET(LVar3, 75)
EVT_SET(LVar4, 76)
EVT_SET(LVar5, 77)
EVT_SET(LVar6, 78)
EVT_SET(LVarA, 174)
EVT_EXEC(N(802422BC))
EVT_CALL(GetModelCenter, 83)
EVT_SET(LVar3, 83)
EVT_SET(LVar4, 84)
EVT_SET(LVar5, 85)
EVT_SET(LVar6, 86)
EVT_SET(LVarA, 0)
EVT_EXEC(N(802422BC))
EVT_CALL(GetModelCenter, 89)
EVT_SET(LVar3, 89)
EVT_SET(LVar4, 90)
EVT_SET(LVar5, 91)
EVT_SET(LVar6, 92)
EVT_SET(LVarA, 0)
EVT_EXEC(N(802422BC))
EVT_CALL(GetModelCenter, 97)
EVT_SET(LVar3, 97)
EVT_SET(LVar4, 98)
EVT_SET(LVar5, 99)
EVT_SET(LVar6, 100)
EVT_SET(LVarA, 0)
EVT_EXEC(N(802422BC))
EVT_CALL(GetModelCenter, 103)
EVT_SET(LVar3, 103)
EVT_SET(LVar4, 104)
EVT_SET(LVar5, 105)
EVT_SET(LVar6, 106)
EVT_SET(LVarA, 0)
EVT_EXEC(N(802422BC))
EVT_RETURN
EVT_END
};
static s32 N(pad_2874)[] = {
0x00000000, 0x00000000, 0x00000000,
};
#include "common/foliage.inc.c"
EvtScript N(802431E4) = {
EVT_CALL(GetNpcPos, 3, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 0)
EVT_CALL(GetModelCenter, LVar9)
EVT_ADD(LVar2, 35)
EVT_CALL(SetNpcPos, 3, LVar0, LVar1, LVar2)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(tree1_Callback) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, 0)
EVT_IF_EQ(AreaByte(5), 1)
EVT_CALL(MakeItemEntity, ITEM_HAPPY_FLOWER_B, -250, 100, 0, 13, GF_FLO09_Item_HappyFlowerB)
EVT_ELSE
EVT_SET(LVar9, 14)
EVT_EXEC(N(802431E4))
EVT_END_IF
EVT_SET(AreaByte(4), 0)
EVT_SET(AreaByte(5), 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(tree2_Callback) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, 0)
EVT_SET(AreaByte(4), 1)
EVT_SET(AreaByte(5), 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(tree3_Callback) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, 0)
EVT_IF_EQ(AreaByte(4), 1)
EVT_IF_EQ(AreaByte(5), 0)
EVT_SET(AreaByte(5), 1)
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_SET(LVar9, 22)
EVT_EXEC(N(802431E4))
EVT_SET(AreaByte(4), 0)
EVT_SET(AreaByte(5), 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
FoliageModelList N(tree1_Leaves) = {
.count = 2,
.models = { 15, 16 }
};
FoliageModelList N(tree1_Trunk) = {
.count = 1,
.models = { 14 }
};
ShakeTreeConfig N(tree1) = {
.leaves = &N(tree1_Leaves),
.trunk = &N(tree1_Trunk),
.callback = &N(tree1_Callback),
};
Vec4f N(triggerCoord_80243428) = { -200.0f, 0.0f, 1.0f, 0.0f };
FoliageModelList N(tree2_Leaves) = {
.count = 2,
.models = { 19, 20 }
};
FoliageModelList N(tree2_Trunk) = {
.count = 1,
.models = { 18 }
};
ShakeTreeConfig N(tree2) = {
.leaves = &N(tree2_Leaves),
.trunk = &N(tree2_Trunk),
.callback = &N(tree2_Callback),
};
Vec4f N(triggerCoord_80243460) = { 0.0f, 0.0f, 1.0f, 0.0f };
FoliageModelList N(tree3_Leaves) = {
.count = 2,
.models = { 23, 24 }
};
FoliageModelList N(tree3_Trunk) = {
.count = 1,
.models = { 22 }
};
ShakeTreeConfig N(tree3) = {
.leaves = &N(tree3_Leaves),
.trunk = &N(tree3_Trunk),
.callback = &N(tree3_Callback),
};
Vec4f N(triggerCoord_80243498) = { 200.0f, 0.0f, 1.0f, 0.0f };
EvtScript N(802434A8) = {
EVT_SET(AreaByte(4), 0)
EVT_SET(AreaByte(5), 0)
EVT_SET(LVar0, EVT_PTR(N(tree1)))
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_WALL_HAMMER, 15, 1, 0)
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_POINT_BOMB, EVT_PTR(N(triggerCoord_80243428)), 1, 0)
EVT_SET(LVar0, EVT_PTR(N(tree2)))
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_WALL_HAMMER, 16, 1, 0)
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_POINT_BOMB, EVT_PTR(N(triggerCoord_80243460)), 1, 0)
EVT_SET(LVar0, EVT_PTR(N(tree3)))
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_WALL_HAMMER, 17, 1, 0)
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_POINT_BOMB, EVT_PTR(N(triggerCoord_80243498)), 1, 0)
EVT_RETURN
EVT_END
};
MobileAISettings N(npcAISettings_802435B0) = {
.moveSpeed = 1.0f,
.moveTime = 500,
.waitTime = 10,
.alertRadius = 50.0f,
.alertOffsetDist = 30.0f,
.playerSearchInterval = 3,
.chaseSpeed = 3.5f,
.chaseTurnRate= 40,
.chaseUpdateInterval = 3,
.chaseRadius = 100.0f,
.chaseOffsetDist = 30.0f,
.unk_AI_2C = 1,
};
EvtScript N(npcAI_802435E0) = {
EVT_CALL(BasicAI_Main, EVT_PTR(N(npcAISettings_802435B0)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_80243600) = {
.height = 30,
.radius = 24,
.ai = &N(npcAI_802435E0),
.onHit = &EnemyNpcHit,
.onDefeat = &EnemyNpcDefeat,
.level = 19,
};
f32 N(FlyingAI_JumpVels)[] = {
4.5f, 3.5f, 2.6f, 2.0f,
1.5f, 20.0f,
};
MobileAISettings N(npcAISettings_80243644) = {
.moveSpeed = 1.0f,
.moveTime = 30,
.waitTime = 5,
.alertRadius = 80.0f,
.alertOffsetDist = 30.0f,
.playerSearchInterval = 2,
.chaseSpeed = 4.5f,
.chaseTurnRate= 6,
.chaseUpdateInterval = 1,
.chaseRadius = 90.0f,
.chaseOffsetDist = 30.0f,
.unk_AI_2C = 1,
};
EvtScript N(npcAI_80243674) = {
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(SetSelfVar, 5, -630)
EVT_CALL(SetSelfVar, 6, 50)
EVT_CALL(SetSelfVar, 1, 200)
EVT_CALL(N(FlyingAI_Main), EVT_PTR(N(npcAISettings_80243644)))
EVT_RETURN
EVT_END
};
NpcSettings N(npcSettings_802436E4) = {
.height = 26,
.radius = 24,
.ai = &N(npcAI_80243674),
.onHit = &EnemyNpcHit,
.onDefeat = &EnemyNpcDefeat,
.level = 19,
};
NpcSettings N(npcSettings_80243710) = {
.height = 24,
.radius = 24,
.level = 99,
};
EvtScript N(npcAI_8024373C) = {
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_IF_GT(LVar1, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcJumpscale, NPC_SELF, 0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 50, LVar2, 15)
EVT_CALL(SetSelfVar, 0, 1)
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(npcAI_80243674)))
EVT_END_IF
EVT_CASE_EQ(2)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(25)
EVT_CALL(SetNpcPos, NPC_SELF, 0, -1000, 0)
EVT_CALL(SetNpcFlagBits, NPC_SELF, ((NPC_FLAG_2)), FALSE)
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_SWITCH
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(defeat_802438C8) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(SetSelfVar, 0, 2)
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(npcAI_8024373C)))
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(1)
EVT_CASE_EQ(2)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(init_80243954) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(npcAI_8024373C)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802438C8)))
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_8024398C) = {
.id = NPC_DAYZEE0,
.settings = &N(npcSettings_80243600),
.pos = { -350.0f, 0.0f, 40.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 15,
.itemDrops = {
{ ITEM_MAPLE_SYRUP, 6, 0 },
{ ITEM_HONEY_SYRUP, 4, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(4),
.maxCoinBonus = 3,
},
.territory = { .temp = { -350, 0, 40, 30, 0, -32767, 0, -350, 0, 40, 200, 0, 0, 1 }},
.animations = {
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim02,
ANIM_Dayzee_Anim03,
ANIM_Dayzee_Anim03,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim08,
ANIM_Dayzee_Anim08,
ANIM_Dayzee_Anim06,
ANIM_Dayzee_Anim07,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
},
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(npcGroup_80243B7C) = {
.id = NPC_DAYZEE1,
.settings = &N(npcSettings_80243600),
.pos = { 260.0f, 0.0f, 75.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.yaw = 270,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 15,
.itemDrops = {
{ ITEM_MAPLE_SYRUP, 6, 0 },
{ ITEM_HONEY_SYRUP, 4, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(4),
.maxCoinBonus = 3,
},
.territory = { .temp = { 260, 0, 75, 30, 0, -32767, 0, 260, 0, 75, 200, 0, 0, 1 }},
.animations = {
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim02,
ANIM_Dayzee_Anim03,
ANIM_Dayzee_Anim03,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim08,
ANIM_Dayzee_Anim08,
ANIM_Dayzee_Anim06,
ANIM_Dayzee_Anim07,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
ANIM_Dayzee_Anim01,
},
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(npcGroup_80243D6C) = {
.id = NPC_BZZAP0,
.settings = &N(npcSettings_802436E4),
.pos = { -50.0f, 55.0f, 90.0f },
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 15,
.itemDrops = {
{ ITEM_MAPLE_SYRUP, 6, 0 },
{ ITEM_HONEY_SYRUP, 4, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.minCoinBonus = 1,
.maxCoinBonus = 4,
},
.territory = { .temp = { -50, 55, 90, 30, 0, -32767, 0, -50, 50, 90, 250, 0, 0, 1 }},
.animations = {
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim03,
ANIM_Bzzap_Anim03,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim06,
ANIM_Bzzap_Anim06,
ANIM_Bzzap_Anim04,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
},
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(npcGroup_80243F5C) = {
.id = NPC_BZZAP1,
.settings = &N(npcSettings_80243710),
.pos = { 0.0f, -1000.0f, 0.0f },
.flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(init_80243954),
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 15,
.itemDrops = {
{ ITEM_MAPLE_SYRUP, 6, 0 },
{ ITEM_HONEY_SYRUP, 4, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(3),
.flowerDrops = STANDARD_FLOWER_DROPS(2),
.minCoinBonus = 1,
.maxCoinBonus = 4,
},
.territory = { .temp = { -50, 55, 90, 100, 0, -32767, 0, -50, 50, 90, 250, 0, 0, 1 }},
.animations = {
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim03,
ANIM_Bzzap_Anim03,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim06,
ANIM_Bzzap_Anim06,
ANIM_Bzzap_Anim04,
ANIM_Bzzap_Anim02,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
ANIM_Bzzap_Anim01,
},
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
NpcGroupList N(npcGroupList_8024414C) = {
NPC_GROUP(N(npcGroup_8024398C), 0x1810, 0x04),
NPC_GROUP(N(npcGroup_80243B7C), 0x1815, 0x04),
NPC_GROUP(N(npcGroup_80243D6C), 0x1817, 0x01),
NPC_GROUP(N(npcGroup_80243F5C), 0x1817, 0x01),
{},
};

View File

@ -1,3 +0,0 @@
#include "flo_09.h"
#include "world/common/enemy/ai/FlyingAI.inc.c"

View File

@ -2,19 +2,27 @@
/// @brief Flower Fields - (East) Triple Tree Path
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_09_shape.h"
#include "mapfs/flo_09_hit.h"
#include "sprite/npc/Dayzee.h"
#include "sprite/npc/Bzzap.h"
enum {
NPC_Dayzee_01 = 0,
NPC_Dayzee_02 = 1,
NPC_Bzzap_01 = 2,
NPC_Bzzap_02 = 3,
};
#define NAMESPACE flo_09
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240000_CB5000)(Evt* script, s32 isInitialCall);
ApiStatus N(UnkFunc43)(Evt* script, s32 isInitialCall);
ApiStatus N(FlyingAI_Main)(Evt* script, s32 isInitialCall);
extern f32 N(FlyingAI_JumpVels)[];
extern NpcGroupList N(npcGroupList_8024414C);
extern EvtScript N(802425DC);
extern EvtScript N(802434A8);
extern EvtScript N(main);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_SetupFoliage);
extern EvtScript N(EVS_SetupVines);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,14 @@
#include "flo_09.h"
EntryList N(Entrances) = {
[flo_09_ENTRY_0] { -520.0, 0.0, 0.0, 90.0 },
[flo_09_ENTRY_1] { 520.0, 0.0, 0.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_09 },
};

View File

@ -0,0 +1,12 @@
#include "flo_09.h"
EvtScript N(EVS_SetupMusic) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,45 @@
#include "flo_09.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_00_5) = EVT_EXIT_WALK(60, flo_09_ENTRY_0, "flo_00", flo_00_ENTRY_5);
EvtScript N(EVS_ExitWalk_flo_03_0) = EVT_EXIT_WALK(60, flo_09_ENTRY_1, "flo_03", flo_03_ENTRY_0);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_00_5)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_03_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC(N(EVS_SetupVines))
EVT_EXEC(N(EVS_SetupFoliage))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o104, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( -511, -4, -319, 10, 0)
EVT_FLOWER_SPAWN_REGION( -302, 77, -32, 116, 0)
EVT_FLOWER_SPAWN_REGION( 51, 18, 141, 127, 0)
EVT_FLOWER_SPAWN_REGION( 234, 38, 502, 98, 0)
EVT_FLOWER_SPAWN_REGION( -525, -163, -400, -80, 60)
EVT_FLOWER_SPAWN_REGION( -346, -148, 517, -91, 60)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilite, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,19 @@
#include "flo_09.h"
// unused extra import for flower-spawning regions
#define NAMESPACE flo_09_vines
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
#define NAMESPACE flo_09
#include "world/common/atomic/flo_DroppingVine.inc.c"
EvtScript N(EVS_SetupVines) = {
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o76, MODEL_o77, MODEL_o78, MODEL_o79)
EVT_DROPPING_VINE(ITEM_STINKY_HERB, MODEL_o72, MODEL_o73, MODEL_o74, MODEL_o75)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o80, MODEL_o81, MODEL_o82, MODEL_o83)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o84, MODEL_o85, MODEL_o86, MODEL_o87)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o96, MODEL_o97, MODEL_o98, MODEL_o99)
EVT_DROPPING_VINE(ITEM_NONE, MODEL_o92, MODEL_o93, MODEL_o94, MODEL_o95)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,149 @@
#include "flo_09.h"
#include "common/foliage.inc.c"
EvtScript N(EVS_SpawnBzzap) = {
EVT_CALL(GetNpcPos, NPC_Bzzap_02, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar1, 0)
EVT_CALL(GetModelCenter, LVar9)
EVT_ADD(LVar2, 35)
EVT_CALL(SetNpcPos, NPC_Bzzap_02, LVar0, LVar1, LVar2)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(Tree1_CallbackScript) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_IF_EQ(AB_FLO_TreePuzzle_SecondCorrect, 1)
EVT_CALL(MakeItemEntity, ITEM_HAPPY_FLOWER_B, -250, 100, 0, ITEM_SPAWN_MODE_FALL_NEVER_VANISH, GF_FLO09_Item_HappyFlowerB)
EVT_ELSE
EVT_SET(LVar9, MODEL_o10)
EVT_EXEC(N(EVS_SpawnBzzap))
EVT_END_IF
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 0)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(Tree2_CallbackScript) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 1)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(Tree3_CallbackScript) = {
EVT_IF_EQ(GF_FLO09_Item_HappyFlowerB, FALSE)
EVT_IF_EQ(AB_FLO_TreePuzzle_FirstCorrect, 1)
EVT_IF_EQ(AB_FLO_TreePuzzle_SecondCorrect, 0)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 1)
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_SET(LVar9, MODEL_o13)
EVT_EXEC(N(EVS_SpawnBzzap))
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 0)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
FoliageModelList N(Tree1_LeafModels) = {
.count = 2,
.models = {
MODEL_o11,
MODEL_o12,
}
};
FoliageModelList N(Tree1_TrunkModels) = {
.count = 1,
.models = {
MODEL_o10,
}
};
ShakeTreeConfig N(ShakeTree_Tree1) = {
.leaves = &N(Tree1_LeafModels),
.trunk = &N(Tree1_TrunkModels),
.callback = &N(Tree1_CallbackScript),
};
BombTrigger N(BombPos_Tree1) = {
.pos = { -200.0f, 0.0f, 1.0f },
.radius = 0.0f
};
FoliageModelList N(Tree2_LeafModels) = {
.count = 2,
.models = {
MODEL_o4,
MODEL_o5,
}
};
FoliageModelList N(Tree2_TrunkModels) = {
.count = 1,
.models = {
MODEL_o3,
}
};
ShakeTreeConfig N(ShakeTree_Tree2) = {
.leaves = &N(Tree2_LeafModels),
.trunk = &N(Tree2_TrunkModels),
.callback = &N(Tree2_CallbackScript),
};
BombTrigger N(BombPos_Tree2) = {
.pos = { 0.0f, 0.0f, 1.0f },
.radius = 0.0f
};
FoliageModelList N(Tree3_LeafModels) = {
.count = 2,
.models = {
MODEL_o14,
MODEL_o15,
}
};
FoliageModelList N(Tree3_TrunkModels) = {
.count = 1,
.models = {
MODEL_o13,
}
};
ShakeTreeConfig N(ShakeTree_Tree3) = {
.leaves = &N(Tree3_LeafModels),
.trunk = &N(Tree3_TrunkModels),
.callback = &N(Tree3_CallbackScript),
};
BombTrigger N(BombPos_Tree3) = {
.pos = { 200.0f, 0.0f, 1.0f },
.radius = 0.0f
};
EvtScript N(EVS_SetupFoliage) = {
EVT_SET(AB_FLO_TreePuzzle_FirstCorrect, 0)
EVT_SET(AB_FLO_TreePuzzle_SecondCorrect, 0)
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o10, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree2)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o3, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree2)), 1, 0)
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree3)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o13, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree3)), 1, 0)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,160 @@
#include "flo_09.h"
#include "world/common/enemy/complete/CrazyDayzee.inc.c"
#include "world/common/enemy/complete/Bzzap.inc.c"
NpcSettings N(NpcSettings_Bzzap_02) = {
.height = 24,
.radius = 24,
.level = 99,
};
EvtScript N(EVS_NpcAI_Bzzap_02) = {
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_IF_GT(LVar1, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcJumpscale, NPC_SELF, 0)
EVT_CALL(NpcJump0, NPC_SELF, LVar0, 50, LVar2, 15)
EVT_CALL(SetSelfVar, 0, 1)
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_Bzzap)))
EVT_END_IF
EVT_CASE_EQ(2)
EVT_CALL(DisablePlayerInput, TRUE)
EVT_WAIT(25)
EVT_CALL(SetNpcPos, NPC_SELF, NPC_DISPOSE_LOCATION)
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_2, FALSE)
EVT_CALL(SetSelfVar, 0, 0)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_END_SWITCH
EVT_WAIT(1)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Bzzap_02) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_CALL(SetSelfVar, 0, 2)
EVT_CALL(BindNpcAI, NPC_SELF, EVT_PTR(N(EVS_NpcAI_Bzzap_02)))
EVT_CALL(DoNpcDefeat)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Bzzap_02) = {
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcAI_Bzzap_02)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Bzzap_02)))
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Dayzee_01) = {
.id = NPC_Dayzee_01,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { -350.0f, 0.0f, 40.0f },
.yaw = 90,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -350, 0, 40 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -350, 0, 40 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Dayzee_02) = {
.id = NPC_Dayzee_02,
.settings = &N(NpcSettings_CrazyDayzee),
.pos = { 260.0f, 0.0f, 75.0f },
.yaw = 270,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = CRAZY_DAYZEE_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { 260, 0, 75 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { 260, 0, 75 },
.detectSize = { 200 },
}
},
.animations = CRAZY_DAYZEE_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Bzzap_01) = {
.id = NPC_Bzzap_01,
.settings = &N(NpcSettings_Bzzap),
.pos = { -50.0f, 55.0f, 90.0f },
.yaw = 90,
.flags = NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.drops = BZZAP_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -50, 55, 90 },
.wanderSize = { 30 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -50, 50, 90 },
.detectSize = { 250 },
}
},
.animations = BZZAP_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
StaticNpc N(NpcData_Bzzap_02) = {
.id = NPC_Bzzap_02,
.settings = &N(NpcSettings_Bzzap_02),
.pos = { NPC_DISPOSE_LOCATION },
.yaw = 90,
.flags = NPC_FLAG_4 | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_NO_PROJECT_SHADOW,
.init = &N(EVS_NpcInit_Bzzap_02),
.drops = BZZAP_DROPS,
.territory = {
.wander = {
.isFlying = TRUE,
.moveSpeedOverride = NO_OVERRIDE_MOVEMENT_SPEED,
.wanderShape = SHAPE_CYLINDER,
.centerPos = { -50, 55, 90 },
.wanderSize = { 100 },
.detectShape = SHAPE_CYLINDER,
.detectPos = { -50, 50, 90 },
.detectSize = { 250 },
}
},
.animations = BZZAP_ANIMS,
.aiDetectFlags = AI_DETECT_SIGHT | AI_DETECT_SENSITIVE_MOTION,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Dayzee_01), BTL_FLO_FORMATION_10, BTL_FLO_STAGE_04),
NPC_GROUP(N(NpcData_Dayzee_02), BTL_FLO_FORMATION_15, BTL_FLO_STAGE_04),
NPC_GROUP(N(NpcData_Bzzap_01), BTL_FLO_FORMATION_17, BTL_FLO_STAGE_01),
NPC_GROUP(N(NpcData_Bzzap_02), BTL_FLO_FORMATION_17, BTL_FLO_STAGE_01),
{}
};

View File

@ -1,9 +0,0 @@
#include "flo_10.h"
s32 N(get_tattle)(void) {
if (evt_get_variable(NULL, GB_StoryProgress) < STORY_CH6_FILLED_SPRING_WITH_WATER) {
return MSG_MapTattle_flo_10_before;
} else {
return MSG_MapTattle_flo_10_after;
}
}

View File

@ -1,7 +0,0 @@
#include "flo_10.h"
#include "effects.h"
ApiStatus N(func_80240040_CB9240)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(1, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,856 +0,0 @@
#include "flo_10.h"
#include "message_ids.h"
#include "effects.h"
#include "sprite/npc/Lily.h"
enum {
NPC_LILY,
};
EntryList N(entryList) = {
{ -360.0f, 0.0f, 0.0f, 90.0f },
{ -360.0f, 0.0f, 0.0f, 90.0f },
{ -100.0f, -10.0f, -172.0f, 135.0f },
};
MapSettings N(settings) = {
.main = &N(main),
.entryList = &N(entryList),
.entryCount = ENTRY_COUNT(N(entryList)),
.background = &gBackgroundImage,
.tattle = { .get = N(get_tattle) },
};
EvtScript N(802414E0) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(53)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_IF_GE(GB_StoryProgress, 49)
EVT_CALL(PlaySound, 0x80000022)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802415C4) = {
EVT_CALL(PushSong, 137, 2)
EVT_RETURN
EVT_END
};
EvtScript N(802415E8) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};
static s32 N(pad_1624)[] = {
0x00000000, 0x00000000, 0x00000000,
};
EvtScript N(80241630) = {
EVT_IF_GE(GB_StoryProgress, 49)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, 0, -60, 6, 1, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_167C) = {
0x00000000,
};
EvtScript N(80241680) = {
EVT_SET_GROUP(11)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, EFFECT_FLOATING_FLOWER, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, EFFECT_FLOATING_FLOWER, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(exitWalk_8024192C) = EVT_EXIT_WALK(60, 0, "flo_24", 1);
EvtScript N(80241988) = {
EVT_BIND_TRIGGER(N(exitWalk_8024192C), TRIGGER_FLOOR_ABOVE, 0, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(main) = {
EVT_SET(GB_WorldLocation, 38)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamLeadPlayer, 0, 0)
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_80244054)))
EVT_EXEC_WAIT(N(80241630))
EVT_EXEC(flo_10_80244A50)
EVT_EXEC(flo_10_802435F8)
EVT_EXEC(flo_10_80242AE8)
EVT_EXEC(flo_10_80244074)
EVT_CALL(ModifyColliderFlags, 3, 11, 0x00000006)
EVT_CALL(ModifyColliderFlags, 3, 12, 0x00000006)
EVT_SET(LVar0, -265)
EVT_SET(LVar1, 247)
EVT_SET(LVar2, 199)
EVT_SET(LVar3, 313)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80241680))
EVT_SET(LVar0, -300)
EVT_SET(LVar1, -275)
EVT_SET(LVar2, -140)
EVT_SET(LVar3, -185)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80241680))
EVT_SET(LVar0, 263)
EVT_SET(LVar1, -248)
EVT_SET(LVar2, 362)
EVT_SET(LVar3, 146)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80241680))
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(1)
EVT_EXEC(flo_10_8024324C)
EVT_CASE_EQ(2)
EVT_EXEC(flo_10_802427EC)
EVT_EXEC(N(80241988))
EVT_CASE_DEFAULT
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 1, 0x7FFFFE00)
EVT_SET(LVar0, EVT_PTR(N(80241988)))
EVT_EXEC(EnterWalk)
EVT_END_SWITCH
EVT_EXEC_WAIT(N(802414E0))
EVT_IF_GE(GB_StoryProgress, 53)
EVT_CALL(N(func_80240040_CB9240))
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_1CA8)[] = {
0x00000000, 0x00000000,
};
s32** N(varStash) = NULL;
EvtScript N(80241CB4) = {
EVT_CALL(ShowGotItem, LVar0, 1, 0)
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtScript N(80241CE4) = {
EVT_CALL(ShowGotItem, LVar0, 1, 16)
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtScript N(updateTexturePan_80241D14) = {
EVT_SET_GROUP(0)
EVT_IF_EQ(LVar5, 1)
EVT_IF_EQ(LVar6, 1)
EVT_IF_EQ(LVar7, 1)
EVT_IF_EQ(LVar8, 1)
EVT_CALL(N(UpdateTexturePanSmooth))
EVT_RETURN
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_CALL(N(UpdateTexturePanStepped))
EVT_RETURN
EVT_END
};
EvtScript N(80241DB0) = {
EVT_CALL(MakeLerp, -50, 170, 385, 0)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, 56, 0, LVar0, 0)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(80241E40) = {
EVT_CALL(MakeLerp, 0, 100, 90, 1)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_SETF(LVar3, LVar0)
EVT_DIVF(LVar2, EVT_FLOAT(333.0))
EVT_DIVF(LVar3, EVT_FLOAT(100.0))
EVT_ADDF(LVar2, EVT_FLOAT(0.703125))
EVT_CALL(ScaleGroup, 56, LVar2, LVar3, LVar2)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(80241F20) = {
EVT_CALL(EnableTexPanning, 53, 1)
EVT_THREAD
EVT_SET(LVar0, 10)
EVT_SET(LVar1, -150)
EVT_SET(LVar2, 0)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 1)
EVT_SET(LVar6, 0)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtScript N(80242030) = {
EVT_WAIT(60)
EVT_CALL(EnableModel, 53, 1)
EVT_EXEC(N(80241F20))
EVT_RETURN
EVT_END
};
EvtScript N(8024206C) = {
EVT_WAIT(80)
EVT_CALL(EnableNpcShadow, 0, FALSE)
EVT_CALL(GetNpcPos, 0, LVar3, LVar4, LVar5)
EVT_CALL(MakeLerp, 10, 55, 108, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(LVar6, LVar4)
EVT_ADD(LVar6, LVar0)
EVT_ADD(LVar6, -10)
EVT_CALL(SetNpcPos, 0, LVar3, LVar6, LVar5)
EVT_CALL(TranslateGroup, 60, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(80242188) = {
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, 524324)
EVT_CALL(GetPlayerPos, LVar2, LVar0, LVar3)
EVT_CALL(MakeLerp, -50, 90, 60, 1)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_DIVF(LVar2, EVT_FLOAT(1.2))
EVT_DIVF(LVar3, EVT_FLOAT(1.2))
EVT_CALL(SetPlayerPos, LVar2, LVar0, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 90, 270, 280, 0)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(8024230C) = {
EVT_WAIT(80)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(UseSettingsFrom, 0, LVar3, LVar4, LVar5)
EVT_CALL(SetPanTarget, 0, LVar3, LVar4, LVar5)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(0.7))
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(25.0), EVT_FLOAT(-22.0))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_RETURN
EVT_END
};
EvtScript N(802423E4) = {
EVT_CALL(DisablePartnerAI, 0)
EVT_EXEC(N(80241DB0))
EVT_EXEC(N(80241E40))
EVT_EXEC(N(80242030))
EVT_EXEC(N(8024206C))
EVT_EXEC(N(80242188))
EVT_EXEC(N(8024230C))
EVT_RETURN
EVT_END
};
EvtScript N(8024244C) = {
EVT_CALL(MakeLerp, 170, 75, 150, 0)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, 56, 0, LVar0, 0)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802424DC) = {
EVT_CALL(MakeLerp, 100, 15, 150, 1)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_SETF(LVar3, LVar0)
EVT_DIVF(LVar2, EVT_FLOAT(333.0))
EVT_DIVF(LVar3, EVT_FLOAT(100.0))
EVT_ADDF(LVar2, EVT_FLOAT(0.703125))
EVT_CALL(ScaleGroup, 56, LVar2, LVar3, LVar2)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802425BC) = {
EVT_EXEC(N(8024244C))
EVT_EXEC(N(802424DC))
EVT_RETURN
EVT_END
};
extern const char N(flo_24_name_hack)[];
EvtScript N(802425E4) = {
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(UseSettingsFrom, 0, LVar3, LVar4, LVar5)
EVT_CALL(SetPanTarget, 0, LVar3, LVar4, LVar5)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(1.0))
EVT_CALL(SetCamDistance, 0, 600)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_CALL(EnableGroup, 56, 1)
EVT_CALL(TranslateGroup, 56, 0, -50, 0)
EVT_CALL(ScaleGroup, 56, 0, 0, 0)
EVT_CALL(EnableGroup, 60, 1)
EVT_EXEC_WAIT(N(802423E4))
EVT_WAIT(20)
EVT_CALL(PlaySound, 0x80000024)
EVT_WAIT(360)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80017)
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.2))
EVT_CALL(PlayerJump1, -100, -10, -172, 75)
EVT_CALL(ShakeCam, 0, 0, 5, EVT_FLOAT(1.0))
EVT_EXEC_WAIT(N(802425BC))
EVT_WAIT(60)
EVT_CALL(GotoMap, EVT_PTR(N(flo_24_name_hack)), 2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(802427EC) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerPos, -100, -10, -172)
EVT_CALL(InterpPlayerYaw, 150, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_DeadStill)
EVT_CALL(SetNpcPos, NPC_PARTNER, -129, 9, -177)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ClearPartnerMoveHistory, -4)
EVT_CALL(EnableGroup, 52, 1)
EVT_CALL(EnableGroup, 19, 0)
EVT_CALL(EnableGroup, 61, 0)
EVT_CALL(EnableGroup, 60, 0)
EVT_CALL(SetNpcPos, 0, -57, -20, -105)
EVT_CALL(InterpNpcYaw, 0, 90, 0)
EVT_CALL(AdjustCam, 0, EVT_FLOAT(90.0), 0, 450, EVT_FLOAT(25.0), EVT_FLOAT(-6.0))
EVT_WAIT(30)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_GetUp)
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_WAIT(10)
EVT_EXEC_WAIT(N(802415C4))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lily_Talk, ANIM_Lily_Idle, 5, MSG_CH6_0082)
EVT_CALL(NpcFacePlayer, 0, 1)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0083)
EVT_CALL(SetNpcAnimation, 0, ANIM_Lily_GiveItem)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, 0, ANIM_Lily_Idle)
EVT_SET(LVar0, 90)
EVT_SET(LVar1, 1)
EVT_EXEC_WAIT(N(80241CB4))
EVT_CALL(AddKeyItem, ITEM_MIRACLE_WATER)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0084)
EVT_CALL(EndSpeech, 0, ANIM_Lily_Talk, ANIM_Lily_Idle, 0)
EVT_CALL(SetNpcAnimation, 0, ANIM_Lily_Idle)
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(802415E8))
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(80242AE8) = {
EVT_IF_LT(GB_StoryProgress, 49)
EVT_CALL(EnableGroup, 52, 0)
EVT_CALL(EnableGroup, 61, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 21, 0x7FFFFE00)
EVT_ELSE
EVT_CALL(EnableGroup, 19, 0)
EVT_CALL(EnableGroup, 61, 0)
EVT_CALL(EnableGroup, 60, 0)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 14, 0x7FFFFE00)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 15, 0x7FFFFE00)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 16, 0x7FFFFE00)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 17, 0x7FFFFE00)
EVT_END_IF
EVT_CALL(EnableTexPanning, 54, 1)
EVT_CALL(EnableTexPanning, 48, 1)
EVT_CALL(EnableTexPanning, 55, 1)
EVT_CALL(EnableTexPanning, 59, 1)
EVT_CALL(EnableTexPanning, 49, 1)
EVT_CALL(EnableTexPanning, 51, 1)
EVT_THREAD
EVT_SET(LVar0, 1)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, -2000)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 3)
EVT_SET(LVar1, -100)
EVT_SET(LVar2, 80)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 1)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 5)
EVT_SET(LVar1, -1000)
EVT_SET(LVar2, 2000)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 1)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 6)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, -2000)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 8)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, -1500)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_THREAD
EVT_SET(LVar0, 9)
EVT_SET(LVar1, 0)
EVT_SET(LVar2, -1000)
EVT_SET(LVar3, 0)
EVT_SET(LVar4, 0)
EVT_SET(LVar5, 0)
EVT_SET(LVar6, 1)
EVT_SET(LVar7, 0)
EVT_SET(LVar8, 0)
EVT_SET(LVar9, 0)
EVT_SET(LVarA, 0)
EVT_SET(LVarB, 0)
EVT_SET(LVarC, 0)
EVT_EXEC(N(updateTexturePan_80241D14))
EVT_END_THREAD
EVT_IF_GE(GB_StoryProgress, 49)
EVT_EXEC(N(80241F20))
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_3218)[] = {
0x00000000, 0x00000000,
};
NpcSettings N(npcSettings_80243220) = {
.height = 45,
.radius = 65,
.level = 99,
};
const char N(flo_24_name_hack)[] = "flo_24";
EvtScript N(8024324C) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetNpcPos, 0, 60, 0, 55)
EVT_CALL(UseSettingsFrom, 0, 0, 0, 0)
EVT_CALL(SetPanTarget, 0, 0, 0, 0)
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(17.0), EVT_FLOAT(-6.0))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_00C6)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_12"), 1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
s32 N(itemList_80243394)[] = {
ITEM_WATER_STONE,
ITEM_NONE,
};
EvtScript N(8024339C) = {
EVT_IF_EQ(GF_FLO10_ShowedLilyTheWaterStone, 1)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_CALL(AwaitPlayerLeave, 0, 0, 19)
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET_GROUP(0)
EVT_CALL(SetTimeFreezeMode, 1)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVar2, LVar0)
EVT_SWITCH(LVar2)
EVT_CASE_EQ(-1)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, 0)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_0081)
EVT_CASE_DEFAULT
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(PlayerMoveTo, -17, -17, 20)
EVT_CALL(func_802CF56C, 2)
EVT_CALL(InterpPlayerYaw, 100, 1)
EVT_WAIT(10)
EVT_CALL(AdjustCam, 0, EVT_FLOAT(1.0), 0, 450, EVT_FLOAT(25.0), EVT_FLOAT(-6.0))
EVT_WAIT(10)
EVT_CALL(SetPlayerAnimation, 393222)
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, 0, -60, 6, 1, 0)
EVT_SET(LVarA, LVar0)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, 0)
EVT_EXEC_WAIT(N(802425E4))
EVT_END_SWITCH
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(AwaitPlayerLeave, 0, 0, 19)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(802435F8) = {
EVT_BIND_PADLOCK(N(8024339C), TRIGGER_FLOOR_TOUCH, 15, EVT_PTR(N(itemList_80243394)), 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(80243628) = {
EVT_WAIT(10)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_IF_LT(LVar5, LVar2)
EVT_SET(LVar6, 30)
EVT_ELSE
EVT_SET(LVar6, 20)
EVT_END_IF
EVT_SET(LVar1, LVar0)
EVT_SET(LVar4, LVar0)
EVT_SUB(LVar1, LVar6)
EVT_ADD(LVar4, LVar6)
EVT_SWITCH(LVar3)
EVT_CASE_RANGE(LVar1, LVar4)
EVT_THREAD
EVT_IF_LT(LVar3, LVar0)
EVT_SUB(LVar0, 40)
EVT_ELSE
EVT_ADD(LVar0, 40)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, TRUE)
EVT_CALL(PlayerMoveTo, LVar0, LVar5, 15)
EVT_CALL(PlayerFaceNpc, 0, 1)
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, FALSE)
EVT_END_THREAD
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(interact_802437C8) = {
EVT_EXEC_WAIT(N(802415C4))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(45)
EVT_EXEC(N(80243628))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, 0, 325)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(23.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_0078)
EVT_CALL(EndSpeech, -1, ANIM_Lily_DreadLoop, ANIM_Lily_Dread, 5)
EVT_CASE_LT(48)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 0)
EVT_EXEC(N(80243628))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, 0, 325)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(23.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_0079)
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Lily_Idle)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_262, 0)
EVT_CALL(ShowEmote, -1, EMOTE_EXCLAMATION, 0, 15, 1, 0, 0, 0, 0)
EVT_WAIT(15)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Idle, ANIM_Lily_Idle, 0, MSG_CH6_007A)
EVT_CALL(EndSpeech, -1, ANIM_Lily_Dread, ANIM_Lily_Idle, 0)
EVT_CALL(GetPlayerTargetYaw, LVar0)
EVT_CALL(InterpNpcYaw, NPC_SELF, LVar0, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 5, MSG_CH6_007B)
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_007C)
EVT_CALL(ShowChoice, MSG_Choice_0011)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(ContinueSpeech, -1, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_007D)
EVT_CASE_EQ(1)
EVT_CALL(ContinueSpeech, -1, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_007E)
EVT_END_SWITCH
EVT_WAIT(10)
EVT_SET(GF_FLO10_LilyRequestedWaterStone, 1)
EVT_CALL(SetEnemyFlagBits, -1, 4194304, 0)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_007F)
EVT_END_IF
EVT_CASE_LT(49)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_0080)
EVT_SET(GF_FLO10_ShowedLilyTheWaterStone, 1)
EVT_CASE_LT(53)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_0085)
EVT_CALL(EndSpeech, -1, ANIM_Lily_Talk, ANIM_Lily_Idle, 0)
EVT_CALL(EndSpeech, -1, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0)
EVT_CASE_LT(60)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0086)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_0087)
EVT_END_SWITCH
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(802415E8))
EVT_RETURN
EVT_END
};
EvtScript N(init_80243D78) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(interact_802437C8)))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(48)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 0)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Lily_IdlePlead)
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 1)
EVT_CALL(SetEnemyFlagBits, -1, 4194304, 1)
EVT_END_IF
EVT_CASE_EQ(48)
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 1)
EVT_CASE_GE(49)
EVT_CALL(SetNpcPos, NPC_SELF, -67, -20, -105)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80243E64) = {
.id = NPC_LILY,
.settings = &N(npcSettings_80243220),
.pos = { 80.0f, -60.0f, 0.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(init_80243D78),
.yaw = 270,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
ANIM_Lily_Idle,
},
.tattle = MSG_NpcTattle_Lily,
};
NpcGroupList N(npcGroupList_80244054) = {
NPC_GROUP(N(npcGroup_80243E64)),
{},
};
static s32 N(pad_406C) = {
0x00000000,
};
s32 N(D_80244070_CBD270) = {
0x00000000,
};
EvtScript N(80244074) = {
EVT_RETURN
EVT_END
};
static s32 N(pad_4084)[] = {
0x00000000, 0x00000000, 0x00000000,
};
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
#include "world/common/atomic/TexturePan.inc.c"

View File

@ -1,41 +0,0 @@
#include "flo_10.h"
#include "common/foliage.inc.c"
FoliageModelList N(tree1_Leaves) = {
.count = 3,
.models = { 33, 34, 35 }
};
FoliageModelList N(tree1_Trunk) = {
.count = 1,
.models = { 32 }
};
FoliageDropList N(tree1_Drops) = {
.count = 1,
.drops = {
{
.itemID = ITEM_JAMMIN_JELLY,
.pos = { 80, 100, -240 },
.spawnMode = 0xF,
.pickupFlag = GF_FLO10_Tree1_JamminJelly,
},
}
};
ShakeTreeConfig N(tree1) = {
.leaves = &N(tree1_Leaves),
.trunk = &N(tree1_Trunk),
.drops = &N(tree1_Drops),
};
Vec4f N(triggerCoord_80244A40) = { 137.0f, 0.0f, -283.0f, 0.0f };
EvtScript N(80244A50) = {
EVT_SET(LVar0, EVT_PTR(N(tree1)))
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_WALL_HAMMER, 9, 1, 0)
EVT_BIND_TRIGGER(N(shakeTree), TRIGGER_POINT_BOMB, EVT_PTR(N(triggerCoord_80244A40)), 1, 0)
EVT_RETURN
EVT_END
};

View File

@ -2,25 +2,31 @@
/// @brief Flower Fields - (SE) Lily's Fountain
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_10_shape.h"
#include "mapfs/flo_10_hit.h"
enum {
NPC_Lily = 0,
};
#define NAMESPACE flo_10
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(UpdateTexturePanSmooth)(Evt* script, s32 isInitialCall);
ApiStatus N(UpdateTexturePanStepped)(Evt* script, s32 isInitialCall);
s32 N(get_tattle)(void);
ApiStatus N(func_80240040_CB9240)(Evt* script, s32 isInitialCall);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_PushFlowerSong);
extern EvtScript N(EVS_PopSong);
extern EvtScript N(EVS_SetupFoliage);
extern EvtScript N(EVS_MakeEntities);
extern EvtScript N(EVS_SetupFountain);
extern EvtScript N(EVS_SetupWaterStoneSocket);
extern EvtScript N(EVS_SetupWaterEffect);
extern s32 N(D_80244070_CBD270);
extern s32** N(varStash);
extern NpcGroupList N(npcGroupList_80244054);
extern EvtScript N(802427EC);
extern EvtScript N(80242AE8);
extern EvtScript N(8024324C);
extern EvtScript N(802435F8);
extern EvtScript N(80244074);
extern EvtScript N(80244A50);
extern EvtScript N(main);
extern EvtScript N(EVS_Scene_ReleaseFountain);
extern EvtScript N(EVS_Scene_PostReleaseFountain);
extern EvtScript N(EVS_Scene_SunReturns);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,23 @@
#include "flo_10.h"
s32 N(get_tattle)(void) {
if (evt_get_variable(NULL, GB_StoryProgress) < STORY_CH6_FILLED_SPRING_WITH_WATER) {
return MSG_MapTattle_flo_10_before;
} else {
return MSG_MapTattle_flo_10_after;
}
}
EntryList N(Entrances) = {
[flo_10_ENTRY_0] { -360.0, 0.0, 0.0, 90.0 },
[flo_10_ENTRY_1] { -360.0, 0.0, 0.0, 90.0 },
[flo_10_ENTRY_2] { -100.0, -10.0, -172.0, 135.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { .get = &N(get_tattle) },
};

View File

@ -0,0 +1,34 @@
#include "flo_10.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_10_ENTRY_1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_IF_GE(GB_StoryProgress, STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(PlaySound, SOUND_80000022)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PushFlowerSong) = {
EVT_CALL(PushSong, SONG_FLOWER_NPC_THEME, 2)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PopSong) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,9 @@
#include "flo_10.h"
EvtScript N(EVS_MakeEntities) = {
EVT_IF_GE(GB_StoryProgress, STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, 0, -60, 6, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,53 @@
#include "flo_10.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_24_1) = EVT_EXIT_WALK(60, flo_10_ENTRY_0, "flo_24", flo_24_ENTRY_1);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_24_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_EXEC(N(EVS_SetupFoliage))
EVT_EXEC(N(EVS_SetupWaterStoneSocket))
EVT_EXEC(N(EVS_SetupFountain))
EVT_EXEC(N(EVS_SetupWaterEffect))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o80, SURFACE_TYPE_FLOWERS)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o93, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( -265, 247, 199, 313, 0)
EVT_FLOWER_SPAWN_REGION( -300, -275, -140, -185, 0)
EVT_FLOWER_SPAWN_REGION( 263, -248, 362, 146, 0)
EVT_CALL(GetEntryID, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(flo_10_ENTRY_1)
EVT_EXEC(N(EVS_Scene_SunReturns))
EVT_CASE_EQ(flo_10_ENTRY_2)
EVT_EXEC(N(EVS_Scene_PostReleaseFountain))
EVT_EXEC(N(EVS_BindExitTriggers))
EVT_CASE_DEFAULT
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_END_SWITCH
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,315 @@
#include "flo_10.h"
#include "sprite/npc/Lily.h"
#include "world/common/complete/GiveReward.inc.c"
#include "world/common/atomic/TexturePan.inc.c"
#include "world/common/atomic/TexturePan.data.inc.c"
EvtScript N(EVS_RaiseFountain) = {
EVT_CALL(MakeLerp, -50, 170, 385, EASING_LINEAR)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, MODEL_g22, 0, LVar0, 0)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_GrowFountain) = {
EVT_CALL(MakeLerp, 0, 100, 90, EASING_QUADRATIC_IN)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_SETF(LVar3, LVar0)
EVT_DIVF(LVar2, EVT_FLOAT(333.0))
EVT_DIVF(LVar3, EVT_FLOAT(100.0))
EVT_ADDF(LVar2, EVT_FLOAT(0.703125))
EVT_CALL(ScaleGroup, MODEL_g22, LVar2, LVar3, LVar2)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_TexPan_Rainbow) = {
EVT_CALL(EnableTexPanning, MODEL_o73, TRUE)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_A)
TEX_PAN_PARAMS_STEP( -150, 0, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_RETURN
EVT_END
};
EvtScript N(EVS_EnableRainbow) = {
EVT_WAIT(60)
EVT_CALL(EnableModel, MODEL_o73, TRUE)
EVT_EXEC(N(EVS_TexPan_Rainbow))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_RaiseLily) = {
EVT_WAIT(80)
EVT_CALL(EnableNpcShadow, NPC_Lily, FALSE)
EVT_CALL(GetNpcPos, NPC_Lily, LVar3, LVar4, LVar5)
EVT_CALL(MakeLerp, 10, 55, 108, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_SET(LVar6, LVar4)
EVT_ADD(LVar6, LVar0)
EVT_ADD(LVar6, -10)
EVT_CALL(SetNpcPos, NPC_Lily, LVar3, LVar6, LVar5)
EVT_CALL(TranslateGroup, MODEL_g31, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_RaisePlayer) = {
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80024)
EVT_CALL(GetPlayerPos, LVar2, LVar0, LVar3)
EVT_CALL(MakeLerp, -50, 90, 60, EASING_QUADRATIC_IN)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_DIVF(LVar2, EVT_FLOAT(1.2))
EVT_DIVF(LVar3, EVT_FLOAT(1.2))
EVT_CALL(SetPlayerPos, LVar2, LVar0, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(MakeLerp, 90, 270, 280, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)
EVT_CALL(SetPlayerPos, 0, LVar0, 0)
EVT_WAIT(1)
EVT_IF_EQ(LVar1, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_RaiseCamera) = {
EVT_WAIT(80)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.7))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(25.0), EVT_FLOAT(-22.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_UnleashFountain) = {
EVT_CALL(DisablePartnerAI, 0)
EVT_EXEC(N(EVS_RaiseFountain))
EVT_EXEC(N(EVS_GrowFountain))
EVT_EXEC(N(EVS_EnableRainbow))
EVT_EXEC(N(EVS_RaiseLily))
EVT_EXEC(N(EVS_RaisePlayer))
EVT_EXEC(N(EVS_RaiseCamera))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_LowerFountain) = {
EVT_CALL(MakeLerp, 170, 75, 150, EASING_LINEAR)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_CALL(TranslateGroup, MODEL_g22, 0, LVar0, 0)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_ShrinkFountain) = {
EVT_CALL(MakeLerp, 100, 15, 150, EASING_QUADRATIC_IN)
EVT_LABEL(1)
EVT_CALL(UpdateLerp)
EVT_SETF(LVar2, LVar0)
EVT_SETF(LVar3, LVar0)
EVT_DIVF(LVar2, EVT_FLOAT(333.0))
EVT_DIVF(LVar3, EVT_FLOAT(100.0))
EVT_ADDF(LVar2, EVT_FLOAT(0.703125))
EVT_CALL(ScaleGroup, MODEL_g22, LVar2, LVar3, LVar2)
EVT_IF_EQ(LVar1, 1)
EVT_WAIT(1)
EVT_GOTO(1)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_FountainSlowing) = {
EVT_EXEC(N(EVS_LowerFountain))
EVT_EXEC(N(EVS_ShrinkFountain))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_ReleaseFountain) = {
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_StandStill)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar3, LVar4, LVar5)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 600)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(EnableGroup, MODEL_g22, TRUE)
EVT_CALL(TranslateGroup, MODEL_g22, 0, -50, 0)
EVT_CALL(ScaleGroup, MODEL_g22, 0, 0, 0)
EVT_CALL(EnableGroup, MODEL_g31, TRUE)
EVT_EXEC_WAIT(N(EVS_UnleashFountain))
EVT_WAIT(20)
EVT_CALL(PlaySound, SOUND_80000024)
EVT_WAIT(360)
EVT_CALL(InterpPlayerYaw, 90, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_80017)
EVT_CALL(SetPlayerJumpscale, EVT_FLOAT(0.2))
EVT_CALL(PlayerJump1, -100, -10, -172, 75)
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 5, EVT_FLOAT(1.0))
EVT_EXEC_WAIT(N(EVS_FountainSlowing))
EVT_WAIT(60)
EVT_CALL(GotoMap, EVT_PTR("flo_24"), flo_24_ENTRY_2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_PostReleaseFountain) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetPlayerPos, -100, -10, -172)
EVT_CALL(InterpPlayerYaw, 150, 0)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_DeadStill)
EVT_CALL(SetNpcPos, NPC_PARTNER, -129, 9, -177)
EVT_CALL(EnablePartnerAI)
EVT_CALL(ClearPartnerMoveHistory, NPC_PARTNER)
EVT_CALL(EnableGroup, MODEL_water, TRUE)
EVT_CALL(EnableGroup, MODEL_g2, FALSE)
EVT_CALL(EnableGroup, MODEL_g12, FALSE)
EVT_CALL(EnableGroup, MODEL_g31, FALSE)
EVT_CALL(SetNpcPos, NPC_Lily, -57, -20, -105)
EVT_CALL(InterpNpcYaw, NPC_Lily, 90, 0)
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(90.0), 0, 450, EVT_FLOAT(25.0), EVT_FLOAT(-6.0))
EVT_WAIT(30)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_GetUp)
EVT_WAIT(20)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_WAIT(10)
EVT_EXEC_WAIT(N(EVS_PushFlowerSong))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Lily, ANIM_Lily_Talk, ANIM_Lily_Idle, 5, MSG_CH6_0082)
EVT_CALL(NpcFacePlayer, NPC_Lily, 1)
EVT_CALL(SpeakToPlayer, NPC_Lily, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0083)
EVT_CALL(SetNpcAnimation, NPC_Lily, ANIM_Lily_GiveItem)
EVT_WAIT(20)
EVT_CALL(SetNpcAnimation, NPC_Lily, ANIM_Lily_Idle)
EVT_GIVE_KEY_REWARD(ITEM_MIRACLE_WATER)
EVT_CALL(SpeakToPlayer, NPC_Lily, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0084)
EVT_CALL(EndSpeech, NPC_Lily, ANIM_Lily_Talk, ANIM_Lily_Idle, 0)
EVT_CALL(SetNpcAnimation, NPC_Lily, ANIM_Lily_Idle)
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(EVS_PopSong))
EVT_CALL(DisablePlayerPhysics, FALSE)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupFountain) = {
EVT_IF_LT(GB_StoryProgress, STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(EnableGroup, MODEL_water, FALSE)
EVT_CALL(EnableGroup, MODEL_g12, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_water, COLLIDER_FLAGS_UPPER_MASK)
EVT_ELSE
EVT_CALL(EnableGroup, MODEL_g2, FALSE)
EVT_CALL(EnableGroup, MODEL_g12, FALSE)
EVT_CALL(EnableGroup, MODEL_g31, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o1, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o83, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o86, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o87, COLLIDER_FLAGS_UPPER_MASK)
EVT_END_IF
EVT_CALL(EnableTexPanning, MODEL_o25, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o40, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o78, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o77, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o118, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o119, TRUE)
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 0,-2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( -100, 80, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_5)
TEX_PAN_PARAMS_STEP(-1000, 2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_6)
TEX_PAN_PARAMS_STEP( 0,-2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_8)
TEX_PAN_PARAMS_STEP( 0,-1500, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_THREAD
TEX_PAN_PARAMS_ID(TEX_PANNER_9)
TEX_PAN_PARAMS_STEP( 0,-1000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD
EVT_IF_GE(GB_StoryProgress, STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_EXEC(N(EVS_TexPan_Rainbow))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,216 @@
#include "flo_10.h"
#include "world/common/npc/Lily.inc.c"
EvtScript N(EVS_Scene_SunReturns) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(SetNpcPos, NPC_Lily, 60, 0, 55)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 0, 0, 0)
EVT_CALL(SetPanTarget, CAM_DEFAULT, 0, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-6.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Lily, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_00C6)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_12"), flo_12_ENTRY_1)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
s32 N(KeyList)[] = {
ITEM_WATER_STONE,
ITEM_NONE
};
EvtScript N(EVS_OnInteract_WaterStoneSocket) = {
EVT_IF_EQ(GF_FLO10_ShowedLilyTheWaterStone, TRUE)
EVT_CALL(GetCurrentPartner, LVarA)
EVT_IF_NE(LVarA, 0)
EVT_CALL(AwaitPlayerLeave, 0, 0, 19)
EVT_RETURN
EVT_END_IF
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVar2, LVar0)
EVT_SWITCH(LVar2)
EVT_CASE_EQ(-1)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_Lily, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_0081)
EVT_CASE_DEFAULT
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(PlayerMoveTo, -17, -17, 20)
EVT_CALL(func_802CF56C, 2)
EVT_CALL(InterpPlayerYaw, 100, 1)
EVT_WAIT(10)
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(1.0), 0, 450, EVT_FLOAT(25.0), EVT_FLOAT(-6.0))
EVT_WAIT(10)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60006)
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, 0, -60, 6, ITEM_SPAWN_MODE_DECORATION, 0)
EVT_SET(LVarA, LVar0)
EVT_CALL(CloseChoicePopup)
EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_NORMAL)
EVT_EXEC_WAIT(N(EVS_Scene_ReleaseFountain))
EVT_END_SWITCH
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CALL(AwaitPlayerLeave, 0, 0, 19)
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_SetupWaterStoneSocket) = {
EVT_BIND_PADLOCK(EVT_PTR(N(EVS_OnInteract_WaterStoneSocket)), TRIGGER_FLOOR_TOUCH, COLLIDER_o83, EVT_PTR(N(KeyList)), 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_MovePlayerToTalk) = {
EVT_WAIT(10)
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_IF_LT(LVar5, LVar2)
EVT_SET(LVar6, 30)
EVT_ELSE
EVT_SET(LVar6, 20)
EVT_END_IF
EVT_SET(LVar1, LVar0)
EVT_SET(LVar4, LVar0)
EVT_SUB(LVar1, LVar6)
EVT_ADD(LVar4, LVar6)
EVT_SWITCH(LVar3)
EVT_CASE_RANGE(LVar1, LVar4)
EVT_THREAD
EVT_IF_LT(LVar3, LVar0)
EVT_SUB(LVar0, 40)
EVT_ELSE
EVT_ADD(LVar0, 40)
EVT_END_IF
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, TRUE)
EVT_CALL(PlayerMoveTo, LVar0, LVar5, 15)
EVT_CALL(PlayerFaceNpc, NPC_Lily, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_SELF, NPC_FLAG_100, FALSE)
EVT_END_THREAD
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Lily) = {
EVT_EXEC_WAIT(N(EVS_PushFlowerSong))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_MAGICAL_BEAN)
EVT_EXEC(N(EVS_MovePlayerToTalk))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 325)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(23.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_0078)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Lily_DreadLoop, ANIM_Lily_Dread, 5)
EVT_CASE_LT(STORY_CH6_GOT_WATER_STONE)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, FALSE)
EVT_EXEC(N(EVS_MovePlayerToTalk))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 325)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(23.0), EVT_FLOAT(-9.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_0079)
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Lily_Idle)
EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_262, 0)
EVT_CALL(ShowEmote, NPC_SELF, EMOTE_EXCLAMATION, 0, 15, TRUE, 0, 0, 0, 0)
EVT_WAIT(15)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Idle, ANIM_Lily_Idle, 0, MSG_CH6_007A)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Lily_Dread, ANIM_Lily_Idle, 0)
EVT_CALL(GetPlayerTargetYaw, LVar0)
EVT_CALL(InterpNpcYaw, NPC_SELF, LVar0, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 5, MSG_CH6_007B)
EVT_CALL(NpcFacePlayer, NPC_SELF, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_007C)
EVT_CALL(ShowChoice, MSG_Choice_0011)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(ContinueSpeech, NPC_SELF, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_007D)
EVT_CASE_EQ(1)
EVT_CALL(ContinueSpeech, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_007E)
EVT_END_SWITCH
EVT_WAIT(10)
EVT_SET(GF_FLO10_LilyRequestedWaterStone, TRUE)
EVT_CALL(SetEnemyFlagBits, NPC_SELF, ENEMY_FLAGS_400000, 0)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 5, MSG_CH6_007F)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_0080)
EVT_SET(GF_FLO10_ShowedLilyTheWaterStone, TRUE)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0, MSG_CH6_0085)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0)
EVT_CALL(EndSpeech, NPC_SELF, ANIM_Lily_TalkPlead, ANIM_Lily_IdlePlead, 0)
EVT_CASE_LT(STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_TalkHappy, ANIM_Lily_IdleHappy, 0, MSG_CH6_0086)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Lily_Talk, ANIM_Lily_Idle, 0, MSG_CH6_0087)
EVT_END_SWITCH
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(EVS_PopSong))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lily) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Lily)))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_WATER_STONE)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Lily_IdlePlead)
EVT_CALL(InterpNpcYaw, NPC_SELF, 90, 1)
EVT_CALL(SetEnemyFlagBits, NPC_SELF, ENEMY_FLAGS_400000, 1)
EVT_END_IF
EVT_CASE_EQ(STORY_CH6_GOT_WATER_STONE)
EVT_CALL(InterpNpcYaw, NPC_SELF, 270, 1)
EVT_CASE_GE(STORY_CH6_FILLED_SPRING_WITH_WATER)
EVT_CALL(SetNpcPos, NPC_SELF, -67, -20, -105)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Lily) = {
.id = NPC_Lily,
.settings = &N(NpcSettings_Lily),
.pos = { 80.0f, -60.0f, 0.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING,
.init = &N(EVS_NpcInit_Lily),
.drops = LILY_DROPS,
.animations = LILY_ANIMS,
.tattle = MSG_NpcTattle_Lily,
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Lily)),
{}
};

View File

@ -2,6 +2,16 @@
#include "nu/nusys.h"
#include "model.h"
s32 N(WavePhase) = {
0
};
// unused wavy distortion effect for edge water -- unclear how it would have been used
EvtScript N(EVS_SetupWaterEffect) = {
EVT_RETURN
EVT_END
};
void N(UnkModelFunc000)(s32 x1, s32 y1, s32 x2, s32 y2) {
s32 i;
f32 f0;
@ -9,7 +19,7 @@ void N(UnkModelFunc000)(s32 x1, s32 y1, s32 x2, s32 y2) {
u16* img;
s32 alpha;
N(D_80244070_CBD270) += 5;
N(WavePhase) += 5;
if (x1 >= x2 || y1 >= y2) {
return;
@ -58,13 +68,13 @@ void N(UnkModelFunc000)(s32 x1, s32 y1, s32 x2, s32 y2) {
if (alpha > 255) {
alpha = 255;
}
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0xFF, 0xFF, 0xFF, alpha);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, alpha);
gDPLoadTextureTile(gMasterGfxPos++, osVirtualToPhysical(img), G_IM_FMT_RGBA, G_IM_SIZ_16b,
SCREEN_WIDTH, 6,
x1, y1 - 6 * i - 6, x2 - 1, y1 - 6 * i - 1, 0,
G_TX_WRAP, G_TX_WRAP, 9, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gMasterGfxPos++, x1 * 4, (y1 + i * 6) * 4, x2 * 4, (y1 + i * 6 + 6) * 4,
G_TX_RENDERTILE, x1 * 32, (y1 - i * 6) * 32, 1024, (s32)(sin_deg(N(D_80244070_CBD270) + i * 30) * 500.0f) - 500);
G_TX_RENDERTILE, x1 * 32, (y1 - i * 6) * 32, 1024, (s32)(sin_deg(N(WavePhase) + i * 30) * 500.0f) - 500);
}
}
@ -74,7 +84,7 @@ void N(UnkModelFunc000)(s32 x1, s32 y1, s32 x2, s32 y2) {
if (alpha > 255) {
alpha = 255;
}
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0xFF, 0xFF, 0xFF, alpha);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, alpha);
gDPLoadTextureTile(gMasterGfxPos++, osVirtualToPhysical(img), G_IM_FMT_RGBA, G_IM_SIZ_16b,
SCREEN_WIDTH, 6,
x1, y1 - 6 * i - m, x2 - 1, y1 - 6 * i - 1, 0,
@ -87,7 +97,7 @@ void N(UnkModelFunc000)(s32 x1, s32 y1, s32 x2, s32 y2) {
void N(UnkModelFunc001)(void) {
Camera* camera = &gCameras[gCurrentCameraID];
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(0x30));
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o40));
ModelBoundingBox* bb = (ModelBoundingBox*) model->modelNode->propertyList;
f32 bbHalfX = bb->halfSizeX;
f32 bbHalfZ = bb->halfSizeZ;
@ -247,3 +257,4 @@ void N(UnkModelFunc001)(void) {
gDPSetDepthSource(gMasterGfxPos++, G_ZS_PIXEL);
}
}

View File

@ -0,0 +1,50 @@
#include "flo_10.h"
#include "common/foliage.inc.c"
FoliageModelList N(Tree1_LeafModels) = {
.count = 3,
.models = {
MODEL_o47,
MODEL_o48,
MODEL_o49,
}
};
FoliageModelList N(Tree1_TrunkModels) = {
.count = 1,
.models = {
MODEL_o88,
}
};
FoliageDropList N(Tree1_Drops) = {
.count = 1,
.drops = {
{
.itemID = ITEM_JAMMIN_JELLY,
.pos = { 80, 100, -240 },
.spawnMode = ITEM_SPAWN_MODE_FALL_SPAWN_ONCE,
.pickupFlag = GF_FLO10_Tree1_JamminJelly,
},
}
};
ShakeTreeConfig N(ShakeTree_Tree1) = {
.leaves = &N(Tree1_LeafModels),
.trunk = &N(Tree1_TrunkModels),
.drops = &N(Tree1_Drops),
};
BombTrigger N(BombPos_Tree1) = {
.pos = { 137.0f, 0.0f, -283.0f },
.radius = 0.0f
};
EvtScript N(EVS_SetupFoliage) = {
EVT_SET(LVar0, EVT_PTR(N(ShakeTree_Tree1)))
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_WALL_HAMMER, COLLIDER_o85, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(shakeTree)), TRIGGER_POINT_BOMB, EVT_PTR(N(BombPos_Tree1)), 1, 0)
EVT_RETURN
EVT_END
};

View File

@ -1,664 +0,0 @@
#include "flo_11.h"
#include "message_ids.h"
#include "sprite/npc/Lakitu.h"
#include "entity.h"
#include "effects.h"
enum {
NPC_LAKITU0,
NPC_LAKITU1,
};
EntryList N(entryList) = {
{ 470.0f, 0.0f, -15.0f, 270.0f },
{ -470.0f, 0.0f, -15.0f, 90.0f },
{ 360.0f, 50.0f, -237.0f, 270.0f },
{ 118.0f, 50.0f, -420.0f, 270.0f },
{ 0.0f, 50.0f, 0.0f, 270.0f },
{ -120.0f, 50.0f, 357.0f, 90.0f },
{ -360.0f, 50.0f, -240.0f, 90.0f },
{ -360.0f, 35.0f, 0.0f, 90.0f },
};
MapSettings N(settings) = {
.main = &N(main),
.entryList = &N(entryList),
.entryCount = ENTRY_COUNT(N(entryList)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_11 },
};
EvtScript N(802403E0) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(80240450) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, 0xD, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, 0xD, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
#include "world/common/entity/PipeData.inc.c"
EvtScript N(exitWalk_8024142C) = EVT_EXIT_WALK(60, 0, "flo_23", 1);
EvtScript N(exitWalk_80241488) = EVT_EXIT_WALK(60, 1, "flo_12", 0);
EvtScript N(802414E4) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 5)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(80241520) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 6)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(8024155C) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 7)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(80241598) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(802415D4) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 3)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(80241610) = {
EVT_SET_GROUP(EVT_GROUP_1B)
EVT_CALL(GotoMap, EVT_PTR("flo_11"), 4)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(8024164C) = {
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_EXEC_WAIT(N(Pipe_ExitVertical))
EVT_RETURN
EVT_END
};
EvtScript N(80241698) = {
EVT_BIND_TRIGGER(N(exitWalk_80241488), TRIGGER_FLOOR_ABOVE, 0, 1, 0)
EVT_BIND_TRIGGER(N(exitWalk_8024142C), TRIGGER_FLOOR_ABOVE, 4, 1, 0)
EVT_SET(LVar0, 2)
EVT_SET(LVar1, 35)
EVT_SET(LVar2, EVT_PTR(N(802414E4)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_SET(LVar0, 3)
EVT_SET(LVar1, 34)
EVT_SET(LVar2, EVT_PTR(N(80241520)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_SET(LVar0, 4)
EVT_SET(LVar1, 33)
EVT_SET(LVar2, EVT_PTR(N(8024155C)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_SET(LVar0, 5)
EVT_SET(LVar1, 32)
EVT_SET(LVar2, EVT_PTR(N(80241598)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_SET(LVar0, 6)
EVT_SET(LVar1, 31)
EVT_SET(LVar2, EVT_PTR(N(802415D4)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_SET(LVar0, 7)
EVT_SET(LVar1, 30)
EVT_SET(LVar2, EVT_PTR(N(80241610)))
EVT_BIND_TRIGGER(N(8024164C), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(main) = {
EVT_SET(GB_WorldLocation, 38)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_CALL(func_80044238, 5)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802430D4)))
EVT_EXEC_WAIT(N(makeEntities))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 1, 0x7FFFFE00)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 5, 0x7FFFFE00)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_LE(LVar0, 1)
EVT_SET(LVar0, EVT_PTR(N(80241698)))
EVT_EXEC(EnterWalk)
EVT_EXEC(N(80242240))
EVT_WAIT(1)
EVT_ELSE
EVT_SET(LVarA, EVT_PTR(N(80241698)))
EVT_EXEC(N(Pipe_EnterVertical))
EVT_WAIT(1)
EVT_END_IF
EVT_EXEC_WAIT(N(802403E0))
EVT_IF_GE(GB_StoryProgress, 53)
EVT_CALL(N(func_802402E0_CBDFB0))
EVT_END_IF
EVT_CALL(ModifyColliderFlags, 3, 9, 0x00000009)
EVT_CALL(ModifyColliderFlags, 3, 10, 0x00000009)
EVT_CALL(ModifyColliderFlags, 3, 11, 0x00000009)
EVT_CALL(ModifyColliderFlags, 3, 12, 0x00000009)
EVT_RETURN
EVT_END
};
static s32 N(pad_1AB8)[] = {
0x00000000, 0x00000000,
};
NpcSettings N(npcSettings_80241AC0) = {
.height = 32,
.radius = 24,
.onHit = &EnemyNpcHit,
.onDefeat = &EnemyNpcDefeat,
.level = 20,
};
s32 N(vectorList_80241AEC)[] = {
0x43E60000, 0x43480000, 0xC3700000, 0x43B40000, 0x43160000, 0xC30C0000, 0x43820000, 0x42C80000,
0xC3700000, 0x43B40000, 0x42C80000, 0xC3DC0000, 0x43E60000, 0x42C80000, 0xC3700000, 0x43B40000,
0x42C80000, 0xC30C0000, 0x43820000, 0x42C80000, 0xC3700000, 0x43B40000, 0x42C80000, 0xC3DC0000,
};
s32 N(vectorList_80241B4C)[] = {
0xC2C80000, 0x43480000, 0xC2480000, 0x00000000, 0x43160000, 0xC3160000, 0x42C80000, 0x42C80000,
0xC2480000, 0x00000000, 0x42C80000, 0x42480000, 0xC2C80000, 0x42C80000, 0xC2480000, 0x00000000,
0x42C80000, 0xC3160000, 0x42C80000, 0x42C80000, 0xC2480000, 0x00000000, 0x42C80000, 0x42480000,
};
s32 N(vectorList_80241BAC)[] = {
0x43B40000, 0x42C80000, 0xC3DC0000, 0x43AF0000, 0x42F00000, 0xC35C0000, 0x43960000, 0x42F00000,
0xC3240000, 0x43200000, 0x42DC0000, 0xC3340000,
};
s32 N(vectorList_80241BDC)[] = {
0x00000000, 0x42C80000, 0x42480000, 0x43480000, 0x42DC0000, 0x41E80000, 0x43670000, 0x42DC0000,
0xC1900000, 0x42E60000, 0x42C80000, 0xC3160000,
};
s32 N(vectorList_80241C0C)[] = {
0x438E8000, 0x42F00000, 0xC2D80000, 0x43B90000, 0x42C80000, 0xC3020000, 0x43E30000, 0x42700000,
0xC1A00000,
};
s32 N(vectorList_80241C30)[] = {
0x43838000, 0x42DC0000, 0xC2840000, 0x43B40000, 0x42B40000, 0x42480000, 0x43E30000, 0x42480000,
0x41A00000,
};
s32 N(vectorList_80241C54)[] = {
0x43C80000, 0x41F00000, 0xC2200000, 0x43960000, 0x42A00000, 0xC2200000, 0x43160000, 0x43480000,
0xC2200000, 0x42C80000, 0x43AF0000, 0xC2200000,
};
s32 N(vectorList_80241C84)[] = {
0x43C80000, 0x41F00000, 0x42200000, 0x43960000, 0x42A00000, 0x42200000, 0x43160000, 0x43480000,
0x42200000, 0x42C80000, 0x43AF0000, 0x42200000,
};
EvtScript N(80241CB4) = {
EVT_LOOP(0)
EVT_CALL(PlaySound, SOUND_295)
EVT_WAIT(LVar0)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(80241CF4) = {
EVT_SET(LVar0, 5)
EVT_EXEC_GET_TID(N(80241CB4), MapVar(11))
EVT_THREAD
EVT_CALL(LoadPath, 160, EVT_PTR(N(vectorList_80241AEC)), 8, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 0, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 160, EVT_PTR(N(vectorList_80241B4C)), 8, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 1, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_SET(MapVar(10), 1)
EVT_RETURN
EVT_END
};
EvtScript N(80241E4C) = {
EVT_THREAD
EVT_CALL(LoadPath, 30, EVT_PTR(N(vectorList_80241BAC)), 4, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 0, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 45, EVT_PTR(N(vectorList_80241BDC)), 4, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 1, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_KILL_THREAD(MapVar(11))
EVT_RETURN
EVT_END
};
EvtScript N(80241F80) = {
EVT_SET(LVar0, 4)
EVT_EXEC_GET_TID(N(80241CB4), MapVar(11))
EVT_THREAD
EVT_CALL(LoadPath, 35, EVT_PTR(N(vectorList_80241C0C)), 3, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 0, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 35, EVT_PTR(N(vectorList_80241C30)), 3, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 1, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(802420C8) = {
EVT_THREAD
EVT_CALL(LoadPath, 40, EVT_PTR(N(vectorList_80241C54)), 4, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 0, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcPos, 0, 0, -1000, 0)
EVT_END_THREAD
EVT_CALL(LoadPath, 40, EVT_PTR(N(vectorList_80241C84)), 4, 0)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, 1, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcPos, 1, 0, -1000, 0)
EVT_WAIT(40)
EVT_KILL_THREAD(MapVar(11))
EVT_RETURN
EVT_END
};
EvtScript N(80242240) = {
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, 1)
EVT_RETURN
EVT_END_IF
EVT_IF_LT(GB_StoryProgress, 45)
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 0)
EVT_RETURN
EVT_END_IF
EVT_CALL(SetNpcPos, 0, 460, 200, -240)
EVT_CALL(SetNpcPos, 1, -100, 200, -50)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar0, 440)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(MapVar(10), 0)
EVT_EXEC(N(80241CF4))
EVT_CALL(SetCamType, 0, 1, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(25.0), EVT_FLOAT(-7.0))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_SET(LVar0, 270)
EVT_SET(LVar1, 100)
EVT_SET(LVar2, -87)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamPosA, 0, 87, 0)
EVT_CALL(SetCamPosB, 0, 0, -50)
EVT_CALL(SetCamPosC, 0, 87, 0)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_CALL(SetCamDistance, 0, 150)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(17.0), EVT_FLOAT(-16.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_IF_EQ(MapVar(10), 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(NpcFaceNpc, 0, 1, 1)
EVT_CALL(NpcFaceNpc, 1, 0, 1)
EVT_EXEC(N(80241E4C))
EVT_WAIT(30)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_0088)
EVT_CALL(NpcFaceNpc, 1, 0, 1)
EVT_CALL(SpeakToPlayer, 1, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_0089)
EVT_CALL(InterpNpcYaw, 0, 0, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, 0, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_008A)
EVT_CALL(SpeakToPlayer, 1, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_008B)
EVT_CALL(SetCamType, 0, 1, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamDistance, 0, 450)
EVT_CALL(SetCamPosA, 0, 87, 0)
EVT_CALL(SetCamPosB, 0, 0, -50)
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_EXEC(N(80241F80))
EVT_CALL(SetNpcVar, 0, 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(idle_80242810) = {
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_IF_NE(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_THREAD
EVT_CALL(AdjustCam, 0, EVT_FLOAT(4.0), 0, 1000, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_END_THREAD
EVT_CALL(StartBossBattle, 3)
EVT_RETURN
EVT_END
};
EvtScript N(defeat_802428B8) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(SetNpcPos, 0, 400, 20, -40)
EVT_CALL(SetNpcPos, 1, 400, 20, 40)
EVT_CALL(InterpNpcYaw, 0, 270, 0)
EVT_CALL(InterpNpcYaw, 1, 270, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar2, -60)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, 0, 900)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(24.0), EVT_FLOAT(-4.0))
EVT_CALL(SetCamPosA, 0, EVT_FLOAT(-95.0), EVT_FLOAT(0.0))
EVT_CALL(SetCamPosB, 0, EVT_FLOAT(0.0), EVT_FLOAT(-50.0))
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_EXEC_WAIT(N(802420C8))
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_SET(GF_FLO11_Defeated_Lakitus, 1)
EVT_SET(MapVar(0), 1)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CASE_EQ(1)
EVT_CASE_EQ(2)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(defeat_80242AC4) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_LABEL(0)
EVT_IF_EQ(MapVar(0), 0)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CASE_EQ(1)
EVT_CASE_EQ(2)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(init_80242B58) = {
EVT_CALL(SetNpcPos, 0, 0, -1000, 0)
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, 0)
EVT_IF_GE(GB_StoryProgress, 45)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 1)
EVT_SET(MapVar(0), 0)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(idle_80242810)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_802428B8)))
EVT_CALL(SetNpcPos, 0, 350, 120, -220)
EVT_CALL(InterpNpcYaw, 0, 270, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(init_80242C38) = {
EVT_CALL(SetNpcPos, 1, 0, -1000, 0)
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, 0)
EVT_IF_GE(GB_StoryProgress, 45)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 1)
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(defeat_80242AC4)))
EVT_CALL(SetNpcPos, 1, 200, 110, 29)
EVT_CALL(InterpNpcYaw, 1, 0, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_80242CF4)[] = {
{
.id = NPC_LAKITU0,
.settings = &N(npcSettings_80241AC0),
.pos = { 553.0f, 60.0f, 52.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_40000,
.init = &N(init_80242B58),
.yaw = 270,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 25,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(3),
.maxCoinBonus = 2,
},
.animations = {
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim02,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim04,
ANIM_Lakitu_Anim04,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
},
},
{
.id = NPC_LAKITU1,
.settings = &N(npcSettings_80241AC0),
.pos = { 553.0f, 60.0f, 52.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_40000,
.init = &N(init_80242C38),
.yaw = 270,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.itemDropChance = 25,
.itemDrops = {
{ ITEM_SUPER_SHROOM, 2, 0 },
{ ITEM_MAPLE_SYRUP, 2, 0 },
{ ITEM_THUNDER_RAGE, 2, 0 },
{ ITEM_STOP_WATCH, 2, 0 },
},
.heartDrops = STANDARD_HEART_DROPS(2),
.flowerDrops = STANDARD_FLOWER_DROPS(3),
.maxCoinBonus = 2,
},
.animations = {
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim02,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim04,
ANIM_Lakitu_Anim04,
ANIM_Lakitu_Anim03,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
ANIM_Lakitu_Anim01,
},
},
};
NpcGroupList N(npcGroupList_802430D4) = {
NPC_GROUP(N(npcGroup_80242CF4), 0x1807, 0x08),
{},
};
static s32 N(pad_30EC) = {
0x00000000,
};
EvtScript N(makeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_MulticoinBlock), -220, 60, -75, 0, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, GF_FLO11_MultiCoinBrick)
EVT_RETURN
EVT_END
};
#include "world/common/entity/Pipe.inc.c"
ApiStatus N(func_802402E0_CBDFB0)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -2,16 +2,28 @@
/// @brief Flower Fields - (West) Maze
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_11_shape.h"
#include "mapfs/flo_11_hit.h"
enum {
NPC_Lakitu_01 = 0,
NPC_Lakitu_02 = 1,
};
enum {
MV_LakituAmbushState = MapVar(0),
MV_LakituSearchSync = MapVar(10),
MV_FlyingSoundsScript = MapVar(11),
};
#define NAMESPACE flo_11
ApiStatus N(func_802402E0_CBDFB0)(Evt* script, s32 isInitialCall);
extern NpcGroupList N(npcGroupList_802430D4);
extern EvtScript N(80240F1C);
extern EvtScript N(80242240);
extern EvtScript N(main);
extern EvtScript N(makeEntities);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_MakeEntities);
extern EvtScript N(EVS_Scene_LakituAmbush);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,20 @@
#include "flo_11.h"
EntryList N(Entrances) = {
[flo_11_ENTRY_0] { 470.0, 0.0, -15.0, 270.0 },
[flo_11_ENTRY_1] { -470.0, 0.0, -15.0, 90.0 },
[flo_11_ENTRY_2] { 360.0, 50.0, -237.0, 270.0 },
[flo_11_ENTRY_3] { 118.0, 50.0, -420.0, 270.0 },
[flo_11_ENTRY_4] { 0.0, 50.0, 0.0, 270.0 },
[flo_11_ENTRY_5] { -120.0, 50.0, 357.0, 90.0 },
[flo_11_ENTRY_6] { -360.0, 50.0, -240.0, 90.0 },
[flo_11_ENTRY_7] { -360.0, 35.0, 0.0, 90.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_11 },
};

View File

@ -0,0 +1,12 @@
#include "flo_11.h"
EvtScript N(EVS_SetupMusic) = {
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,94 @@
#include "flo_11.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
#include "world/common/entity/Pipe.inc.c"
#include "world/common/entity/Pipe.data.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_23_1) = EVT_EXIT_WALK(60, flo_11_ENTRY_0, "flo_23", flo_23_ENTRY_1);
EvtScript N(EVS_ExitWalk_flo_12_0) = EVT_EXIT_WALK(60, flo_11_ENTRY_1, "flo_12", flo_12_ENTRY_0);
// template for GotoMap exits used with pipes in the maze
#define EVT_GOTO_MAP(mapName, entry) \
{ \
EVT_SET_GROUP(EVT_GROUP_1B) \
EVT_CALL(GotoMap, EVT_PTR(mapName), entry) \
EVT_WAIT(100) \
EVT_RETURN \
EVT_END \
}
// template for binding the event for the generic EVS_OnEnterPipe
#define EVT_SETUP_PIPE(entry, collider, exitScript) \
EVT_SET(LVar0, entry) \
EVT_SET(LVar1, collider) \
EVT_SET(LVar2, EVT_PTR(exitScript)) \
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_OnEnterPipe)), TRIGGER_FLOOR_TOUCH, LVar1, 1, 0)
EvtScript N(EVS_GotoMap_flo_11_5) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_5);
EvtScript N(EVS_GotoMap_flo_11_6) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_6);
EvtScript N(EVS_GotoMap_flo_11_7) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_7);
EvtScript N(EVS_GotoMap_flo_11_2) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_2);
EvtScript N(EVS_GotoMap_flo_11_3) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_3);
EvtScript N(EVS_GotoMap_flo_11_4) = EVT_GOTO_MAP("flo_11", flo_11_ENTRY_4);
EvtScript N(EVS_OnEnterPipe) = {
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_EXEC_WAIT(N(EVS_Pipe_ExitVertical))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_12_0)), TRIGGER_FLOOR_ABOVE, COLLIDER_deiliw, 1, 0)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_23_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_SETUP_PIPE(flo_11_ENTRY_2, COLLIDER_o91, N(EVS_GotoMap_flo_11_5)) // link 2 <--> 5
EVT_SETUP_PIPE(flo_11_ENTRY_3, COLLIDER_o92, N(EVS_GotoMap_flo_11_6)) // link 3 <--> 6
EVT_SETUP_PIPE(flo_11_ENTRY_4, COLLIDER_o93, N(EVS_GotoMap_flo_11_7)) // link 4 <--> 7
EVT_SETUP_PIPE(flo_11_ENTRY_5, COLLIDER_o94, N(EVS_GotoMap_flo_11_2)) // link 2 <--> 5
EVT_SETUP_PIPE(flo_11_ENTRY_6, COLLIDER_o95, N(EVS_GotoMap_flo_11_3)) // link 3 <--> 6
EVT_SETUP_PIPE(flo_11_ENTRY_7, COLLIDER_o96, N(EVS_GotoMap_flo_11_4)) // link 4 <--> 7
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_CALL(func_80044238, 5)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_EXEC_WAIT(N(EVS_MakeEntities))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilitw, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilite, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_LE(LVar0, flo_11_ENTRY_1)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_EXEC(N(EVS_Scene_LakituAmbush))
EVT_WAIT(1)
EVT_ELSE
EVT_SET(LVarA, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(N(EVS_Pipe_EnterVertical))
EVT_WAIT(1)
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o90, SURFACE_TYPE_HEDGES)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o104, SURFACE_TYPE_HEDGES)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o105, SURFACE_TYPE_HEDGES)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o109, SURFACE_TYPE_HEDGES)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,397 @@
#include "flo_11.h"
#include "world/common/enemy/complete/Lakitu_Stationary.inc.c"
Vec3f N(FlightPath_Lakitu_01_Search)[] = {
{ 460.0, 200.0, -240.0 },
{ 360.0, 150.0, -140.0 },
{ 260.0, 100.0, -240.0 },
{ 360.0, 100.0, -440.0 },
{ 460.0, 100.0, -240.0 },
{ 360.0, 100.0, -140.0 },
{ 260.0, 100.0, -240.0 },
{ 360.0, 100.0, -440.0 },
};
Vec3f N(FlightPath_Lakitu_02_Search)[] = {
{ -100.0, 200.0, -50.0 },
{ 0.0, 150.0, -150.0 },
{ 100.0, 100.0, -50.0 },
{ 0.0, 100.0, 50.0 },
{ -100.0, 100.0, -50.0 },
{ 0.0, 100.0, -150.0 },
{ 100.0, 100.0, -50.0 },
{ 0.0, 100.0, 50.0 },
};
Vec3f N(FlightPath_Lakitu_01_Gather)[] = {
{ 360.0, 100.0, -440.0 },
{ 350.0, 120.0, -220.0 },
{ 300.0, 120.0, -164.0 },
{ 160.0, 110.0, -180.0 },
};
Vec3f N(FlightPath_Lakitu_02_Gather)[] = {
{ 0.0, 100.0, 50.0 },
{ 200.0, 110.0, 29.0 },
{ 231.0, 110.0, -18.0 },
{ 115.0, 100.0, -150.0 },
};
Vec3f N(FlightPath_Lakitu_01_Attack)[] = {
{ 285.0, 120.0, -108.0 },
{ 370.0, 100.0, -130.0 },
{ 454.0, 60.0, -20.0 },
};
Vec3f N(FlightPath_Lakitu_02_Attack)[] = {
{ 263.0, 110.0, -66.0 },
{ 360.0, 90.0, 50.0 },
{ 454.0, 50.0, 20.0 },
};
Vec3f N(FlightPath_Lakitu_01_Flee)[] = {
{ 400.0, 30.0, -40.0 },
{ 300.0, 80.0, -40.0 },
{ 150.0, 200.0, -40.0 },
{ 100.0, 350.0, -40.0 },
};
Vec3f N(FlightPath_Lakitu_02_Flee)[] = {
{ 400.0, 30.0, 40.0 },
{ 300.0, 80.0, 40.0 },
{ 150.0, 200.0, 40.0 },
{ 100.0, 350.0, 40.0 },
};
EvtScript N(EVS_PlayFlightSounds) = {
EVT_LOOP(0)
EVT_CALL(PlaySound, SOUND_295)
EVT_WAIT(LVar0)
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_LakitusFlying_Search) = {
EVT_SET(LVar0, 5)
EVT_EXEC_GET_TID(N(EVS_PlayFlightSounds), MV_FlyingSoundsScript)
EVT_THREAD
EVT_CALL(LoadPath, 160, EVT_PTR(N(FlightPath_Lakitu_01_Search)),
ARRAY_COUNT(N(FlightPath_Lakitu_01_Search)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_01, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 160, EVT_PTR(N(FlightPath_Lakitu_02_Search)),
ARRAY_COUNT(N(FlightPath_Lakitu_02_Search)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_SET(MV_LakituSearchSync, 1)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_LakitusFlying_Gather) = {
EVT_THREAD
EVT_CALL(LoadPath, 30, EVT_PTR(N(FlightPath_Lakitu_01_Gather)),
ARRAY_COUNT(N(FlightPath_Lakitu_01_Gather)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_01, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 45, EVT_PTR(N(FlightPath_Lakitu_02_Gather)),
ARRAY_COUNT(N(FlightPath_Lakitu_02_Gather)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_KILL_THREAD(MV_FlyingSoundsScript)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_LakitusFlying_Attack) = {
EVT_SET(LVar0, 4)
EVT_EXEC_GET_TID(N(EVS_PlayFlightSounds), MV_FlyingSoundsScript)
EVT_THREAD
EVT_CALL(LoadPath, 35, EVT_PTR(N(FlightPath_Lakitu_01_Attack)),
ARRAY_COUNT(N(FlightPath_Lakitu_01_Attack)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_01, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_END_THREAD
EVT_CALL(LoadPath, 35, EVT_PTR(N(FlightPath_Lakitu_02_Attack)),
ARRAY_COUNT(N(FlightPath_Lakitu_02_Attack)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_RETURN
EVT_END
};
EvtScript N(EVS_LakitusFlying_Flee) = {
EVT_THREAD
EVT_CALL(LoadPath, 40, EVT_PTR(N(FlightPath_Lakitu_01_Flee)),
ARRAY_COUNT(N(FlightPath_Lakitu_01_Flee)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_01, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_Lakitu_01, NPC_DISPOSE_LOCATION)
EVT_END_THREAD
EVT_CALL(LoadPath, 40, EVT_PTR(N(FlightPath_Lakitu_02_Flee)),
ARRAY_COUNT(N(FlightPath_Lakitu_02_Flee)), EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(GetNextPathPos)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, LVar1, LVar2, LVar3)
EVT_WAIT(1)
EVT_IF_EQ(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(SetNpcPos, NPC_Lakitu_02, NPC_DISPOSE_LOCATION)
EVT_WAIT(40)
EVT_KILL_THREAD(MV_FlyingSoundsScript)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Scene_LakituAmbush) = {
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, TRUE)
EVT_RETURN
EVT_END_IF
EVT_IF_LT(GB_StoryProgress, STORY_CH6_GOT_MAGICAL_BEAN)
EVT_RETURN
EVT_END_IF
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, FALSE)
EVT_RETURN
EVT_END_IF
EVT_CALL(SetNpcPos, NPC_Lakitu_01, 460, 200, -240)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, -100, 200, -50)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_IF_LT(LVar0, 440)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(DisablePlayerInput, TRUE)
EVT_SET(MV_LakituSearchSync, 0)
EVT_EXEC(N(EVS_LakitusFlying_Search))
EVT_CALL(SetCamType, CAM_DEFAULT, 1, FALSE)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(25.0), EVT_FLOAT(-7.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_SET(LVar0, 270)
EVT_SET(LVar1, 100)
EVT_SET(LVar2, -87)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, 87, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamPosC, CAM_DEFAULT, 87, 0)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(30)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 150)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-16.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_LOOP(0)
EVT_WAIT(1)
EVT_IF_EQ(MV_LakituSearchSync, 1)
EVT_BREAK_LOOP
EVT_END_IF
EVT_END_LOOP
EVT_CALL(NpcFaceNpc, NPC_Lakitu_01, NPC_Lakitu_02, 1)
EVT_CALL(NpcFaceNpc, NPC_Lakitu_02, NPC_Lakitu_01, 1)
EVT_EXEC(N(EVS_LakitusFlying_Gather))
EVT_WAIT(30)
EVT_CALL(SpeakToPlayer, NPC_Lakitu_01, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_0088)
EVT_CALL(NpcFaceNpc, NPC_Lakitu_02, NPC_Lakitu_01, 1)
EVT_CALL(SpeakToPlayer, NPC_Lakitu_02, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_0089)
EVT_CALL(InterpNpcYaw, NPC_Lakitu_01, 0, 1)
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Lakitu_01, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_008A)
EVT_CALL(SpeakToPlayer, NPC_Lakitu_02, ANIM_Lakitu_Anim16, ANIM_Lakitu_Anim01, 0, MSG_CH6_008B)
EVT_CALL(SetCamType, CAM_DEFAULT, 1, FALSE)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_CALL(SetCamDistance, CAM_DEFAULT, 450)
EVT_CALL(SetCamPosA, CAM_DEFAULT, 87, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_EXEC(N(EVS_LakitusFlying_Attack))
EVT_CALL(SetNpcVar, NPC_Lakitu_01, 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcIdle_Lakitu_01) = {
EVT_LOOP(0)
EVT_CALL(GetSelfVar, 0, LVar0)
EVT_IF_NE(LVar0, 0)
EVT_BREAK_LOOP
EVT_END_IF
EVT_WAIT(1)
EVT_END_LOOP
EVT_THREAD
EVT_CALL(AdjustCam, CAM_DEFAULT, EVT_FLOAT(4.0), 0, 1000, EVT_FLOAT(14.0), EVT_FLOAT(-11.0))
EVT_END_THREAD
EVT_CALL(StartBossBattle, SONG_SPECIAL_BATTLE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Lakitu_01) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_CALL(SetNpcPos, NPC_Lakitu_01, 400, 20, -40)
EVT_CALL(SetNpcPos, NPC_Lakitu_02, 400, 20, 40)
EVT_CALL(InterpNpcYaw, NPC_Lakitu_01, 270, 0)
EVT_CALL(InterpNpcYaw, NPC_Lakitu_02, 270, 0)
EVT_CALL(GetPlayerPos, LVar0, LVar1, LVar2)
EVT_ADD(LVar2, -60)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 900)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(24.0), EVT_FLOAT(-4.0))
EVT_CALL(SetCamPosA, CAM_DEFAULT, EVT_FLOAT(-95.0), EVT_FLOAT(0.0))
EVT_CALL(SetCamPosB, CAM_DEFAULT, EVT_FLOAT(0.0), EVT_FLOAT(-50.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_EXEC_WAIT(N(EVS_LakitusFlying_Flee))
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_SET(GF_FLO11_Defeated_Lakitus, TRUE)
EVT_SET(MV_LakituAmbushState, 1)
EVT_CALL(DisablePlayerInput, FALSE)
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcDefeat_Lakitu_02) = {
EVT_CALL(GetBattleOutcome, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(OUTCOME_PLAYER_WON)
EVT_LABEL(0)
EVT_IF_EQ(MV_LakituAmbushState, 0)
EVT_WAIT(1)
EVT_GOTO(0)
EVT_END_IF
EVT_CASE_EQ(OUTCOME_PLAYER_LOST)
EVT_CASE_EQ(OUTCOME_PLAYER_FLED)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lakitu_01) = {
EVT_CALL(SetNpcPos, NPC_Lakitu_01, NPC_DISPOSE_LOCATION)
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, FALSE)
EVT_IF_GE(GB_StoryProgress, STORY_CH6_GOT_MAGICAL_BEAN)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, TRUE)
EVT_SET(MV_LakituAmbushState, 0)
EVT_CALL(BindNpcIdle, NPC_SELF, EVT_PTR(N(EVS_NpcIdle_Lakitu_01)))
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Lakitu_01)))
EVT_CALL(SetNpcPos, NPC_Lakitu_01, 350, 120, -220)
EVT_CALL(InterpNpcYaw, NPC_Lakitu_01, 270, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Lakitu_02) = {
EVT_CALL(SetNpcPos, NPC_Lakitu_02, NPC_DISPOSE_LOCATION)
EVT_IF_EQ(GF_FLO11_Defeated_Lakitus, FALSE)
EVT_IF_GE(GB_StoryProgress, STORY_CH6_GOT_MAGICAL_BEAN)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, TRUE)
EVT_CALL(BindNpcDefeat, NPC_SELF, EVT_PTR(N(EVS_NpcDefeat_Lakitu_02)))
EVT_CALL(SetNpcPos, NPC_Lakitu_02, 200, 110, 29)
EVT_CALL(InterpNpcYaw, NPC_Lakitu_02, 0, 1)
EVT_END_IF
EVT_END_IF
EVT_END_IF
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Lakitus)[] = {
{
.id = NPC_Lakitu_01,
.settings = &N(NpcSettings_Lakitu),
.pos = { 553.0f, 60.0f, 52.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_40000,
.init = &N(EVS_NpcInit_Lakitu_01),
.drops = LAKITU_DROPS,
.animations = LAKITU_ANIMS,
},
{
.id = NPC_Lakitu_02,
.settings = &N(NpcSettings_Lakitu),
.pos = { 553.0f, 60.0f, 52.0f },
.yaw = 270,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_40000,
.init = &N(EVS_NpcInit_Lakitu_02),
.drops = LAKITU_DROPS,
.animations = LAKITU_ANIMS,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Lakitus), BTL_FLO_FORMATION_07, BTL_FLO_STAGE_08),
{}
};

View File

@ -0,0 +1,9 @@
#include "flo_11.h"
#include "entity.h"
EvtScript N(EVS_MakeEntities) = {
EVT_CALL(MakeEntity, EVT_PTR(Entity_MulticoinBlock), -220, 60, -75, 0, MAKE_ENTITY_END)
EVT_CALL(AssignBlockFlag, GF_FLO11_MultiCoinBrick)
EVT_RETURN
EVT_END
};

View File

@ -1,7 +0,0 @@
#include "flo_12.h"
#include "effects.h"
ApiStatus N(func_80240000_CC0E30)(Evt* script, s32 isInitialCall) {
fx_sun_undeclared(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}

View File

@ -1,530 +0,0 @@
#include "flo_12.h"
#include "message_ids.h"
#include "sprite/npc/Rosie.h"
enum {
NPC_ROSIE0,
NPC_ROSIE1,
};
static s32 N(flo_12_D_802429E0)[112];
EntryList N(entryList) = {
{ 280.0f, 0.0f, 0.0f, 270.0f },
{ 280.0f, 0.0f, 0.0f, 270.0f },
};
MapSettings N(settings) = {
.main = &N(main),
.entryList = &N(entryList),
.entryCount = ENTRY_COUNT(N(entryList)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_12 },
};
EvtScript N(80240750) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(53)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(8024080C) = {
EVT_CALL(PushSong, 137, 3)
EVT_RETURN
EVT_END
};
EvtScript N(80240830) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};
static s32 N(pad_86C) = {
0x00000000,
};
EvtScript N(80240870) = {
EVT_SET_GROUP(EVT_GROUP_0B)
EVT_SET(LVarA, LVar0)
EVT_SET(LVarB, LVar1)
EVT_SET(LVarC, LVar2)
EVT_SET(LVarD, LVar3)
EVT_SET(LVarE, LVar4)
EVT_SUB(LVarC, LVar0)
EVT_SUB(LVarD, LVar1)
EVT_SETF(LVar0, LVarC)
EVT_DIVF(LVar0, EVT_FLOAT(100.0))
EVT_SETF(LVarF, EVT_FLOAT(100.0))
EVT_DIVF(LVarF, LVar0)
EVT_ADD(LVarF, 11)
EVT_SET(LVar5, 200)
EVT_DIV(LVar5, LVarF)
EVT_ADD(LVar5, 1)
EVT_LOOP(LVar5)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_CALL(RandInt, 199, LVar2)
EVT_SET(LVar3, 210)
EVT_SUB(LVar3, LVar2)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_ADD(LVar2, LVarE)
EVT_CALL(PlayEffect, 0xD, LVar0, LVar2, LVar1, LVar3, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_END_LOOP
EVT_WAIT(LVarF)
EVT_LABEL(0)
EVT_CALL(RandInt, LVarC, LVar0)
EVT_CALL(RandInt, LVarD, LVar1)
EVT_ADD(LVar0, LVarA)
EVT_ADD(LVar1, LVarB)
EVT_CALL(PlayEffect, 0xD, LVar0, LVarE, LVar1, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_WAIT(LVarF)
EVT_GOTO(0)
EVT_RETURN
EVT_END
};
EvtScript N(exitWalk_80240B1C) = EVT_EXIT_WALK(60, 0, "flo_11", 1);
EvtScript N(80240B78) = {
EVT_BIND_TRIGGER(N(exitWalk_80240B1C), TRIGGER_FLOOR_ABOVE, 0, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(main) = {
EVT_SET(GB_WorldLocation, 38)
EVT_CALL(SetSpriteShading, -1)
EVT_CALL(SetCamLeadPlayer, 0, 0)
EVT_CALL(SetCamPerspective, 0, 3, 25, 16, 4096)
EVT_CALL(SetCamBGColor, 0, 0, 0, 0)
EVT_CALL(SetCamEnabled, 0, 1)
EVT_SET(AreaFlag(22), 0)
EVT_CALL(MakeNpcs, 0, EVT_PTR(N(npcGroupList_802429B8)))
EVT_CALL(ModifyColliderFlags, 3, 11, 0x00000006)
EVT_SET(LVar0, -65)
EVT_SET(LVar1, -210)
EVT_SET(LVar2, 90)
EVT_SET(LVar3, -110)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80240870))
EVT_SET(LVar0, -200)
EVT_SET(LVar1, 130)
EVT_SET(LVar2, -80)
EVT_SET(LVar3, 170)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80240870))
EVT_SET(LVar0, -270)
EVT_SET(LVar1, -80)
EVT_SET(LVar2, -225)
EVT_SET(LVar3, 125)
EVT_SET(LVar4, 0)
EVT_EXEC(N(80240870))
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, 1)
EVT_EXEC(N(802419F4))
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, 1, 0x7FFFFE00)
EVT_SET(LVar0, EVT_PTR(N(80240B78)))
EVT_EXEC(EnterWalk)
EVT_END_IF
EVT_EXEC_WAIT(N(80240750))
EVT_IF_GE(GB_StoryProgress, 53)
EVT_CALL(N(func_80240000_CC0E30))
EVT_END_IF
EVT_RETURN
EVT_END
};
static s32 N(pad_E28)[] = {
0x00000000, 0x00000000,
};
NpcSettings N(npcSettings_80240E30) = {
.height = 56,
.radius = 40,
.level = 99,
};
NpcSettings N(npcSettings_80240E5C) = {
.height = 24,
.radius = 24,
.level = 99,
};
#include "common/foliage.inc.c"
s32** N(varStash) = NULL;
EvtScript N(802417F0) = {
EVT_CALL(ShowGotItem, LVar0, 1, 0)
EVT_RETURN
EVT_RETURN
EVT_END
};
EvtScript N(80241820) = {
EVT_CALL(ShowGotItem, LVar0, 1, 16)
EVT_RETURN
EVT_RETURN
EVT_END
};
s32 N(D_80241850_CC2680) = {
0x00000000,
};
s32 N(D_80241854_CC2684) = {
0x00000000,
};
EvtScript N(80241858) = {
EVT_SET(LVar9, LVar1)
EVT_CALL(ShowKeyChoicePopup)
EVT_SET(LVarA, LVar0)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CASE_EQ(-1)
EVT_CASE_DEFAULT
EVT_CALL(RemoveKeyItemAt, LVar1)
EVT_CALL(GetPlayerPos, LVar3, LVar4, LVar5)
EVT_CALL(N(AddPlayerHandsOffset), LVar3, LVar4, LVar5)
EVT_BITWISE_OR_CONST(LVar0, 0x50000)
EVT_CALL(MakeItemEntity, LVar0, LVar3, LVar4, LVar5, 1, 0)
EVT_CALL(SetPlayerAnimation, 393221)
EVT_WAIT(30)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(RemoveItemEntity, LVar0)
EVT_END_SWITCH
EVT_CALL(N(func_80240614_CC1444), LVarA)
EVT_CALL(CloseChoicePopup)
EVT_UNBIND
EVT_RETURN
EVT_END
};
EvtScript N(8024199C) = {
EVT_CALL(N(func_8024064C_CC147C), LVar0)
EVT_BIND_PADLOCK(N(80241858), 0x10, 0, EVT_PTR(N(flo_12_D_802429E0)), 0, 1)
EVT_CALL(N(func_802405C0_CC13F0), LVar0)
EVT_RETURN
EVT_END
};
s32 N(D_802419EC_CC281C)[] = {
0x0000001E, 0x00000000,
};
EvtScript N(802419F4) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(GetNpcPos, 0, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, 0, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, 0, 350)
EVT_CALL(SetCamPitch, 0, EVT_FLOAT(17.0), EVT_FLOAT(-9.5))
EVT_CALL(SetCamPosA, 0, 0, 0)
EVT_CALL(SetCamPosB, 0, 0, -50)
EVT_CALL(SetCamSpeed, 0, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, 0, 0, 1)
EVT_CALL(WaitForCam, 0, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, 0, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_00C7)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_03"), 2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(80241B6C) = {
EVT_WAIT(10)
EVT_CALL(SetNpcFlagBits, 0, ((NPC_FLAG_100)), TRUE)
EVT_CALL(PlayerMoveTo, -5, 20, 20)
EVT_CALL(SetNpcFlagBits, 0, ((NPC_FLAG_100)), FALSE)
EVT_CALL(PlayerFaceNpc, 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(80241BE4) = {
EVT_WAIT(10)
EVT_CALL(SetNpcFlagBits, 0, ((NPC_FLAG_100)), TRUE)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), TRUE)
EVT_CALL(PlayerMoveTo, -5, 20, 20)
EVT_CALL(SetNpcFlagBits, 0, ((NPC_FLAG_100)), FALSE)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), FALSE)
EVT_CALL(PlayerFaceNpc, 0, 1)
EVT_RETURN
EVT_END
};
EvtScript N(interact_80241C8C) = {
EVT_EXEC_WAIT(N(8024080C))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(47)
EVT_SWITCH(GF_FLO12_Met_Rosie)
EVT_CASE_EQ(0)
EVT_EXEC(N(80241B6C))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetCamProperties, 0, EVT_FLOAT(4.0), LVar0, LVar1, LVar2, 325, EVT_FLOAT(19.0), EVT_FLOAT(-9.5))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008C)
EVT_CALL(ShowChoice, MSG_Choice_0011)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(ContinueSpeech, -1, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008D)
EVT_CASE_EQ(1)
EVT_CALL(ContinueSpeech, -1, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008E)
EVT_END_SWITCH
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_TakeOut)
EVT_WAIT(10)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, 1, 1380)
EVT_WAIT(10)
EVT_SWITCH(GF_FLO10_LilyRequestedWaterStone)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_008F)
EVT_CASE_EQ(1)
EVT_CALL(SetPlayerAnimation, 393218)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_008F)
EVT_CALL(SetPlayerAnimation, 393221)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0091)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_AnimPray)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0092)
EVT_SET(GF_FLO12_RosieRequestedSomethingBeautiful, 1)
EVT_END_SWITCH
EVT_SET(GF_FLO12_Met_Rosie, 1)
EVT_CASE_EQ(1)
EVT_SWITCH(GF_FLO12_RosieRequestedSomethingBeautiful)
EVT_CASE_EQ(0)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, 1)
EVT_EXEC(N(80241BE4))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_0090)
EVT_CALL(SetPlayerAnimation, 393221)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0091)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_AnimPray)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0092)
EVT_SET(GF_FLO12_RosieRequestedSomethingBeautiful, 1)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_0090)
EVT_END_IF
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0093)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_CASE_LT(48)
EVT_CALL(FindKeyItem, ITEM_CRYSTAL_BERRY, LVar0)
EVT_IF_NE(LVar0, -1)
EVT_EXEC(N(80241BE4))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetCamProperties, 0, EVT_FLOAT(4.0), LVar0, LVar1, LVar2, 325, EVT_FLOAT(19.0), EVT_FLOAT(-9.5))
EVT_END_IF
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0094)
EVT_SET(LVar0, EVT_PTR(N(D_802419EC_CC281C)))
EVT_SET(LVar1, 0)
EVT_EXEC_WAIT(N(8024199C))
EVT_SWITCH(LVar0)
EVT_CASE_LE(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0093)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0095)
EVT_CALL(RemoveItemEntity, LVar7)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380)
EVT_SET(LVar0, 87)
EVT_SET(LVar1, 1)
EVT_EXEC_WAIT(N(802417F0))
EVT_CALL(AddKeyItem, ITEM_WATER_STONE)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0096)
EVT_SET(AreaFlag(22), 1)
EVT_SET(GB_StoryProgress, 48)
EVT_END_SWITCH
EVT_CASE_LT(53)
EVT_SWITCH(AreaFlag(22))
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0097)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0096)
EVT_END_SWITCH
EVT_CASE_LT(60)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0098)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0099)
EVT_END_SWITCH
EVT_CALL(ResetCam, 0, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(80240830))
EVT_RETURN
EVT_END
};
EvtScript N(init_802423D0) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(interact_80241C8C)))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 35)
EVT_CALL(SetNpcPos, 1, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_2)), TRUE)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_HAS_SHADOW)), TRUE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(47)
EVT_IF_EQ(GF_FLO12_Met_Rosie, 1)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, 1, 1380)
EVT_SET(LVarA, LVar0)
EVT_END_IF
EVT_CASE_LT(48)
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, 1, 1380)
EVT_SET(LVarA, LVar0)
EVT_CASE_DEFAULT
EVT_CALL(SetNpcFlagBits, 1, ((NPC_FLAG_100)), FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380)
EVT_SET(LVarA, LVar0)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
StaticNpc N(npcGroup_802425D8)[] = {
{
.id = NPC_ROSIE0,
.settings = &N(npcSettings_80240E30),
.pos = { -70.0f, 0.0f, 20.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_400000,
.init = &N(init_802423D0),
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
},
.tattle = MSG_NpcTattle_Rosie,
},
{
.id = NPC_ROSIE1,
.settings = &N(npcSettings_80240E5C),
.pos = { -70.0f, 0.0f, 20.0f },
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_GRAVITY,
.yaw = 90,
.drops = {
.dropFlags = NPC_DROP_FLAGS_80,
.heartDrops = NO_DROPS,
.flowerDrops = NO_DROPS,
},
.animations = {
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
ANIM_Rosie_Idle,
},
},
};
NpcGroupList N(npcGroupList_802429B8) = {
NPC_GROUP(N(npcGroup_802425D8)),
{},
};
#include "world/common/todo/StashVars.inc.c"
#include "world/common/todo/GetItemName.inc.c"
#include "world/common/todo/GetNpcCollisionHeight.inc.c"
#include "world/common/todo/AddPlayerHandsOffset.inc.c"
ApiStatus N(func_802405C0_CC13F0)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
if (isInitialCall) {
N(D_80241850_CC2680) = FALSE;
}
if (N(D_80241850_CC2680)) {
N(D_80241850_CC2680) = FALSE;
evt_set_variable(script, *args, N(D_80241854_CC2684));
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
ApiStatus N(func_80240614_CC1444)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
N(D_80241854_CC2684) = evt_get_variable(script, *args);
N(D_80241850_CC2680) = TRUE;
return ApiStatus_DONE2;
}
ApiStatus N(func_8024064C_CC147C)(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32* ptr = (s32*)evt_get_variable(script, *args);
s32 i;
if (ptr != NULL) {
for (i = 0; ptr[i] != 0; i++) {
N(flo_12_D_802429E0)[i] = ptr[i];
}
N(flo_12_D_802429E0)[i] = 0;
} else {
for (i = 0; i < 0x70; i++) {
N(flo_12_D_802429E0)[i] = i + 16;
N(flo_12_D_802429E0)[112] = 0;
}
}
return ApiStatus_DONE2;
}

View File

@ -2,19 +2,23 @@
/// @brief Flower Fields - (West) Rosie's Trellis
#include "common.h"
#include "../flo.h"
#include "message_ids.h"
#include "map.h"
#include "../flo.h"
#include "mapfs/flo_12_shape.h"
#include "mapfs/flo_12_hit.h"
enum {
NPC_Rosie = 0,
NPC_Dummy = 1,
};
#define NAMESPACE flo_12
ApiStatus N(AddPlayerHandsOffset)(Evt* script, s32 isInitialCall);
ApiStatus N(TransformFoliage)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240000_CC0E30)(Evt* script, s32 isInitialCall);
ApiStatus N(func_802405C0_CC13F0)(Evt* script, s32 isInitialCall);
ApiStatus N(func_80240614_CC1444)(Evt* script, s32 isInitialCall);
ApiStatus N(func_8024064C_CC147C)(Evt* script, s32 isInitialCall);
extern NpcGroupList N(npcGroupList_802429B8);
extern EvtScript N(802419F4);
extern EvtScript N(main);
extern EvtScript N(EVS_Main);
extern EvtScript N(EVS_SetupMusic);
extern EvtScript N(EVS_PushFlowerSong);
extern EvtScript N(EVS_PopMusic);
extern EvtScript N(EVS_Scene_SunReturns);
extern NpcGroupList N(DefaultNPCs);

View File

@ -0,0 +1,14 @@
#include "flo_12.h"
EntryList N(Entrances) = {
[flo_12_ENTRY_0] { 280.0, 0.0, 0.0, 270.0 },
[flo_12_ENTRY_1] { 280.0, 0.0, 0.0, 270.0 },
};
MapSettings N(settings) = {
.main = &N(EVS_Main),
.entryList = &N(Entrances),
.entryCount = ENTRY_COUNT(N(Entrances)),
.background = &gBackgroundImage,
.tattle = { MSG_MapTattle_flo_12 },
};

View File

@ -0,0 +1,31 @@
#include "flo_12.h"
EvtScript N(EVS_SetupMusic) = {
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_12_ENTRY_1)
EVT_CALL(SetMusicTrack, 0, SONG_SUNSHINE_RETURNS, 0, 8)
EVT_ELSE
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8)
EVT_CASE_DEFAULT
EVT_CALL(SetMusicTrack, 0, SONG_FLOWER_FIELDS_SUNNY, 0, 8)
EVT_END_SWITCH
EVT_END_IF
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PushFlowerSong) = {
EVT_CALL(PushSong, SONG_FLOWER_NPC_THEME, 3)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PopMusic) = {
EVT_CALL(FadeOutMusic, 0, 250)
EVT_WAIT(10)
EVT_CALL(PopSong)
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,44 @@
#include "flo_12.h"
#include "effects.h"
#include "world/common/atomic/flo_FlowerSpawnRegion.inc.c"
API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;
}
EvtScript N(EVS_ExitWalk_flo_11_1) = EVT_EXIT_WALK(60, flo_12_ENTRY_0, "flo_11", flo_11_ENTRY_1);
EvtScript N(EVS_BindExitTriggers) = {
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitWalk_flo_11_1)), TRIGGER_FLOOR_ABOVE, COLLIDER_deilie, 1, 0)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_Main) = {
EVT_SET(GB_WorldLocation, LOCATION_FLOWER_FIELDS)
EVT_CALL(SetSpriteShading, SHADING_NONE)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_SETUP_CAMERA_DEFAULT()
EVT_SET(AF_FLO_GivenCrystalBerry, FALSE)
EVT_CALL(MakeNpcs, FALSE, EVT_PTR(N(DefaultNPCs)))
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_o180, SURFACE_TYPE_FLOWERS)
EVT_FLOWER_SPAWN_REGION( -65, -210, 90, -110, 0)
EVT_FLOWER_SPAWN_REGION( -200, 130, -80, 170, 0)
EVT_FLOWER_SPAWN_REGION( -270, -80, -225, 125, 0)
EVT_CALL(GetEntryID, LVar0)
EVT_IF_EQ(LVar0, flo_12_ENTRY_1)
EVT_EXEC(N(EVS_Scene_SunReturns))
EVT_ELSE
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_deilite, COLLIDER_FLAGS_UPPER_MASK)
EVT_SET(LVar0, EVT_PTR(N(EVS_BindExitTriggers)))
EVT_EXEC(EnterWalk)
EVT_END_IF
EVT_EXEC_WAIT(N(EVS_SetupMusic))
EVT_IF_GE(GB_StoryProgress, STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_CALL(N(SpawnSunEffect))
EVT_END_IF
EVT_RETURN
EVT_END
};

View File

@ -0,0 +1,217 @@
#include "flo_12.h"
#include "world/common/npc/Rosie.inc.c"
#include "world/common/npc/Dummy.inc.c"
#include "common/foliage.inc.c"
#include "world/common/complete/GiveReward.inc.c"
#include "world/common/complete/KeyItemChoice.inc.c"
s32 N(KeyList)[] = {
ITEM_CRYSTAL_BERRY,
ITEM_NONE
};
EvtScript N(EVS_Scene_SunReturns) = {
EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(GetNpcPos, NPC_Rosie, LVar0, LVar1, LVar2)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetPanTarget, CAM_DEFAULT, LVar0, LVar1, LVar2)
EVT_CALL(SetCamDistance, CAM_DEFAULT, 350)
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(17.0), EVT_FLOAT(-9.5))
EVT_CALL(SetCamPosA, CAM_DEFAULT, 0, 0)
EVT_CALL(SetCamPosB, CAM_DEFAULT, 0, -50)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(WaitForCam, CAM_DEFAULT, EVT_FLOAT(1.0))
EVT_WAIT(20)
EVT_CALL(SpeakToPlayer, NPC_Rosie, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_00C7)
EVT_WAIT(10)
EVT_CALL(GotoMap, EVT_PTR("flo_03"), flo_03_ENTRY_2)
EVT_WAIT(100)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PlayerApproachRosie) = {
EVT_WAIT(10)
EVT_CALL(SetNpcFlagBits, NPC_Rosie, NPC_FLAG_100, TRUE)
EVT_CALL(PlayerMoveTo, -5, 20, 20)
EVT_CALL(SetNpcFlagBits, NPC_Rosie, NPC_FLAG_100, FALSE)
EVT_CALL(PlayerFaceNpc, NPC_Rosie, TRUE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_PlayerApproachRosieAndItem) = {
EVT_WAIT(10)
EVT_CALL(SetNpcFlagBits, NPC_Rosie, NPC_FLAG_100, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, TRUE)
EVT_CALL(PlayerMoveTo, -5, 20, 20)
EVT_CALL(SetNpcFlagBits, NPC_Rosie, NPC_FLAG_100, FALSE)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, FALSE)
EVT_CALL(PlayerFaceNpc, NPC_Rosie, TRUE)
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInteract_Rosie) = {
EVT_EXEC_WAIT(N(EVS_PushFlowerSong))
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_SWITCH(GF_FLO12_Met_Rosie)
EVT_CASE_EQ(0)
EVT_EXEC(N(EVS_PlayerApproachRosie))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetCamProperties, CAM_DEFAULT, EVT_FLOAT(4.0), LVar0, LVar1, LVar2, 325, EVT_FLOAT(19.0), EVT_FLOAT(-9.5))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008C)
EVT_CALL(ShowChoice, MSG_Choice_0011)
EVT_WAIT(10)
EVT_SWITCH(LVar0)
EVT_CASE_EQ(0)
EVT_CALL(ContinueSpeech, NPC_SELF, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008D)
EVT_CASE_EQ(1)
EVT_CALL(ContinueSpeech, NPC_SELF, ANIM_Rosie_Talk, ANIM_Rosie_Idle, 5, MSG_CH6_008E)
EVT_END_SWITCH
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_TakeOut)
EVT_WAIT(10)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, ITEM_SPAWN_MODE_DECORATION, 0x00000564)
EVT_WAIT(10)
EVT_SWITCH(GF_FLO10_LilyRequestedWaterStone)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_008F)
EVT_CASE_EQ(1)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60002)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_008F)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60005)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0091)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_AnimPray)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0092)
EVT_SET(GF_FLO12_RosieRequestedSomethingBeautiful, TRUE)
EVT_END_SWITCH
EVT_SET(GF_FLO12_Met_Rosie, TRUE)
EVT_CASE_EQ(1)
EVT_SWITCH(GF_FLO12_RosieRequestedSomethingBeautiful)
EVT_CASE_EQ(0)
EVT_IF_EQ(GF_FLO10_LilyRequestedWaterStone, TRUE)
EVT_EXEC(N(EVS_PlayerApproachRosieAndItem))
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_0090)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_60005)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0091)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_AnimPray)
EVT_WAIT(40)
EVT_CALL(SetPlayerAnimation, ANIM_Mario_10002)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0092)
EVT_SET(GF_FLO12_RosieRequestedSomethingBeautiful, TRUE)
EVT_ELSE
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_TalkHold, 5, MSG_CH6_0090)
EVT_END_IF
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0093)
EVT_END_SWITCH
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_GOT_WATER_STONE)
EVT_CALL(FindKeyItem, ITEM_CRYSTAL_BERRY, LVar0)
EVT_IF_NE(LVar0, -1)
EVT_EXEC(N(EVS_PlayerApproachRosieAndItem))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 30)
EVT_CALL(SetCamProperties, CAM_DEFAULT, EVT_FLOAT(4.0), LVar0, LVar1, LVar2, 325, EVT_FLOAT(19.0), EVT_FLOAT(-9.5))
EVT_END_IF
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0094)
EVT_CHOOSE_KEY_ITEM_FROM(N(KeyList))
EVT_SWITCH(LVar0)
EVT_CASE_LE(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0093)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0095)
EVT_CALL(RemoveItemEntity, LVar7)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -33, 14, 19, ITEM_SPAWN_MODE_DECORATION, EVT_INDEX_OF_GAME_FLAG(GF_FLO12_HeldItemPickup))
EVT_GIVE_KEY_REWARD(ITEM_WATER_STONE)
EVT_WAIT(10)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0096)
EVT_SET(AF_FLO_GivenCrystalBerry, TRUE)
EVT_SET(GB_StoryProgress, STORY_CH6_GOT_WATER_STONE)
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE)
EVT_SWITCH(AF_FLO_GivenCrystalBerry)
EVT_CASE_EQ(0)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0097)
EVT_CASE_EQ(1)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0096)
EVT_END_SWITCH
EVT_CASE_LT(STORY_CH6_RETURNED_TO_TOAD_TOWN)
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0098)
EVT_CASE_DEFAULT
EVT_CALL(SpeakToPlayer, NPC_SELF, ANIM_Rosie_TalkHold, ANIM_Rosie_IdleHold, 5, MSG_CH6_0099)
EVT_END_SWITCH
EVT_CALL(ResetCam, CAM_DEFAULT, EVT_FLOAT(4.0))
EVT_EXEC_WAIT(N(EVS_PopMusic))
EVT_RETURN
EVT_END
};
EvtScript N(EVS_NpcInit_Rosie) = {
EVT_CALL(BindNpcInteract, NPC_SELF, EVT_PTR(N(EVS_NpcInteract_Rosie)))
EVT_CALL(GetNpcPos, NPC_SELF, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 35)
EVT_CALL(SetNpcPos, NPC_Dummy, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_2, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_HAS_SHADOW, TRUE)
EVT_SWITCH(GB_StoryProgress)
EVT_CASE_LT(STORY_CH6_GOT_CRYSTAL_BERRY)
EVT_IF_EQ(GF_FLO12_Met_Rosie, TRUE)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, ITEM_SPAWN_MODE_DECORATION, EVT_INDEX_OF_GAME_FLAG(GF_FLO12_HeldItemPickup))
EVT_SET(LVarA, LVar0)
EVT_END_IF
EVT_CASE_LT(STORY_CH6_GOT_WATER_STONE)
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_WATER_STONE, -33, 14, 19, ITEM_SPAWN_MODE_DECORATION, EVT_INDEX_OF_GAME_FLAG(GF_FLO12_HeldItemPickup))
EVT_SET(LVarA, LVar0)
EVT_CASE_DEFAULT
EVT_CALL(SetNpcFlagBits, NPC_Dummy, NPC_FLAG_100, FALSE)
EVT_CALL(SetNpcAnimation, NPC_SELF, ANIM_Rosie_IdleHold)
EVT_CALL(MakeItemEntity, ITEM_CRYSTAL_BERRY, -33, 14, 19, ITEM_SPAWN_MODE_DECORATION, EVT_INDEX_OF_GAME_FLAG(GF_FLO12_HeldItemPickup))
EVT_SET(LVarA, LVar0)
EVT_END_SWITCH
EVT_RETURN
EVT_END
};
StaticNpc N(NpcData_Rosie)[] = {
{
.id = NPC_Rosie,
.settings = &N(NpcSettings_Rosie),
.pos = { -70.0f, 0.0f, 20.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_100 | NPC_FLAG_LOCK_ANIMS | NPC_FLAG_JUMPING | NPC_FLAG_400000,
.init = &N(EVS_NpcInit_Rosie),
.drops = ROSIE_DROPS,
.animations = ROSIE_ANIMS,
.tattle = MSG_NpcTattle_Rosie,
},
{
.id = NPC_Dummy,
.settings = &N(NpcSettings_Dummy),
.pos = { -70.0f, 0.0f, 20.0f },
.yaw = 90,
.flags = NPC_FLAG_PASSIVE | NPC_FLAG_GRAVITY,
.drops = ROSIE_DROPS,
.animations = ROSIE_ANIMS,
},
};
NpcGroupList N(DefaultNPCs) = {
NPC_GROUP(N(NpcData_Rosie)),
{}
};

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