Effect Hahen Ok (#875)

* OK

* format

* gameplay keep

* undef syms

* drawFlags -> params

* Format

* Fix railskb include

* DL consistency with OoT

* Hex
This commit is contained in:
Derek Hensley 2022-07-11 18:48:37 -07:00 committed by GitHub
parent 94372c3670
commit f85a398162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 170 additions and 56 deletions

View File

@ -854,8 +854,8 @@
<DList Name="gameplay_keep_DL_01A4D0" Offset="0x1A4D0" />
<DList Name="gameplay_keep_DL_01A538" Offset="0x1A538" />
<DList Name="gameplay_keep_DL_01A590" Offset="0x1A590" />
<DList Name="gameplay_keep_DL_01A620" Offset="0x1A620" />
<Texture Name="gameplay_keep_Tex_01A6B0" OutName="tex_01A6B0" Format="rgba16" Width="16" Height="16" Offset="0x1A6B0" />
<DList Name="gEffFragments1DL" Offset="0x1A620" />
<Texture Name="gWitheredLeafTex" OutName="withered_leaf" Format="rgba16" Width="16" Height="16" Offset="0x1A6B0" />
<Texture Name="gameplay_keep_Tex_01A8B0" OutName="tex_01A8B0" Format="i8" Width="16" Height="32" Offset="0x1A8B0" />
<Texture Name="gameplay_keep_Tex_01AAB0" OutName="tex_01AAB0" Format="i8" Width="16" Height="32" Offset="0x1AAB0" />
<DList Name="gameplay_keep_DL_01ACF0" Offset="0x1ACF0" />
@ -871,7 +871,7 @@
<DList Name="gameplay_keep_DL_01ED90" Offset="0x1ED90" />
<DList Name="gZTargetArrowDL" Offset="0x1F0F0" />
<Texture Name="gameplay_keep_Tex_01F200" OutName="tex_01F200" Format="i8" Width="8" Height="8" Offset="0x1F200" />
<DList Name="gameplay_keep_DL_01F300" Offset="0x1F300" />
<DList Name="gEffFragments2DL" Offset="0x1F300" />
<Texture Name="gameplay_keep_Tex_01F340" OutName="tex_01F340" Format="ia8" Width="32" Height="32" Offset="0x1F340" />
<Texture Name="gSelectionCursorTex" OutName="selection_cursor" Format="ia4" Width="16" Height="16" Offset="0x1F740" />
<Texture Name="gControlStickTex" OutName="control_stick" Format="ia8" Width="16" Height="16" Offset="0x1F7C0" />

View File

@ -546,8 +546,8 @@ void EffectSsGSplash_Spawn(PlayState* play, Vec3f* pos, Color_RGBA8* primColor,
// void EffectSsLightning_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Color_RGBA8* pzParm3, Color_RGBA8* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8);
// void EffectSsDtBubble_SpawnColorProfile(UNK_TYPE4 param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8);
void EffectSsDtBubble_SpawnCustomColor(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ);
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, s16 objId, s16 life, Gfx* dList);
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList);
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objId, s16 life, Gfx* dList);
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 flags, s16 scale, s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList);
// void func_800B2364(void);
// void EffectSsStick_Spawn(UNK_TYPE4 uParm1, UNK_PTR puParm2, UNK_TYPE2 uParm3);
// void EffectSsSibuki_Spawn(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);

3
spec
View File

@ -1859,8 +1859,7 @@ beginseg
name "ovl_Effect_Ss_Hahen"
compress
include "build/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.o"
include "build/data/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen.data.o"
include "build/data/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen.reloc.o"
include "build/src/overlays/effects/ovl_Effect_Ss_Hahen/ovl_Effect_Ss_Hahen_reloc.o"
endseg
beginseg

View File

