mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2025-02-18 21:31:03 +00:00
Document objects used with En_Fall (fall, fall2, lodmoon, moonston) (#558)
* Document lodmoon * Document moonston * Document the open-mouth moon part of fall2 * Document object_fall * Move flags to .c * palette -> tlut * File header comment * OPEN_DISPS/CLOSE_DISPS spacing * Lots more spacing * Add spaces after breaks * Better describe the subtypes * More fixes * Be a little more specific in fireball comments * Respond to Elliptic's second review * I need to stop forgetting to run ./format.sh * Single line comment styling * Preserve ordering
This commit is contained in:
parent
5eb1b417de
commit
0e6662aafd
@ -1,31 +1,56 @@
|
||||
<Root>
|
||||
<!--
|
||||
Contains the high-detail moon used in cutscenes and in Termina Field,
|
||||
the debris that rises from the ground as the moon is crashing, the
|
||||
ball of fire that surrounds the moon when it is crashing, and the ring
|
||||
of fire that expands outward when the moon is almost done crashing.
|
||||
-->
|
||||
<File Name="object_fall" Segment="6">
|
||||
<DList Name="object_fall_DL_000190" Offset="0x190" />
|
||||
<DList Name="object_fall_DL_000198" Offset="0x198" />
|
||||
<DList Name="object_fall_DL_000220" Offset="0x220" />
|
||||
<Texture Name="object_fall_Tex_000260" OutName="tex_000260" Format="i8" Width="16" Height="16" Offset="0x260" />
|
||||
<DList Name="object_fall_DL_000420" Offset="0x420" />
|
||||
<DList Name="object_fall_DL_000428" Offset="0x428" />
|
||||
<DList Name="object_fall_DL_000490" Offset="0x490" />
|
||||
<DList Name="object_fall_DL_000498" Offset="0x498" />
|
||||
<Array Name="object_fall_Vtx_0004C0" Count="209" Offset="0x4C0">
|
||||
<!-- Debris -->
|
||||
<DList Name="gMoonEmptyDL1" Offset="0x190" /> <!-- Was likely going to be used with gMoonDebrisModel1DL before they made all debris use the same material -->
|
||||
<DList Name="gMoonDebrisMaterialDL" Offset="0x198" />
|
||||
<DList Name="gMoonDebrisModel1DL" Offset="0x220" />
|
||||
<Texture Name="gMoonDebrisTex" OutName="moon_debris" Format="i8" Width="16" Height="16" Offset="0x260" />
|
||||
<DList Name="gMoonEmptyDL2" Offset="0x420" /> <!-- Was likely going to be used with gMoonDebrisModel2DL before they made all debris use the same material -->
|
||||
<DList Name="gMoonDebrisModel2DL" Offset="0x428" />
|
||||
<DList Name="gMoonEmptyDL3" Offset="0x490" /> <!-- Was likely going to be used with gMoonDebrisModel3DL before they made all debris use the same material -->
|
||||
<DList Name="gMoonDebrisModel3DL" Offset="0x498" />\
|
||||
|
||||
<!-- Fireball Vertices -->
|
||||
<Array Name="gMoonFireballVtx" Count="209" Offset="0x4C0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="object_fall_DL_0011D0" Offset="0x11D0" />
|
||||
<Texture Name="object_fall_Tex_001688" OutName="tex_001688" Format="i8" Width="64" Height="64" Offset="0x1688" />
|
||||
<Texture Name="object_fall_Tex_002688" OutName="tex_002688" Format="i4" Width="64" Height="64" Offset="0x2688" />
|
||||
<Texture Name="object_fall_Tex_002E88" OutName="tex_002E88" Format="i4" Width="64" Height="64" Offset="0x2E88" />
|
||||
<DList Name="object_fall_DL_003C30" Offset="0x3C30" />
|
||||
<Texture Name="object_fall_Tex_003E28" OutName="tex_003E28" Format="i8" Width="32" Height="64" Offset="0x3E28" />
|
||||
<Texture Name="object_fall_Tex_004628" OutName="tex_004628" Format="i8" Width="32" Height="64" Offset="0x4628" />
|
||||
<TextureAnimation Name="object_fall_Matanimheader_004E38" Offset="0x4E38" />
|
||||
<TextureAnimation Name="object_fall_Matanimheader_004E58" Offset="0x4E58" />
|
||||
<DList Name="object_fall_DL_0077F0" Offset="0x77F0" />
|
||||
<Texture Name="object_fall_TLUT_0082F8" OutName="tlut_0082F8" Format="rgba16" Width="4" Height="4" Offset="0x82F8" />
|
||||
<Texture Name="object_fall_TLUT_008318" OutName="tlut_008318" Format="rgba16" Width="4" Height="4" Offset="0x8318" />
|
||||
<Texture Name="object_fall_Tex_008338" OutName="tex_008338" Format="rgba16" Width="32" Height="32" Offset="0x8338" />
|
||||
<Texture Name="object_fall_Tex_008B38" OutName="tex_008B38" Format="rgba16" Width="64" Height="32" Offset="0x8B38" />
|
||||
<Texture Name="object_fall_Tex_009B38" OutName="tex_009B38" Format="ci4" Width="64" Height="64" Offset="0x9B38" />
|
||||
<Texture Name="object_fall_Tex_00A338" OutName="tex_00A338" Format="ci4" Width="64" Height="64" Offset="0xA338" />
|
||||
|
||||
<!-- Fireball DisplayList -->
|
||||
<DList Name="gMoonFireballDL" Offset="0x11D0" />
|
||||
|
||||
<!-- Fireball Textures -->
|
||||
<Texture Name="gMoonFireballFlecksTex" OutName="moon_fireball_flecks" Format="i8" Width="64" Height="64" Offset="0x1688" />
|
||||
<Texture Name="gMoonFireballFlamesTex" OutName="moon_fireball_flames" Format="i4" Width="64" Height="64" Offset="0x2688" />
|
||||
<Texture Name="gMoonFireballMaskTex" OutName="moon_fireball_mask" Format="i4" Width="64" Height="64" Offset="0x2E88" />
|
||||
|
||||
<!-- Fire Ring DisplayList -->
|
||||
<DList Name="gMoonFireRingDL" Offset="0x3C30" />
|
||||
|
||||
<!-- Fire Ring Textures -->
|
||||
<Texture Name="gMoonFireRingFlamesTex" OutName="moon_fire_ring_flames" Format="i8" Width="32" Height="64" Offset="0x3E28" />
|
||||
<Texture Name="gMoonFireRingMaskTex" OutName="moon_fire_ring_mask" Format="i8" Width="32" Height="64" Offset="0x4628" />
|
||||
|
||||
<!-- Fire Ring Texture Animation -->
|
||||
<TextureAnimation Name="gMoonFireRingTexAnim" Offset="0x4E38" />
|
||||
|
||||
<!-- Unused Fireball Texture Animation -->
|
||||
<TextureAnimation Name="gMoonUnusedFireballTexAnim" Offset="0x4E58" /> <!-- Almost certainly scrapped for just doing the TwoTexScrolls manually in EnFall_Fireball_Draw -->
|
||||
|
||||
<!-- Moon DisplayList -->
|
||||
<DList Name="gMoonDL" Offset="0x77F0" />
|
||||
|
||||
<!-- Moon Textures -->
|
||||
<Texture Name="gMoonFarSideTLUT" OutName="moon_far_side_tlut" Format="rgba16" Width="4" Height="4" Offset="0x82F8" />
|
||||
<Texture Name="gMoonFaceTLUT" OutName="moon_face_tlut" Format="rgba16" Width="4" Height="4" Offset="0x8318" />
|
||||
<Texture Name="gMoonEyeTex" OutName="moon_eye" Format="rgba16" Width="32" Height="32" Offset="0x8338" />
|
||||
<Texture Name="gMoonTeethTex" OutName="moon_teeth" Format="rgba16" Width="64" Height="32" Offset="0x8B38" />
|
||||
<Texture Name="gMoonFarSideTex" OutName="moon_far_side" Format="ci4" Width="64" Height="64" Offset="0x9B38" />
|
||||
<Texture Name="gMoonFaceTex" OutName="moon_face" Format="ci4" Width="64" Height="64" Offset="0xA338" />
|
||||
</File>
|
||||
</Root>
|
||||
|
@ -1,12 +1,16 @@
|
||||
<Root>
|
||||
<!--
|
||||
Open-mouth version of the moon and the "warp beam" that emerges from the
|
||||
moon's mouth, both used in the cutscene before warping to the moon.
|
||||
-->
|
||||
<File Name="object_fall2" Segment="6">
|
||||
<DList Name="object_fall2_DL_002970" Offset="0x2970" />
|
||||
<Texture Name="object_fall2_TLUT_0034A8" OutName="tlut_0034A8" Format="rgba16" Width="4" Height="4" Offset="0x34A8" />
|
||||
<Texture Name="object_fall2_TLUT_0034C8" OutName="tlut_0034C8" Format="rgba16" Width="4" Height="4" Offset="0x34C8" />
|
||||
<Texture Name="object_fall2_Tex_0034E8" OutName="tex_0034E8" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
|
||||
<Texture Name="object_fall2_Tex_003CE8" OutName="tex_003CE8" Format="ci4" Width="64" Height="64" Offset="0x3CE8" />
|
||||
<Texture Name="object_fall2_Tex_0044E8" OutName="tex_0044E8" Format="ci4" Width="64" Height="64" Offset="0x44E8" />
|
||||
<Texture Name="object_fall2_Tex_004CE8" OutName="tex_004CE8" Format="rgba16" Width="64" Height="32" Offset="0x4CE8" />
|
||||
<DList Name="gOpenMouthMoonDL" Offset="0x2970" />
|
||||
<Texture Name="gOpenMouthMoonFarSideTLUT" OutName="open_mouth_moon_far_side_tlut" Format="rgba16" Width="4" Height="4" Offset="0x34A8" />
|
||||
<Texture Name="gOpenMouthMoonFaceTLUT" OutName="open_mouth_moon_face_tlut" Format="rgba16" Width="4" Height="4" Offset="0x34C8" />
|
||||
<Texture Name="gOpenMouthMoonEyesTex" OutName="open_mouth_moon_eyes" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
|
||||
<Texture Name="gOpenMouthMoonFarSideTex" OutName="open_mouth_moon_far_side" Format="ci4" Width="64" Height="64" Offset="0x3CE8" />
|
||||
<Texture Name="gOpenMouthMoonFaceTex" OutName="open_mouth_moon_face" Format="ci4" Width="64" Height="64" Offset="0x44E8" />
|
||||
<Texture Name="gOpenMouthMoonTeethTex" OutName="open_mouth_moon_teeth" Format="rgba16" Width="64" Height="32" Offset="0x4CE8" />
|
||||
<!-- <Blob Name="object_fall2_Blob_005CE8" Size="0x228" Offset="0x5CE8" /> -->
|
||||
<DList Name="object_fall2_DL_006E00" Offset="0x6E00" />
|
||||
<DList Name="object_fall2_DL_006EF0" Offset="0x6EF0" />
|
||||
|
@ -1,12 +1,13 @@
|
||||
<Root>
|
||||
<!-- Low detail version of the moon used during gameplay (except in Termina Field) -->
|
||||
<File Name="object_lodmoon" Segment="6">
|
||||
<DList Name="object_lodmoon_DL_0010E0" Offset="0x10E0" />
|
||||
<DList Name="object_lodmoon_DL_001158" Offset="0x1158" />
|
||||
<Texture Name="object_lodmoon_TLUT_0015D8" OutName="tlut_0015D8" Format="rgba16" Width="4" Height="4" Offset="0x15D8" />
|
||||
<Texture Name="object_lodmoon_TLUT_0015F8" OutName="tlut_0015F8" Format="rgba16" Width="4" Height="4" Offset="0x15F8" />
|
||||
<Texture Name="object_lodmoon_Tex_001618" OutName="tex_001618" Format="rgba16" Width="32" Height="32" Offset="0x1618" />
|
||||
<Texture Name="object_lodmoon_Tex_001E18" OutName="tex_001E18" Format="rgba16" Width="64" Height="32" Offset="0x1E18" />
|
||||
<Texture Name="object_lodmoon_Tex_002E18" OutName="tex_002E18" Format="ci4" Width="64" Height="64" Offset="0x2E18" />
|
||||
<Texture Name="object_lodmoon_Tex_003618" OutName="tex_003618" Format="ci4" Width="64" Height="64" Offset="0x3618" />
|
||||
<DList Name="gLodmoonEyesDL" Offset="0x10E0" />
|
||||
<DList Name="gLodmoonMoonDL" Offset="0x1158" />
|
||||
<Texture Name="gLodmoonFaceTLUT" OutName="lodmoon_face_tlut" Format="rgba16" Width="4" Height="4" Offset="0x15D8" />
|
||||
<Texture Name="gLodmoonFarSideTLUT" OutName="lodmoon_far_side_tlut" Format="rgba16" Width="4" Height="4" Offset="0x15F8" />
|
||||
<Texture Name="gLodmoonEyesTex" OutName="lodmoon_eyes" Format="rgba16" Width="32" Height="32" Offset="0x1618" />
|
||||
<Texture Name="gLodmoonTeethTex" OutName="lodmoon_teeth" Format="rgba16" Width="64" Height="32" Offset="0x1E18" />
|
||||
<Texture Name="gLodmoonFaceTex" OutName="lodmoon_face" Format="ci4" Width="64" Height="64" Offset="0x2E18" />
|
||||
<Texture Name="gLodmoonFarSideTex" OutName="lodmoon_far_side" Format="ci4" Width="64" Height="64" Offset="0x3618" />
|
||||
</File>
|
||||
</Root>
|
||||
|
@ -1,9 +1,13 @@
|
||||
<Root>
|
||||
<!--
|
||||
The Moon's Tear that can be seen falling from the telescope,
|
||||
along with its associated fire trail.
|
||||
-->
|
||||
<File Name="object_moonston" Segment="6">
|
||||
<DList Name="object_moonston_DL_000400" Offset="0x400" />
|
||||
<DList Name="object_moonston_DL_0004C8" Offset="0x4C8" />
|
||||
<Texture Name="object_moonston_Tex_000608" OutName="tex_000608" Format="i8" Width="32" Height="32" Offset="0x608" />
|
||||
<Texture Name="object_moonston_Tex_000A08" OutName="tex_000A08" Format="i8" Width="32" Height="64" Offset="0xA08" />
|
||||
<TextureAnimation Name="object_moonston_Matanimheader_001220" Offset="0x1220" />
|
||||
<DList Name="gFallingMoonsTearDL" Offset="0x400" />
|
||||
<DList Name="gFallingMoonsTearFireDL" Offset="0x4C8" />
|
||||
<Texture Name="gFallingMoonsTearTex" OutName="falling_moons_tear" Format="i8" Width="32" Height="32" Offset="0x608" />
|
||||
<Texture Name="gFallingMoonsTearFireTex" OutName="falling_moons_tear_fire" Format="i8" Width="32" Height="64" Offset="0xA08" />
|
||||
<TextureAnimation Name="gFallingMoonsTearTexAnim" Offset="0x1220" />
|
||||
</File>
|
||||
</Root>
|
||||
|
@ -4,14 +4,15 @@
|
||||
* Description: The moon and related effects, along with the Moon's Tear that falls from its eye.
|
||||
*
|
||||
* This actor handles mutliple types of moon as well as a variety of effects. Specifically, it handles:
|
||||
* - A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes
|
||||
* - A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon's interior.
|
||||
* - An enlarged high-detail moon, used for when the moon is crashing.
|
||||
* - A low-detail moon, used everywhere else. Its object file is named "Lodmoon".
|
||||
* - The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail.
|
||||
* - The ball of fire that surrounds the moon when it is crashing.
|
||||
* - The debris that rises from the ground as the moon is crashing.
|
||||
* - The ring of fire that expands outward when the moon is almost done crashing.
|
||||
* - Moon: A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes.
|
||||
* - StoppedClosedMouthMoon: A high-detail moon, used in the Clock Tower after the Giants stop the moon from crashing.
|
||||
* - StoppedOpenMouthMoon: A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon.
|
||||
* - CrashingMoon: An enlarged high-detail moon, used for when the moon is crashing.
|
||||
* - LodMoon: A low-detail moon, used everywhere else.
|
||||
* - MoonsTear: The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail.
|
||||
* - Fireball: The ball of fire that surrounds the moon when it is crashing.
|
||||
* - RisingDebris: The debris that rises from the ground as the moon is crashing.
|
||||
* - FireRing: The ring of fire that expands outward when the moon is almost done crashing.
|
||||
*/
|
||||
|
||||
#include "z_en_fall.h"
|
||||
@ -24,6 +25,9 @@
|
||||
|
||||
#define THIS ((EnFall*)thisx)
|
||||
|
||||
#define FLAG_FIRE_BALL_INTENSIFIES (1 << 0)
|
||||
#define FLAG_FIRE_RING_APPEARS (1 << 1)
|
||||
|
||||
void EnFall_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
@ -35,20 +39,20 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
|
||||
void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx);
|
||||
void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx);
|
||||
void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx);
|
||||
void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_RisingDebris_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_LodMoon_DrawWithoutLerp(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
typedef struct {
|
||||
u8 dListIndex;
|
||||
u8 modelIndex;
|
||||
Vec3f pos;
|
||||
Vec3f velocity;
|
||||
Vec3s rot;
|
||||
@ -87,14 +91,17 @@ void EnFall_Moon_AdjustScaleAndPosition(EnFall* this, GlobalContext* globalCtx)
|
||||
Actor_SetScale(&this->actor, this->scale * 1.2f);
|
||||
this->actor.world.pos.y = this->actor.home.pos.y;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Actor_SetScale(&this->actor, this->scale * 2.4f);
|
||||
this->actor.world.pos.y = this->actor.home.pos.y;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Actor_SetScale(&this->actor, this->scale * 3.6f);
|
||||
this->actor.world.pos.y = this->actor.home.pos.y;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Actor_SetScale(&this->actor, this->scale * 3.6f);
|
||||
if (EN_FALL_TYPE(&this->actor) == EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER) {
|
||||
@ -112,7 +119,7 @@ void EnFall_RisingDebris_ResetParticles(EnFall* this) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
|
||||
debrisParticles[i].dListIndex = 3;
|
||||
debrisParticles[i].modelIndex = 3;
|
||||
}
|
||||
this->activeDebrisParticleCount = 0;
|
||||
}
|
||||
@ -130,15 +137,19 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case 1:
|
||||
this->scale = 0.08f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this->scale = 0.04f;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this->scale = 0.02f;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->scale = 0.01f;
|
||||
break;
|
||||
|
||||
default:
|
||||
this->scale = 0.16f;
|
||||
break;
|
||||
@ -150,12 +161,15 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER:
|
||||
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LODMOON);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_MOONS_TEAR:
|
||||
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MOONSTON);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH:
|
||||
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL2);
|
||||
break;
|
||||
|
||||
default:
|
||||
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL);
|
||||
break;
|
||||
@ -199,6 +213,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions;
|
||||
Actor_SetScale(&this->actor, this->scale);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_STOPPED_MOON_CLOSED_MOUTH:
|
||||
this->actor.draw = EnFall_Moon_Draw;
|
||||
this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions;
|
||||
@ -207,6 +222,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_CLOCK_TOWER_MOON:
|
||||
this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions;
|
||||
Actor_SetScale(&this->actor, this->scale * 3.0f);
|
||||
@ -215,20 +231,23 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_CRASHING_MOON:
|
||||
this->actor.draw = EnFall_Moon_Draw;
|
||||
Actor_SetScale(&this->actor, this->scale * 5.3999996f);
|
||||
this->actionFunc = EnFall_CrashingMoon_PerformCutsceneActions;
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_CRASH_FIRE_BALL:
|
||||
this->actor.update = EnFall_FireBall_Update;
|
||||
this->actor.draw = EnFall_FireBall_Draw;
|
||||
this->actor.update = EnFall_Fireball_Update;
|
||||
this->actor.draw = EnFall_Fireball_Draw;
|
||||
this->scale = 1.0f;
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->fireBallIntensity = 0.0f;
|
||||
this->fireBallAlpha = 100;
|
||||
this->fireballIntensity = 0.0f;
|
||||
this->fireballAlpha = 100;
|
||||
this->actor.shape.rot.x = this->actor.shape.rot.z;
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_CRASH_RISING_DEBRIS:
|
||||
this->actor.update = EnFall_RisingDebris_Update;
|
||||
this->actor.draw = EnFall_RisingDebris_Draw;
|
||||
@ -237,12 +256,14 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 1.0f);
|
||||
this->actor.shape.rot.x = 0;
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_LODMOON_NO_LERP:
|
||||
this->actor.draw = EnFall_LodMoon_DrawWithoutLerp;
|
||||
this->dayStartTime = CLOCK_TIME(6, 0);
|
||||
this->currentDay = CURRENT_DAY;
|
||||
EnFall_Moon_AdjustScaleAndPosition(this, globalCtx);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_LODMOON:
|
||||
case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER:
|
||||
this->actor.draw = EnFall_LodMoon_DrawWithLerp;
|
||||
@ -250,6 +271,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
this->currentDay = CURRENT_DAY;
|
||||
EnFall_Moon_AdjustScaleAndPosition(this, globalCtx);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_MOONS_TEAR:
|
||||
this->actor.update = EnFall_Update;
|
||||
this->actor.draw = NULL;
|
||||
@ -264,17 +286,21 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH:
|
||||
this->actor.draw = NULL;
|
||||
this->actionFunc = EnFall_StoppedOpenMouthMoon_PerformCutsceneActions;
|
||||
Actor_SetScale(&this->actor, this->scale * 3.0f);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_CRASH_FIRE_RING:
|
||||
this->actor.update = EnFall_FireRing_Update;
|
||||
this->actor.draw = EnFall_FireRing_Draw;
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
break;
|
||||
|
||||
default:
|
||||
// used for EN_FALL_TYPE_TERMINA_FIELD_MOON and anything else that isn't in the enum
|
||||
this->actor.draw = EnFall_Moon_Draw;
|
||||
this->dayStartTime = CLOCK_TIME(6, 0);
|
||||
this->currentDay = CURRENT_DAY;
|
||||
@ -294,6 +320,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
|
||||
sGiantsCutsceneState += 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) &&
|
||||
CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) {
|
||||
@ -320,6 +347,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
|
||||
sGiantsCutsceneState = 9;
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
globalCtx->csCtx.frames--;
|
||||
break;
|
||||
@ -351,11 +379,12 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCont
|
||||
if (this->eyeGlowIntensity == 0.0f) {
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_EYE_FLASH);
|
||||
}
|
||||
this->eyeGlowIntensity += 0.033333335f;
|
||||
this->eyeGlowIntensity += 1 / 30.0f;
|
||||
if (this->eyeGlowIntensity > 1.0f) {
|
||||
this->eyeGlowIntensity = 1.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->actor.draw = EnFall_OpenMouthMoon_Draw;
|
||||
break;
|
||||
@ -369,6 +398,7 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
|
||||
case 2:
|
||||
func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x85));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->actor.draw = NULL;
|
||||
break;
|
||||
@ -382,9 +412,11 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
|
||||
case 1060:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1);
|
||||
break;
|
||||
|
||||
case 1089:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY);
|
||||
break;
|
||||
|
||||
case 1303:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON);
|
||||
break;
|
||||
@ -393,14 +425,17 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
|
||||
func_800B9010(&this->actor, NA_SE_EV_FALL_POWER - SFX_FLAG);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (globalCtx->csCtx.frames) {
|
||||
case 561:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1);
|
||||
break;
|
||||
|
||||
case 590:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY);
|
||||
break;
|
||||
|
||||
case 737:
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON);
|
||||
break;
|
||||
@ -420,9 +455,7 @@ void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, Glo
|
||||
}
|
||||
|
||||
/**
|
||||
* This is rarely used in the final game. One example of where it *is* used
|
||||
* is when the moon is crashing; there is a second, smaller moon hidden within
|
||||
* the larger moon that uses this action function.
|
||||
* Used by the Moon in Termina Field, as well as all LodMoons.
|
||||
*/
|
||||
void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx) {
|
||||
u16 currentDay;
|
||||
@ -467,7 +500,7 @@ void EnFall_MoonsTear_Initialize(EnFall* this) {
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
}
|
||||
|
||||
void EnFall_DoNothing(EnFall* this, GlobalContext* globalCtx) {
|
||||
void EnFall_MoonsTear_DoNothing(EnFall* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) {
|
||||
@ -488,7 +521,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_EXPLOSION);
|
||||
this->actor.draw = NULL;
|
||||
this->actionFunc = EnFall_DoNothing;
|
||||
this->actionFunc = EnFall_MoonsTear_DoNothing;
|
||||
} else {
|
||||
func_800B9010(&this->actor, NA_SE_EV_MOONSTONE_FALL - SFX_FLAG);
|
||||
}
|
||||
@ -504,7 +537,7 @@ void EnFall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
* Updates the alpha for every vertex in the fire ball so that some parts of
|
||||
* the sphere are more transparent or opaque than others.
|
||||
*/
|
||||
void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) {
|
||||
void EnFall_Fireball_SetPerVertexAlpha(f32 fireballAlpha) {
|
||||
static u8 sAlphaTableIndex[] = {
|
||||
4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 0, 1, 1, 1, 4, 0, 4, 0, 1, 1, 1, 3, 0, 3, 0, 1, 1, 1, 4, 4, 1,
|
||||
1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 3, 0, 0, 1, 1, 1, 1, 1, 4, 0, 4, 4, 0, 4, 4, 1, 1, 1, 1,
|
||||
@ -516,24 +549,24 @@ void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) {
|
||||
|
||||
s32 pad;
|
||||
u8 perVertexAlphaTable[5];
|
||||
Vtx* vertices = Lib_SegmentedToVirtual(object_fall_Vtx_0004C0);
|
||||
Vtx* vertices = Lib_SegmentedToVirtual(gMoonFireballVtx);
|
||||
s32 i;
|
||||
|
||||
if (fireBallAlpha > 1.0f) {
|
||||
fireBallAlpha = 1.0f;
|
||||
if (fireballAlpha > 1.0f) {
|
||||
fireballAlpha = 1.0f;
|
||||
}
|
||||
perVertexAlphaTable[0] = 0;
|
||||
perVertexAlphaTable[1] = (s8)(255.0f * fireBallAlpha);
|
||||
perVertexAlphaTable[2] = (s8)(155.0f * fireBallAlpha);
|
||||
perVertexAlphaTable[3] = (s8)(104.0f * fireBallAlpha);
|
||||
perVertexAlphaTable[4] = (s8)(54.0f * fireBallAlpha);
|
||||
perVertexAlphaTable[1] = (s8)(255.0f * fireballAlpha);
|
||||
perVertexAlphaTable[2] = (s8)(155.0f * fireballAlpha);
|
||||
perVertexAlphaTable[3] = (s8)(104.0f * fireballAlpha);
|
||||
perVertexAlphaTable[4] = (s8)(54.0f * fireballAlpha);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sAlphaTableIndex); i++, vertices++) {
|
||||
vertices->v.cn[3] = perVertexAlphaTable[sAlphaTableIndex[i]];
|
||||
}
|
||||
}
|
||||
|
||||
void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnFall* this = THIS;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 2) {
|
||||
@ -541,11 +574,11 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (func_800EE29C(globalCtx, 0x1C2)) {
|
||||
this->actor.draw = EnFall_FireBall_Draw;
|
||||
if (this->flags & EN_FALL_FLAG_FIRE_BALL_INTENSIFIES) {
|
||||
this->fireBallIntensity += 0.01f;
|
||||
if (this->fireBallIntensity > 1.0f) {
|
||||
this->fireBallIntensity = 1.0f;
|
||||
this->actor.draw = EnFall_Fireball_Draw;
|
||||
if (this->flags & FLAG_FIRE_BALL_INTENSIFIES) {
|
||||
this->fireballIntensity += 0.01f;
|
||||
if (this->fireballIntensity > 1.0f) {
|
||||
this->fireballIntensity = 1.0f;
|
||||
}
|
||||
}
|
||||
func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x1C2));
|
||||
@ -553,29 +586,33 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0) {
|
||||
default:
|
||||
this->actor.draw = NULL;
|
||||
this->fireBallAlpha = 0;
|
||||
this->fireballAlpha = 0;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (this->fireBallAlpha < 100) {
|
||||
this->fireBallAlpha += 4;
|
||||
if (this->fireballAlpha < 100) {
|
||||
this->fireballAlpha += 4;
|
||||
}
|
||||
if (this->fireBallAlpha > 100) {
|
||||
this->fireBallAlpha = 100;
|
||||
if (this->fireballAlpha > 100) {
|
||||
this->fireballAlpha = 100;
|
||||
}
|
||||
EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f);
|
||||
EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (this->fireBallAlpha > 0) {
|
||||
this->fireBallAlpha -= 2;
|
||||
if (this->fireballAlpha > 0) {
|
||||
this->fireballAlpha -= 2;
|
||||
}
|
||||
if (this->fireBallAlpha < 0) {
|
||||
this->fireBallAlpha = 0;
|
||||
if (this->fireballAlpha < 0) {
|
||||
this->fireballAlpha = 0;
|
||||
}
|
||||
EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f);
|
||||
EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->flags |= EN_FALL_FLAG_FIRE_BALL_INTENSIFIES;
|
||||
this->flags |= FLAG_FIRE_BALL_INTENSIFIES;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
@ -583,7 +620,7 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.draw = NULL;
|
||||
}
|
||||
|
||||
if (func_800EE29C(globalCtx, 0x1C2) && this->fireBallAlpha > 0) {
|
||||
if (func_800EE29C(globalCtx, 0x1C2) && this->fireballAlpha > 0) {
|
||||
func_8019F128(NA_SE_EV_MOON_FALL_LAST - SFX_FLAG);
|
||||
}
|
||||
Actor_SetScale(&this->actor, this->scale * 1.74f);
|
||||
@ -593,7 +630,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
|
||||
if (debrisParticles[i].dListIndex < 3) {
|
||||
if (debrisParticles[i].modelIndex < 3) {
|
||||
debrisParticles[i].pos.x += debrisParticles[i].velocity.x;
|
||||
debrisParticles[i].pos.y += debrisParticles[i].velocity.y;
|
||||
debrisParticles[i].pos.z += debrisParticles[i].velocity.z;
|
||||
@ -601,7 +638,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) {
|
||||
debrisParticles[i].rot.y += 0xC8;
|
||||
debrisParticles[i].rot.z += 0x12C;
|
||||
if ((this->actor.world.pos.y + 3000.0f) < debrisParticles[i].pos.y) {
|
||||
debrisParticles[i].dListIndex = 3;
|
||||
debrisParticles[i].modelIndex = 3;
|
||||
this->activeDebrisParticleCount--;
|
||||
}
|
||||
}
|
||||
@ -614,8 +651,8 @@ s32 EnFall_RisingDebris_InitializeParticles(EnFall* this) {
|
||||
f32 scale;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
|
||||
if (debrisParticles[i].dListIndex >= 3) {
|
||||
debrisParticles[i].dListIndex = (s32)Rand_ZeroFloat(3.0f);
|
||||
if (debrisParticles[i].modelIndex >= 3) {
|
||||
debrisParticles[i].modelIndex = (s32)Rand_ZeroFloat(3.0f);
|
||||
debrisParticles[i].pos.x = this->actor.world.pos.x;
|
||||
debrisParticles[i].pos.y = this->actor.world.pos.y;
|
||||
debrisParticles[i].pos.z = this->actor.world.pos.z;
|
||||
@ -658,13 +695,13 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnFall* this = THIS;
|
||||
|
||||
if (func_800EE29C(globalCtx, 0x1C2) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0 == 5) {
|
||||
if (!(this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS)) {
|
||||
if (!(this->flags & FLAG_FIRE_RING_APPEARS)) {
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_RING_EXPLOSION);
|
||||
}
|
||||
this->flags |= EN_FALL_FLAG_FIRE_RING_APPEARS;
|
||||
this->flags |= FLAG_FIRE_RING_APPEARS;
|
||||
}
|
||||
if (this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS) {
|
||||
this->fireRingAlpha += 0.033333335f;
|
||||
if (this->flags & FLAG_FIRE_RING_APPEARS) {
|
||||
this->fireRingAlpha += 1 / 30.0f;
|
||||
if (this->fireRingAlpha > 1.0f) {
|
||||
this->fireRingAlpha = 1.0f;
|
||||
}
|
||||
@ -679,6 +716,10 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for all closed-mouth high-detail moons, including
|
||||
* StoppedClosedMouthMoon and CrashingMoon.
|
||||
*/
|
||||
void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
// This offsets the moon's focus so that the Moon's Tear actually falls
|
||||
// out of its eye when looking at it through the telescope.
|
||||
@ -691,9 +732,11 @@ void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
Matrix_MultiplyVector3fByState(sFocusOffset, &this->actor.focus.pos);
|
||||
|
||||
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_0077F0);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@ -706,9 +749,11 @@ void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_fall2_DL_002970);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gOpenMouthMoonDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@ -722,14 +767,17 @@ void EnFall_LodMoon_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 20, 25, 30, 0, 0x3E7, 0x3200);
|
||||
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_AA_ZB_OPA_SURF2);
|
||||
gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
|
||||
|
||||
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_0010E0);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLodmoonEyesDL);
|
||||
gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_001158);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLodmoonMoonDL);
|
||||
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@ -759,57 +807,63 @@ void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Matrix_InsertXRotation_s(thisx->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(thisx->shape.rot.z, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
EnFall_LodMoon_Draw(thisx, globalCtx);
|
||||
}
|
||||
|
||||
void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnFall* this = THIS;
|
||||
u32 gameplayFrames = globalCtx->gameplayFrames;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
this->fireBallYTexScroll1 += (s32)(4.0f + (this->fireBallIntensity * 12.0f));
|
||||
this->fireBallYTexScroll2 += (s32)(2.0f + (this->fireBallIntensity * 6.0f));
|
||||
|
||||
this->fireballYTexScroll1 += (s32)(4.0f + (this->fireballIntensity * 12.0f));
|
||||
this->fireballYTexScroll2 += (s32)(2.0f + (this->fireballIntensity * 6.0f));
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80,
|
||||
(s32)(((1.0f - this->fireBallIntensity) * 160.0f) + (255.0f * this->fireBallIntensity)),
|
||||
(s32)((70.0f * (1.0f - this->fireBallIntensity)) + (255.0f * this->fireBallIntensity)),
|
||||
(s32)(70.0f * (1.0f - this->fireBallIntensity)), 255);
|
||||
(s32)(((1.0f - this->fireballIntensity) * 160.0f) + (255.0f * this->fireballIntensity)),
|
||||
(s32)((70.0f * (1.0f - this->fireballIntensity)) + (255.0f * this->fireballIntensity)),
|
||||
(s32)(70.0f * (1.0f - this->fireballIntensity)), 255);
|
||||
gDPSetEnvColor(
|
||||
POLY_XLU_DISP++, (s32)(((1.0f - this->fireBallIntensity) * 50.0f) + (200.0f * this->fireBallIntensity)),
|
||||
(s32)(20.0f * (1.0f - this->fireBallIntensity)), (s32)(20.0f * (1.0f - this->fireBallIntensity)), 255);
|
||||
POLY_XLU_DISP++, (s32)(((1.0f - this->fireballIntensity) * 50.0f) + (200.0f * this->fireballIntensity)),
|
||||
(s32)(20.0f * (1.0f - this->fireballIntensity)), (s32)(20.0f * (1.0f - this->fireballIntensity)), 255);
|
||||
|
||||
// Glowing sphere of fire
|
||||
// For the glowing sphere of fire
|
||||
gSPSegment(POLY_XLU_DISP++, 0x09,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireBallYTexScroll2, 64, 64, 1,
|
||||
-gameplayFrames, -this->fireBallYTexScroll1, 64, 64));
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireballYTexScroll2, 64, 64, 1,
|
||||
-gameplayFrames, -this->fireballYTexScroll1, 64, 64));
|
||||
|
||||
// "Flecks" of fire
|
||||
// For the "flecks" of fire around the fireball
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0A,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64, 1,
|
||||
-gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64));
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 1,
|
||||
-gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64));
|
||||
|
||||
gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE);
|
||||
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_0011D0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gMoonFireballDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
static Gfx* sDebrisDLists[] = { object_fall_DL_000220, object_fall_DL_000428, object_fall_DL_000498 };
|
||||
static Gfx* sDebrisModelDLists[] = { gMoonDebrisModel1DL, gMoonDebrisModel2DL, gMoonDebrisModel3DL };
|
||||
EnFall* this = THIS;
|
||||
f32 scale = this->scale * 0.06f;
|
||||
s32 i;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_000198);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonDebrisMaterialDL);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
|
||||
if (debrisParticles[i].dListIndex < 3) {
|
||||
if (debrisParticles[i].modelIndex < 3) {
|
||||
Matrix_InsertTranslation(debrisParticles[i].pos.x, debrisParticles[i].pos.y, debrisParticles[i].pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
@ -817,9 +871,10 @@ void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDebrisDLists[debrisParticles[i].dListIndex]);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDebrisModelDLists[debrisParticles[i].modelIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@ -832,13 +887,18 @@ void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->fireRingAlpha = 1.0f;
|
||||
}
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(object_fall_Matanimheader_004E38));
|
||||
|
||||
AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(gMoonFireRingTexAnim));
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE);
|
||||
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, (s32)(this->fireRingAlpha * 255.0f));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_003C30);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, gMoonFireRingDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
@ -847,13 +907,18 @@ void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_moonston_Matanimheader_001220));
|
||||
|
||||
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gFallingMoonsTearTexAnim));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_moonston_DL_000400);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gFallingMoonsTearDL);
|
||||
|
||||
Matrix_Scale(3.0f, 3.0f, 6.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_moonston_DL_0004C8);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, gFallingMoonsTearFireDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
@ -6,9 +6,6 @@
|
||||
#define EN_FALL_SCALE(thisx) ((thisx)->params & 0x7F)
|
||||
#define EN_FALL_TYPE(thisx) (((thisx)->params & 0xF80) >> 7)
|
||||
|
||||
#define EN_FALL_FLAG_FIRE_BALL_INTENSIFIES (1 << 0)
|
||||
#define EN_FALL_FLAG_FIRE_RING_APPEARS (1 << 1)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ EN_FALL_TYPE_TERMINA_FIELD_MOON,
|
||||
/* 1 */ EN_FALL_TYPE_TITLE_SCREEN_MOON,
|
||||
@ -37,19 +34,19 @@ typedef struct EnFall {
|
||||
/* 0x14C */ f32 scale;
|
||||
/* 0x150 */ union {
|
||||
f32 eyeGlowIntensity;
|
||||
f32 fireBallIntensity;
|
||||
f32 fireballIntensity;
|
||||
f32 fireRingAlpha;
|
||||
};
|
||||
/* 0x154 */ u16 flags;
|
||||
/* 0x158 */ union {
|
||||
s32 fireBallAlpha;
|
||||
s32 fireballAlpha;
|
||||
s32 activeDebrisParticleCount;
|
||||
};
|
||||
/* 0x15C */ union {
|
||||
s16 fireBallYTexScroll1;
|
||||
s16 fireballYTexScroll1;
|
||||
s16 fireWallYScale;
|
||||
};
|
||||
/* 0x15E */ s16 fireBallYTexScroll2;
|
||||
/* 0x15E */ s16 fireballYTexScroll2;
|
||||
/* 0x160 */ EnFallActionFunc actionFunc;
|
||||
} EnFall; // size = 0x164
|
||||
|
||||
|
@ -10920,7 +10920,7 @@
|
||||
0x80A6CD38:("EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions",),
|
||||
0x80A6CD74:("EnFall_Moon_PerformDefaultActions",),
|
||||
0x80A6CECC:("EnFall_MoonsTear_Initialize",),
|
||||
0x80A6CF60:("EnFall_DoNothing",),
|
||||
0x80A6CF60:("EnFall_MoonsTear_DoNothing",),
|
||||
0x80A6CF70:("EnFall_MoonsTear_Fall",),
|
||||
0x80A6D0DC:("EnFall_Update",),
|
||||
0x80A6D100:("EnFall_FireBall_SetPerVertexAlpha",),
|
||||
|
Loading…
x
Reference in New Issue
Block a user