@ -529,7 +529,7 @@ void EffectSsDtBubble_SpawnCustomColor(PlayState* play, Vec3f* pos, Vec3f* veloc
* - due to how life is implemented it is capped at 200. Any value over 200 is accepted, but the fragment will
* only live for 200 frames
*/
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, s16 objId,
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objId,
s16 life, Gfx* dList) {
EffectSsHahenInitParams initParams;
@ -537,7 +537,7 @@ void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
Math_Vec3f_Copy(&initParams.velocity, velocity);
Math_Vec3f_Copy(&initParams.accel, accel);
initParams.dList = dList;
initParams.unused = unused;
initParams.flags = flags;
initParams.scale = scale;
initParams.objId = objId;
initParams.life = life;
@ -554,7 +554,7 @@ void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
* - due to how life is implemented it is capped at 200. Any value over 200 is accepted, but the fragment will
* only live for 200 frames
*/
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, s16 randScaleRange,
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 flags, s16 scale, s16 randScaleRange,
s16 count, s16 objId, s16 life, Gfx* dList) {
s32 i;
Vec3f velocity;
@ -568,7 +568,7 @@ void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 u
velocity.z = (Rand_ZeroOne() - 0.5f) * burstScale;
velocity.y = ((Rand_ZeroOne() * 0.5f) + 0.5f) * burstScale;
EffectSsHahen_Spawn(play, pos, &velocity, &accel, unused, Rand_S16Offset(scale, randScaleRange), objId, life,
EffectSsHahen_Spawn(play, pos, &velocity, &accel, flags, Rand_S16Offset(scale, randScaleRange), objId, life,
dList);
}
}
@ -576,7 +576,7 @@ void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 u
void func_800B2364(PlayState* play, Vec3f* pos, Gfx* dList) {
Vec3f accel = { 0.0f, -2.0f, 0.0f };
EffectSsHahen_Spawn(play, pos, &gZeroVec3f, &accel, 1, 5, 1, 10, dList);
EffectSsHahen_Spawn(play, pos, &gZeroVec3f, &accel, HAHEN_SMALL, 5, GAMEPLAY_KEEP, 10, dList);
}
// EffectSsStick Spawn Functions

View File

@ -1566,7 +1566,7 @@ void func_809DD2F8(PlayState* play) {
MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_01A620);
gSPDisplayList(POLY_OPA_DISP++, gEffFragments1DL);
}
}

View File

@ -540,7 +540,8 @@ void func_808BE4D4(EnDekunuts* this, PlayState* play) {
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0);
Actor_Spawn(&play->actorCtx, play, ACTOR_OBJ_ETCETERA, this->actor.home.pos.x, this->actor.home.pos.y,
this->actor.home.pos.z, 0, this->actor.home.rot.y, 0, 0x80);
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, 64, 10, gDekuScrubFlowerFragmentDL);
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, OBJECT_DEKUNUTS, 10,
gDekuScrubFlowerFragmentDL);
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -7,6 +7,7 @@
#include "z_en_fu_kago.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Fu/z_en_fu.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_fu_mato/object_fu_mato.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
@ -221,7 +222,7 @@ void func_80ACFA78(EnFuKago* this, PlayState* play) {
}
this->dyna.actor.freezeTimer = 2;
EffectSsHahen_SpawnBurst(play, &this->dyna.actor.world.pos, 17.0f, 0, 15, 13, 20, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->dyna.actor.world.pos, 17.0f, 0, 15, 13, 20, HAHEN_OBJECT_DEFAULT, 10, NULL);
this->unk_338 = 60;
this->unk_33A = 1;

View File

@ -6,6 +6,7 @@
#include "z_en_fu_mato.h"
#include "overlays/actors/ovl_En_Fu/z_en_fu.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_fu_mato/object_fu_mato.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
@ -239,7 +240,7 @@ void func_80ACE850(EnFuMato* this, PlayState* play) {
}
this->dyna.actor.freezeTimer = 2;
EffectSsHahen_SpawnBurst(play, &this->dyna.actor.world.pos, 13.0f, 0, 7, 8, 20, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->dyna.actor.world.pos, 13.0f, 0, 7, 8, 20, HAHEN_OBJECT_DEFAULT, 10, NULL);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODPLATE_BROKEN);
this->actionFunc = func_80ACECFC;
}

View File

@ -6,6 +6,7 @@
#include "z_en_geg.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_oF1d_map/object_oF1d_map.h"
#include "objects/object_taisou/object_taisou.h"
#include "objects/object_hakugin_demo/object_hakugin_demo.h"
@ -692,8 +693,8 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) {
this->unk_4C0[i].x *= temp_f20;
this->unk_4C0[i].y *= temp_f20;
this->unk_4C0[i].z *= temp_f20;
EffectSsHahen_Spawn(play, &this->unk_4B4, &this->unk_4C0[i], &sp74, 1, sp68, 1, 15,
gameplay_keep_DL_06AB30);
EffectSsHahen_Spawn(play, &this->unk_4B4, &this->unk_4C0[i], &sp74, HAHEN_SMALL, sp68, GAMEPLAY_KEEP,
15, gameplay_keep_DL_06AB30);
}
}
this->unk_4E0--;

View File

@ -5,6 +5,7 @@
*/
#include "z_en_guard_nuts.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_100000 | ACTOR_FLAG_80000000)
@ -273,7 +274,7 @@ void EnGuardNuts_Burrow(EnGuardNuts* this, PlayState* play) {
EnGuardNuts_ChangeAnim(this, DIG_ANIM);
Math_Vec3f_Copy(&digPos, &this->actor.world.pos);
digPos.y = this->actor.floorHeight;
EffectSsHahen_SpawnBurst(play, &digPos, 4.0f, 0, 10, 3, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &digPos, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
this->targetHeadPos.y = 0;
this->actor.flags |= ACTOR_FLAG_8000000;
this->targetHeadPos.x = this->targetHeadPos.y;
@ -304,7 +305,7 @@ void EnGuardNuts_Unburrow(EnGuardNuts* this, PlayState* play) {
if ((yawDiff < 0x4000) && ((D_80ABBE20 == 0) || (this->actor.xzDistToPlayer > 150.0f))) {
Math_Vec3f_Copy(&digPos, &this->actor.world.pos);
digPos.y = this->actor.floorHeight;
EffectSsHahen_SpawnBurst(play, &digPos, 4.0f, 0, 10, 3, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &digPos, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
D_80ABBE20 = 0;
if (this->guardTextIndex == 9) {

View File

@ -5,6 +5,7 @@
*/
#include "z_en_hidden_nuts.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_hintnuts/object_hintnuts.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_2000000)
@ -257,7 +258,7 @@ void func_80BDB7E8(EnHiddenNuts* this, PlayState* play) {
Math_Vec3f_Copy(&sp3C, &this->actor.world.pos);
sp3C.y = this->actor.floorHeight + 30.0f;
EffectSsHahen_SpawnBurst(play, &sp3C, 4.0f, 0, 10, 3, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &sp3C, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
func_80BDB1B4(this, 7);
@ -304,7 +305,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) {
Math_Vec3f_Copy(&sp44, &this->actor.world.pos);
sp44.y = this->actor.floorHeight + 30.0f;
EffectSsHahen_SpawnBurst(play, &sp44, 4.0f, 0, 10, 3, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &sp44, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
this->unk_208 = 1;
@ -398,7 +399,7 @@ void func_80BDBED4(EnHiddenNuts* this, PlayState* play) {
sp38.y = this->actor.floorHeight;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
EffectSsHahen_SpawnBurst(play, &sp38, 4.0f, 0, 10, 3, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &sp38, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -5,6 +5,7 @@
*/
#include "z_en_hint_skb.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_skb/object_skb.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
@ -816,7 +817,8 @@ void func_80C215E4(PlayState* play, EnHintSkb* this, Vec3f* arg2) {
sp50.y += (Rand_ZeroOne() - 0.5f) * 4.0f;
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, ((Rand_ZeroOne() * 5.0f) + 12.0f) * 0.8f, -1, 10, NULL);
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, ((Rand_ZeroOne() * 5.0f) + 12.0f) * 0.8f, HAHEN_OBJECT_DEFAULT,
10, NULL);
func_800BBFB0(play, &sp5C, 10.0f, 1, 150, 0, 1);
}

View File

@ -5,6 +5,7 @@
*/
#include "z_en_karebaba.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_dekubaba/object_dekubaba.h"
@ -275,7 +276,7 @@ void func_808F1778(EnKarebaba* this, PlayState* play) {
}
this->actor.shape.rot.y += 0x1999;
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
}
void func_808F1878(EnKarebaba* this) {
@ -407,7 +408,7 @@ void func_808F1C84(EnKarebaba* this, PlayState* play) {
if (this->unk_1EE == 0) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) {
this->actor.scale.z = 0.0f;
@ -415,7 +416,8 @@ void func_808F1C84(EnKarebaba* this, PlayState* play) {
this->actor.scale.x = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10,
NULL);
}
if (this->actor.bgCheckFlags & 2) {
@ -463,7 +465,7 @@ void func_808F200C(EnKarebaba* this, PlayState* play) {
Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1);
func_808F238C(this);
} else {
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f);
}
this->actor.scale.y = this->actor.scale.x;
@ -520,7 +522,7 @@ void func_808F228C(EnKarebaba* this, PlayState* play) {
}
this->actor.shape.rot.y += 0x1999;
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
}
void func_808F238C(EnKarebaba* this) {

View File

@ -6,6 +6,7 @@
#include "z_en_peehat.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_ph/object_ph.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
@ -260,7 +261,8 @@ void func_80897258(PlayState* play, EnPeehat* this, Vec3f* arg2, f32 arg3, f32 a
D_80899564.z = randPlusMinusPoint5Scaled(1.05f);
D_80899558.y = randPlusMinusPoint5Scaled(4.0f) + 8.0f;
EffectSsHahen_Spawn(play, &sp44, &D_80899558, &D_80899564, 0, (Rand_ZeroFloat(5.0f) + 12.0f) * arg4, -1, 10, NULL);
EffectSsHahen_Spawn(play, &sp44, &D_80899558, &D_80899564, 0, (Rand_ZeroFloat(5.0f) + 12.0f) * arg4,
HAHEN_OBJECT_DEFAULT, 10, NULL);
}
void func_80897390(EnPeehat* this, PlayState* play) {

View File

@ -4,8 +4,8 @@
* Description: Ikana Graveyard - Circle of Stalchildren
*/
#include "overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h"
#include "z_en_rail_skb.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_skb/object_skb.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
@ -848,7 +848,7 @@ void func_80B72430(EnRailSkb* this, PlayState* play, s32 arg2) {
sp50.y += Rand_Centered() * 4.0f;
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, (Rand_Next() & 7) + 10, -1, 10, NULL);
EffectSsHahen_Spawn(play, &sp5C, &sp50, &sp44, 0, (Rand_Next() & 7) + 10, HAHEN_OBJECT_DEFAULT, 10, NULL);
func_800BBFB0(play, &sp5C, 10.0f, 1, 150, 0, 1);
}
}

View File

@ -2,6 +2,7 @@
#define Z_EN_RAIL_SKB_H
#include "global.h"
#include "overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h"
struct EnRailSkb;

View File

@ -6,7 +6,7 @@
#include "z_en_railgibud.h"
#include "z64rumble.h"
#include "objects/object_rd/object_rd.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
@ -674,7 +674,7 @@ void EnRailgibud_SpawnEffectsForSinkingIntoTheGround(EnRailgibud* this, PlayStat
rockFragmentAccel.z = Rand_Centered();
rockFragmentVelocity.y += Rand_Centered() * 4.0f;
EffectSsHahen_Spawn(play, &rockFragmentPos, &rockFragmentVelocity, &rockFragmentAccel, 0,
(Rand_Next() & 7) + 10, -1, 10, NULL);
(Rand_Next() & 7) + 10, HAHEN_OBJECT_DEFAULT, 10, NULL);
EnRailgibud_SpawnDust(play, &rockFragmentPos, 10.0f, 10, 150, 0);
}
}
@ -1112,6 +1112,7 @@ void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (gSaveContext.save.entranceIndex != 0x2090) { // NOT Cutscene: Music Box House Opens
Actor_MarkForDeath(&this->actor);
}

View File

@ -121,7 +121,7 @@ void func_80BCAC40(EnScopenuts* this, PlayState* play) {
sp54.x = Rand_Centered() * 10.0f;
sp54.y = 2.0f * Rand_Centered();
sp54.z = Rand_Centered() * 10.0f;
EffectSsHahen_Spawn(play, &sp60, &sp54, &D_80BCCCE4, 0, 0x96, 1, 0x10, D_80BCCCDC[i & 1]);
EffectSsHahen_Spawn(play, &sp60, &sp54, &D_80BCCCE4, 0, 150, GAMEPLAY_KEEP, 16, D_80BCCCDC[i & 1]);
}
}

View File

@ -328,7 +328,7 @@ void EnSnowman_SpawnBigSnowballFragmentEffects(EnSnowman* this, PlayState* play)
pos.y = (Rand_ZeroFloat(8.0f) * velocity.y) + this->snowballPos.y;
pos.z = (Rand_ZeroFloat(10.0f) * velocity.z) + this->snowballPos.z;
EffectSsHahen_Spawn(play, &pos, &velocity, &sAccel, 0,
Rand_S16Offset((((i % 3) * 50) + 50), (((i % 3) * 25) + 25)), 452, 20,
Rand_S16Offset((((i % 3) * 50) + 50), (((i % 3) * 25) + 25)), OBJECT_SNOWMAN, 20,
sSnowballFragmentDLs[i % 3]);
}
@ -755,7 +755,7 @@ void EnSnowman_Dead(EnSnowman* this, PlayState* play) {
pos.y = (Rand_ZeroFloat(3.0f) * velocity.y) + this->actor.world.pos.y;
pos.z = (Rand_ZeroFloat(6.0f) * velocity.z) + this->actor.world.pos.z;
EffectSsHahen_Spawn(play, &pos, &velocity, &sAccel, 0,
Rand_S16Offset((((i % 3) * 20) + 20), (((i % 3) * 10) + 10)), 452, 20,
Rand_S16Offset((((i % 3) * 20) + 20), (((i % 3) * 10) + 10)), OBJECT_SNOWMAN, 20,
sSnowballFragmentDLs[i % 3]);
}
@ -1086,7 +1086,7 @@ void EnSnowman_UpdateSnowball(Actor* thisx, PlayState* play) {
if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) {
scale = 10;
for (i = 0; i < 3; i++) {
EffectSsHahen_SpawnBurst(play, &thisx->world.pos, 5.0f, 0, scale, scale >> 1, 3, 452, 20,
EffectSsHahen_SpawnBurst(play, &thisx->world.pos, 5.0f, 0, scale, scale >> 1, 3, OBJECT_SNOWMAN, 20,
sSnowballFragmentDLs[i]);
scale *= 2;
}

View File

@ -6,6 +6,7 @@
#include "z_obj_bigicicle.h"
#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_bigicicle/object_bigicicle.h"
#define FLAGS 0x00000000
@ -166,8 +167,8 @@ void func_80AE8DE4(ObjBigicicle* this, PlayState* play) {
sp8C.y = Rand_ZeroFloat(2.0f);
sp8C.z = randPlusMinusPoint5Scaled(13.0f);
EffectSsHahen_Spawn(play, &sp98, &sp8C, &D_80AE987C, 2, (Rand_ZeroFloat(20.0f) + 30.0f) * temp_f20,
OBJECT_BIGICICLE, 0x28, object_bigicicle_DL_0009B0);
EffectSsHahen_Spawn(play, &sp98, &sp8C, &D_80AE987C, HAHEN_XLU, (Rand_ZeroFloat(20.0f) + 30.0f) * temp_f20,
OBJECT_BIGICICLE, 40, object_bigicicle_DL_0009B0);
}
sp98.x = this->actor.world.pos.x;
@ -278,7 +279,7 @@ void func_80AE939C(ObjBigicicle* this, PlayState* play) {
sp98.y = this->actor.world.pos.y + (sp8C.y * 7.0f * temp_f20);
sp98.z = this->actor.world.pos.z + (sp8C.z * 5.0f * temp_f20);
EffectSsHahen_Spawn(play, &sp98, &sp8C, &D_80AE987C, 2, (Rand_ZeroFloat(30.0f) + 40.0f) * temp_f20,
EffectSsHahen_Spawn(play, &sp98, &sp8C, &D_80AE987C, HAHEN_XLU, (Rand_ZeroFloat(30.0f) + 40.0f) * temp_f20,
OBJECT_BIGICICLE, 30, object_bigicicle_DL_0009B0);
}

View File

@ -1,33 +1,131 @@
/*
* File: z_eff_ss_hahen.c
* Overlay: ovl_Effect_Ss_Hahen
* Description:
* Description: Fragments
*/
#include "z_eff_ss_hahen.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define rPitch regs[0]
#define rYaw regs[1]
#define rFlags regs[2]
#define rScale regs[3]
#define rObjId regs[4]
#define rObjBankIndex regs[5]
#define rMinLife regs[6]
#define PARAMS ((EffectSsHahenInitParams*)initParamsx)
s32 EffectSsHahen_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
u32 EffectSsHahen_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
void EffectSsHahen_Update(PlayState* play, u32 index, EffectSs* this);
void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this);
#if 0
const EffectSsInit Effect_Ss_Hahen_InitVars = {
EFFECT_SS_HAHEN,
EffectSsHahen_Init,
};
#endif
void EffectSsHahen_CheckForObject(EffectSs* this, PlayState* play) {
if (((this->rObjBankIndex = Object_GetIndex(&play->objectCtx, this->rObjId)) < 0) ||
!Object_IsLoaded(&play->objectCtx, this->rObjBankIndex)) {
this->life = -1;
this->draw = NULL;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/func_8097B270.s")
u32 EffectSsHahen_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) {
EffectSsHahenInitParams* initParams = PARAMS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/EffectSsHahen_Init.s")
this->pos = initParams->pos;
this->velocity = initParams->velocity;
this->accel = initParams->accel;
this->life = 200;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/func_8097B424.s")
if (initParams->dList != NULL) {
this->gfx = initParams->dList;
this->rObjId = initParams->objId;
EffectSsHahen_CheckForObject(this, play);
} else {
this->gfx = gEffFragments1DL;
this->rObjId = HAHEN_OBJECT_DEFAULT;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/func_8097B504.s")
this->draw = EffectSsHahen_Draw;
this->update = EffectSsHahen_Update;
this->rFlags = initParams->flags;
this->rScale = initParams->scale;
this->rPitch = Rand_ZeroOne() * 314.0f;
this->rYaw = Rand_ZeroOne() * 314.0f;
this->rMinLife = 200 - initParams->life;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/EffectSsHahen_Draw.s")
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Hahen/EffectSsHahen_Update.s")
void EffectSsHahen_DrawOpa(PlayState* play, EffectSs* this) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
s32 pad;
OPEN_DISPS(gfxCtx);
if (this->rObjId != HAHEN_OBJECT_DEFAULT) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment);
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C28C(play->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, this->gfx);
CLOSE_DISPS(gfxCtx);
}
void EffectSsHahen_DrawXlu(PlayState* play, EffectSs* this) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
s32 pad;
OPEN_DISPS(gfxCtx);
if (this->rObjId != -1) {
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment);
}
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(play->state.gfxCtx);
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
CLOSE_DISPS(gfxCtx);
}
void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) {
f32 scale;
if (this->rFlags & HAHEN_SMALL) {
scale = this->rScale * (0.001f * 0.1f);
} else {
scale = this->rScale * 0.001f;
}
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_RotateYF(this->rYaw * 0.01f, MTXMODE_APPLY);
Matrix_RotateXFApply(this->rPitch * 0.01f);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
if (this->rFlags & HAHEN_XLU) {
EffectSsHahen_DrawXlu(play, this);
} else {
EffectSsHahen_DrawOpa(play, this);
}
}
void EffectSsHahen_Update(PlayState* play, u32 index, EffectSs* this) {
Player* player = GET_PLAYER(play);
this->rPitch += 0x37;
this->rYaw += 0xA;
if ((this->pos.y <= player->actor.floorHeight) && (this->life < this->rMinLife)) {
this->life = 0;
}
if (this->rObjId != HAHEN_OBJECT_DEFAULT) {
EffectSsHahen_CheckForObject(this, play);
}
}

View File

@ -5,12 +5,15 @@
#define HAHEN_OBJECT_DEFAULT -1
#define HAHEN_SMALL (1 << 0)
#define HAHEN_XLU (1 << 1)
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f velocity;
/* 0x18 */ Vec3f accel;
/* 0x24 */ Gfx* dList;
/* 0x28 */ s16 unused;
/* 0x28 */ s16 flags;
/* 0x2A */ s16 scale;
/* 0x2C */ s16 objId;
/* 0x2C */ s16 life;

View File

@ -8171,10 +8171,10 @@
0x8097AD60:("EffectSsDtBubble_Init",),
0x8097AF50:("EffectSsDtBubble_Draw",),
0x8097B160:("EffectSsDtBubble_Update",),
0x8097B270:("func_8097B270",),
0x8097B270:("EffectSsHahen_CheckForObject",),
0x8097B2E4:("EffectSsHahen_Init",),
0x8097B424:("func_8097B424",),
0x8097B504:("func_8097B504",),
0x8097B424:("EffectSsHahen_DrawOpa",),
0x8097B504:("EffectSsHahen_DrawXlu",),
0x8097B5E4:("EffectSsHahen_Draw",),
0x8097B708:("EffectSsHahen_Update",),
0x8097B810:("EffectSsStick_Init",),

View File

@ -388,7 +388,6 @@ D_04016360 = 0x04016360;
D_0401A4D0 = 0x0401A4D0;
D_0401A538 = 0x0401A538;
D_0401A590 = 0x0401A590;
D_0401A620 = 0x0401A620;
D_0401ACF0 = 0x0401ACF0;
D_0401ED00 = 0x0401ED00;
D_0401F0F0 = 0x0401F0F0;