diff --git a/include/functions.h b/include/functions.h index e35fc618..a3a395fd 100644 --- a/include/functions.h +++ b/include/functions.h @@ -238,8 +238,8 @@ void particleEmitter_setDrawMode(ParticleEmitter *, s32); void particleEmitter_setStartingFrameRange(ParticleEmitter *this, s32 arg1, s32 arg2); void particleEmitter_setParticleFramerateRange(ParticleEmitter *, f32, f32); void particleEmitter_setParticleSpawnPositionRange(ParticleEmitter *, f32, f32, f32, f32, f32, f32); -void func_802EFB70(ParticleEmitter *, f32, f32); -void func_802EFB84(ParticleEmitter *, f32, f32); +void particleEmitter_setStartingScaleRange(ParticleEmitter *, f32, f32); +void particleEmitter_setFinalScaleRange(ParticleEmitter *, f32, f32); void particleEmitter_setScaleAndLifetimeRanges(ParticleEmitter *, ParticleScaleAndLifetimeRanges *); void particleEmitter_setVelocityAndAccelerationRanges(ParticleEmitter *, struct41s *); void particleEmitter_setPositionAndVelocityRanges(ParticleEmitter *this, struct42s *arg1); @@ -384,7 +384,7 @@ extern s32 func_802F9AA8(enum sfx_e); Actor * func_803055E0(enum actor_e id, s32 pos[3], s32 arg2, s32 arg3, s32 arg4); Actor * spawn_actor(enum actor_e id, s32 pos[3], s32 yaw); -f32 func_80309724(f32[3]); +f32 mapModel_getFloorY(f32[3]); BKModelBin *func_8030A428(s32); u8 func_8030D90C(void); void sfxsource_setSfxId(u8 indx, enum sfx_e uid); @@ -429,7 +429,7 @@ void func_80326244(Actor *); void func_8032728C(f32[3], f32, s32, int(*)(Actor *)); -Actor *func_8032813C(enum actor_e actor_id, f32 position[3], s32 yaw); +Actor *spawn_actor_f32(enum actor_e actor_id, f32 position[3], s32 yaw); int func_8032863C(AnimCtrl *, f32, f32); int func_80328A2C(Actor *, f32, s32, f32); void subaddie_set_state(Actor *, u32); diff --git a/include/prop.h b/include/prop.h index 6f4ddde7..7725291b 100644 --- a/include/prop.h +++ b/include/prop.h @@ -192,7 +192,7 @@ typedef struct actor_s{ u32 unk58_1: 1; u32 unk58_0: 1; f32 unk5C; - f32 unk60; // actor lifetime? + f32 lifetime_value; // actor lifetime? f32 yaw_ideal; //0x64 f32 pitch;//0x68 f32 unk6C; @@ -260,7 +260,7 @@ typedef struct actor_s{ u32 unk138_28:1; u32 unk138_27:2; u32 unk138_25:1; - u32 unk138_24:1; + u32 is_first_encounter:TRUE; u32 unk138_23:1; u32 unk138_22:1; u32 unk138_21:1; diff --git a/src/BGS/ch/bigalligator.c b/src/BGS/ch/bigalligator.c index 548614af..e50ff1f2 100644 --- a/src/BGS/ch/bigalligator.c +++ b/src/BGS/ch/bigalligator.c @@ -20,5 +20,5 @@ void func_8038FCB0(Actor *this){ return; this->marker->propPtr->unk8_3 = 1; actor_collisionOff(this); - this->initialized = 1; + this->initialized = TRUE; } diff --git a/src/BGS/ch/code_2270.c b/src/BGS/ch/code_2270.c index ffefe90c..ec0463bc 100644 --- a/src/BGS/ch/code_2270.c +++ b/src/BGS/ch/code_2270.c @@ -142,8 +142,8 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ if(this->state == 2){ skeletalAnim_set(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); unqPtr->unkC = randf2(5.0f, 15.0f); - if(!this->unk138_24){ - this->unk138_24 = 1; + if(!this->is_first_encounter){ + this->is_first_encounter = TRUE; if(unqPtr->unkA == 0){ func_80311480(0xc72, 0xe, this->position, this->marker, func_80388784, 0); }else{ diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c index 0bffffd5..91fd4683 100644 --- a/src/BGS/ch/croctus.c +++ b/src/BGS/ch/croctus.c @@ -48,7 +48,7 @@ void func_80387D18(ActorMarker * arg0, u32 arg1){ nextActPtr = spawn_child_actor(0x6A, &this); nextActPtr->state = 2; nextActPtr->unkF4_8 = 0x8C; - nextActPtr->unk60 = 3.0f; + nextActPtr->lifetime_value = 3.0f; nextActPtr->unk38_31 = arg1; if(arg0); } @@ -134,7 +134,7 @@ void func_80387FD4(Actor *this){ this->marker->propPtr->unk8_3 = TRUE; }//L80388144 func_803289EC(this, 0.0f, 1); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; return; }//L80388160 @@ -170,11 +170,11 @@ void func_80387FD4(Actor *this){ switch(this->state){ case 1:// L80388370 - this->unk60 += time_getDelta(); - if(0.7 <= this->unk60){ + this->lifetime_value += time_getDelta(); + if(0.7 <= this->lifetime_value){ subaddie_set_state_with_direction(this, 2, 0.0f, 1); func_80387C90(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; func_80324D54(0.1f, SFX_D0_GRIMLET_SQUEAK, 1.0f, 0x7530, this->position, 0.0f, 1800.0f); } break; @@ -186,11 +186,11 @@ void func_80387FD4(Actor *this){ break; case 3:// L80388434 - this->unk60 += time_getDelta(); - if( this->unk60 >= 0.13 + 0.7/4 * (5 - this->unkF4_8)){ + this->lifetime_value += time_getDelta(); + if( this->lifetime_value >= 0.13 + 0.7/4 * (5 - this->unkF4_8)){ subaddie_set_state_with_direction(this, 4, 0.62f, 1); func_80387C90(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; func_80324D54(0.3f, 0x406, 1.0f, 0x55f0, this->position, 0.0f, 1800.0f); } break; diff --git a/src/BGS/ch/flibbit.c b/src/BGS/ch/flibbit.c index 5b900306..efb27844 100644 --- a/src/BGS/ch/flibbit.c +++ b/src/BGS/ch/flibbit.c @@ -16,7 +16,7 @@ typedef struct{ }ActorLocal_Flibbit; -extern f32 func_80309724(f32 *); +extern f32 mapModel_getFloorY(f32 *); extern void func_80256E24(f32 [3], f32, f32, f32, f32, f32); void chflibbit_update(Actor *this); @@ -46,7 +46,7 @@ bool BGS_func_803863F0(Actor *this, f32 arg1[3], s32 arg2){ local->unk8[1] = arg1[1]; local->unk8[2] = arg1[2]; - local->unk8[1] = func_80309724(arg1); + local->unk8[1] = mapModel_getFloorY(arg1); skeletalAnim_set(this->unk148, 0xdb, 0.2f,(arg2) ? randf2(0.7f, 0.8f) : randf2(0.75f, 0.85f)); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); func_80324D54(0.2f, 0x3f2, randf2(0.7f, 1.3f), randi2(0x61A8, 0x6978), this->position, 500.0f, 2500.0f); @@ -211,7 +211,7 @@ void func_80386AEC(Actor *this, s32 next_state) { skeletalAnim_set(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); skeletalAnim_setProgress(this->unk148, randf2(0.0f, 0.9f)); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_1_LOOP); - this->position[1] = func_80309724(this->position); + this->position[1] = mapModel_getFloorY(this->position); local->unk18 = 1.0f; } @@ -219,7 +219,7 @@ void func_80386AEC(Actor *this, s32 next_state) { FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500); skeletalAnim_set(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); - this->position[1] = func_80309724(this->position); + this->position[1] = mapModel_getFloorY(this->position); local->unk18 = 1.0f; } @@ -333,7 +333,7 @@ void chflibbit_update(Actor *this){ local->unkE[1] = (s16) this->position_y; local->unkE[2] = (s16) this->position_z; - local->unkE[1] = func_80309724(this->position); + local->unkE[1] = mapModel_getFloorY(this->position); func_80386AEC(this, 1); } player_getPosition(player_position); @@ -439,8 +439,8 @@ void chflibbit_update(Actor *this){ this->position_y += local->unk14*spA4; local->unk14 -= 3000.0f*spA4; - if(this->position_y < func_80309724(this->position)){ - this->position_y = func_80309724(this->position); + if(this->position_y < mapModel_getFloorY(this->position)){ + this->position_y = mapModel_getFloorY(this->position); func_80386AEC(this, 7); } } diff --git a/src/BGS/ch/leafboat.c b/src/BGS/ch/leafboat.c index bb46af45..6d2dfbc9 100644 --- a/src/BGS/ch/leafboat.c +++ b/src/BGS/ch/leafboat.c @@ -74,7 +74,7 @@ void func_8038FD9C(Actor *this){ local->unk60[0] = this->pitch; local->unk60[1] = this->yaw; local->unk60[2] = this->roll; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->velocity_x = 0.0f; this->unk10_12 = 0; } @@ -151,7 +151,7 @@ void func_8038FD9C(Actor *this){ local->unk60[0] = this->pitch; local->unk60[1] = this->yaw; local->unk60[2] = this->roll; - this->unk60 += time_getDelta(); + this->lifetime_value += time_getDelta(); _player_getPosition(player_position); if( func_80294660() == 0x100 && func_8028F20C() @@ -186,9 +186,9 @@ void func_8038FD9C(Actor *this){ } this->marker->unk3E_1 = 0; - local->unk18[1] = 10 * sinf((((this->unk60 * local->unk6C) / 180.0) * BAD_PI)); - this->unk1C[0] = 4.5 * cosf((((this->unk60 * local->unk6C) / 180.0) * BAD_PI)); - this->unk1C[1] = 2*sinf((((this->unk60 * local->unk6C) / 180.0) * BAD_PI)); + local->unk18[1] = 10 * sinf((((this->lifetime_value * local->unk6C) / 180.0) * BAD_PI)); + this->unk1C[0] = 4.5 * cosf((((this->lifetime_value * local->unk6C) / 180.0) * BAD_PI)); + this->unk1C[1] = 2*sinf((((this->lifetime_value * local->unk6C) / 180.0) * BAD_PI)); sp64[0] = local->unk3C[0] + local->unk24[0]; sp64[1] = local->unk3C[1] + local->unk24[1]; sp64[2] = local->unk3C[2] + local->unk24[2]; diff --git a/src/BGS/ch/mrvile.c b/src/BGS/ch/mrvile.c index bb1d3839..cd9f4b7c 100644 --- a/src/BGS/ch/mrvile.c +++ b/src/BGS/ch/mrvile.c @@ -179,7 +179,7 @@ void func_8038BDD4(Actor *this) { : local->unk24; skeletalAnim_setDuration(this->unk148, (200.0f / local->unk24) * 0.5); local->unk28[1] = sp50 * 200.0f; - temp_f0_3 = func_80309724(this->position); + temp_f0_3 = mapModel_getFloorY(this->position); if (temp_f0_3 > 125.0f) { this->position[1] = 125.0f; } else if (temp_f0_3 > 80.0f) { diff --git a/src/BGS/ch/mudhut.c b/src/BGS/ch/mudhut.c index 8b960673..95ff9cd8 100644 --- a/src/BGS/ch/mudhut.c +++ b/src/BGS/ch/mudhut.c @@ -61,8 +61,8 @@ void func_8038EB4C(ActorMarker *this){ Actor *thisActor; thisActor = marker_getActor(this); - thisActor = func_8032813C(ACTOR_D_WOOD_DEMOLISHED, thisActor->position, NULL); - thisActor = func_8032813C(ACTOR_4D_STEAM_2, thisActor->position, NULL); + thisActor = spawn_actor_f32(ACTOR_D_WOOD_DEMOLISHED, thisActor->position, NULL); + thisActor = spawn_actor_f32(ACTOR_4D_STEAM_2, thisActor->position, NULL); if(this); } @@ -75,7 +75,7 @@ void chmudhut_update(Actor *this){ if(func_80334904() == 2){ if(!this->initialized){ this->marker->collidable = 0; - this->initialized = 1; + this->initialized = TRUE; } switch(this->state){ diff --git a/src/BGS/ch/pinkegg.c b/src/BGS/ch/pinkegg.c index 8f1193d9..3a47cec1 100644 --- a/src/BGS/ch/pinkegg.c +++ b/src/BGS/ch/pinkegg.c @@ -101,7 +101,7 @@ void chpinkegg_update(Actor *this){ if(!this->initialized){ this->marker->propPtr->unk8_3 = 1; marker_setCollisionScripts(this->marker, NULL, NULL, chpinkegg_collision); - this->initialized = 1; + this->initialized = TRUE; } switch(this->state){ diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index 005ea00c..9f83f12b 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -46,7 +46,7 @@ void func_8038F470(ActorMarker *this, s32 arg1, enum chtanktup_leg_e leg_id){ sp18[2] = thisActor->position_z; sp18[1] += 50.0f; - leg = func_8032813C(leg_id + ACTOR_E9_TANKTUP_LEG_FL, sp18, (s32)thisActor->yaw); + leg = spawn_actor_f32(leg_id + ACTOR_E9_TANKTUP_LEG_FL, sp18, (s32)thisActor->yaw); subaddie_set_state_with_direction(leg, arg1 + 1, 0, -1); leg->unk10_12 = leg_id; } @@ -111,8 +111,8 @@ void func_8038F6A4(Actor *this) { nodeprop_getPosition(temp_v0, local->unk18); } - this->unk138_24 = 0; - this->initialized = 1; + this->is_first_encounter = FALSE; + this->initialized = TRUE; } if (!this->unk16C_4) { @@ -138,12 +138,12 @@ void func_8038F6A4(Actor *this) case 1: func_8038F610(this); player_getPosition(sp48); - if (!this->unk138_24) + if (!this->is_first_encounter) { if ((((ml_distance_vec3f(local->unk18, sp48) < 250.0f) && (ml_distance_vec3f(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO)) { func_80311480(0xC7E, 0, 0, 0, 0, 0); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } } if (local->unk10) diff --git a/src/BGS/ch/yellowflibbit.c b/src/BGS/ch/yellowflibbit.c index c4955360..092bae47 100644 --- a/src/BGS/ch/yellowflibbit.c +++ b/src/BGS/ch/yellowflibbit.c @@ -40,8 +40,8 @@ void func_8038D1E0(Actor *this) { particleEmitter_setStartingFrameRange(temp_s0, 0, 7); particleEmitter_setPosition(temp_s0, this->position); particleEmitter_setRGB(temp_s0, D_80390B04); - func_802EFB70(temp_s0, 1.0f, 1.5f); - func_802EFB84(temp_s0, 2.5f, 3.0f); + particleEmitter_setStartingScaleRange(temp_s0, 1.0f, 1.5f); + particleEmitter_setFinalScaleRange(temp_s0, 2.5f, 3.0f); particleEmitter_setParticleVelocityRange(temp_s0, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f); particleEmitter_setParticleLifeTimeRange(temp_s0, 3.0f, 4.0f); particleEmitter_emitN(temp_s0, 4); @@ -60,7 +60,7 @@ s32 func_8038D2F4(Actor *this, f32 *arg1, bool arg2) { local->unkA[0] = (s16) arg1[0]; local->unkA[1] = (s16) arg1[1]; local->unkA[2] = (s16) arg1[2]; - local->unkA[1] = (s16) (s32) func_80309724(arg1); + local->unkA[1] = (s16) (s32) mapModel_getFloorY(arg1); skeletalAnim_set(this->unk148, ASSET_DB_ANIM_FLIBBIT_HOP, 0.2f, (arg2) ? randf2(0.7f, 0.8f) : randf2(0.7f, 0.8f)); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); func_80324D54(0.2f, SFX_3F2_UNKNOWN, randf2(0.7f, 1.3f), randi2(25000, 27000), this->position, 500.0f, 2500.0f); @@ -235,14 +235,14 @@ void func_8038D9D0(Actor *this, s32 next_state) { skeletalAnim_set(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); skeletalAnim_setProgress(this->unk148, randf2(0.0f, 0.9)); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_1_LOOP); - this->position[1] = func_80309724(this->position); + this->position[1] = mapModel_getFloorY(this->position); local->unk1C = 1.0f; } if (next_state == 8) { FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500); skeletalAnim_set(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); - this->position[1] = func_80309724(this->position); + this->position[1] = mapModel_getFloorY(this->position); local->unk1C = 1.0f; } if (next_state == 9) { @@ -482,8 +482,8 @@ void BGS_func_8038E034(Actor *this) { this->position_y += local->unk18*sp9C; local->unk18 -= 3000.0f*sp9C; - if(this->position_y < func_80309724(this->position)){ - this->position_y = func_80309724(this->position); + if(this->position_y < mapModel_getFloorY(this->position)){ + this->position_y = mapModel_getFloorY(this->position); func_8038D9D0(this, 10); } } diff --git a/src/BGS/code_9750.c b/src/BGS/code_9750.c index 5c38e2d3..56f54e3e 100644 --- a/src/BGS/code_9750.c +++ b/src/BGS/code_9750.c @@ -79,7 +79,7 @@ void BGS_func_8038FB84(ActorMarker *this, ActorMarker *other_marker){ void func_8038FBF8(Actor *this){ if(!this->initialized){ - this->initialized = 1; + this->initialized = TRUE; this->marker->propPtr->unk8_3 = 1; marker_setCollisionScripts(this->marker, NULL, NULL, BGS_func_8038FB84); } diff --git a/src/CCW/ch/grublinhood.c b/src/CCW/ch/grublinhood.c index be909653..fd65f86f 100644 --- a/src/CCW/ch/grublinhood.c +++ b/src/CCW/ch/grublinhood.c @@ -89,7 +89,7 @@ void __chgrublinhood_die(ActorMarker* marker, s32 arg1) { __chgrublinhood_emitHat(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z)); actor_collisionOff(actor); - actor->unk138_24 = 1; + actor->is_first_encounter = TRUE; } Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ @@ -109,7 +109,7 @@ Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ func_8033A45C(11, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2); func_8033A45C(12, (local->season == WINTER) ? 2 : 1); func_8033A45C(13, (local->season == WINTER) ? 1 : 0); - func_8033A45C(14, (this->unk138_24)? 0 : 1); + func_8033A45C(14, (this->is_first_encounter)? FALSE : TRUE); return actor_draw(marker, gfx, mtx, vtx); } diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c index 44ec5ab0..f3eeb5e8 100644 --- a/src/CCW/code_2270.c +++ b/src/CCW/code_2270.c @@ -137,7 +137,7 @@ void chGobiCCW_update(Actor *this) { this->unk16C_4 = TRUE; this->marker->propPtr->unk8_3 = TRUE; this->marker->actorFreeFunc = chGobiCCW_free; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; local->unk4 = skeletalAnim_new(); local->spit_model = assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT); marker_setCollisionScripts(this->marker, 0, func_8038894C, 0); @@ -159,13 +159,13 @@ void chGobiCCW_update(Actor *this) { return; } if(this->state == 1){ - if (!this->unk138_24) { + if (!this->is_first_encounter) { player_getPosition(sp48); if (ml_distance_vec3f(this->position, sp48) < 600.0f) { if (local->unk0->unk2 != 0) { func_80311480((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL); } - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index 1a3e9c0d..07c99ce5 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -214,7 +214,7 @@ void CCW_func_80389BFC(Actor *this) { if (!this->unk16C_4) { this->unk16C_4 = TRUE; this->marker->propPtr->unk8_3 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; this->position[0] = -4900.0f; this->position[1] = 4619.0f; this->position[2] = 0.0f; @@ -253,12 +253,12 @@ void CCW_func_80389BFC(Actor *this) { } if (this->state == 1) { player_getPosition(sp4C); - if( !this->unk138_24 + if( !this->is_first_encounter && (local->unkC[2] >= 6500) && (sp4C[2] < 6500.0f) && (local->unk0->unk28 != 0) ){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; func_80324E38(0.0f, 3); timed_setStaticCameraToNode(0.0f, local->unk0->unk24); func_80324DBC(0.0f, local->unk0->unk28, 6, NULL, this->marker, func_80389700, NULL); diff --git a/src/CCW/code_3DA0.c b/src/CCW/code_3DA0.c index 239f6643..f30271a4 100644 --- a/src/CCW/code_3DA0.c +++ b/src/CCW/code_3DA0.c @@ -28,7 +28,7 @@ f32 func_8038A190(Actor *this, f32 *arg1) { f32 temp_f0; f32 temp_f2; - temp_f0 = func_80309724(arg1); + temp_f0 = mapModel_getFloorY(arg1); temp_f2 = this->position[1]; if (((temp_f2 + 50.0f) < temp_f0) || (temp_f0 < (temp_f2 - 50.0f))) { return temp_f2; diff --git a/src/CCW/code_4D00.c b/src/CCW/code_4D00.c index df4a2bcf..c987048c 100644 --- a/src/CCW/code_4D00.c +++ b/src/CCW/code_4D00.c @@ -61,7 +61,7 @@ void func_8038B19C(Actor *this) { if (!this->unk16C_4) { this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; func_8038B0F0(this, 1); } @@ -88,8 +88,8 @@ void func_8038B19C(Actor *this) { func_8038B0F0(this, 1); } } - if (!this->unk138_24 && func_803292E0(this)) { - this->unk138_24 = TRUE; + if (!this->is_first_encounter && func_803292E0(this)) { + this->is_first_encounter = TRUE; func_80311480(0xCC8, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); diff --git a/src/CCW/code_50D0.c b/src/CCW/code_50D0.c index 393ae58e..04482610 100644 --- a/src/CCW/code_50D0.c +++ b/src/CCW/code_50D0.c @@ -87,11 +87,11 @@ void func_8038B814(Actor *this, s32 next_state) { void func_8038B87C(Actor *this) { if (!this->unk16C_4) { this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; func_8038B814(this, 1); } - if (!this->unk138_24 && func_803292E0(this)) { - this->unk138_24 = TRUE; + if (!this->is_first_encounter && func_803292E0(this)) { + this->is_first_encounter = TRUE; func_80311480(0xCC9, 0, NULL, NULL, NULL, NULL); } func_8028E668(this->position, 300.0f, -50.0f, 120.0f); diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 2f6611cc..ab4a9f6e 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -121,7 +121,7 @@ void chnabnut_update(Actor *this) { D_8038F350[1] = this->position[1]; D_8038F350[2] = this->position[2]; if (this->state == 0) { - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; local->returned_acorn_count = NULL; } chnabnut_setState(this, 1); @@ -133,15 +133,15 @@ void chnabnut_update(Actor *this) { if (this->state == NABNUT_STATE_1_SAD) { player_getPosition(sp30); - if (!this->unk138_24 && (ml_distance_vec3f(this->position, sp30) < 400.0f)) { - this->unk138_24 = TRUE; + if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp30) < 400.0f)) { + this->is_first_encounter = TRUE; func_80311480(0xCCA, 0xE, this->position, NULL, NULL, NULL); } if (item_getCount(ITEM_23_ACORNS) > 0) { func_80258A4C(this->position, this->yaw - 90.0f, sp30, &sp2C, &sp28, &sp24); this->yaw += sp24 * 10.0f; } - if (this->unk138_24 && !func_803114B0()) { + if (this->is_first_encounter && !func_803114B0()) { func_8028F364(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this); if ((carriedObj_getActorId() == ACTOR_2A9_ACORN) && (ml_distance_vec3f(this->position, sp30) < 300.0f) && func_8028FC34()) { func_8028FA54(D_8038F350); diff --git a/src/CCW/code_5BF0.c b/src/CCW/code_5BF0.c index 95c58509..dce0110e 100644 --- a/src/CCW/code_5BF0.c +++ b/src/CCW/code_5BF0.c @@ -93,7 +93,7 @@ void func_8038C41C(Actor *this) { if (!this->unk16C_4) { this->marker->propPtr->unk8_3 = TRUE; this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; return; } @@ -114,8 +114,8 @@ void func_8038C41C(Actor *this) { if ((this->marker->id == 0x1CB) && (this->state == 2)) { player_getPosition(sp2C); - if (!this->unk138_24 && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) { - this->unk138_24 = TRUE; + if (!this->is_first_encounter && (ml_distance_vec3f(this->position, sp2C) < 400.0f)) { + this->is_first_encounter = TRUE; func_80311480(0xCCD, 0, NULL, NULL, NULL, NULL); } } diff --git a/src/CCW/code_6620.c b/src/CCW/code_6620.c index 2dcffcc6..ebef7f78 100644 --- a/src/CCW/code_6620.c +++ b/src/CCW/code_6620.c @@ -45,8 +45,8 @@ void func_8038CA10(ActorMarker *marker) { if (this->marker->unk14_21) { if (0.65 < (f64) randf()) { pCtrl = func_802EDD8C(local->unk4, 0.0f, this->position[1] + 500.0f); - func_802EFB70(pCtrl, 0.04f, 0.05f); - func_802EFB84(pCtrl, 0.18f, 0.2f); + particleEmitter_setStartingScaleRange(pCtrl, 0.04f, 0.05f); + particleEmitter_setFinalScaleRange(pCtrl, 0.18f, 0.2f); particleEmitter_setParticleSpawnPositionRange(pCtrl, -10.0f, 0.0f, -10.0f, 10.0f, 20.0f, 10.0f); particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 31.0f, 0.0f, 0.0f, 37.0f, 0.0f); particleEmitter_emitN(pCtrl, 1); @@ -91,7 +91,7 @@ void func_8038CC4C(Actor *this) { if (!this->unk16C_4) { this->marker->propPtr->unk8_3 = TRUE; this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; local->unk0 = &D_8038F490[0]; while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){ local->unk0++; @@ -113,12 +113,12 @@ void func_8038CC4C(Actor *this) { this->yaw += 30.0f * sp44; } } - if (!this->unk138_24) { + if (!this->is_first_encounter) { player_getPosition(sp38); if (ml_distance_vec3f(this->position, sp38) < 900.0f) { if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) { func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/CCW/code_6AC0.c b/src/CCW/code_6AC0.c index 4a10d4d4..4c932c23 100644 --- a/src/CCW/code_6AC0.c +++ b/src/CCW/code_6AC0.c @@ -82,7 +82,7 @@ void func_8038CFB4(Actor *this) { if (!this->unk16C_4) { this->marker->propPtr->unk8_3 = TRUE; this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; func_8038CEB0(this, 1); if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) { levelSpecificFlags_set(0x25, 1); @@ -114,11 +114,11 @@ void func_8038CFB4(Actor *this) { } if (this->state == 1) { - if (!this->unk138_24) { + if (!this->is_first_encounter) { player_getPosition(sp60); if (ml_distance_vec3f(this->position, sp60) < 900.0f) { func_80311480(0xCCF, 4, NULL, NULL, NULL, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } if (levelSpecificFlags_get(0x25) != 0) { diff --git a/src/CCW/code_6EC0.c b/src/CCW/code_6EC0.c index 20de4630..4dde1a2e 100644 --- a/src/CCW/code_6EC0.c +++ b/src/CCW/code_6EC0.c @@ -53,7 +53,7 @@ void func_8038D368(Actor *this) { if (!this->unk16C_4) { this->marker->propPtr->unk8_3 = TRUE; this->unk16C_4 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; local->unk0 = D_8038F600; while (local->unk0->map != 0 && map_get() != local->unk0->map) { local->unk0++; @@ -66,7 +66,7 @@ void func_8038D368(Actor *this) { return; } - if(!this->unk138_24){ + if(!this->is_first_encounter){ player_getPosition(plyr_pos); if (ml_distance_vec3f(this->position, plyr_pos) < 600.0f) { if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { @@ -76,7 +76,7 @@ void func_8038D368(Actor *this) { func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); } } - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } diff --git a/src/CCW/code_7120.c b/src/CCW/code_7120.c index 51e994ac..a34c90e0 100644 --- a/src/CCW/code_7120.c +++ b/src/CCW/code_7120.c @@ -30,8 +30,8 @@ void CCW_func_8038D510(Actor *this) { particleEmitter_setFade(pCtrl, 0.01f, 0.5f); particleEmitter_setStartingFrameRange(pCtrl, 0, 7); particleEmitter_setPosition(pCtrl, this->position); - func_802EFB70(pCtrl, 1.0f, 2.0f); - func_802EFB84(pCtrl, 3.0f, 4.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 2.0f); + particleEmitter_setFinalScaleRange(pCtrl, 3.0f, 4.0f); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038F670); particleEmitter_setRGB(pCtrl, D_8038F664); particleEmitter_setParticleLifeTimeRange(pCtrl, 3.0f, 4.0f); @@ -52,7 +52,7 @@ void func_8038D5DC(Actor *this) { func_802EFA18(pCtrl, 3); particleEmitter_setModel(pCtrl, 0x896); particleEmitter_setPosition(pCtrl, this->position); - func_802EFB70(pCtrl, 0.05f, 0.3f); + particleEmitter_setStartingScaleRange(pCtrl, 0.05f, 0.3f); particleEmitter_setAngularVelocityRange(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f diff --git a/src/FP/ch/boggy1.c b/src/FP/ch/boggy1.c index 4ce57932..024683ec 100644 --- a/src/FP/ch/boggy1.c +++ b/src/FP/ch/boggy1.c @@ -137,7 +137,7 @@ void func_8038794C(Actor *this){ switch(this->state){ case 1://L80387AB0 if(mapSpecificFlags_get(0xb)) - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; if(mapSpecificFlags_get(0x1)){ func_8028F94C(1, this->position); @@ -147,13 +147,13 @@ void func_8038794C(Actor *this){ break; }//L80387B38 - if(!this->unk138_24 && func_80329530(this, 0x1f4)){ + if(!this->is_first_encounter && func_80329530(this, 0x1f4)){ if(!func_8028ECAC() || func_8028ECAC() == BSGROUP_8_TROT){ if(func_80311480(0xbff, 0x2a, this->position, NULL, NULL, NULL)){ for(i = 0; i <5; i++ ){ timedFunc_set_1(D_80391BEC[i], (GenFunction_1)func_8038787C, (s32)this->marker); } - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/FP/ch/boggy2.c b/src/FP/ch/boggy2.c index c67f740d..4c0a4a4a 100644 --- a/src/FP/ch/boggy2.c +++ b/src/FP/ch/boggy2.c @@ -390,7 +390,7 @@ void func_803895E0(void){ f20 = (f32)func_80304DA8(s0); f8 = (f32)func_80304DB8(s0); f22 = f8*0.01; - actor = func_8032813C(D_80391DB8[i].actor_id, sp64, (s32)f20); + actor = spawn_actor_f32(D_80391DB8[i].actor_id, sp64, (s32)f20); actor->scale = f22; } } diff --git a/src/FP/ch/boggy3.c b/src/FP/ch/boggy3.c index 3f2e516c..ee7b69d6 100644 --- a/src/FP/ch/boggy3.c +++ b/src/FP/ch/boggy3.c @@ -69,7 +69,7 @@ void func_80390388(Actor *this){ || jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS) || func_80390334() ){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } if( func_80329530(this, 0xFA) @@ -77,14 +77,14 @@ void func_80390388(Actor *this){ ){ if(0.0f == this->unk1C[0] && func_80390334()){ if(func_80311480(0xc1f, 0xb, this->position, NULL, NULL, NULL)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; this->unk1C[0] = 1.0f; } } else{ - if( !this->unk138_24 ){ + if( !this->is_first_encounter ){ if(func_80311480(0xc1e, 0x2b, this->position, NULL, NULL, NULL)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/FP/ch/scarfsled.c b/src/FP/ch/scarfsled.c index 1a4f7d01..6cd8cfaf 100644 --- a/src/FP/ch/scarfsled.c +++ b/src/FP/ch/scarfsled.c @@ -141,7 +141,7 @@ void chScarfSled_update(Actor *this){ } this->velocity_x = this->position_x; - this->velocity_y = func_80309724(this->position); + this->velocity_y = mapModel_getFloorY(this->position); this->velocity_z = this->position_z; if(this->state == 2){ __chScarfSled_func_80386630(this); diff --git a/src/FP/ch/twinkly.c b/src/FP/ch/twinkly.c index 64ce2a07..2aa36b4c 100644 --- a/src/FP/ch/twinkly.c +++ b/src/FP/ch/twinkly.c @@ -71,7 +71,7 @@ Actor *func_8038C0B0(ActorMarker *marker, UNK_TYPE(s32) arg1, f32 arg2, UNK_TYPE sp4C[2] = (f32)marker->propPtr->z; sp40[0] = (f32)marker->pitch; - sp40[1] = this->unk60; + sp40[1] = this->lifetime_value; sp40[2] = (f32)marker->roll; sp3C = this->scale; if(animMtxList_len(marker->unk20)){ @@ -100,7 +100,7 @@ void func_8038C260(f32 position[3], s32 count, enum asset_e model_id){ 400.0f, 400.0f, 400.0f, 800.0f, 800.0f, 800.0f ); - func_802EFB70(pCtrl, 0.1f, 0.2f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.2f); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f); particleEmitter_setParticleLifeTimeRange(pCtrl, 1.5f, 1.5f); particleEmitter_setFade(pCtrl, 0.0f, 0.3f); @@ -167,7 +167,7 @@ void func_8038C428(Actor *arg0, f32 arg1[3], f32 arg2) sp5C[0] = arg0->position[0] + var_f22; sp5C[1] = arg0->position[1]; sp5C[2] = arg0->position[2] + var_f24; - temp_f14 = func_80309724(sp5C); + temp_f14 = mapModel_getFloorY(sp5C); if (sp7F) { do { sp78 += 1; @@ -206,7 +206,7 @@ bool func_8038C718(Actor *this, f32 arg1){ animctrl_setAnimTimer(this->animctrl, tmp); if(arg1 == 0.0f) - arg1 = func_80309724(this->position); + arg1 = mapModel_getFloorY(this->position); if(this->position_y <= arg1){ this->position_y = arg1; @@ -233,7 +233,7 @@ void func_8038C8F0(ActorMarker *marker){ this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); other = marker_getActor(this->unk100); - muncher = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392070, 170); + muncher = spawn_actor_f32(ACTOR_337_TWINKLY_MUNCHER, D_80392070, 170); muncher->unk100 = other->marker; muncher->unkF4_8 = 1; @@ -289,7 +289,7 @@ void func_8038C9A0(Actor *this){ if(!func_8038C718(this, 0)){ subaddie_set_state_with_direction(this, 2, 0.001f, 1); func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); - this->unk60 = this->yaw; + this->lifetime_value = this->yaw; } break; diff --git a/src/FP/ch/twinklybox.c b/src/FP/ch/twinklybox.c index d8de5ab2..7a30ac04 100644 --- a/src/FP/ch/twinklybox.c +++ b/src/FP/ch/twinklybox.c @@ -3,7 +3,7 @@ #include "variables.h" extern void func_80324CD8(f32); -extern Actor *func_8032813C(enum actor_e, f32[3], s32); +extern Actor *spawn_actor_f32(enum actor_e, f32[3], s32); Actor *FP_func_8038CED0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); void func_8038D6C8(Actor *this); @@ -209,9 +209,9 @@ void func_8038D41C(ActorMarker *marker){ ActorMarker *_marker = reinterpret_cast(ActorMarker *, marker); Actor *actor; - actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392354, 170); + actor = spawn_actor_f32(ACTOR_337_TWINKLY_MUNCHER, D_80392354, 170); actor->unk100 = _marker; - actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392360, 170); + actor = spawn_actor_f32(ACTOR_337_TWINKLY_MUNCHER, D_80392360, 170); actor->unk100 = _marker; if(pad[0]); } @@ -369,7 +369,7 @@ void func_8038D6C8(Actor *this){ this->unk38_31 = 0xA; item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); __spawnQueue_add_1((GenFunction_1)func_8038D41C, (s32)this->marker); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; func_80347A14(0); func_802FAD64(ITEM_14_HEALTH); break; @@ -407,12 +407,12 @@ void func_8038D6C8(Actor *this){ if(0.96 < animctrl_getAnimTimer(this->animctrl)){ - if(this->unk60 <= 0.0){ + if(this->lifetime_value <= 0.0){ __spawnQueue_add_1((GenFunction_1)func_8038D474, (s32)this->marker); - this->unk60 = 2.9f; + this->lifetime_value = 2.9f; } else{ - this->unk60 -= sp24; + this->lifetime_value -= sp24; } item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); } diff --git a/src/FP/ch/twinklymuncher.c b/src/FP/ch/twinklymuncher.c index a5bc0925..4a4a56e5 100644 --- a/src/FP/ch/twinklymuncher.c +++ b/src/FP/ch/twinklymuncher.c @@ -107,7 +107,7 @@ void func_8038E094(Actor *this){ marker_setCollisionScripts(this->marker, NULL, func_8038DEB8, NULL); this->marker->propPtr->unk8_3 = TRUE; animctrl_setAnimTimer(this->animctrl, 0.99999f); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; if(this->unkF4_8 == 1){ func_8038DDC8(this); } @@ -148,18 +148,18 @@ void func_8038E094(Actor *this){ case 1: //L8038E2DC this->marker->propPtr->unk8_3 = FALSE; animctrl_setAnimTimer(this->animctrl, 0.99f); - if(this->unk60 < 5.0){ - this->unk60 += sp34; + if(this->lifetime_value < 5.0){ + this->lifetime_value += sp34; } else{ - if(10.0 <= this->unk60 || randf() < this->unk60/10.0){ + if(10.0 <= this->lifetime_value || randf() < this->lifetime_value/10.0){ if(!func_8038DF34(this)){ - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; func_8038DDC8(this); break; } } - this->unk60 += sp34; + this->lifetime_value += sp34; } break; @@ -216,7 +216,7 @@ void func_8038E094(Actor *this){ if(actor_animationIsAt(this, 0.97f)){ subaddie_set_state_with_direction(this, 1, 0.97f, 0); actor_playAnimationOnce(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; } break; diff --git a/src/FP/ch/wozza.c b/src/FP/ch/wozza.c index 95c5a094..f10fb5d0 100644 --- a/src/FP/ch/wozza.c +++ b/src/FP/ch/wozza.c @@ -299,10 +299,10 @@ void FP_func_8038F7AC(Actor *this){ break; } - if(func_80329530(this, 500) && !this->unk138_24){ + if(func_80329530(this, 500) && !this->is_first_encounter){ if(func_80311480(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ timed_setStaticCameraToNode(0.0f, 0x2E); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } break; }//L8038FD40 diff --git a/src/FP/ch/xmastree.c b/src/FP/ch/xmastree.c index 6220f350..9e35c04b 100644 --- a/src/FP/ch/xmastree.c +++ b/src/FP/ch/xmastree.c @@ -124,18 +124,18 @@ void chXmasTree_update(Actor *this){ if(!mapSpecificFlags_get(2)) break; subaddie_set_state(this, 3); - this->unk60 = 2.0f; + this->lifetime_value = 2.0f; func_8025A6EC(COMUSIC_61_XMAS_TREE_LIGHTS_UP, 28000); func_802BAFE4(0x1A); func_80311480(0xC14, 0, NULL, NULL, NULL, NULL); break; case 3: // L803872F0 - if(0.0 <= this->unk60){ - if( 1.8 < this->unk60){ + if(0.0 <= this->lifetime_value){ + if( 1.8 < this->lifetime_value){ __chXmasTree_80386EF4(this, 0); } - else if(this->unk60 < 0.2){//L80387340 + else if(this->lifetime_value < 0.2){//L80387340 __chXmasTree_80386EF4(this, 1); } else{ @@ -144,7 +144,7 @@ void chXmasTree_update(Actor *this){ __chXmasTree_8038709C(this); } }//L803873AC - this->unk60 -= sp2C; + this->lifetime_value -= sp2C; } else{//L803873BC if(func_802BB270()){ @@ -174,12 +174,12 @@ void chXmasTree_update(Actor *this){ if(item_empty(ITEM_6_HOURGLASS)){ subaddie_set_state(this, 5); mapSpecificFlags_set(2, FALSE); - this->unk60 = 0.1f; + this->lifetime_value = 0.1f; if(!func_8038BFA0()){ if(!mapSpecificFlags_get(9) || mapSpecificFlags_get(1)){ func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); func_802BAFE4(0x1a); - this->unk60 = 2.0f; + this->lifetime_value = 2.0f; } } } @@ -187,11 +187,11 @@ void chXmasTree_update(Actor *this){ break; case 5: // L803874EC - if(0.0 <= this->unk60){ - if( 1.8 < this->unk60){ + if(0.0 <= this->lifetime_value){ + if( 1.8 < this->lifetime_value){ __chXmasTree_80386EF4(this, 1); } - else if(this->unk60 < 0.2){ + else if(this->lifetime_value < 0.2){ __chXmasTree_80386EF4(this, 0); } else{ @@ -200,7 +200,7 @@ void chXmasTree_update(Actor *this){ __chXmasTree_8038709C(this); } } - this->unk60 -= sp2C; + this->lifetime_value -= sp2C; } else{ __chXmasTree_80386F84(this); diff --git a/src/FP/ch/xmastreestar.c b/src/FP/ch/xmastreestar.c index 082abdde..790d6b89 100644 --- a/src/FP/ch/xmastreestar.c +++ b/src/FP/ch/xmastreestar.c @@ -38,9 +38,9 @@ void func_8038EC34(ActorMarker *this_marker, ActorMarker *other_marker){ } void func_8038EC5C(Actor *this){ - if(0.0f == this->unk60){ + if(0.0f == this->lifetime_value){ this->unk38_31++; - this->unk60 = 0.33f; + this->lifetime_value = 0.33f; if(this->unk38_31 < 4){ func_8025A6EC(COMUSIC_2B_DING_B, 28000); } @@ -91,11 +91,11 @@ void func_8038ECD8(Actor *this){ local->unk1A = TRUE; }//L8038EE98 - if(0.0f != this->unk60){ - if(time_getDelta() < this->unk60){ - this->unk60 -= time_getDelta(); + if(0.0f != this->lifetime_value){ + if(time_getDelta() < this->lifetime_value){ + this->lifetime_value -= time_getDelta(); }else{ - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; } }//L8038EEF0 switch(this->state){ diff --git a/src/FP/ch/xmastreeswitch.c b/src/FP/ch/xmastreeswitch.c index f3ae72b5..d8b0a866 100644 --- a/src/FP/ch/xmastreeswitch.c +++ b/src/FP/ch/xmastreeswitch.c @@ -81,7 +81,7 @@ void func_8038E940(Actor *this){ marker_setCollisionScripts(this->marker, NULL, func_8038E7CC, NULL); subaddie_set_state_with_direction(this, 1, 0.05f, 1); this->unk38_31 = 0; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; }//L8038EA3C this->unk58_0 = (this->state == 1) ? FALSE : TRUE; @@ -102,16 +102,16 @@ void func_8038E940(Actor *this){ actor_playAnimationOnce(this); FUNC_8030E624(SFX_416, 0.8f, 32000); this->marker->collidable = FALSE; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; break; case 3: //L8038EB44 - if(this->unk60 == 0.0f && actor_animationIsAt(this, 0.95f)){ - this->unk60 = 1.0f; + if(this->lifetime_value == 0.0f && actor_animationIsAt(this, 0.95f)){ + this->lifetime_value = 1.0f; mapSpecificFlags_set(2, TRUE); break; } - if(this->unk60 != 0.0f && !mapSpecificFlags_get(2)){ + if(this->lifetime_value != 0.0f && !mapSpecificFlags_get(2)){ func_8038E774(this); } break; diff --git a/src/FP/racectrl.c b/src/FP/racectrl.c index 3234c89d..96a6ac7b 100644 --- a/src/FP/racectrl.c +++ b/src/FP/racectrl.c @@ -90,8 +90,8 @@ void func_8038AC90(s32 indx, s32 arg1){ Actor *a1; Actor *a2; - m1 = func_8032813C(0x161, D_80392F70[indx].position, 0)->marker; - m2 = func_8032813C(0x162, D_80393280[indx].position, 0)->marker; + m1 = spawn_actor_f32(0x161, D_80392F70[indx].position, 0)->marker; + m2 = spawn_actor_f32(0x162, D_80393280[indx].position, 0)->marker; a1 = marker_getActor(m1); a2 = marker_getActor(m2); @@ -143,23 +143,23 @@ void func_8038AEE0(s32 indx){ Actor *sp1C; switch(indx){ case 0:// L8038AF0C - sp1C = func_8032813C(0x22d, D_80391ED0, D_80391EDC); + sp1C = spawn_actor_f32(0x22d, D_80391ED0, D_80391EDC); break; case 1:// L8038AF38 - sp1C = func_8032813C(0x22e, D_80391EE0, D_80391EEC); + sp1C = spawn_actor_f32(0x22e, D_80391EE0, D_80391EEC); break; case 2:// L8038AF64 - sp1C = func_8032813C(0x22d, D_80391EF0, FP_D_80391EFC); + sp1C = spawn_actor_f32(0x22d, D_80391EF0, FP_D_80391EFC); break; case 3:// L8038AF90 - sp1C = func_8032813C(0x22d, D_80391F00, D_80391F0C); + sp1C = spawn_actor_f32(0x22d, D_80391F00, D_80391F0C); break; case 4:// L8038AFBC - sp1C = func_8032813C(0x22d, D_80391F10, D_80391F1C); + sp1C = spawn_actor_f32(0x22d, D_80391F10, D_80391F1C); break; } D_80393590[indx] = sp1C->marker; @@ -191,7 +191,7 @@ void FP_func_8038B0B8(void){ } void func_8038B0F8(void){ - Actor *trainers = func_8032813C(ACTOR_2C_TURBO_TALON_TRAINERS, D_80391F20, 100); + Actor *trainers = spawn_actor_f32(ACTOR_2C_TURBO_TALON_TRAINERS, D_80391F20, 100); trainers->unk10_1 = FALSE; } diff --git a/src/GV/ch/gobi1.c b/src/GV/ch/gobi1.c index 3ec32a72..4fb04de9 100644 --- a/src/GV/ch/gobi1.c +++ b/src/GV/ch/gobi1.c @@ -176,13 +176,13 @@ void chGobi1_update(Actor *this){ } if(this->state == 1 || this->state == 2){ - if( !this->unk138_24 + if( !this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 80) && func_8028F2A0() && func_80311480(0xa73, 0, NULL, NULL, NULL, NULL) ){ - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } }//L803877A4 diff --git a/src/GV/ch/gobi2.c b/src/GV/ch/gobi2.c index b818b789..dcd2639b 100644 --- a/src/GV/ch/gobi2.c +++ b/src/GV/ch/gobi2.c @@ -200,11 +200,11 @@ void chGobi2_update(Actor *this){ }//L80388114 if(this->state == 2){ - if(!this->unk138_24){ + if(!this->is_first_encounter){ if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){ if(func_8028F2A0()){ if(func_80311480(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL)) - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/GV/ch/histup.c b/src/GV/ch/histup.c index db1379d1..717cf8a4 100644 --- a/src/GV/ch/histup.c +++ b/src/GV/ch/histup.c @@ -119,15 +119,15 @@ void func_8038DBDC(Actor *this){ this->unk1C[0] = 0.0f; }//L8038DC90 if(func_8038E178() != (s32)this->unk1C[0] || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){ - if(15.0f <= this->unk60){ + if(15.0f <= this->lifetime_value){ subaddie_set_state_with_direction(this, 2, 0.01f, 1); animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); animctrl_setDuration(this->animctrl, 2.0f); this->unk1C[0] = (f32)func_8038E178(); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; } else{//L8038DD2C - this->unk60 += 1.0f; + this->lifetime_value += 1.0f; } } break; diff --git a/src/GV/ch/trunker.c b/src/GV/ch/trunker.c index 2d2be41d..6f3ca007 100644 --- a/src/GV/ch/trunker.c +++ b/src/GV/ch/trunker.c @@ -69,13 +69,13 @@ void chTrucker_update(Actor *this){ } }//L803891D8 if( this->state == 1 - && !this->unk138_24 + && !this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 80) && func_8028F2A0() ){ func_80311480(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; }//L80389254 if(this->state == 1 && mapSpecificFlags_get(0xC)){ diff --git a/src/GV/code_3630.c b/src/GV/code_3630.c index dd69a89a..9c2c4cc4 100644 --- a/src/GV/code_3630.c +++ b/src/GV/code_3630.c @@ -30,7 +30,7 @@ void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){ void func_80389A60(Actor *this){ func_80311480(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; subaddie_set_state(this, 5); } @@ -47,8 +47,8 @@ void func_80389ABC(Actor *this){ void func_80389B1C(Actor *this){ if(!this->unk16C_4){ - this->unk60 = (f32) func_8038E184(); - this->unk138_24 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0); + this->lifetime_value = (f32) func_8038E184(); + this->is_first_encounter = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0); this->unk138_23 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(2); this->unk16C_4 = TRUE; } @@ -62,16 +62,16 @@ void func_80389B1C(Actor *this){ animctrl_setTransitionDuration(this->animctrl, 0.15f); if(this->state == 1 || this->state == 2){ - if(! this->unk138_24 && func_80329530(this, 250) && !func_80329530(this, 0x50)){ + if(! this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 0x50)){ func_80311480(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; mapSpecificFlags_set(0, TRUE); } } switch(this->state){ case 1://L80389CC4 - if(this->unk60 <= (f32)func_8038E178()){ + if(this->lifetime_value <= (f32)func_8038E178()){ func_80389ABC(this); } else if(actor_animationIsAt(this, 0.99f)){ @@ -92,7 +92,7 @@ void func_80389B1C(Actor *this){ break; case 2: //L80389DB0 - if(this->unk60 <= (f32)func_8038E178()){ + if(this->lifetime_value <= (f32)func_8038E178()){ func_80389ABC(this); } else if(actor_animationIsAt(this, 0.99f)){ diff --git a/src/GV/code_3D90.c b/src/GV/code_3D90.c index 8028262d..bed28c02 100644 --- a/src/GV/code_3D90.c +++ b/src/GV/code_3D90.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern f32 func_80309724(f32[3]); +extern f32 mapModel_getFloorY(f32[3]); void func_80329904(ActorMarker *, s32, void *); void func_8038A314(Actor *this); @@ -143,7 +143,7 @@ void func_8038A31C(Actor *this){ this->pitch = 0.0f; if(this->unk100 && sp24 && this->unk100->id == MARKER_AF_MAGIC_CARPET_SHADOW){ sp24->position_x = this->position_x; - sp24->position_y = func_80309724(this->position) + 60.0f; + sp24->position_y = mapModel_getFloorY(this->position) + 60.0f; sp24->position_z = this->position_z; sp24->unk1C[0] = func_8038A264(sp24, this); sp24->yaw = this->yaw; diff --git a/src/GV/code_43B0.c b/src/GV/code_43B0.c index efcaa2bc..1d5b3624 100644 --- a/src/GV/code_43B0.c +++ b/src/GV/code_43B0.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern f32 func_80309724(f32[3]); +extern f32 mapModel_getFloorY(f32[3]); void func_80329904(ActorMarker *, s32, void *); @@ -57,7 +57,7 @@ void func_8038A8CC(ActorMarker *this_marker){ s32 pad; this->unk100 = shadow->marker; - shadow->position_y = func_80309724(this->position); + shadow->position_y = mapModel_getFloorY(this->position); shadow->unk1C[0] = func_8038A860(shadow, this); shadow->yaw = this->yaw; func_8032AA58(shadow, this->scale); diff --git a/src/GV/code_4740.c b/src/GV/code_4740.c index 6f90f7b1..b226265f 100644 --- a/src/GV/code_4740.c +++ b/src/GV/code_4740.c @@ -61,8 +61,8 @@ void func_8038ABD8(f32 position[3], s32 cnt){ -100.0f, 10.0f, -100.0f, 100.0f, 60.0f, 100.0f ); - func_802EFB70(pCtrl, 0.1f, 0.5f); - func_802EFB84(pCtrl, 1.2f, 2.6f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.5f); + particleEmitter_setFinalScaleRange(pCtrl, 1.2f, 2.6f); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.5f, 1.4f); particleEmitter_emitN(pCtrl, cnt); @@ -79,8 +79,8 @@ void func_8038ACEC(f32 pos[3], s32 cnt){ -200.0f, 20.0f, -200.0f, 300.0f, 120.0f, 200.0f ); - func_802EFB70(pCtrl, 1.0f, 2.6f); - func_802EFB84(pCtrl, 3.0f, 5.5f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 2.6f); + particleEmitter_setFinalScaleRange(pCtrl, 3.0f, 5.5f); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 1.2f, 3.2f); particleEmitter_emitN(pCtrl, cnt); @@ -94,7 +94,7 @@ void func_8038ADFC(f32 pos[3], s32 cnt){ particleEmitter_setAngularVelocityRange(pCtrl, -500.0f, -500.0f, -500.0f, 500.0f, 500.0f, 500.0f); func_802EF9F8(pCtrl, 0.6f); func_802EFA18(pCtrl, 2); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_setDrawMode(pCtrl, 2); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 4.0f, 6.0f); @@ -271,19 +271,19 @@ void func_8038B124(Actor *this){ if(0.98 < animctrl_getAnimTimer(this->animctrl)){ subaddie_set_state_with_direction(this, 6, 0.99f, 0); actor_playAnimationOnce(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->unk1C[0] = 1.0f; } break; case 6: //L8038B78C - if(75.0f <= this->unk60){ + if(75.0f <= this->lifetime_value){ subaddie_set_state_with_direction(this, 7, 0.00001f, 1); actor_playAnimationOnce(this); this->unk1C[0] = 1.0f; } else{ - this->unk60 += 1.0f; + this->lifetime_value += 1.0f; } break; diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c index 9b271158..94a5c69b 100644 --- a/src/GV/code_5570.c +++ b/src/GV/code_5570.c @@ -130,8 +130,8 @@ void func_8038BC7C(f32 position[3], s32 cnt){ -250.0f, 10.0f, -250.0f, 250.0f, 110.0f, 250.0f ); - func_802EFB70(pCtrl, 0.1f, 0.5f); - func_802EFB84(pCtrl, 2.0f, 2.6f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.5f); + particleEmitter_setFinalScaleRange(pCtrl, 2.0f, 2.6f); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.5f, 1.4f); particleEmitter_emitN(pCtrl, cnt); @@ -148,8 +148,8 @@ void func_8038BD8C(f32 position[3], s32 cnt){ -100.0f, 20.0f, -100.0f, 100.0f, 60.0f, 100.0f ); - func_802EFB70(pCtrl, 0.1f, 0.5f); - func_802EFB84(pCtrl, 1.2, 1.6f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.5f); + particleEmitter_setFinalScaleRange(pCtrl, 1.2, 1.6f); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.5f, 1.4f); particleEmitter_emitN(pCtrl, cnt); @@ -244,9 +244,9 @@ void GV_func_8038BEA0(Actor *this){ } } else{ - if(!this->unk138_24){ + if(!this->is_first_encounter){ if(func_80311480(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index d0f9c536..60efb6e8 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -35,7 +35,7 @@ void _chchimpystump_80386CA0(Actor *this){ void chchimpystump_update(Actor *this){ if(!this->initialized){ actor_collisionOff(this); - this->initialized = 1; + this->initialized = TRUE; this->unk28 = this->position_y; this->position_y -= 134.0f; this->marker->propPtr->unk8_3 = 1; diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index c7ad0e01..5ee92dd7 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -222,12 +222,12 @@ void func_803876D0(Actor *this){ if(!this->initialized){ ((ActorLocal_Conga *)&this->local)->unkC = 1; this->unk16C_0 = 1; - this->initialized = 1; + this->initialized = TRUE; this->velocity_x = 0.0f; this->unk28 = 0.0f; node_prop = func_80304C38(0x150, this); ((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(node_prop); - func_80304D4C(node_prop, &((ActorLocal_Conga *)&this->local)->unk10); + nodeprop_getPosition_s32(node_prop, &((ActorLocal_Conga *)&this->local)->unk10); } if(0.0f == this->unk28){ this->unk28 = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTIBLE) != NULL)? 2.0f: 1.0f; @@ -259,9 +259,9 @@ void func_803876D0(Actor *this){ mapSpecificFlags_set(0xA, 1); }//L803878F8 - if( sp3C && !this->unk138_24){ + if( sp3C && !this->is_first_encounter){ if(func_80311480((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){ - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } } //L80387968 diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c index a93748ab..8a4abb15 100644 --- a/src/MM/ch/hut.c +++ b/src/MM/ch/hut.c @@ -58,8 +58,8 @@ void func_803869EC(ActorMarker *this){ f32 *pos; actorPtr = marker_getActor(this); - actorPtr = func_8032813C(0x4B, actorPtr->position, 0); - func_8032813C(ACTOR_4D_STEAM_2, actorPtr->position, 0); + actorPtr = spawn_actor_f32(0x4B, actorPtr->position, 0); + spawn_actor_f32(ACTOR_4D_STEAM_2, actorPtr->position, 0); if(this); } @@ -74,7 +74,7 @@ void chhut_update(Actor *this){ if(!this->initialized){ this->marker->collidable = 0; - this->initialized = 1; + this->initialized = TRUE; } switch(this->state){ case HUT_STATE_INTACT: diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c index c953c75a..30fbb84b 100644 --- a/src/MM/ch/juju.c +++ b/src/MM/ch/juju.c @@ -70,7 +70,7 @@ void func_803890A0(ActorMarker *marker, s32 arg1){ position[1] = actorPtr->position_y; position[2] = actorPtr->position_z; for(i = 0; i < 4; i++){ - jujuPtr = func_8032813C(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw); + jujuPtr = spawn_actor_f32(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw); jujuPtr->marker->collidable = 0; actorPtr = marker_getActor(marker); func_80388DE8(actorPtr, i, jujuPtr); diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c index 0a55b44a..a4668fce 100644 --- a/src/MM/ch/jujuhitbox.c +++ b/src/MM/ch/jujuhitbox.c @@ -120,8 +120,8 @@ void func_80388E20(Actor *this){ jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; if(!this->initialized){ - this->initialized = 1; - this->unk138_24 = 0; + this->initialized = TRUE; + this->is_first_encounter = FALSE; jujuCtlPtr->unk18 = 0.5f; } if(!this->unk16C_4){ @@ -133,9 +133,9 @@ void func_80388E20(Actor *this){ && !func_80329530(this, 0x50) && !func_8028ECAC() ){ - if( !this->unk138_24 ){ + if( !this->is_first_encounter ){ if(func_80311480(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){ - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } } } diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index 19c989fe..d6a4f503 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -37,7 +37,7 @@ void func_80388300(Actor **arg0){ && func_8028FC34() ){ func_8028FA34(0xc6, *arg0); - (*arg0)->unk138_24 = 1; + (*arg0)->is_first_encounter = TRUE; timed_setStaticCameraToNode(1.2f, 0xF); func_80324E38(1.2f, 3); } @@ -101,10 +101,10 @@ void chLMonkey_update(Actor *this){ if( func_80329530(this, 345) && !func_80329530(this, 150) && !item_getCount(ITEM_19_ORANGE) - && !this->unk138_24 + && !this->is_first_encounter ){ func_80311480(ASSET_B3F_DIALOG_CHIMPY_MEET, 0xe, this->position, NULL, NULL, NULL); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; }//L80388774 actor_loopAnimation(this); subaddie_maybe_set_state_position_direction(this, 2, 0.0f, -1, 0.02f); diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c index 66e35e57..17898123 100644 --- a/src/MM/ch/orange.c +++ b/src/MM/ch/orange.c @@ -16,7 +16,7 @@ #endif /* extern functions */ -f32 func_80309724(f32*); +f32 mapModel_getFloorY(f32*); /* public functions */ void MM_func_80387FF4(Actor *this); @@ -59,7 +59,7 @@ void MM_func_80387FF4(Actor * this){ this->position_y += velocity_y; this->position_z += this->velocity_z; - ground_position_y = func_80309724(this->position); + ground_position_y = mapModel_getFloorY(this->position); if(this->position_y < ground_position_y){ this->position_y = ground_position_y; @@ -67,16 +67,16 @@ void MM_func_80387FF4(Actor * this){ func_8030E6D4(SFX_2F_ORANGE_SPLAT); this->unk28 = 1.0f; - this->unk60 = 340.0f; + this->lifetime_value = 340.0f; this->state = 2; } break; case ORANGE_LANDED_STATE: - if(this->unk60 < 324.0){ + if(this->lifetime_value < 324.0){ this->marker->collidable = 0; } - this->unk60 -= 4.0; - if(this->unk60 < 4.0){ + this->lifetime_value -= 4.0; + if(this->lifetime_value < 4.0){ marker_despawn(this->marker); } break; @@ -93,7 +93,7 @@ Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){ position[0] = actorPtr->position_x; position[1] = actorPtr->unk1C_y + 3.0f; position[2] = actorPtr->position_z; - modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->unk60) ); + modelRender_setAlpha( (s32) MIN(255.0f, actorPtr->lifetime_value) ); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_draw(dl, mptr, position, rotation, actorPtr->unk28, sp60, func_8030A428(0x18)); actorPtr->position_y -= 1.9; diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index e3e0a585..f0150c4c 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -65,8 +65,8 @@ void func_80386444(ActorMarker *marker){ p_ctrl = partEmitMgr_newEmitter(30); particleEmitter_setPosition(p_ctrl, closest_orange_pad->position); particleEmitter_setModel(p_ctrl, 0x89f); - func_802EFB70(p_ctrl, 0.09f, 0.19f); - func_802EFB84(p_ctrl, 0.0f, 0.0f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.09f, 0.19f); + particleEmitter_setFinalScaleRange(p_ctrl, 0.0f, 0.0f); particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 500.0f, -200.0f, @@ -104,7 +104,7 @@ void func_80386768(Actor * this){ if(!this->initialized){ this->marker->propPtr->unk8_3 = 1; actor_collisionOff(this); - this->initialized = 1; + this->initialized = TRUE; }//L803867B0 if(!this->unk16C_4){ @@ -127,17 +127,17 @@ void func_80386768(Actor * this){ } if(this->state == 1){ - if(this->unk60 < 72.0f){ + if(this->lifetime_value < 72.0f){ func_8033E73C(this->marker, 5, func_80329904); func_8033E3F0(9, this->marker->unk14_21); } - this->unk60 = MIN(255.0, this->unk60 + 7.0); + this->lifetime_value = MIN(255.0, this->lifetime_value + 7.0); - if(255.0 == this->unk60){ + if(255.0 == this->lifetime_value){ marker_despawn(this->marker); } }else{ }//L80386928 - actor_setOpacity(this, 0xFF - (s32)this->unk60); + actor_setOpacity(this, 0xFF - (s32)this->lifetime_value); }//*/ diff --git a/src/MMM/ch/loggo.c b/src/MMM/ch/loggo.c index 1cf3e026..f32b4d04 100644 --- a/src/MMM/ch/loggo.c +++ b/src/MMM/ch/loggo.c @@ -22,11 +22,11 @@ ActorInfo chLoggo = { /* .code */ void __chLoggo_flush(ActorMarker* marker) { - Actor* sp1C = marker_getActor(marker); + Actor* actor = marker_getActor(marker); func_8028F918(2); - subaddie_set_state_with_direction(sp1C, 2, 0.01, 1); - actor_playAnimationOnce(sp1C); - sp1C->unk60 = 3.2f; + subaddie_set_state_with_direction(actor, 2, 0.01, 1); + actor_playAnimationOnce(actor); + actor->lifetime_value = 3.2f; } void __chLoggo_textCallback(ActorMarker* caller, enum asset_e text_id, s32 arg3) { @@ -69,7 +69,7 @@ void chLoggo_update(Actor *this){ marker_setCollisionScripts(this->marker, __chLoggo_collide, NULL, NULL); subaddie_set_state_with_direction(this, 1, 0.01f, 1); actor_loopAnimation(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; if(!fileProgressFlag_get(FILEPROG_8A_EXITED_LOGGO) && levelSpecificFlags_get(0x33)){ if(func_80311480(ASSET_AE0_TEXT_EXIT_LOGGO, 4, NULL, NULL, NULL, NULL)){ fileProgressFlag_set(FILEPROG_8A_EXITED_LOGGO, TRUE); @@ -112,8 +112,8 @@ void chLoggo_update(Actor *this){ func_8028F6E4(BS_INTR_2F_LOGGO, sp38); } - if(0.0 < this->unk60){ - this->unk60 -= sp44; + if(0.0 < this->lifetime_value){ + this->lifetime_value -= sp44; } else{ warp_mmmEnterLoggo(0, 0); diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index 32d7a320..b36f4ad3 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -61,9 +61,9 @@ void __chnapper_setState(Actor *this, s32 next_state){ void func_80386ACC(ActorMarker *this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); - if(!this->unk138_24){ + if(!this->is_first_encounter){ if(func_80311480(0xad8, 0, NULL, NULL, NULL, NULL)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } diff --git a/src/MMM/code_2040.c b/src/MMM/code_2040.c index 88179ae9..5e3c5284 100644 --- a/src/MMM/code_2040.c +++ b/src/MMM/code_2040.c @@ -196,7 +196,7 @@ f32 MMM_func_80388430(Actor *this, s32 arg1, s32 arg2, f32 arg3) { break; } func_8030E878(SFX_82_METAL_BREAK, randf2(0.93f, 1.07f), 0x7FF8, this->position, 100.0f, 900.0f); - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; } } arg3 += 4.5; @@ -226,7 +226,7 @@ bool func_80388670(ActorMarker * this_marker, ActorMarker * other_marker){ void func_803888B8(Actor *this){ func_803300C0(this->marker, func_80388670); func_802D3CE8(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; switch(this->state){ case 4: switch(this->marker->id){ @@ -255,7 +255,7 @@ Actor *func_80388994(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { f32 sp6C[3]; this = actor_drawFullDepth(marker, gfx, mtx, vtx); - if (marker->unk14_21 && (this->unk60 != 0.0f)) { + if (marker->unk14_21 && (this->lifetime_value != 0.0f)) { func_8034A174((struct5Bs *) marker->unk44, 5, &sp84); func_8034A174((struct5Bs *) marker->unk44, 6, &sp78); for(i = 0; i < 8; i++){ @@ -290,13 +290,13 @@ void func_80388BDC(Actor *this) { mapSpecificFlags_set(1, ((this->yaw > 260.0f) && (this->yaw < 330.0f)) ? TRUE : FALSE); if (!this->unk16C_4) { if (this->yaw != 0.0f) { - this->unk60 = 0.5f; + this->lifetime_value = 0.5f; subaddie_set_state(this, 7); this->unk38_31 = 1; this->yaw = 270.0f; } else { this->unk38_31 = 0; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; } this->unk16C_4 = TRUE; } @@ -327,13 +327,13 @@ void func_80388BDC(Actor *this) { break; case 7: if (this->unk38_31) { - this->unk60 -= time_getDelta(); - if (this->unk60 < 0.0f) { - this->unk60 = 0.0f; + this->lifetime_value -= time_getDelta(); + if (this->lifetime_value < 0.0f) { + this->lifetime_value = 0.0f; } } if( (!this->unk38_31 && item_empty(ITEM_0_HOURGLASS_TIMER)) - || ((this->unk38_31) && (this->unk60 == 0.0f)) + || ((this->unk38_31) && (this->lifetime_value == 0.0f)) ) { if (!this->unk38_31) { func_802BAFE4(0x22); @@ -357,7 +357,7 @@ void func_80388BDC(Actor *this) { func_8025AE0C(0x7D0, 2.5f); } this->unk38_31 = 0; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; volatileFlag_setAndTriggerDialog_0(VOLATILE_FLAG_AD_MMM_CHURCH_DOOR_MISSED); } break; diff --git a/src/RBB/ch/boombox.c b/src/RBB/ch/boombox.c index d658660a..78222f91 100644 --- a/src/RBB/ch/boombox.c +++ b/src/RBB/ch/boombox.c @@ -78,8 +78,8 @@ void func_8038E998(Actor *this){ particleEmitter_setFade(other, 0.0f, 0.1f); particleEmitter_setStartingFrameRange(other, 0, 7); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, 0.25f, 0.75f); - func_802EFB84(other, 0.75f, 1.75f); + particleEmitter_setStartingScaleRange(other, 0.25f, 0.75f); + particleEmitter_setFinalScaleRange(other, 0.75f, 1.75f); particleEmitter_setParticleSpawnPositionRange(other, -50.0f, 25.0f, -50.0f, 50.0f, 25.0f, 50.0f); particleEmitter_setParticleVelocityRange(other, -50.0f, 100.0f, -50.0f, 50.0f, 200.0f, 50.0f); particleEmitter_setParticleLifeTimeRange(other, 0.5f, 1.0f); @@ -97,8 +97,8 @@ void func_8038EAB4(Actor *this){ particleEmitter_setParticleFramerateRange(other, 4.0f, 4.0f); particleEmitter_setParticleSpawnPositionRange(other, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, 3.0f, 3.0f); - func_802EFB84(other, 8.0f, 8.0f); + particleEmitter_setStartingScaleRange(other, 3.0f, 3.0f); + particleEmitter_setFinalScaleRange(other, 8.0f, 8.0f); particleEmitter_setParticleLifeTimeRange(other, 0.5f, 0.5f); particleEmitter_setParticleVelocityRange(other, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); particleEmitter_emitN(other, 1); @@ -111,8 +111,8 @@ void func_8038EC14(Actor *this){ particleEmitter_setFade(other, 0.05f, 0.1f); particleEmitter_setStartingFrameRange(other, 0, 7); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, 1.0f, 1.5f); - func_802EFB84(other, 2.0f, 3.0f); + particleEmitter_setStartingScaleRange(other, 1.0f, 1.5f); + particleEmitter_setFinalScaleRange(other, 2.0f, 3.0f); particleEmitter_setParticleSpawnPositionRange(other, -75.0f, 25.0f, -75.0f, 75.0f, 75.0f, 75.0f); particleEmitter_setParticleVelocityRange(other, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f); particleEmitter_setRGB(other, &RBB_D_80390DD0); @@ -127,7 +127,7 @@ void func_8038ED3C(Actor * actor, s32 arg1){ func_802EFA18(other, 3); particleEmitter_setModel(other, arg1); particleEmitter_setPosition(other, actor->position); - func_802EFB70(other, 0.05f, 0.4f); + particleEmitter_setStartingScaleRange(other, 0.05f, 0.4f); particleEmitter_setAngularVelocityRange(other, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setSpawnIntervalRange(other, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(other, 10.0f, 10.0f); @@ -172,7 +172,7 @@ int func_8038EF08(Actor *this, f32 (*position)[3], f32 arg2){ local->unk20[1] = sp54[1] + this->position_y; local->unk20[2] = sp54[2] + this->position_z; - local->unk20[1] = func_80309724(&local->unk20); + local->unk20[1] = mapModel_getFloorY(&local->unk20); sp40[0] = local->unk20[0]; sp40[1] = local->unk20[1] + this->scale*100.0f; @@ -336,7 +336,7 @@ void func_8038F618(Actor *this){ local->unk38 = 0; local->unk39 = 0; local->unk0 = &D_80390D80[(this->modelCacheIndex == 0x30d)? 1 : 0]; - local->unk2C = func_80309724(&this->position); + local->unk2C = mapModel_getFloorY(&this->position); local->unk34 = 0; local->unk4 = 0.5f; local->unk30 = 0.0f; diff --git a/src/RBB/ch/bossboombox.c b/src/RBB/ch/bossboombox.c index d36b9e48..f61d98f3 100644 --- a/src/RBB/ch/bossboombox.c +++ b/src/RBB/ch/bossboombox.c @@ -104,8 +104,8 @@ void func_8038C39C(Actor *this){ particleEmitter_setStartingFrameRange(other, 0, 7); particleEmitter_setDrawMode(other, 4); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); - func_802EFB84(other, 3.0f*local->unk0->unk4, local->unk0->unk4*7.0f); + particleEmitter_setStartingScaleRange(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); + particleEmitter_setFinalScaleRange(other, 3.0f*local->unk0->unk4, local->unk0->unk4*7.0f); particleEmitter_setParticleSpawnPositionRange(other, local->unk0->unk4*-200.0f, local->unk0->unk4*100.0f, local->unk0->unk4*-200.0f, local->unk0->unk4*200.0f, local->unk0->unk4*100.0f, local->unk0->unk4*200.0f @@ -126,8 +126,8 @@ void RBB_func_8038C538(Actor *this){ particleEmitter_setDrawMode(other, 4); particleEmitter_setStartingFrameRange(other, 0, 7); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*6.0f); - func_802EFB84(other, 0.5*local->unk0->unk4, local->unk0->unk4*3.0f); + particleEmitter_setStartingScaleRange(other, local->unk0->unk4*1, local->unk0->unk4*6.0f); + particleEmitter_setFinalScaleRange(other, 0.5*local->unk0->unk4, local->unk0->unk4*3.0f); particleEmitter_setParticleSpawnPositionRange(other, local->unk0->unk4*-300.0f, local->unk0->unk4*100.0f, local->unk0->unk4*-300.0f, local->unk0->unk4*300.0f, local->unk0->unk4*300.0f, local->unk0->unk4*300.0f @@ -155,7 +155,7 @@ void RBB_func_8038C70C(Actor *this){ local->unk0->unk4 * 300.0f, local->unk0->unk4 * 200.0f, local->unk0->unk4 * 300.0f ); particleEmitter_setPosition(other, this->position); - func_802EFB70(other, local->unk0->unk4*0.3, local->unk0->unk4*0.8); + particleEmitter_setStartingScaleRange(other, local->unk0->unk4*0.3, local->unk0->unk4*0.8); particleEmitter_setAngularVelocityRange(other, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f @@ -181,8 +181,8 @@ void func_8038C8A8(Actor * this){ particleEmitter_setDrawMode(other, 4); particleEmitter_setStartingFrameRange(other, 0, 7); particleEmitter_setPosition(other, sp24); - func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); - func_802EFB84(other, local->unk0->unk4*3.0f, local->unk0->unk4*6.0f); + particleEmitter_setStartingScaleRange(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); + particleEmitter_setFinalScaleRange(other, local->unk0->unk4*3.0f, local->unk0->unk4*6.0f); particleEmitter_setPositionVelocityAndAccelerationRanges(other, &D_80390CA8); particleEmitter_setParticleLifeTimeRange(other, 1.0f, 2.0f); particleEmitter_setRGB(other, &D_80390C9C); diff --git a/src/RBB/ch/dolphin.c b/src/RBB/ch/dolphin.c index 9f0c806a..ecbb8356 100644 --- a/src/RBB/ch/dolphin.c +++ b/src/RBB/ch/dolphin.c @@ -54,8 +54,8 @@ void func_8038B900(Actor *this){ ){//L8038BB24 func_8034A174(this->marker->unk44, 5, sp48); other = func_802EDD8C(&sp48, 0.0f, -1300.0f); - func_802EFB70(other, 0.04f, 0.04f); - func_802EFB84(other, 0.18f, 0.18f); + particleEmitter_setStartingScaleRange(other, 0.04f, 0.04f); + particleEmitter_setFinalScaleRange(other, 0.18f, 0.18f); particleEmitter_setParticleSpawnPositionRange(other, -10.0f, 0.0f, -10.0f, 10.0f, 20.0f, 10.0f); particleEmitter_setParticleVelocityRange(other, 0.0f, 31.0f, 0.0f, 0.0f, 37.0f, 0.0f); particleEmitter_emitN(other, 1); @@ -85,12 +85,12 @@ void func_8038B900(Actor *this){ } if(this->state == 1){ - if( !this->unk138_24 + if( !this->is_first_encounter && func_80329530(this, 0x258) && !func_8028ECAC() ){ func_80311480(0xb9b, 4, 0, 0, 0, 0); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } } diff --git a/src/RBB/code_1570.c b/src/RBB/code_1570.c index b8fad6cb..fc01be69 100644 --- a/src/RBB/code_1570.c +++ b/src/RBB/code_1570.c @@ -131,8 +131,8 @@ void func_80387C5C(void){ particleEmitter_setDrawMode(actor, PART_EMIT_NO_LOOP); particleEmitter_setStartingFrameRange(actor, 0, 0); particleEmitter_setParticleFramerateRange(actor, 4.0f, 4.0f); - func_802EFB70(actor, 10.0f, 10.0f); - func_802EFB84(actor, 15.0f, 20.0f); + particleEmitter_setStartingScaleRange(actor, 10.0f, 10.0f); + particleEmitter_setFinalScaleRange(actor, 15.0f, 20.0f); particleEmitter_setParticleLifeTimeRange(actor, 4.0f, 4.0f); particleEmitter_setParticleVelocityRange(actor, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); particleEmitter_emitInVolume(actor, &D_803902D4, &D_803902E0, 1); @@ -152,7 +152,7 @@ void func_80387E20(void){ func_802EF9F8(actor, 0.6f); func_802EFA18(actor, 3); particleEmitter_setModel(actor, 0x427); - func_802EFB70(actor, 0.05f, 0.4f); + particleEmitter_setStartingScaleRange(actor, 0.05f, 0.4f); particleEmitter_setAngularVelocityRange(actor, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setSpawnIntervalRange(actor, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(actor, 10.0f, 10.0f); diff --git a/src/SM/ch/attacktutorial.c b/src/SM/ch/attacktutorial.c index 08ca4e08..d6f4b6a6 100644 --- a/src/SM/ch/attacktutorial.c +++ b/src/SM/ch/attacktutorial.c @@ -124,7 +124,7 @@ void chAttackTutorial_update(Actor *this){ this->unk1C_z = this->position_z;} } this->unk10_12 = (ability_isUnlocked(ABILITY_C_ROLL))? 2 : (ability_isUnlocked(ABILITY_4_CLAW_SWIPE)? 1:0); - this->initialized = 1; + this->initialized = TRUE; } switch(this->state){ diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c index 3d2be419..ed9d54e3 100644 --- a/src/SM/ch/vegetables.c +++ b/src/SM/ch/vegetables.c @@ -5,7 +5,7 @@ //external -f32 func_80309724(f32*); +f32 mapModel_getFloorY(f32*); void func_802C4218(s32, f32, f32, f32); void func_803252D0(f32, s32); void subaddie_set_state_with_direction(Actor *, s32, f32, s32); @@ -223,7 +223,7 @@ void func_80387DCC(ActorMarker *marker, ActorMarker *other_marker){ Actor *func_80387DF4(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor *actor = marker_getActor(marker); - if(actor->unk138_24) + if(actor->is_first_encounter) func_8033A470(3, 7); else func_8033A45C(3, 0); @@ -320,10 +320,10 @@ void func_80388080(Actor *this){ this->velocity_x = temp_velX; this->velocity_y = (local->unkC == 3) ? 90.0f : 70.0f; this->velocity_z = temp_velZ; - this->unk138_24 = 1; + this->is_first_encounter = TRUE; this->unk138_23 = 0; this->unk38_0 = 0; - this->initialized = 1; + this->initialized = TRUE; this->scale = 0.5; }//L80388278 switch (this->state) @@ -347,7 +347,7 @@ void func_80388080(Actor *this){ this->velocity_y -= 5.0f; this->scale = MIN(this->scale + 0.05, 1.0); if(this->velocity_y < 0.0f && this->position_y < this->unk1C_y){ - this->position_y = func_80309724(this->position); + this->position_y = mapModel_getFloorY(this->position); if(local->unkC == 3) func_80387F00(this); @@ -483,7 +483,7 @@ void func_80388080(Actor *this){ sp54[2] = this->position_z; if(local->unkC == 1) sp54[1] += 150.0f; - this->unk138_24 = 0; + this->is_first_encounter = FALSE; func_80387A80(partEmitMgr_newEmitter(3), sp54, 3, (local->unkC == 1)? 0x4f0: 0x4f1); }//L80388CC4 diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index 352b315a..d68482c6 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -233,8 +233,8 @@ void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ break; case ASSET_E1D_TEXT_BOTTLES_TUTORIAL_OFFER_WAIT: /* 2FFC 803893EC 920B0138 */ - actor->unk138_24 = 0; - actor->unk60 = 0.0f; + actor->is_first_encounter = FALSE; + actor->lifetime_value = 0.0f; break; case ASSET_DF6_TEXT_BOTTLES_HIGH_JUMP_LEARN: /* 3014 80389404 0C0A3E46 */ @@ -406,7 +406,7 @@ void chsmmole_Update(Actor * this){ if(!this->initialized){ this->marker->propPtr->unk8_3 = 0; actor_collisionOff(this); - this->initialized = 1; + this->initialized = TRUE; marker_setFreeMethod(this->marker, func_80389984); if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30 sp40 = func_80304C38(0x349, this); @@ -557,7 +557,7 @@ void chsmmole_Update(Actor * this){ }//L8038A1B8 user_input = -1; if(this->unk38_0){ - this->unk60 += time_getDelta(); + this->lifetime_value += time_getDelta(); if(func_803114C4() != 0xe1d){ if(sp50[FACE_BUTTON(BUTTON_A)] == 1) user_input = 1; //A button pressed @@ -572,9 +572,9 @@ void chsmmole_Update(Actor * this){ chsmmole_skipIntroTutorial(); //give all SM moves } this->unk38_0 = 0; - }else if(!this->unk138_24 && 5.0 < this->unk60){ + }else if(!this->is_first_encounter && 5.0 < this->lifetime_value){ func_80311480(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; } } break; diff --git a/src/SM/code_4070.c b/src/SM/code_4070.c index d3a1cdb5..e81fe197 100644 --- a/src/SM/code_4070.c +++ b/src/SM/code_4070.c @@ -74,7 +74,7 @@ void SM_func_8038A5D8(Actor *this){ this->unk1C_y = this->position_y; this->unk1C_z = this->position_z; }//L8038A644 - this->initialized = 1; + this->initialized = TRUE; }//L8038A650 func_8024E55C(0, sp44); diff --git a/src/SM/code_5B0.c b/src/SM/code_5B0.c index 13aecdef..fe53d2ef 100644 --- a/src/SM/code_5B0.c +++ b/src/SM/code_5B0.c @@ -76,8 +76,8 @@ void func_80386B04(ParticleEmitter *p_ctrl, f32 *arg1, s32 arg2, f32 arg3) { particleEmitter_setModel(p_ctrl, 0x42E); particleEmitter_setPosition(p_ctrl, arg1); particleEmitter_setDrawMode(p_ctrl, 2); - func_802EFB70(p_ctrl, arg3, arg3); - func_802EFB84(p_ctrl, arg3, arg3); + particleEmitter_setStartingScaleRange(p_ctrl, arg3, arg3); + particleEmitter_setFinalScaleRange(p_ctrl, arg3, arg3); particleEmitter_setAngularVelocityRange(p_ctrl, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f); particleEmitter_setSpawnIntervalRange(p_ctrl, 0.00f, 0.01f); particleEmitter_setParticleLifeTimeRange(p_ctrl, 2.0f, 2.0f); @@ -91,8 +91,8 @@ void func_80386C2C(ParticleEmitter *p_ctrl, f32 *arg1, s32 arg2, f32 arg3) { particleEmitter_setFade(p_ctrl, 0.00f, 0.01f); particleEmitter_setStartingFrameRange(p_ctrl, 0, 7); particleEmitter_setPosition(p_ctrl, arg1); - func_802EFB70(p_ctrl, (arg3 * 0.1), (arg3 * 0.5)); - func_802EFB84(p_ctrl, (arg3 * 1.5), (arg3 * 3.0)); + particleEmitter_setStartingScaleRange(p_ctrl, (arg3 * 0.1), (arg3 * 0.5)); + particleEmitter_setFinalScaleRange(p_ctrl, (arg3 * 1.5), (arg3 * 3.0)); particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(p_ctrl, 1.5f, 2.0f); particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_8038AB9C); diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index e2829a75..da257796 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -117,7 +117,7 @@ void func_80387774(Actor **this_ptr){ && func_8028FC34() ){ func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr); - (*this_ptr)->unk138_24 = TRUE; + (*this_ptr)->is_first_encounter = TRUE; } } @@ -146,11 +146,11 @@ void func_803878CC(Actor * this){ }//L80387970 if(func_80329530(this, 250) && !func_80329530(this, 80) - && !this->unk138_24 + && !this->is_first_encounter && item_getCount(ITEM_18_GOLD_BULLIONS) == 0 ){ func_80311480(0xa0b, 0xe, this->position, this->marker, func_80387520, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; subaddie_set_state_forward(this, 3); } @@ -161,7 +161,7 @@ void func_803878CC(Actor * this){ func_80311480(0xa0c, 4, NULL, NULL, NULL, NULL); this->unk138_23 = TRUE; - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; }//L80387A54 diff --git a/src/TTC/ch/clam.c b/src/TTC/ch/clam.c index 3f9b864f..29651f06 100644 --- a/src/TTC/ch/clam.c +++ b/src/TTC/ch/clam.c @@ -160,7 +160,7 @@ void __chClam_emitLargeShellParticles(f32 position[3], s32 count){ particleEmitter_setModel(pCtrl, ASSET_37C_MODEL_CLAM_LARGE_SHELL_PIECE); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C3F4); particleEmitter_setAngularVelocityRange(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_emitN(pCtrl, count); } @@ -176,7 +176,7 @@ void __chClam_emitEyeParticles(f32 position[3], s32 count){ particleEmitter_setModel(pCtrl, ASSET_37D_MODEL_CLAM_EYE); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C424); particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_emitN(pCtrl, count); } @@ -192,7 +192,7 @@ void __chClam_emitSmallShellParticles(f32 position[3], s32 count){ particleEmitter_setModel(pCtrl, ASSET_37E_MODEL_CLAM_SMALL_SHELL_PIECE); particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C454); particleEmitter_setAngularVelocityRange(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); - func_802EFB70(pCtrl, 0.5f, 0.8f); + particleEmitter_setStartingScaleRange(pCtrl, 0.5f, 0.8f); particleEmitter_emitN(pCtrl, count); } @@ -277,7 +277,7 @@ void chClam_update(Actor *this){ } if(this->state != 3){ - sp48 = func_80309724(this->position); + sp48 = mapModel_getFloorY(this->position); if(sp4C != NULL){ sp44 = sp4C->marker->id; } diff --git a/src/TTC/ch/leaky.c b/src/TTC/ch/leaky.c index e11ff76f..6798fb88 100644 --- a/src/TTC/ch/leaky.c +++ b/src/TTC/ch/leaky.c @@ -54,12 +54,12 @@ void chLeaky_update(Actor *this) { } } if( this->state == 1 - && !this->unk138_24 + && !this->is_first_encounter && func_80329530(this, 250) && !func_80329530(this, 160) && !func_8028ECAC() && func_80311480(0xA1A, 0, NULL, NULL, NULL, NULL) ){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } if (func_803114B0() == 0) { if (actor_animationIsAt(this, 0.83f)) { diff --git a/src/TTC/ch/lockup.c b/src/TTC/ch/lockup.c index 47136a49..792980b8 100644 --- a/src/TTC/ch/lockup.c +++ b/src/TTC/ch/lockup.c @@ -75,7 +75,7 @@ void func_80389600(Actor *this){ s32 tmp_v1; int i; - if( !this->unk138_24 + if( !this->is_first_encounter && this->unkF4_8 == 0xA && !jiggyscore_isCollected(JIGGY_13_TTC_LOCKUP) && func_80329530(this, 320) @@ -83,7 +83,7 @@ void func_80389600(Actor *this){ && !func_8028ECAC() && func_80311480(0xA15, 0, NULL, NULL, NULL, NULL) ){ - this->unk138_24 = 1; + this->is_first_encounter = TRUE; }//L803896AC if(!this->unk16C_4){ diff --git a/src/TTC/ch/nipper.c b/src/TTC/ch/nipper.c index bdb6e020..ca39843b 100644 --- a/src/TTC/ch/nipper.c +++ b/src/TTC/ch/nipper.c @@ -68,7 +68,7 @@ Actor *func_80387EB0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { void TTC_func_80387F18(Actor *this) { subaddie_set_state_looped(this, 3); this->unk1C[0] = 0.0f; - switch((s32)this->unk60){ + switch((s32)this->lifetime_value){ case 0x78: animctrl_setDuration(this->animctrl, 1.2f); break; @@ -126,7 +126,7 @@ void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) { this = marker_getActor(this_marker); func_8032B4DC(this, other_marker, 7); - if (this->unk60 == 40.0f) { + if (this->lifetime_value == 40.0f) { subaddie_set_state_with_direction(this, 6, 0.01f, 1); actor_playAnimationOnce(this); for(i = 0; i < 3; i++){ @@ -139,14 +139,14 @@ void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) { return; } - if (this->unk60 == 80.0f) { + if (this->lifetime_value == 80.0f) { TTC_func_80387FF4(this); - this->unk60 = 40.0f; + this->lifetime_value = 40.0f; return; } TTC_func_80387FF4(this); - this->unk60 = 80.0f; + this->lifetime_value = 80.0f; func_80311480(0xA10, 4, NULL, NULL, NULL, NULL); return; } @@ -167,7 +167,7 @@ void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ if(other_marker->id == 1){ this = marker_getActor(this_marker); if( !mapSpecificFlags_get(7) - && this->unk138_24 + && this->is_first_encounter && func_80311480(0xa0f, 0, NULL, NULL, NULL, NULL) ){ mapSpecificFlags_set(7, TRUE); @@ -178,7 +178,7 @@ void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ void func_803883C8(ActorMarker * this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); if( !this->unk138_23 - && this->unk138_24 + && this->is_first_encounter && func_80311480(0xa11, 0, NULL, NULL, NULL, NULL) ){ this->unk138_23 = TRUE; @@ -221,7 +221,7 @@ void func_80388434(Actor *this){ if(!this->initialized){ animctrl_setTransitionDuration(this->animctrl, 0.35f); subaddie_set_state_with_direction(this, 1, 0.01f, 1); - this->unk60 = 120.0f; + this->lifetime_value = 120.0f; this->marker->propPtr->unk8_3 = TRUE; marker_setCollisionScripts(this->marker, func_803883C8, func_80388344, func_80388178); func_803300C0(this->marker, func_803882E4); @@ -229,13 +229,13 @@ void func_80388434(Actor *this){ }//L8038860C if(func_8038812C(this)){ temp_v0 = func_8028ECAC(); - if( !this->unk138_24 + if( !this->is_first_encounter && temp_v0 != 1 && temp_v0 != 10 ){ subaddie_set_state_with_direction(this, 5, 0.01f, 1); if(func_80311480(0xa0e, 0xf, this->position, this->marker, TTC_func_80387FB0, NULL)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300); ncStaticCamera_setToNode(11); @@ -262,7 +262,7 @@ void func_80388434(Actor *this){ break; } - if(this->unk60 <= this->unk38_31){ + if(this->lifetime_value <= this->unk38_31){ TTC_func_80387F18(this); break; } diff --git a/src/TTC/ch/treasure.c b/src/TTC/ch/treasure.c index 6547d480..943d16e3 100644 --- a/src/TTC/ch/treasure.c +++ b/src/TTC/ch/treasure.c @@ -34,12 +34,12 @@ void __chtreasure_updatePosition(Actor *this){ this->position[1] = this->unk1C[1];\ this->position[2] = this->unk1C[2]; - this->position[0] += this->unk5C*cosf(this->unk60); - this->position[2] += this->unk5C*sinf(this->unk60); - this->unk60 += 2.0*time_getDelta()*this->unk5C/300.0; - if(2*M_PI <= this->unk60) - this->unk60 -= 2*M_PI; - this->yaw = this->unk60*180.0/M_PI; + this->position[0] += this->unk5C*cosf(this->lifetime_value); + this->position[2] += this->unk5C*sinf(this->lifetime_value); + this->lifetime_value += 2.0*time_getDelta()*this->unk5C/300.0; + if(2*M_PI <= this->lifetime_value) + this->lifetime_value -= 2*M_PI; + this->yaw = this->lifetime_value*180.0/M_PI; } void chtreasure_update(Actor *this){ @@ -54,7 +54,7 @@ void chtreasure_update(Actor *this){ } actor_collisionOff(this); this->scale = 0.5f; - this->unk60 = M_PI/2; + this->lifetime_value = M_PI/2; this->unk5C = 0.0f; this->unk1C[0] = this->position[0]; this->unk1C[1] = this->position[1]; diff --git a/src/TTC/ch/treasurehunt.c b/src/TTC/ch/treasurehunt.c index 91939865..f423908f 100644 --- a/src/TTC/ch/treasurehunt.c +++ b/src/TTC/ch/treasurehunt.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern f32 func_80309724(f32[3]); +extern f32 mapModel_getFloorY(f32[3]); extern void func_8028F45C(s32, f32[3]); typedef struct { @@ -92,11 +92,11 @@ void func_80389A1C(void) { Actor *actor; ActorLocal_TreasureHunt *local; - actor = func_8032813C(0x55, D_8038C820[D_8037DCB4], 0); + actor = spawn_actor_f32(0x55, D_8038C820[D_8037DCB4], 0); local = (ActorLocal_TreasureHunt *)&actor->local; actor->yaw = D_8038C868[D_8037DCB4]; local->unk0 = D_8037DCB4; - actor->unk60 = 0.0f; + actor->lifetime_value = 0.0f; actor->state = 0; } @@ -105,11 +105,11 @@ void func_80389A9C(void) { ActorLocal_TreasureHunt *local; s32 actor_id; - actor = func_8032813C((D_8038C898 - 1)[D_8037DCB4], D_8038C820[D_8037DCB4 - 1], 0); + actor = spawn_actor_f32((D_8038C898 - 1)[D_8037DCB4], D_8038C820[D_8037DCB4 - 1], 0); local = (ActorLocal_TreasureHunt *)&actor->local; actor->yaw = D_8038C880[D_8037DCB4 - 1]; local->unk0 = D_8037DCB4; - actor->unk60 = 0.0f; + actor->lifetime_value = 0.0f; actor->state = 0; } @@ -156,7 +156,7 @@ void func_80389CC4(s16 arg0[3], s32 arg1){ D_8038D708[0] = (f32)arg0[0]; D_8038D708[1] = (f32)arg0[1]; D_8038D708[2] = (f32)arg0[2]; - D_8038D708[1] = func_80309724(D_8038D708); + D_8038D708[1] = mapModel_getFloorY(D_8038D708); __spawnQueue_add_4((GenFunction_4)func_802C4140, 0xF4, reinterpret_cast(s32, D_8038D708[0]), reinterpret_cast(s32, D_8038D708[1]), reinterpret_cast(s32, D_8038D708[2])); D_8038D700 = partEmitMgr_newEmitter(3); particleEmitter_setRGB(D_8038D700, D_8038C91C); @@ -192,8 +192,8 @@ void TTC_func_80389E90(Actor *this){ switch(this->state){ case 0://L80389F20 - this->unk60 = MIN(255.0, this->unk60 + tick*150.0); - if(255.0 == this->unk60){ + this->lifetime_value = MIN(255.0, this->lifetime_value + tick*150.0); + if(255.0 == this->lifetime_value){ this->state = 1; } break; @@ -203,12 +203,12 @@ void TTC_func_80389E90(Actor *this){ } break; case 2://L80389FC4 - this->unk60 = MAX(0.0, this->unk60 - tick*((this->marker->modelId == ASSET_3EA_MODEL_RED_X)? 200.0 : 150.0)); - if(0.0 == this->unk60) + this->lifetime_value = MAX(0.0, this->lifetime_value - tick*((this->marker->modelId == ASSET_3EA_MODEL_RED_X)? 200.0 : 150.0)); + if(0.0 == this->lifetime_value) marker_despawn(this->marker); break; }//L8038A094 - actor_setOpacity(this, (s32)this->unk60); + actor_setOpacity(this, (s32)this->lifetime_value); this->depth_mode = 2; } diff --git a/src/core1/code_1BE90.c b/src/core1/code_1BE90.c index 2b3bf856..4dda2be5 100644 --- a/src/core1/code_1BE90.c +++ b/src/core1/code_1BE90.c @@ -366,12 +366,12 @@ void func_8025A58C(s32 arg0, s32 arg1){ } -void func_8025A5AC(enum comusic_e comusic_id, s32 arg1, s32 arg2){ +void func_8025A5AC(enum comusic_e comusic_id, s32 volume, s32 arg2){ CoMusic *tmp_a2; s32 sp20; - if(arg1 == -1){ - arg1 = func_80250034(comusic_id); + if(volume == -1){ + volume = func_80250034(comusic_id); } tmp_a2 = __find_track(comusic_id); @@ -393,20 +393,20 @@ void func_8025A5AC(enum comusic_e comusic_id, s32 arg1, s32 arg2){ tmp_a2->unk12 = 0; tmp_a2->unk15 = 0; tmp_a2->unk4 = 0.0f; - func_80259994(tmp_a2, arg1); + func_80259994(tmp_a2, volume); func_8024FC1C(sp20, comusic_id); } - func_8024FD28(sp20, (s16) arg1); - tmp_a2->unk8 = arg1; + func_8024FD28(sp20, (s16) volume); + tmp_a2->unk8 = volume; } -void func_8025A6CC(enum comusic_e arg0, s32 arg1){ - func_8025A5AC(arg0, arg1, 0); +void func_8025A6CC(enum comusic_e track_id, s32 volume){ + func_8025A5AC(track_id, volume, 0); } -void func_8025A6EC(enum comusic_e track_id, s32 arg1){ - func_8025A5AC(track_id, arg1, 1); +void func_8025A6EC(enum comusic_e track_id, s32 volume){ + func_8025A5AC(track_id, volume, 1); } //comusic_queueTrack diff --git a/src/core2/ba/marker.c b/src/core2/ba/marker.c index eb6baa5d..ed60df39 100644 --- a/src/core2/ba/marker.c +++ b/src/core2/ba/marker.c @@ -159,7 +159,7 @@ void __baMarker_8028B9A8(s32 arg0){ s32 ideal_yaw[3]; tmp_v0 = cubeList_findNodePropByActorId(0x1F6, 0); - func_80304D4C(tmp_v0, &ideal_yaw); + nodeprop_getPosition_s32(tmp_v0, &ideal_yaw); func_802CA1CC(arg0); func_8032811C(ACTOR_47_EMPTY_HONEYCOMB, &ideal_yaw, 0); func_8025A6EC(COMUSIC_2B_DING_B, 28000); diff --git a/src/core2/bs/droneenter.c b/src/core2/bs/droneenter.c index c1bbe4a8..dad86fc1 100644 --- a/src/core2/bs/droneenter.c +++ b/src/core2/bs/droneenter.c @@ -74,8 +74,8 @@ void __bsDroneEnter_initParticleTypes(ParticleEmitter *p_ctrl, enum asset_e spri particleEmitter_manualFree(p_ctrl); particleEmitter_setSprite(p_ctrl, sprite_id); particleEmitter_setFade(p_ctrl, 0.3f, 0.8f); - func_802EFB70(p_ctrl, 0.15f, 0.22f); - func_802EFB84(p_ctrl, 0.03f, 0.05f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.15f, 0.22f); + particleEmitter_setFinalScaleRange(p_ctrl, 0.03f, 0.05f); particleEmitter_setAngularVelocityRange(p_ctrl, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); particleEmitter_setParticleLifeTimeRange(p_ctrl, 0.55f, 0.55f); } diff --git a/src/core2/bs/dronevanish.c b/src/core2/bs/dronevanish.c index 12b80bbd..df4c8d59 100644 --- a/src/core2/bs/dronevanish.c +++ b/src/core2/bs/dronevanish.c @@ -60,8 +60,8 @@ void __bsDroneVanish_particleEmitInit(ParticleEmitter *p_ctrl, enum asset_e spri particleEmitter_setSprite(p_ctrl, sprite_id); particleEmitter_setFade(p_ctrl, 0.3f, 0.8f); particleEmitter_setParticleSpawnPositionRange(p_ctrl, -45.0f, 0.0f, -45.0f, 45.0f, 0.0f, 45.0f); - func_802EFB70(p_ctrl, 0.15f, 0.22f); - func_802EFB84(p_ctrl, 0.03f, 0.05f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.15f, 0.22f); + particleEmitter_setFinalScaleRange(p_ctrl, 0.03f, 0.05f); particleEmitter_setAngularVelocityRange(p_ctrl, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); particleEmitter_setParticleLifeTimeRange(p_ctrl, 0.55f, 0.55f); } diff --git a/src/core2/bs/dronexform.c b/src/core2/bs/dronexform.c index c437a214..4af1e99e 100644 --- a/src/core2/bs/dronexform.c +++ b/src/core2/bs/dronexform.c @@ -37,7 +37,7 @@ void func_802AF7A0(ParticleEmitter *arg0, enum asset_e arg1){ particleEmitter_setSprite(arg0, arg1); particleEmitter_setParticleAccelerationRange(arg0, 0.0f, -50.0f, 0.0f, 0.0f, -50.0f, 0.0f); particleEmitter_setFade(arg0, 0.4f, 0.8f); - func_802EFB84(arg0, 0.03f, 0.03f); + particleEmitter_setFinalScaleRange(arg0, 0.03f, 0.03f); particleEmitter_setAngularVelocityRange(arg0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); particleEmitter_setParticleLifeTimeRange(arg0, 0.65f, 0.65f); func_802EFF50(arg0, 1.0f); @@ -48,7 +48,7 @@ void func_802AF88C(ParticleEmitter * arg0, f32 arg1, f32 arg2){ arg1*30.0f, 10.0f, arg2*30.0f, arg1*30.0f, 10.0f, arg2*30.0f ); - func_802EFB70(arg0, D_8037D470.unk14, D_8037D470.unk14); + particleEmitter_setStartingScaleRange(arg0, D_8037D470.unk14, D_8037D470.unk14); } void func_802AF900(void){ @@ -148,8 +148,8 @@ void func_802AFBB8(f32 arg0[3]){ particleEmitter_setFade(s0, 0.7f, 0.8f); particleEmitter_setParticleFramerateRange(s0, 12.0f, 12.0f); particleEmitter_setPosition(s0, arg0); - func_802EFB70(s0, 3.2f, 3.2f); - func_802EFB84(s0, 3.2f, 3.2f); + particleEmitter_setStartingScaleRange(s0, 3.2f, 3.2f); + particleEmitter_setFinalScaleRange(s0, 3.2f, 3.2f); particleEmitter_setParticleLifeTimeRange(s0, 0.8f, 0.8f); particleEmitter_emitN(s0, 1); @@ -158,8 +158,8 @@ void func_802AFBB8(f32 arg0[3]){ particleEmitter_setFade(s0, 0.1f, 0.8f); particleEmitter_setParticleFramerateRange(s0, 15.0f, 15.0f); particleEmitter_setPosition(s0, arg0); - func_802EFB70(s0, 3.0f, 3.0f); - func_802EFB84(s0, 3.0f, 3.0f); + particleEmitter_setStartingScaleRange(s0, 3.0f, 3.0f); + particleEmitter_setFinalScaleRange(s0, 3.0f, 3.0f); particleEmitter_setParticleLifeTimeRange(s0, 0.65f, 0.65f); particleEmitter_emitN(s0, 1); @@ -167,8 +167,8 @@ void func_802AFBB8(f32 arg0[3]){ particleEmitter_setSprite(s0, ASSET_713_SPRITE_SPARKLE_YELLOW); //sparkle particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364BB0); particleEmitter_setFade(s0, 0.0f, 0.6f); - func_802EFB70(s0, 0.28f, 0.32f); - func_802EFB84(s0, 0.03f, 0.03f); + particleEmitter_setStartingScaleRange(s0, 0.28f, 0.32f); + particleEmitter_setFinalScaleRange(s0, 0.03f, 0.03f); particleEmitter_setAngularVelocityRange(s0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); particleEmitter_setParticleLifeTimeRange(s0, 2.0f, 2.0f); func_802EFF50(s0, 1.0f); @@ -187,8 +187,8 @@ void func_802AFBB8(f32 arg0[3]){ particleEmitter_setSprite(s0, ASSET_716_SPRITE_SPARKLE_WHITE); //sparkle particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364C40); particleEmitter_setFade(s0, 0.0f, 0.6f); - func_802EFB70(s0, 0.28f, 0.32f); - func_802EFB84(s0, 0.03f, 0.03f); + particleEmitter_setStartingScaleRange(s0, 0.28f, 0.32f); + particleEmitter_setFinalScaleRange(s0, 0.03f, 0.03f); particleEmitter_setAngularVelocityRange(s0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); particleEmitter_setParticleLifeTimeRange(s0, 2.0f, 2.0f); func_802EFF50(s0, 1.0f); diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index bbe3b848..b52a5549 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -24,7 +24,7 @@ f32 D_8037DE20[3]; void chBadShad_update(Actor *this){ s32 iVar1; if(!this->initialized){ - this->initialized = 1; + this->initialized = TRUE; this->marker->collidable = 0; } if(!this->despawn_flag && this->unk1C_x < (f32)(globalTimer_getTime() - 1) ){ diff --git a/src/core2/ch/bigbutt.c b/src/core2/ch/bigbutt.c index 8728c25d..325cef14 100644 --- a/src/core2/ch/bigbutt.c +++ b/src/core2/ch/bigbutt.c @@ -121,7 +121,7 @@ void func_802C6240(Actor *this){ this->marker->dieFunc = func_802C61C0; this->marker->collisionFunc = func_802C60AC; this->marker->collision2Func = func_802C6150; - this->unk138_24 = 0; + this->is_first_encounter = FALSE; this->unk16C_0 = 1; this->initialized = TRUE; return; @@ -291,14 +291,14 @@ void func_802C6240(Actor *this){ actor_playAnimationOnce(this); if(actor_animationIsAt(this, 0.95f)){ subaddie_set_state_with_direction(this, 0xe, 0.99f, 1); - this->unk60 = 4.0f; + this->lifetime_value = 4.0f; } break; case 0xe: //L802C6C7C actor_playAnimationOnce(this); - this->unk60 -= time_getDelta(); - if(this->unk60 <= 0.0f){ + this->lifetime_value -= time_getDelta(); + if(this->lifetime_value <= 0.0f){ this->unk166 = 0x63; subaddie_set_state_forward(this, 0xF); } diff --git a/src/core2/ch/bottlesbonus.c b/src/core2/ch/bottlesbonus.c index 335cd15a..d16a62a2 100644 --- a/src/core2/ch/bottlesbonus.c +++ b/src/core2/ch/bottlesbonus.c @@ -436,7 +436,7 @@ void chBottlesBonus_startTimer(s32 arg0, s32 arg1, s32 arg2) { actor = marker_getActor(chBottlesBonusMarker); actor->state = 4; - actor->unk60 = 0.0f; + actor->lifetime_value = 0.0f; timedFunc_set_2(0.25f, item_set, ITEM_6_HOURGLASS, TRUE); timedFunc_set_2(0.25f, item_set, ITEM_0_HOURGLASS_TIMER, D_803681A0[chBottleBonusPuzzleIndex + 1].time_seconds * 60 - 1); } @@ -456,7 +456,7 @@ void chBottlesBonus_update(Actor *this) { if (!this->unk16C_4) { this->unk16C_4 = TRUE; actor_collisionOff(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; D_8037DEB4 = D_8037DEB0 = 0; marker_setFreeMethod(this->marker, chBottlesBonus_free); if (chBottleBonusBookselfModelBin == 0) { @@ -502,11 +502,11 @@ void chBottlesBonus_update(Actor *this) { } } } - this->unk60 += sp50; + this->lifetime_value += sp50; switch(this->state){ case 1: - if ((this->unk60 > 2.0) && gctransition_done()) { - this->unk60 = 0.0f; + if ((this->lifetime_value > 2.0) && gctransition_done()) { + this->lifetime_value = 0.0f; func_8025A6EC(COMUSIC_98_BBONUS_PIECES_SHUFFLE, -1); comusic_8025AB44(COMUSIC_95_BBONUS_A, 0, 2000); func_8025AABC(COMUSIC_95_BBONUS_A); @@ -532,7 +532,7 @@ void chBottlesBonus_update(Actor *this) { case 3: break; case 4: - if (this->unk60 > 2.0) { + if (this->lifetime_value > 2.0) { func_8025AEA0(COMUSIC_94_BBONUS, ((item_getCount(ITEM_0_HOURGLASS_TIMER) * 0x201D2) / (s32) ((D_803681A0[chBottleBonusPuzzleIndex + 1].time_seconds * 60) - 1)) + 330000); if ((item_getCount(ITEM_6_HOURGLASS) == 0) && (chBottlesBonusCursor_isPuzzleCompleted() == 0)) { chBottlesBonus_lose(&D_8037DCC9, 0xE26); @@ -547,7 +547,7 @@ void chBottlesBonus_update(Actor *this) { void __chBottlesBonus_spawn(void){ Actor *actor; if(chBottlesBonusMarker == NULL){ - actor = func_8032813C(0x1E0, D_803682C4, 0); + actor = spawn_actor_f32(0x1E0, D_803682C4, 0); chBottlesBonusMarker = actor->marker; chBottlesBonusCursor_spawn(); func_802DF270(); diff --git a/src/core2/ch/bottlesbonuscursor.c b/src/core2/ch/bottlesbonuscursor.c index 98aac683..d31ddfec 100644 --- a/src/core2/ch/bottlesbonuscursor.c +++ b/src/core2/ch/bottlesbonuscursor.c @@ -168,7 +168,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { } ActorMarker *chBottlesBonusCursor_spawn(void){ - Actor *this = func_8032813C(0x2B4, D_80368400, 0); + Actor *this = spawn_actor_f32(0x2B4, D_80368400, 0); chBottlesBonusCursorMarker = this->marker; return chBottlesBonusCursorMarker; } diff --git a/src/core2/ch/bubble.c b/src/core2/ch/bubble.c index 49b339a6..34c93d50 100644 --- a/src/core2/ch/bubble.c +++ b/src/core2/ch/bubble.c @@ -29,8 +29,8 @@ s32 __chBubble_func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){ this->position_y = arg0[1] - arg1/2; this->position_z = arg0[2]; func_8032AA58(this, arg1/200.0); - this->unk60 -= time_getDelta(); - if(this->unk60 < 0.0f){ + this->lifetime_value -= time_getDelta(); + if(this->lifetime_value < 0.0f){ sp1C = 1; } if(sp1C) @@ -56,6 +56,6 @@ void chBubble_update(Actor *this){ marker_setCollisionScripts(this->marker, __chBubble_collisionCallback, NULL, NULL); marker_setFreeMethod(this->marker, __chBubble_freeCallback); func_802F32C4(func_8032994C(), this->position, 200.0f, this->marker, __chBubble_func_802C5C70); - this->unk60 = 10.0f; + this->lifetime_value = 10.0f; } } diff --git a/src/core2/ch/collectible.c b/src/core2/ch/collectible.c index 8e12fa41..6d5f3cb7 100644 --- a/src/core2/ch/collectible.c +++ b/src/core2/ch/collectible.c @@ -88,7 +88,7 @@ bool chCollectible_collectItem(Actor* actor, enum file_progress_e arg1, enum ass if(!actor || !actor->unk38_0) return TRUE; - actor->unk60 = arg5; + actor->lifetime_value = arg5; chCollectible_setState(actor, 1); return FALSE; } @@ -160,8 +160,8 @@ void chCollectible_update(Actor *this) { switch (this->state) { case 1: - if (this->unk60 > 0.0) { - this->unk60 -= time_getDelta(); + if (this->lifetime_value > 0.0) { + this->lifetime_value -= time_getDelta(); } else { chCollectible_setState(this, 2); } diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index 81f6b17b..5f58b574 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -78,7 +78,7 @@ void __chCrab_ow(ActorMarker *marker, ActorMarker *other) { Actor *this; this = marker_getActor(marker); - this->unk60 = 3.0f; + this->lifetime_value = 3.0f; subaddie_set_state(this, 6); actor_playAnimationOnce(this); if (marker->id == MARKER_13_SNIPPET) { @@ -108,7 +108,7 @@ void __chCrab_emitClawPiece(ParticleEmitter *p_ctrl, f32 position[3], enum asset __chCrab_particleEmitterSetup(p_ctrl, position); particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(p_ctrl, model_id); - func_802EFB70(p_ctrl, 0.5f, 0.8f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.5f, 0.8f); particleEmitter_setAngularVelocityRange(p_ctrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); particleEmitter_emitN(p_ctrl, 2); @@ -118,7 +118,7 @@ void __chCrab_emitLegPiece(ParticleEmitter *p_ctrl, f32 position[3], enum asset_ __chCrab_particleEmitterSetup(p_ctrl, position); particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(p_ctrl, model_id); - func_802EFB70(p_ctrl, 0.5f, 0.8f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.5f, 0.8f); particleEmitter_setAngularVelocityRange(p_ctrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); particleEmitter_emitN(p_ctrl, 6); @@ -128,7 +128,7 @@ void __chCrab_emitHeadPiece(ParticleEmitter *p_ctrl, f32 position[3], enum asset __chCrab_particleEmitterSetup(p_ctrl, position); particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(p_ctrl, model_id); - func_802EFB70(p_ctrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(p_ctrl, 1.0f, 1.0f); particleEmitter_setAngularVelocityRange(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setParticleVelocityRange(p_ctrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); particleEmitter_emitN(p_ctrl, 1); @@ -180,7 +180,7 @@ void __chCrab_die(ActorMarker *marker, ActorMarker *other){ FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 32750, this->position, 950, 1900); FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 28000, this->position, 950, 1900); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); - this->unk60 = 5.0f; + this->lifetime_value = 5.0f; marker->collidable = FALSE; this->unk138_27 = 1; marker_despawn(marker); @@ -239,7 +239,7 @@ void chCrab_update(Actor *this) { marker_setCollisionScripts(this->marker, __chCrab_touch, __chCrab_ow, __chCrab_die); func_803300C0(this->marker, &__chCrab_802CB76C); this->unk124_0 = this->unk138_31 = FALSE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; this->unk16C_4 = TRUE; animctrl_setTransitionDuration(this->animctrl, 0.25f); if (map_get() == MAP_A_TTC_SANDCASTLE) { @@ -273,7 +273,7 @@ void chCrab_update(Actor *this) { func_80311480(ASSET_D32_DIALOG_MUTANT_CRAB_MEET, 0xF, this->position, NULL, __chCrab_mutantTextCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xE, TRUE); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } if (map_get() == MAP_A_TTC_SANDCASTLE) { @@ -292,8 +292,8 @@ void chCrab_update(Actor *this) { } if (levelSpecificFlags_get(0xE)) { if ((this->state != 8) && (this->state != 9)) { - subaddie_set_state_with_direction(this, (this->unk138_24) ? 8 : 9, 0.0f, 1); - this->unk138_24 = FALSE; + subaddie_set_state_with_direction(this, (this->is_first_encounter) ? 8 : 9, 0.0f, 1); + this->is_first_encounter = FALSE; } } @@ -353,8 +353,8 @@ void chCrab_update(Actor *this) { break; case 5: //L802CC0AC - this->unk60 = MAX(0.0, this->unk60 - sp30); - if (this->unk60 == 0.0f) { + this->lifetime_value = MAX(0.0, this->lifetime_value - sp30); + if (this->lifetime_value == 0.0f) { subaddie_set_state(this, 7); actor_playAnimationOnce(this); if (this->marker->id == 0x16B) { @@ -368,7 +368,7 @@ void chCrab_update(Actor *this) { case 6: //L802CC18C if (animctrl_isStopped(this->animctrl)) { - if (this->unk60 == 0.0f) { + if (this->lifetime_value == 0.0f) { func_80326310(this); } else { subaddie_set_state(this, 5); diff --git a/src/core2/ch/drips.c b/src/core2/ch/drips.c index c432aac2..fa749103 100644 --- a/src/core2/ch/drips.c +++ b/src/core2/ch/drips.c @@ -41,8 +41,8 @@ void func_80359A40(f32 position[3], struct_core2_D2AB0 *arg1, s32 cnt){ particleEmitter_setDrawMode(pCtrl, PART_EMIT_ROTATABLE); particleEmitter_setRGB(pCtrl, D_80372AE4); particleEmitter_setPosition(pCtrl, position); - func_802EFB70(pCtrl, 0.1f, 0.1f); - func_802EFB84(pCtrl, 1.0f, 1.4f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.1f); + particleEmitter_setFinalScaleRange(pCtrl, 1.0f, 1.4f); particleEmitter_setSpawnIntervalRange(pCtrl, arg1->unk0, arg1->unk4); particleEmitter_setParticleLifeTimeRange(pCtrl, arg1->unk8, arg1->unkC); particleEmitter_setFade(pCtrl, 0.0f, 0.5f); @@ -72,9 +72,9 @@ void chdrips_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = TRUE; actor_collisionOff(this); - this->unk60 = this->yaw/360.0; + this->lifetime_value = this->yaw/360.0; } - if(__chdrips_playerWithinDist(this, 5000) && randf() < this->unk60){ + if(__chdrips_playerWithinDist(this, 5000) && randf() < this->lifetime_value){ pCtrl = partEmitMgr_newEmitter(1); particleEmitter_setModel(pCtrl, ASSET_8A0_SPRITE_WATER_DROP); particleEmitter_setPosition(pCtrl, this->position); @@ -83,8 +83,8 @@ void chdrips_update(Actor *this){ particleEmitter_setParticleCallback(pCtrl, __chdrips_particleCallback); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 7.0f, 7.0f); - func_802EFB70(pCtrl, 0.1f, 0.1f); - func_802EFB84(pCtrl, 0.1f, 0.1f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.1f); + particleEmitter_setFinalScaleRange(pCtrl, 0.1f, 0.1f); particleEmitter_emitN(pCtrl, 1); } } diff --git a/src/core2/ch/firefx.c b/src/core2/ch/firefx.c index fd3cfbcb..23a385b5 100644 --- a/src/core2/ch/firefx.c +++ b/src/core2/ch/firefx.c @@ -25,8 +25,8 @@ void __chfirefx_spawnSmoke(f32 position[3], f32 scale){ particleEmitter_setPosition(pCtrl, position); particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 110.0f*scale, 0.0f, 0.0f, 110.0f*scale, 0.0f); particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 40.0f*scale, 0.0f, 0.0f, 90.0f*scale, 0.0f); - func_802EFB70(pCtrl, 2.6*scale, 3.2*scale); - func_802EFB84(pCtrl, 5.0*scale, 6.0*scale); + particleEmitter_setStartingScaleRange(pCtrl, 2.6*scale, 3.2*scale); + particleEmitter_setFinalScaleRange(pCtrl, 5.0*scale, 6.0*scale); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 4.0f, 7.0f); particleEmitter_setFade(pCtrl, 0.3f, 0.7f); @@ -44,8 +44,8 @@ void __chfirefx_spawnSpark(f32 position[3], f32 scale){ particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 20.0f*scale, 0.0f, 0.0f, 20.0f*scale, 0.0f); particleEmitter_setParticleVelocityRange(pCtrl, -30.0f*scale, 120.0f*scale, -30.0f*scale, 60.0f*scale, 360.0f*scale, 60.0f*scale); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -50.0f, 0.0f, 0.0f, -90.0f, 0.0f); - func_802EFB70(pCtrl, 0.1*scale, 0.2*scale); - func_802EFB84(pCtrl, 0.2*scale, 0.4*scale); + particleEmitter_setStartingScaleRange(pCtrl, 0.1*scale, 0.2*scale); + particleEmitter_setFinalScaleRange(pCtrl, 0.2*scale, 0.4*scale); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.9f, 1.3f); particleEmitter_setFade(pCtrl, 0.3f, 0.7f); diff --git a/src/core2/ch/flotsam.c b/src/core2/ch/flotsam.c index 7f5f53e7..ea0f1993 100644 --- a/src/core2/ch/flotsam.c +++ b/src/core2/ch/flotsam.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern f32 func_80309724(f32[3]); +extern f32 mapModel_getFloorY(f32[3]); typedef struct { f32 unk0; @@ -261,7 +261,7 @@ void func_8035C8F4(Actor *this){ this->marker->unk14_21 = FALSE; this->marker->actorFreeFunc = func_8035C8C8; marker_setCollisionScripts(this->marker, func_8035C6C4, func_8035C6C4, func_8035C6F0); - local->unk4 = func_80309724(this->position); + local->unk4 = mapModel_getFloorY(this->position); local->pCtrl_8 = NULL; local->unk34[0] = this->yaw; local->unk34[2] = local->unk34[1] = local->unk34[0]; diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index ff84663d..b844bfdd 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -287,7 +287,7 @@ void func_802C4BB4(ActorMarker *marker){ sp20 = marker->id - 0xe4; this = marker_getActor(marker); sp18 = this->scale; - other = func_8032813C(sp20 + 0x198, this->position, (s32)this->yaw); + other = spawn_actor_f32(sp20 + 0x198, this->position, (s32)this->yaw); other->scale = sp18; } diff --git a/src/core2/ch/ghost.c b/src/core2/ch/ghost.c index 18e7f02c..d6767aba 100644 --- a/src/core2/ch/ghost.c +++ b/src/core2/ch/ghost.c @@ -60,8 +60,8 @@ void func_8035AFE0(f32 scale, f32 pos[3], s32 cnt, enum asset_e sprite_id, s32 a -100.0f*scale, -20.0f*scale, -100.0f*scale, 100.0f*scale, 100.0f*scale, 100.0f*scale ); - func_802EFB70(pCtrl, scale*0.4, scale*0.6); - func_802EFB84(pCtrl, scale*1.0, scale*1.4); + particleEmitter_setStartingScaleRange(pCtrl, scale*0.4, scale*0.6); + particleEmitter_setFinalScaleRange(pCtrl, scale*1.0, scale*1.4); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 1.0f, 1.4f); particleEmitter_setFade(pCtrl, 0.0f, 0.01f); @@ -96,7 +96,7 @@ void func_8035B2C4(ActorMarker *this_marker, ActorMarker *other_marker){ void func_8035B3B4(ActorMarker *this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; } int func_8035B3E4(Actor *this){ @@ -208,7 +208,7 @@ void func_8035B900(Actor *this){ this->marker->propPtr->unk8_3 = FALSE; actor_collisionOn(this); this->velocity_z = 0.0f; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->unk1C[0] = this->position_y + this->scale*100.0f; this->velocity_y = this->scale*2.0; this->velocity_x = this->unk1C[0]; @@ -216,8 +216,8 @@ void func_8035B900(Actor *this){ animctrl_setTransitionDuration(this->animctrl, 0.8f); }//L8035B9D4 - if(0.0 < this->unk60 - sp2C){ - this->unk60 -= sp2C; + if(0.0 < this->lifetime_value - sp2C){ + this->lifetime_value -= sp2C; } else{//L8035BA08 switch(this->state){ diff --git a/src/core2/ch/gloop.c b/src/core2/ch/gloop.c index f1a6cf1c..cf460ecb 100644 --- a/src/core2/ch/gloop.c +++ b/src/core2/ch/gloop.c @@ -38,7 +38,7 @@ void chgloop_spawnBubble(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ sp1C[0] = reinterpret_cast(f32, arg0); sp1C[1] = reinterpret_cast(f32, arg1); sp1C[2] = reinterpret_cast(f32, arg2); - func_8032813C(ACTOR_E7_GLOOP_BUBBLE, sp1C, (s32)reinterpret_cast(f32, arg3)); + spawn_actor_f32(ACTOR_E7_GLOOP_BUBBLE, sp1C, (s32)reinterpret_cast(f32, arg3)); } void chgloop_update(Actor *this){ diff --git a/src/core2/ch/icecube.c b/src/core2/ch/icecube.c index ce17a4f7..b0e021f7 100644 --- a/src/core2/ch/icecube.c +++ b/src/core2/ch/icecube.c @@ -114,7 +114,7 @@ void func_8035A04C(f32 position[3], s32 cnt, enum asset_e model_id, f32 scale){ particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f); particleEmitter_setParticleVelocityRange(pCtrl, -400.0f*scale, 450.0f*scale, -400.0f*scale, 400.0f*scale, 600.0f*scale, 400.0f*scale); particleEmitter_setAngularVelocityRange(pCtrl, 100.0f*scale, 100.0f*scale, 100.0f*scale, 250.0f*scale, 250.0f*scale, 250.0f*scale); - func_802EFB70(pCtrl, scale*0.2, scale*0.4); + particleEmitter_setStartingScaleRange(pCtrl, scale*0.2, scale*0.4); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f); particleEmitter_setParticleLifeTimeRange(pCtrl, 2.2f, 2.2f); particleEmitter_setFade(pCtrl, 0.0f, 0.3f); @@ -130,8 +130,8 @@ void func_8035A228(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){ particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f*scale, 0.0f, -50.0f*scale, 50.0f*scale, 200.0f*scale, 50.0f*scale); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f); particleEmitter_setParticleVelocityRange(pCtrl, -280.0f*scale, 0.0f, -280.0f*scale, 280.0f*scale, 280.0f*scale, 280.0f*scale); - func_802EFB70(pCtrl, scale*0.6, scale*0.8); - func_802EFB84(pCtrl, scale*1.0, scale*1.4); + particleEmitter_setStartingScaleRange(pCtrl, scale*0.6, scale*0.8); + particleEmitter_setFinalScaleRange(pCtrl, scale*1.0, scale*1.4); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 1.2f, 1.8f); particleEmitter_setFade(pCtrl, 0.0f, 0.01f); @@ -146,8 +146,8 @@ void func_8035A3F8(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){ particleEmitter_setPosition(pCtrl, position); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f); particleEmitter_setParticleVelocityRange(pCtrl, -60.0f*scale, 0.0f, -60.0f*scale, 60.0f*scale, 60.0f*scale, 60.0f*scale); - func_802EFB70(pCtrl, scale*0.4, scale*0.6); - func_802EFB84(pCtrl, scale*0.8, scale*1.2); + particleEmitter_setStartingScaleRange(pCtrl, scale*0.4, scale*0.6); + particleEmitter_setFinalScaleRange(pCtrl, scale*0.8, scale*1.2); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.5f, 0.7f); particleEmitter_setFade(pCtrl, 0.0f, 0.3f); @@ -276,11 +276,11 @@ void chicecube_update(Actor *this){ this->alpha_124_19 = 0x50; actor_setOpacity(this, this->alpha_124_19); this->unk38_31 = 0; - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; }//L8035ABC0 - if(this->unk60 <= 0.0){ - if(-99999.0 != this->unk60){ - this->unk60 = -99999.0f; + if(this->lifetime_value <= 0.0){ + if(-99999.0 != this->lifetime_value){ + this->lifetime_value = -99999.0f; actor_collisionOn(this); this->unk1C[0] =this->position[0]; this->unk1C[1] =this->position[1]; @@ -289,7 +289,7 @@ void chicecube_update(Actor *this){ } } else{//L8035AC3C - this->unk60 -= sp3C; + this->lifetime_value -= sp3C; } if(0.0 >= this->velocity[1]){ diff --git a/src/core2/ch/jigsawdance.c b/src/core2/ch/jigsawdance.c index 26aee375..3d5a6964 100644 --- a/src/core2/ch/jigsawdance.c +++ b/src/core2/ch/jigsawdance.c @@ -30,7 +30,7 @@ Actor *__chJigsawDance_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3 Actor *thisActor = marker_getActor(this); if(!thisActor->initialized){ - thisActor->initialized = 1; + thisActor->initialized = TRUE; return thisActor; } else{ diff --git a/src/core2/ch/jinjo.c b/src/core2/ch/jinjo.c index 1ede67d8..4d4e88be 100644 --- a/src/core2/ch/jinjo.c +++ b/src/core2/ch/jinjo.c @@ -104,7 +104,7 @@ void chJinjo_update(Actor * this){ local = &this->jinjo; if(!this->initialized){ - this->initialized = 1; + this->initialized = TRUE; local->unk0 = 1; local->unk4 = 0; local->unk8 = (this->position_y < func_80309B24(this->position)); diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index 1446d240..adcc2533 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -163,9 +163,9 @@ void chmole_healthRefill(ActorMarker *marker, enum asset_e arg1, s32 arg2){ func_80311480(chmole_learnedAllGameAbilities()? 0xa87 : chmole_learnedAllLevelAbilitiesDialog(), 7, 0, actor->marker, chmole_healthRefill, NULL); } else{//L802D97BC - if(actor->unk138_24){ + if(actor->is_first_encounter){ func_80347A14(1); - actor->unk138_24 = FALSE; + actor->is_first_encounter = FALSE; } timed_exitStaticCamera(0.0f); if(actor->state == 5){ @@ -229,7 +229,7 @@ int chmole_learnAbility(Actor *this){ // New Ability: Learn Dialog & Misc Actions else{ func_80347A14(0); - this->unk138_24 = 1; + this->is_first_encounter = TRUE; sp2C = moleTable[this->unkF4_8-9].learn_text; ability_unlock(moleTable[this->unkF4_8-9].ability); switch(moleTable[this->unkF4_8-9].ability){ diff --git a/src/core2/ch/overlaycopyright.c b/src/core2/ch/overlaycopyright.c index be9169de..bbe04271 100644 --- a/src/core2/ch/overlaycopyright.c +++ b/src/core2/ch/overlaycopyright.c @@ -34,7 +34,7 @@ void chOverlayCopyright_update(Actor *this){ void __chOverlayCopyright_spawn(void) { Actor *actor; if (chOverlayCopyrightMarker == 0) { - actor = func_8032813C(ACTOR_1DD_COPYRIGHT_OVERLAY, D_803680D0, 0); + actor = spawn_actor_f32(ACTOR_1DD_COPYRIGHT_OVERLAY, D_803680D0, 0); chOverlayCopyrightMarker = actor->marker; } } diff --git a/src/core2/ch/overlaynocontroller.c b/src/core2/ch/overlaynocontroller.c index 1b68e459..41f715f9 100644 --- a/src/core2/ch/overlaynocontroller.c +++ b/src/core2/ch/overlaynocontroller.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern Actor *func_8032813C(enum actor_e, f32[3], s32); +extern Actor *spawn_actor_f32(enum actor_e, f32[3], s32); extern void actor_postdrawMethod(ActorMarker *marker); Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); @@ -73,7 +73,7 @@ void chOverlayNoController_update(Actor *this) { void __chOverlayNoController_spawn(void){ if(chOverlayNoController_marker == NULL){ - chOverlayNoController_marker = func_8032813C(ACTOR_1DF_NO_CONTROLLER_OVERLAY, D_80368168, 0)->marker; + chOverlayNoController_marker = spawn_actor_f32(ACTOR_1DF_NO_CONTROLLER_OVERLAY, D_80368168, 0)->marker; } } diff --git a/src/core2/ch/overlaypressstart.c b/src/core2/ch/overlaypressstart.c index 68722cc3..ef9de934 100644 --- a/src/core2/ch/overlaypressstart.c +++ b/src/core2/ch/overlaypressstart.c @@ -5,7 +5,7 @@ extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32); extern void actor_predrawMethod(Actor *); extern void actor_postdrawMethod(ActorMarker *); -extern Actor *func_8032813C(enum actor_e id, f32[3], s32); +extern Actor *spawn_actor_f32(enum actor_e id, f32[3], s32); Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); @@ -69,7 +69,7 @@ void chOverlayPressStart_func_802DCC78(ActorMarker *this){ void chOverlayPressStart_update(Actor *this){ if(!this->initialized){ - this->initialized = 1; + this->initialized = TRUE; this->depth_mode = MODEL_RENDER_DEPTH_NONE; actor_collisionOff(this); subaddie_set_state_with_direction(this, 1, 0.0f, 1); @@ -85,7 +85,7 @@ void chOverlayPressStart_update(Actor *this){ void __chOverlayPressStart_spawn(void){ if(D_8037DE80 == NULL){ - D_8037DE80 = func_8032813C(ACTOR_1DE_PRESS_START_OVERLAY, D_80368118, 0)->marker; + D_8037DE80 = spawn_actor_f32(ACTOR_1DE_PRESS_START_OVERLAY, D_80368118, 0)->marker; } } diff --git a/src/core2/ch/shrapnel.c b/src/core2/ch/shrapnel.c index ef741ee9..339e51ed 100644 --- a/src/core2/ch/shrapnel.c +++ b/src/core2/ch/shrapnel.c @@ -50,7 +50,7 @@ void chShrapnel_func_802D0AB8(Actor *this) { void chShrapnel_spawnExplodeActor(s32 arg0){ Actor *this = reinterpret_cast(Actor *, arg0); - func_8032813C(0xF3, this->unk1C, 0); + spawn_actor_f32(0xF3, this->unk1C, 0); } void chShrapnel_emitExplosion(Actor *this) { @@ -65,8 +65,8 @@ void chShrapnel_emitExplosion(Actor *this) { particleEmitter_setParticleFramerateRange(temp_v0, 4.0f, 4.0f); particleEmitter_setParticleSpawnPositionRange(temp_v0, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); particleEmitter_setPosition(temp_v0, this->position); - func_802EFB70(temp_v0, 3.0f, 3.0f); - func_802EFB84(temp_v0, 8.0f, 8.0f); + particleEmitter_setStartingScaleRange(temp_v0, 3.0f, 3.0f); + particleEmitter_setFinalScaleRange(temp_v0, 8.0f, 8.0f); particleEmitter_setParticleLifeTimeRange(temp_v0, 0.5f, 0.5f); particleEmitter_setParticleVelocityRange(temp_v0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); particleEmitter_emitN(temp_v0, 1); @@ -81,8 +81,8 @@ void chShrapnel_emitSmoke(Actor *this) { particleEmitter_setFade(temp_v0, 0.05f, 0.1f); particleEmitter_setStartingFrameRange(temp_v0, 0, 7); particleEmitter_setPosition(temp_v0, this->position); - func_802EFB70(temp_v0, 1.0f, 1.5f); - func_802EFB84(temp_v0, 2.0f, 3.0f); + particleEmitter_setStartingScaleRange(temp_v0, 1.0f, 1.5f); + particleEmitter_setFinalScaleRange(temp_v0, 2.0f, 3.0f); particleEmitter_setParticleSpawnPositionRange(temp_v0, -75.0f, 25.0f, -75.0f, 75.0f, 75.0f, 75.0f); particleEmitter_setParticleVelocityRange(temp_v0, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f); particleEmitter_setRGB(temp_v0, D_803673F8); @@ -99,7 +99,7 @@ void chShrapnel_emitBodyParts(Actor *this, enum asset_e model_id, s32 n) { func_802EFA18(temp_v0, 1); particleEmitter_setModel(temp_v0, model_id); particleEmitter_setPosition(temp_v0, this->position); - func_802EFB70(temp_v0, 0.05f, 2.0f); + particleEmitter_setStartingScaleRange(temp_v0, 0.05f, 2.0f); particleEmitter_setAngularVelocityRange(temp_v0, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setSpawnIntervalRange(temp_v0, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(temp_v0, 10.0f, 10.0f); @@ -147,15 +147,15 @@ void chshrapnel_update(Actor *this) { this->unk4C = 0.0f; } chShrapnel_func_802D0FC8(this); - this->unk60 += tick; - if (M_PI <= this->unk60) { - this->unk60 -= M_PI; + this->lifetime_value += tick; + if (M_PI <= this->lifetime_value) { + this->lifetime_value -= M_PI; } this->unk1C[0] = this->position[0]; this->unk1C[1] = this->position[1]; this->unk1C[2] = this->position[2]; this->unk1C[1] = func_80309B24(this->position) - 15.0f; - this->position[1] = this->unk1C[1] - (sinf(this->unk60 * 4.0f) * 10.0f); + this->position[1] = this->unk1C[1] - (sinf(this->lifetime_value * 4.0f) * 10.0f); _player_getPosition(player_position); switch (this->state) { case 1: diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index 04580d32..65b81e93 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -79,12 +79,12 @@ static void __chsnacker_start_dialog(Actor *this) { this->unk28 = 0.0f; if (level_get() == LEVEL_2_TREASURE_TROVE_COVE) { text_index = mapSpecificFlags_getN(8, 3); - if( !this->unk138_24 ) { + if( !this->is_first_encounter ) { if(text_index < 4) { if(func_80311480(0xA1B + text_index, 0, NULL, NULL, NULL, NULL)){ text_index++; mapSpecificFlags_setN(8, text_index, 3); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } } @@ -99,7 +99,7 @@ bool func_802E0DC0(f32 snacker_position[3]){ player_getPosition(player_position); return (4000000.0f < ml_distanceSquared_vec3f(player_position, snacker_position)) - || ( (snacker_position[1] - func_80309724(snacker_position) < 70.0f) && (func_80309B24(snacker_position) - snacker_position[1] < 70.0f)); + || ( (snacker_position[1] - mapModel_getFloorY(snacker_position) < 70.0f) && (func_80309B24(snacker_position) - snacker_position[1] < 70.0f)); } void func_802E0E88(Actor *this){ @@ -359,7 +359,7 @@ void chSnacker_spawn(void) { } } - snacker = func_8032813C(ACTOR_68_SNACKER, spawn_position, 0); + snacker = spawn_actor_f32(ACTOR_68_SNACKER, spawn_position, 0); s_chSnacker_marker = snacker->marker; local = (ChSnackerLocal *)&snacker->local; diff --git a/src/core2/ch/snowball.c b/src/core2/ch/snowball.c index 93185b8a..795c0b88 100644 --- a/src/core2/ch/snowball.c +++ b/src/core2/ch/snowball.c @@ -122,7 +122,7 @@ void chSnowball_update(Actor *this) { this->velocity[1] = (sp58[1] - this->position[1])/32 - -32.0f; this->velocity[2] = (sp58[2] - this->position[2])/32; local->unk4 = 0; - this->unk60 = 6.0f; + this->lifetime_value = 6.0f; } switch (this->state) { case 1: @@ -150,8 +150,8 @@ void chSnowball_update(Actor *this) { } } local->unk4++; - if (this->unk60 > 0.0) { - this->unk60 -= time_getDelta(); + if (this->lifetime_value > 0.0) { + this->lifetime_value -= time_getDelta(); } else { marker_despawn(this->marker); } diff --git a/src/core2/ch/snowmanhat.c b/src/core2/ch/snowmanhat.c index ad398225..3ed3d24b 100644 --- a/src/core2/ch/snowmanhat.c +++ b/src/core2/ch/snowmanhat.c @@ -26,7 +26,7 @@ void chSnowmanHat_update(Actor *this){ if( 360.0f <= this->pitch) this->pitch -= 360.0f; - if(this->position_y <= func_80309724(this->position)){ + if(this->position_y <= mapModel_getFloorY(this->position)){ subaddie_set_state(this, 2); FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 32750, this->position, 2250, 4500); } diff --git a/src/core2/ch/soundsource.c b/src/core2/ch/soundsource.c index 6be92dee..a83829d0 100644 --- a/src/core2/ch/soundsource.c +++ b/src/core2/ch/soundsource.c @@ -110,7 +110,7 @@ void func_802D096C(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ sp1C[0] = reinterpret_cast(f32, arg0); sp1C[1] = reinterpret_cast(f32, arg1); sp1C[2] = reinterpret_cast(f32, arg2); - func_8032813C(0x28B, sp1C, arg3); + spawn_actor_f32(0x28B, sp1C, arg3); } diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 3476e1e4..88696d42 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -81,7 +81,7 @@ void __chTermite_emitLegs(ParticleEmitter *pCtrl, f32 position[3]){ __chTermite_setupParticleEmitter(pCtrl, position); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(pCtrl, ASSET_393_MODEL_TERMITE_LEG); - func_802EFB70(pCtrl, 0.5f, 0.8f); + particleEmitter_setStartingScaleRange(pCtrl, 0.5f, 0.8f); particleEmitter_setAngularVelocityRange(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); particleEmitter_setParticleVelocityRange(pCtrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); particleEmitter_emitN(pCtrl, 6); @@ -91,7 +91,7 @@ void __chTermite_emitHead(ParticleEmitter *pCtrl, f32 position[3]){ __chTermite_setupParticleEmitter(pCtrl, position); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(pCtrl, ASSET_394_MODEL_TERMITE_HEAD); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_setAngularVelocityRange(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); particleEmitter_emitN(pCtrl, 1); @@ -101,7 +101,7 @@ void __chTermite_emitBody(ParticleEmitter *pCtrl, f32 position[3]){ __chTermite_setupParticleEmitter(pCtrl, position); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(pCtrl, ASSET_395_MODEL_TERMITE_BODY); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_setAngularVelocityRange(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); particleEmitter_emitN(pCtrl, 1); @@ -111,7 +111,7 @@ void __chTermite_emitEyes(ParticleEmitter *pCtrl, f32 position[3]){ __chTermite_setupParticleEmitter(pCtrl, position); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1400.0f, 0.0f, 0.0f, -1400.0f, 0.0f); particleEmitter_setModel(pCtrl, ASSET_396_MODEL_TERMITE_EYES); - func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 1.0f, 1.0f); particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); particleEmitter_setParticleVelocityRange(pCtrl, -80.0f, 400.0f, -80.0f, 160.0f, 860.0f, 160.0f); particleEmitter_emitN(pCtrl, 2); @@ -141,7 +141,7 @@ void __chTermite_testCallback(ActorMarker *caller, enum asset_e text_id, s32 arg Actor *this; this = marker_getActor(caller); - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; levelSpecificFlags_set(0xd, FALSE); } @@ -154,7 +154,7 @@ void chTermite_update(Actor *this) { if (!this->unk16C_4) { marker_setCollisionScripts(this->marker, NULL, __chTermite_ow, __chTermite_die); this->unk124_0 = this->unk138_31 = FALSE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; this->unk16C_0 = TRUE; this->unk16C_4 = TRUE; } @@ -168,7 +168,7 @@ void chTermite_update(Actor *this) { func_80311480(ASSET_B43_DIALOG_TERMITE_MEET_AS_BEAR, 7, this->position, this->marker, __chTermite_testCallback, NULL); mapSpecificFlags_set(0, TRUE); levelSpecificFlags_set(0xD, TRUE); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } if( func_80329530(this, 300) diff --git a/src/core2/ch/whipcrack.c b/src/core2/ch/whipcrack.c index bed46ae7..dc5f5602 100644 --- a/src/core2/ch/whipcrack.c +++ b/src/core2/ch/whipcrack.c @@ -32,7 +32,7 @@ void __chwhipcrack_spawnPieces(Actor *this, enum asset_e model_id, s32 cnt){ 120.0f, 300.0f, 120.0f ); particleEmitter_setPosition(pCtrl, this->position); - func_802EFB70(pCtrl, 0.5f, 1.0f); + particleEmitter_setStartingScaleRange(pCtrl, 0.5f, 1.0f); particleEmitter_setAngularVelocityRange(pCtrl, -500.0f, -500.0f, -500.0f, 500.0f, 500.0f, 500.0f @@ -52,8 +52,8 @@ void __chwhipcrack_spawnSmoke(Actor *this, s32 cnt){ particleEmitter_setFade(pCtrl, 0.05f, 0.1f); particleEmitter_setStartingFrameRange(pCtrl, 0, 7); particleEmitter_setPosition(pCtrl, this->position); - func_802EFB70(pCtrl, 3.0f, 3.5f); - func_802EFB84(pCtrl, 4.5f, 5.5f); + particleEmitter_setStartingScaleRange(pCtrl, 3.0f, 3.5f); + particleEmitter_setFinalScaleRange(pCtrl, 4.5f, 5.5f); particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f, 50.0f, -50.0f, 50.0f, 200.0f, 50.0f diff --git a/src/core2/code_16010.c b/src/core2/code_16010.c index 8c273be4..e4ecf392 100644 --- a/src/core2/code_16010.c +++ b/src/core2/code_16010.c @@ -51,9 +51,9 @@ void func_8029D0D8(void) { } void func_8029D154(void){ - f32 sp1C[3]; - player_getPosition(sp1C); - func_8032813C(0x188, sp1C, (s32)yaw_get()); + f32 plyr_pos[3]; + player_getPosition(plyr_pos); + spawn_actor_f32(0x188, plyr_pos, (s32)yaw_get()); } void func_8029D194(void) { diff --git a/src/core2/code_3EC30.c b/src/core2/code_3EC30.c index 7cab4ad9..dfccd932 100644 --- a/src/core2/code_3EC30.c +++ b/src/core2/code_3EC30.c @@ -11,14 +11,14 @@ ActorInfo D_80365FB0 = { 0x65, 0xF3, 0x0, 0x0, 0x0, func_802C5BC0, func_80326224 void func_802C5BC0(Actor *this){ if(!this->initialized){ actor_collisionOff(this); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->pitch = 90.0f; fxRipple_802F3554(4, this->position); this->initialized = TRUE; } else{ - this->unk60 += time_getDelta(); - if(2.0 < this->unk60) + this->lifetime_value += time_getDelta(); + if(2.0 < this->lifetime_value) marker_despawn(this->marker); } } diff --git a/src/core2/code_400F0.c b/src/core2/code_400F0.c index f90fe837..aa202841 100644 --- a/src/core2/code_400F0.c +++ b/src/core2/code_400F0.c @@ -70,10 +70,10 @@ void func_802C70DC(Actor *actor, Struct_Core2_400F0_0 * arg1, s32 arg2){ tmp_f20 = time_getDelta(); while(0.0f < tmp_f20){ - actor->unk60 -= tmp_f20; - if(0.0f < actor->unk60) + actor->lifetime_value -= tmp_f20; + if(0.0f < actor->lifetime_value) break; - tmp_f20 = mlAbsF(actor->unk60); + tmp_f20 = mlAbsF(actor->lifetime_value); s0 = &arg1[actor->unk154]; func_802C7080(actor, s0->unk4, s0->unk8, s0->unkC); s0++; @@ -91,7 +91,7 @@ void func_802C70DC(Actor *actor, Struct_Core2_400F0_0 * arg1, s32 arg2){ actor->unk154++; } //L802C71B8 - actor->unk60 = s0->unk0; + actor->lifetime_value = s0->unk0; }//L802C71CC } @@ -124,7 +124,7 @@ void func_802C7318(Actor *actor){ local->unk0[i] = 0.0f; local->unk8[i] = 0.0f; } - actor->unk60 = 0.0f; + actor->lifetime_value = 0.0f; actor->unk154 = 0; actor->unk124_5 = 0; reinterpret_cast(s32, actor->unkBC) = 1; @@ -194,7 +194,7 @@ void func_802C7568(enum actor_e actor_id, s32 arg1, f32 arg2){ void func_802C75A0(Actor *actor, s32 arg1){ actor->unk124_5 = arg1; actor->unk154 = 0; - actor->unk60 = 0.0f; + actor->lifetime_value = 0.0f; } void func_802C75C8(enum actor_e actor_id, s32 arg1){ diff --git a/src/core2/code_41460.c b/src/core2/code_41460.c index ba7b1705..b82a3605 100644 --- a/src/core2/code_41460.c +++ b/src/core2/code_41460.c @@ -166,7 +166,7 @@ Actor *func_802C8580(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ sp68[2] = (f32)position[2]; sp68[0] += s0->unk30[0]*3.0f; - s0->unk50 = func_80309724(&sp68); + s0->unk50 = mapModel_getFloorY(&sp68); s0->unk14[2] = 0.0f; s0->unk14[1] = 0.0f; diff --git a/src/core2/code_41FB0.c b/src/core2/code_41FB0.c index 81fc5a4a..76bb1e53 100644 --- a/src/core2/code_41FB0.c +++ b/src/core2/code_41FB0.c @@ -153,7 +153,7 @@ Actor *func_802C8FE4(s32 arg0, f32 position[3], Actor *arg2){ D_8037DDB4 += 360.0/sp74->count; while(360.0 <= D_8037DDB4){ D_8037DDB4 -= 360.0;} //L802C9114 - actor =(i == 0 && arg2) ? arg2 : func_8032813C(sp74->actor_id, position, 0); + actor =(i == 0 && arg2) ? arg2 : spawn_actor_f32(sp74->actor_id, position, 0); actor->unk10_0 = 1; s0 = (struct41FB0s_1 *) &actor->unkBC; s0->unk0 = arg0; diff --git a/src/core2/code_42CB0.c b/src/core2/code_42CB0.c index 5aff03d2..b35d28c8 100644 --- a/src/core2/code_42CB0.c +++ b/src/core2/code_42CB0.c @@ -98,7 +98,7 @@ void chHoneycomb_update(Actor *this){ int i; if(!this->initialized){ - this->unk60 = (randf() < 0.5) ? 200.0 : -200.0; + this->lifetime_value = (randf() < 0.5) ? 200.0 : -200.0; this->initialized = TRUE; if( this->marker->id == MARKER_53_EMPTY_HONEYCOMB){ if(local->uid == 0) @@ -146,7 +146,7 @@ void chHoneycomb_update(Actor *this){ } } - this->yaw += time_getDelta()*this->unk60; + this->yaw += time_getDelta()*this->lifetime_value; if(360.0f <= this->yaw) this->yaw -= 360.0f; if(this->yaw < 0.0f) this->yaw += 360.0f; diff --git a/src/core2/code_45310.c b/src/core2/code_45310.c index 035e941b..a592d0c8 100644 --- a/src/core2/code_45310.c +++ b/src/core2/code_45310.c @@ -313,7 +313,7 @@ void func_802CCC5C(Actor *this) { local->unk30[0] = (s16) this->position[0]; local->unk30[1] = (s16) this->position[1]; local->unk30[2] = (s16) this->position[2]; - local->unk30[1] = (s16) func_80309724(this->position); + local->unk30[1] = (s16) mapModel_getFloorY(this->position); temp_f0 = func_80309B24(this->position); if (local->unk30[1] < temp_f0) { local->unk30[1] = (s16) (s32) temp_f0; @@ -500,8 +500,8 @@ void func_802CCC5C(Actor *this) { this->position[2] = this->position[2] + sp40[2]; this->position[1] += local->unk36 * spB8; local->unk36 -= 3000.0f * spB8; - if (this->position[1] < func_80309724(this->position)) { - this->position[1] = func_80309724(this->position); + if (this->position[1] < mapModel_getFloorY(this->position)) { + this->position[1] = mapModel_getFloorY(this->position); skeletalAnim_set(this->unk148, 0x111, 0.1f, 1.0f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_2_ONCE); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index 70dddc93..953f3b43 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -288,7 +288,7 @@ void chBeeSwarm_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3]) particleEmitter_setFade(p_ctrl, 0.0f, 0.65f); particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); particleEmitter_setModel(p_ctrl,this->marker->modelId); - func_802EFB70(p_ctrl, 0.25f, 0.25f); + particleEmitter_setStartingScaleRange(p_ctrl, 0.25f, 0.25f); particleEmitter_setAngularVelocityRange(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setParticleVelocityRange(p_ctrl, -300.0f, 750.0f, -300.0f, 300.0f, 900.0f, 300.0f); particleEmitter_emitN(p_ctrl, 1); @@ -376,7 +376,7 @@ void chBeeSwarm_update(Actor *this) { fileProgressFlag_set(FILEPROG_D_BEEHIVE_TEXT, TRUE); } subaddie_set_state(this, (this->unk100 != NULL) ? 1 : 2); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; chBeeSwarm_802CF040(this); this->unk38_0 = volatileFlag_get(VOLATILE_FLAG_1) | volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE); } @@ -479,18 +479,18 @@ void chBeeSwarm_update(Actor *this) { break; case 4: spB4[1] += 50.0f; - this->unk60 += dt; - if ((this->unk60 - 0.5 > 0.0) && (local->unk0 > 0) && (func_8028ECAC() != 3)) { + this->lifetime_value += dt; + if ((this->lifetime_value - 0.5 > 0.0) && (local->unk0 > 0) && (func_8028ECAC() != 3)) { func_8028F504(0xD); - this->unk60 -= 0.5; + this->lifetime_value -= 0.5; } - if ((this->unk60 > 0.2) && (func_8028ECAC() == 3)) { + if ((this->lifetime_value > 0.2) && (func_8028ECAC() == 3)) { if (local->unk0-- > 0) { sp68[0] = local->unk8[local->unk0].unk0[0] + this->position[0]; sp68[1] = local->unk8[local->unk0].unk0[1] + this->position[1]; sp68[2] = local->unk8[local->unk0].unk0[2] + this->position[2]; chBeeSwarm_802CF610(this, partEmitMgr_newEmitter(1), sp68); - this->unk60 -= 0.2; + this->lifetime_value -= 0.2; } } if (local->unk0 == 0) { diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index f668bae9..09f6ffcf 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -160,7 +160,7 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3 break; case ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE: //L802D1A98 - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; if(this->unk38_31 != 0){ func_8025A6EC(COMUSIC_2B_DING_B, 28000); item_adjustByDiffWithHud(ITEM_1C_MUMBO_TOKEN, -this->unk38_31); @@ -229,12 +229,12 @@ void chMumbo_update(Actor *this) { if(!this->initialized){ this->initialized = TRUE; this->marker->propPtr->unk8_3 = FALSE; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; if (chMumbo_func_802D181C(0x201)) { - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; subaddie_set_state(this, 7U); } else if (chMumbo_func_802D181C(0x202)) { - this->unk60 = 2.0f; + this->lifetime_value = 2.0f; subaddie_set_state(this, 8U); } } @@ -249,7 +249,7 @@ void chMumbo_update(Actor *this) { } this->unk38_0 = (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); this->unk10_12 = 0; - this->unk138_24 = 0; + this->is_first_encounter = FALSE; this->unk16C_4 = TRUE; } @@ -333,7 +333,7 @@ void chMumbo_update(Actor *this) { ) { func_80311480(ASSET_DAE_DIALOG_MUMBO_TREX_START, 6, NULL, this->marker, __chMumbo_textCallback, NULL); fileProgressFlag_set(FILEPROG_BA_HAS_SEEN_TREX_TEXT, 1); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; subaddie_set_state(this, 3); } else if ( sp44 @@ -385,7 +385,7 @@ void chMumbo_update(Actor *this) { } if (actor_animationIsAt(this, 0.01f)) { - if ( this->unk138_24 + if ( this->is_first_encounter || (this->unk10_12 == 0 && (player_getTransformation() != TRANSFORM_1_BANJO) && (player_getTransformation() != TRANSFORM_7_WISHWASHY)) @@ -407,7 +407,7 @@ void chMumbo_update(Actor *this) { func_8025A58C(-1, 1000); } if (actor_animationIsAt(this, 0.999f)) { - if (!this->unk138_24) { + if (!this->is_first_encounter) { func_8028F918(0); } func_8025A7DC(COMUSIC_1D_MUMBO_TRANSFORMATION); @@ -416,7 +416,7 @@ void chMumbo_update(Actor *this) { chMumbo_func_802D1B8C(this, D_8037DDF0); break; } - if (this->unk138_24) { + if (this->is_first_encounter) { subaddie_set_state(this, 3); func_80311480(ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 6, NULL, this->marker, __chMumbo_textCallback, NULL); break; @@ -483,11 +483,11 @@ Actor *chMumbo_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { f32 sp44[3]; f32 sp38[3] = D_80367510; - func_8033A45C(4, (this->unk60 == 0.0f)); - func_8033A45C(5, (this->unk60 == 1.0f)); - func_8033A45C(6, (this->unk60 == 0.0f)); - func_8033A45C(7, (this->unk60 == 1.0f)); - func_8033A45C(8, (this->unk60 == 2.0f)); + func_8033A45C(4, (this->lifetime_value == 0.0f)); + func_8033A45C(5, (this->lifetime_value == 1.0f)); + func_8033A45C(6, (this->lifetime_value == 0.0f)); + func_8033A45C(7, (this->lifetime_value == 1.0f)); + func_8033A45C(8, (this->lifetime_value == 2.0f)); func_8033A45C(9, 0); out = actor_draw(marker, gfx, mtx, vtx); if( marker->unk14_21 && out->state == 8){ diff --git a/src/core2/code_4BE10.c b/src/core2/code_4BE10.c index b19475f8..45559030 100644 --- a/src/core2/code_4BE10.c +++ b/src/core2/code_4BE10.c @@ -29,8 +29,8 @@ void func_802D2DA0(Actor *this) { if (--this->unk38_31 == 0) { marker_despawn(this->marker); } - pCtrl = partEmitMgr_newEmitter((s32) this->unk60); - for(phi_s6 = 0; phi_s6 < (s32)this->unk60; phi_s6++){ + pCtrl = partEmitMgr_newEmitter((s32) this->lifetime_value); + for(phi_s6 = 0; phi_s6 < (s32)this->lifetime_value; phi_s6++){ for(i = 0; i < 3; i++){ sp70[i] = this->position[i] + randf()*2*this->unkF4_8 - ((i == 1)? 0: this->unkF4_8); } diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 899f9f31..ae830036 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -167,7 +167,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) { FUNC_8030E624(SFX_82_METAL_BREAK, 0.7f, 32736); FUNC_8030E624(SFX_82_METAL_BREAK, 0.6f, 32736); func_802D2FB0(sp2C, 0x14, -0x1E, 0x190, 3.0f, 0x15E, 0x50, 0x96); - sp2C->unk60 = 1.0f; + sp2C->lifetime_value = 1.0f; fileProgressFlag_set(FILEPROG_A5_LAIR_CRYPT_GATE_OPEN, 1); break; diff --git a/src/core2/code_509D0.c b/src/core2/code_509D0.c index 82a3bcf4..82674786 100644 --- a/src/core2/code_509D0.c +++ b/src/core2/code_509D0.c @@ -77,8 +77,8 @@ void __chLevelCollectible_presentCollectEmitSparkles(f32 position[3], enum asset particleEmitter_setParticleAccelerationRange(p_emitter, 0.0f, -250.0f, 0.0f, 0.0f, -250.0f, 0.0f); particleEmitter_setParticleVelocityRange(p_emitter, -100.0f, 200.0f, -100.0f, 100.0f, 350.0f, 100.0f); particleEmitter_setAngularVelocityRange(p_emitter, 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 240.0f); - func_802EFB70(p_emitter, 0.47f, 0.47f); - func_802EFB84(p_emitter, 0.03f, 0.03f); + particleEmitter_setStartingScaleRange(p_emitter, 0.47f, 0.47f); + particleEmitter_setFinalScaleRange(p_emitter, 0.03f, 0.03f); particleEmitter_setFade(p_emitter, 0.4f, 0.8f); particleEmitter_setParticleLifeTimeRange(p_emitter, 0.9f, 0.9f); particleEmitter_emitN(p_emitter, 8); diff --git a/src/core2/code_517A0.c b/src/core2/code_517A0.c index 9897bd4d..61fdd80d 100644 --- a/src/core2/code_517A0.c +++ b/src/core2/code_517A0.c @@ -44,7 +44,7 @@ void func_802D8730(Actor *this) { if (this->velocity_y < 0.0f) { this->velocity_y = 0.07f; pCtrl = func_802F4094(this->position, 40.0f); - func_802EFB70(pCtrl, 0.05f, 0.06f); + particleEmitter_setStartingScaleRange(pCtrl, 0.05f, 0.06f); particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -3400.0f, 0.0f, 0.0f, -3400.0f, 0.0f); particleEmitter_setRGB(pCtrl, D_80367C84); particleEmitter_setParticleVelocityRange(pCtrl, -180.0f, 200.0f, -180.0f, 180.0f, 400.0f, 180.0f); diff --git a/src/core2/code_51950.c b/src/core2/code_51950.c index 039e21d2..09405d4d 100644 --- a/src/core2/code_51950.c +++ b/src/core2/code_51950.c @@ -47,7 +47,7 @@ void func_802D88E0(Actor *this) { if (this->position_y > -16000.0f) { this->position_y += this->unk1C[1]; } - if (this->unk60 > 0.5) { + if (this->lifetime_value > 0.5) { pCtrl = partEmitMgr_newEmitter(1U); for(i = 0; i < 3; i++){ sp5C[i] = this->position[i] + (randf()*2)*25 - ((i == 1) ? 0 : 25); @@ -59,13 +59,13 @@ void func_802D88E0(Actor *this) { func_802EFF50(pCtrl, 1.0f); particleEmitter_setSpawnInterval(pCtrl, 0.25f); } - this->unk60 -= time_getDelta(); - if (this->unk60 < 0.0f) { + this->lifetime_value -= time_getDelta(); + if (this->lifetime_value < 0.0f) { marker_despawn(this->marker); return; } - temp_f10 = (s32) ml_map_f(this->unk60, 0.0f, 0.3f, 0.0f, 255.0f); + temp_f10 = (s32) ml_map_f(this->lifetime_value, 0.0f, 0.3f, 0.0f, 255.0f); actor_setOpacity(this, temp_f10); if (temp_f10 == 0) { marker_despawn(this->marker); @@ -81,11 +81,11 @@ void func_802D8B20(enum actor_e actor_id){ player_getPosition(plyr_pos); temp2 = player_getYaw(); temp_v0 = (randf() > 0.5) ? 0x1E : -0x1E; - feather = func_8032813C(actor_id, plyr_pos, (s32) (temp2 + temp_v0)); + feather = spawn_actor_f32(actor_id, plyr_pos, (s32) (temp2 + temp_v0)); func_8032AA58(feather, 0.45f); feather->unk28 = 22.0f; feather->unk1C[1] = 48.0f; - feather->unk60 = 1.2f; + feather->lifetime_value = 1.2f; } void func_802D8BE4(bool gold_feather){ diff --git a/src/core2/code_53A10.c b/src/core2/code_53A10.c index 5d2d3b0f..80535b34 100644 --- a/src/core2/code_53A10.c +++ b/src/core2/code_53A10.c @@ -58,16 +58,16 @@ void func_802DAA14(Actor *this){ } if(!this->initialized){ - this->unk60 = 0.5f; - this->initialized = 1; + this->lifetime_value = 0.5f; + this->initialized = TRUE; } - if(0.0f < this->unk60){ - this->unk60 -= time_getDelta(); + if(0.0f < this->lifetime_value){ + this->lifetime_value -= time_getDelta(); return; } - if(!this->unk138_24){ + if(!this->is_first_encounter){ if(level_get() == LEVEL_A_MAD_MONSTER_MANSION){ text_id = 0xadc; } @@ -79,6 +79,6 @@ void func_802DAA14(Actor *this){ text_id = tmp; } func_80311480(text_id, 4, NULL, this->marker, func_802DA9A0, NULL); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } diff --git a/src/core2/code_53C10.c b/src/core2/code_53C10.c index eae84936..fea01ae3 100644 --- a/src/core2/code_53C10.c +++ b/src/core2/code_53C10.c @@ -39,7 +39,7 @@ void func_802DABA0(ParticleEmitter *pCtrl, f32 position[3], f32 scale, enum asse func_802EFA18(pCtrl, 5); func_802EFA20(pCtrl, 0.8f, 1.0f); particleEmitter_setSfx(pCtrl, SFX_1F_HITTING_AN_ENEMY_3, 6000); - func_802EFB70(pCtrl, scale, scale); + particleEmitter_setStartingScaleRange(pCtrl, scale, scale); particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 3.5f, 3.5f); particleEmitter_setFade(pCtrl, 0.0f, 0.65f); @@ -222,7 +222,7 @@ void func_802DB4E0(ActorMarker *marker, s32 arg1){ subaddie_set_state_with_direction(actor, 9, 0.0f, 1); actor_playAnimationOnce(actor); actor_collisionOff(actor); - actor->unk60 = randf2(3.0f, 6.0f); + actor->lifetime_value = randf2(3.0f, 6.0f); } void func_802DB548(ActorMarker *marker, ActorMarker *other_marker) { @@ -243,7 +243,7 @@ void func_802DB5A0(Actor *this) { if (!this->unk16C_4) { marker_setCollisionScripts(this->marker, &func_802DB440, local->unk30, local->unk34); this->marker->propPtr->unk8_3 = FALSE; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->unk124_0 = this->unk138_31 = FALSE; local->unk38 = 0; this->unk16C_4 = TRUE; @@ -370,8 +370,8 @@ void func_802DB5A0(Actor *this) { if (animctrl_getAnimTimer(this->animctrl) != 0.0f) { func_802DB2F8(this); } - if (this->unk60 > 0.0f) { - this->unk60 -= time_getDelta(); + if (this->lifetime_value > 0.0f) { + this->lifetime_value -= time_getDelta(); break; } subaddie_set_state_with_direction(this, 0xA, 0.0f, 1); diff --git a/src/core2/code_54D50.c b/src/core2/code_54D50.c index aa1a197d..cbf176f0 100644 --- a/src/core2/code_54D50.c +++ b/src/core2/code_54D50.c @@ -44,8 +44,8 @@ void func_802DBCE0(ParticleEmitter *pCtrl, f32 arg1[3]){ particleEmitter_setSprite(other, ASSET_70C_SPRITE_RIPPLE); particleEmitter_setDrawMode(other, 1); particleEmitter_setPosition(other, arg1); - func_802EFB70(other, 0.1f, 0.1f); - func_802EFB84(other, 1.0f, 1.4f); + particleEmitter_setStartingScaleRange(other, 0.1f, 0.1f); + particleEmitter_setFinalScaleRange(other, 1.0f, 1.4f); particleEmitter_setParticleLifeTimeRange(other, 1.0f, 1.4f); particleEmitter_setFade(other, 0.0f, 0.5f); particleEmitter_emitN(other, 1); @@ -97,8 +97,8 @@ void func_802DC018(Actor *this){ } if(func_802DBF94(this, 600) && randf() < 0.2){ tmp_f0 = randf2(0.01f, 0.06f); - func_802EFB70(local->unk0, tmp_f0, tmp_f0); - func_802EFB84(local->unk0, tmp_f0, tmp_f0); + particleEmitter_setStartingScaleRange(local->unk0, tmp_f0, tmp_f0); + particleEmitter_setFinalScaleRange(local->unk0, tmp_f0, tmp_f0); particleEmitter_emitN(local->unk0, 1); }//L802DC0F4 } diff --git a/src/core2/code_55390.c b/src/core2/code_55390.c index 3c898192..7241b537 100644 --- a/src/core2/code_55390.c +++ b/src/core2/code_55390.c @@ -74,7 +74,7 @@ void func_802DC45C(Actor *this){ void func_802DC4C4(void) { Actor *actor; if (D_8037DE40 == 0) { - actor = func_8032813C(ACTOR_1DB_GAME_OVER, D_80368040, 0); + actor = spawn_actor_f32(ACTOR_1DB_GAME_OVER, D_80368040, 0); D_8037DE40 = actor->marker; func_8025A58C(0, 5000); func_8025AB00(); diff --git a/src/core2/code_556C0.c b/src/core2/code_556C0.c index b2e590a2..bd3256ef 100644 --- a/src/core2/code_556C0.c +++ b/src/core2/code_556C0.c @@ -37,7 +37,7 @@ void func_802DC67C(Actor *this){ void func_802DC6E4(void) { Actor *actor; if (D_8037DE50 == 0) { - actor = func_8032813C(0x19C, D_80368070, 0); + actor = spawn_actor_f32(0x19C, D_80368070, 0); D_8037DE50 = actor->marker; func_8025A58C(0, 5000); func_8025AB00(); diff --git a/src/core2/code_55850.c b/src/core2/code_55850.c index afe72ef7..bd758591 100644 --- a/src/core2/code_55850.c +++ b/src/core2/code_55850.c @@ -69,7 +69,7 @@ void func_802DC900(Actor *this){ void func_802DC960(void) { Actor *actor; if (D_8037DE60 == 0) { - actor = func_8032813C(0x1DC, D_803680A0, 0); + actor = spawn_actor_f32(0x1DC, D_803680A0, 0); D_8037DE60 = actor->marker; } } diff --git a/src/core2/code_57C70.c b/src/core2/code_57C70.c index 2f4889eb..463f1a28 100644 --- a/src/core2/code_57C70.c +++ b/src/core2/code_57C70.c @@ -156,7 +156,7 @@ void func_802DEE1C(Actor *this) { void func_802DF04C(void){ Actor *this; if(D_8037DFE0 == NULL){ - this = func_8032813C(0x19B, D_80368330, 0); + this = spawn_actor_f32(0x19B, D_80368330, 0); D_8037DFE0 = this->marker; } } diff --git a/src/core2/code_581D0.c b/src/core2/code_581D0.c index a6702acf..f10f08f5 100644 --- a/src/core2/code_581D0.c +++ b/src/core2/code_581D0.c @@ -41,7 +41,7 @@ Actor *func_802DF160(Gfx **gfx, Mtx **mtx, Vtx **vtx) { void func_802DF270(void){ Actor *this; if(D_8037E000 == NULL){ - this = func_8032813C(0x2B5, D_80368360, 0); + this = spawn_actor_f32(0x2B5, D_80368360, 0); D_8037E000 = this->marker; } } diff --git a/src/core2/code_66D90.c b/src/core2/code_66D90.c index 784226f4..e6744e58 100644 --- a/src/core2/code_66D90.c +++ b/src/core2/code_66D90.c @@ -46,8 +46,8 @@ ParticleEmitter *func_802EDD8C(f32 pos[3], f32 xz_range, f32 arg2){ ); particleEmitter_setPosition(pCtrl, pos); particleEmitter_setRGB(pCtrl, D_80368850); - func_802EFB70(pCtrl, 0.05f, 0.09f); - func_802EFB84(pCtrl, 0.05f, 0.09f); + particleEmitter_setStartingScaleRange(pCtrl, 0.05f, 0.09f); + particleEmitter_setFinalScaleRange(pCtrl, 0.05f, 0.09f); func_802EFF50(pCtrl, 10.0f); func_802EFF5C(pCtrl, 0.25f, 0.25f, 0.0f); func_802EFF7C(pCtrl, 0.0f, 0.1f, 0.0f); diff --git a/src/core2/code_66FB0.c b/src/core2/code_66FB0.c index 8331167d..7741ab91 100644 --- a/src/core2/code_66FB0.c +++ b/src/core2/code_66FB0.c @@ -45,7 +45,7 @@ void func_802EDF40(f32 pos[3], s32 arg1, s32 cnt, f32 arg3, f32 arg4, f32 arg5, f32 tmp_f0; if(arg1 < 0x3e7){ particleEmitter_setModel(pCtrl, D_80368860[arg1]); - func_802EFB70(pCtrl, arg3 * 0.6, arg3 * 1.1); + particleEmitter_setStartingScaleRange(pCtrl, arg3 * 0.6, arg3 * 1.1); particleEmitter_setAngularVelocityRange(pCtrl, 400.0f, 400.0f, 400.0f, 800.0f, 800.0f, 800.0f); } else{//L802EE008 @@ -56,8 +56,8 @@ void func_802EDF40(f32 pos[3], s32 arg1, s32 cnt, f32 arg3, f32 arg4, f32 arg5, else{ particleEmitter_setStartingFrameRange(pCtrl, 0, 0); } - func_802EFB70(pCtrl, arg3, arg3); - func_802EFB84(pCtrl, arg3, arg3); + particleEmitter_setStartingScaleRange(pCtrl, arg3, arg3); + particleEmitter_setFinalScaleRange(pCtrl, arg3, arg3); particleEmitter_setAngularVelocityRange(pCtrl, 0, 0, 0, 0, 0, 0); func_802EFF9C(pCtrl, 0); }//L802EE0B4 diff --git a/src/core2/code_67650.c b/src/core2/code_67650.c index f3c81429..6442bc65 100644 --- a/src/core2/code_67650.c +++ b/src/core2/code_67650.c @@ -77,8 +77,8 @@ void func_802EE6CC(f32 position[3], f32 velocity[3], s32 color[4], s32 arg3, f32 } particleEmitter_setDrawMode(p_ctrl, sp3C); particleEmitter_setParticleLifeTimeRange(p_ctrl, arg4, arg4); - func_802EFB70(p_ctrl, arg6 / 175.0, arg6 / 175.0); - func_802EFB84(p_ctrl, (arg6 + arg7) / 175.0, (arg6 + arg7) / 175.0); + particleEmitter_setStartingScaleRange(p_ctrl, arg6 / 175.0, arg6 / 175.0); + particleEmitter_setFinalScaleRange(p_ctrl, (arg6 + arg7) / 175.0, (arg6 + arg7) / 175.0); if (arg8 == 0) { particleEmitter_setParticleFramerateRange(p_ctrl, (15.0 / arg4), (15.0 / arg4)); } else { diff --git a/src/core2/code_6AEF0.c b/src/core2/code_6AEF0.c index 80e25235..40882f14 100644 --- a/src/core2/code_6AEF0.c +++ b/src/core2/code_6AEF0.c @@ -28,8 +28,8 @@ ParticleEmitter *func_802F1EC8(f32 *position) { particleEmitter_setParticleVelocityRange(p_emitter, -10.0f, 10.0f, -10.0f, 10.0f, 240.0f, 10.0f); particleEmitter_setRGB(p_emitter, D_80368AA0); particleEmitter_setFade(p_emitter, 0.2f, 0.3f); - func_802EFB70(p_emitter, 0.2f, 0.4f); - func_802EFB84(p_emitter, 0.85f, 0.9f); + particleEmitter_setStartingScaleRange(p_emitter, 0.2f, 0.4f); + particleEmitter_setFinalScaleRange(p_emitter, 0.85f, 0.9f); particleEmitter_setParticleLifeTimeRange(p_emitter, 0.3f, 0.35f); return p_emitter; } diff --git a/src/core2/code_6B30.c b/src/core2/code_6B30.c index 3dd52395..b02f725e 100644 --- a/src/core2/code_6B30.c +++ b/src/core2/code_6B30.c @@ -4,7 +4,7 @@ #include "core2/ba/carry.h" #include "core2/ba/physics.h" -extern Actor *func_8032813C(enum actor_e, f32[3], s32); +extern Actor *spawn_actor_f32(enum actor_e, f32[3], s32); /* .bss */ u8 D_8037BFA0; @@ -116,7 +116,7 @@ void func_8028DE0C(enum actor_e actor_id){ f32 sp20[3]; baModel_getPosition(sp20); - actor = func_8032813C(actor_id, sp20, (s32) yaw_get()); + actor = spawn_actor_f32(actor_id, sp20, (s32) yaw_get()); actor->unk138_22 = TRUE; bacarry_set_marker(actor->marker); bs_setState(BS_3A_CARRY_IDLE); diff --git a/src/core2/code_6CD20.c b/src/core2/code_6CD20.c index 181515a1..c21bb34e 100644 --- a/src/core2/code_6CD20.c +++ b/src/core2/code_6CD20.c @@ -42,8 +42,8 @@ void func_802F3CF8(f32 arg0[3], s32 arg1, s32 arg2){ ); func_802EFF50(pCtrl, 1.0f); particleEmitter_setFade(pCtrl, 0.1f, 0.5f); - func_802EFB70(pCtrl, 0.1f, 0.2f); - func_802EFB84(pCtrl, 0.4f, 0.5f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.2f); + particleEmitter_setFinalScaleRange(pCtrl, 0.4f, 0.5f); particleEmitter_setParticleLifeTimeRange(pCtrl, 0.75f, 0.75f); particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80368D88); if(arg1 == 0){ diff --git a/src/core2/code_6CEC0.c b/src/core2/code_6CEC0.c index aaf5b9e6..20dc7789 100644 --- a/src/core2/code_6CEC0.c +++ b/src/core2/code_6CEC0.c @@ -25,8 +25,8 @@ ParticleEmitter *func_802F3E98(f32 pos[3], enum asset_e sprite_id){ ); particleEmitter_setFade(this, 0.4f, 0.8f); particleEmitter_setPosition(this, pos); - func_802EFB70(this, 0.22f, 0.22f); - func_802EFB84(this, 0.03f, 0.03f); + particleEmitter_setStartingScaleRange(this, 0.22f, 0.22f); + particleEmitter_setFinalScaleRange(this, 0.03f, 0.03f); particleEmitter_setAngularVelocityRange(this, 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 240.0f diff --git a/src/core2/code_6D030.c b/src/core2/code_6D030.c index 1f41f9ce..3fbb4a54 100644 --- a/src/core2/code_6D030.c +++ b/src/core2/code_6D030.c @@ -53,8 +53,8 @@ ParticleEmitter *func_802F4094(f32 pos[3], f32 arg1){ ); particleEmitter_setPosition(pCtrl, pos); particleEmitter_setRGB(pCtrl, D_80368DD0); - func_802EFB70(pCtrl, 0.02f, 0.04f); - func_802EFB84(pCtrl, 0.01f, 0.01f); + particleEmitter_setStartingScaleRange(pCtrl, 0.02f, 0.04f); + particleEmitter_setFinalScaleRange(pCtrl, 0.01f, 0.01f); particleEmitter_setParticleLifeTimeRange(pCtrl, 2.0f, 2.0f); func_802EFF50(pCtrl, 10.0f); return pCtrl; diff --git a/src/core2/code_6D270.c b/src/core2/code_6D270.c index 7a282063..1ffceebf 100644 --- a/src/core2/code_6D270.c +++ b/src/core2/code_6D270.c @@ -56,8 +56,8 @@ ParticleEmitter *func_802F4274(f32 arg0[3]) { particleEmitter_setParticleLifeTimeRange(temp_v0, 0.7f, 0.7f); particleEmitter_setPosition(temp_v0, sp2C); particleEmitter_setRGB(temp_v0, D_80368DE0); - func_802EFB70(temp_v0, 0.8, 0.8); - func_802EFB84(temp_v0, 0.8, 0.8); + particleEmitter_setStartingScaleRange(temp_v0, 0.8, 0.8); + particleEmitter_setFinalScaleRange(temp_v0, 0.8, 0.8); return temp_v0; } diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 17ab69f8..fb85c370 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -1036,16 +1036,12 @@ s32 nodeprop_getRadius(NodeProp *arg0) { return arg0->unk6.radius; } -void func_80304D4C(NodeProp *arg0, s32 dst[3]) { - dst[0] = arg0->x; - dst[1] = arg0->y; - dst[2] = arg0->z; +void nodeprop_getPosition_s32(NodeProp *nodeProp, s32 dst[3]) { + TUPLE_ASSIGN(dst, nodeProp->x, nodeProp->y, nodeProp->z) } -void nodeprop_getPosition(NodeProp *arg0, f32 arg1[3]) { - arg1[0] = arg0->x; - arg1[1] = arg0->y; - arg1[2] = arg0->z; +void nodeprop_getPosition(NodeProp *nodeProp, f32 dst[3]) { + TUPLE_ASSIGN(dst, nodeProp->x, nodeProp->y, nodeProp->z) } u32 func_80304DA8(NodeProp *arg0) { @@ -1249,7 +1245,7 @@ Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 ar if(actor){ tmp = func_80305510(arg3); if(tmp != NULL){ - func_80304D4C(tmp, sp34); + nodeprop_getPosition_s32(tmp, sp34); actor->unk44_14 = func_80341D5C(arg1, sp34); } else{ @@ -1266,12 +1262,13 @@ Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 ar return actor; } -Actor *spawn_actor(enum actor_e arg0, s32 arg1[3], s32 arg2) { +Actor *spawn_actor(enum actor_e arg0, s32 pos[3], s32 rot) { s32 i; + arg0 = (!dummy_func_80320248()) ? (ACTOR_4_BIGBUTT) : (arg0); for (i = 0; i < sSpawnableActorSize; i++) { if (arg0 == sSpawnableActorList[i].infoPtr->actorId) { - return sSpawnableActorList[i].spawnFunc(arg1, arg2, ((0, sSpawnableActorList[i])).infoPtr, sSpawnableActorList[i].unk8); + return sSpawnableActorList[i].spawnFunc(pos, rot, ((0, sSpawnableActorList[i])).infoPtr, sSpawnableActorList[i].unk8); } } diff --git a/src/core2/code_935F0.c b/src/core2/code_935F0.c index 768a6044..85042a82 100644 --- a/src/core2/code_935F0.c +++ b/src/core2/code_935F0.c @@ -104,7 +104,7 @@ void func_8031A678(Actor *this){ void __chMinigame_textCallback1(ActorMarker *marker, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(marker); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } void __chMinigame_transformToCroc(ActorMarker *marker, enum asset_e text_id, s32 arg2){ @@ -164,7 +164,7 @@ void chMinigame_update(Actor *this){ func_8028FAB0(this->position); this->unk1C[0] = 0.0f; this->unk1C[1] = this->yaw; this->unk1C[2] = 0.0f; func_8028FAEC(this->unk1C); - this->unk138_24 = 0; + this->is_first_encounter = FALSE; if(this->unk10_12 >= 7){ marker_despawn(this->marker); return; @@ -177,7 +177,7 @@ void chMinigame_update(Actor *this){ if(volatileFlag_get(VOLATILE_FLAG_2_FF_IN_MINIGAME)){ switch(this->state){ case MINIGAME_STATE_1_INTRODUCE_GAME://L8031AB2C - if(this->unk138_24) + if(this->is_first_encounter) __chMinigame_setState(this, MINIGAME_STATE_2_IN_PROGESS); break; case MINIGAME_STATE_2_IN_PROGESS://L8031AB50 diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index 36e015a2..514e82ca 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -835,7 +835,7 @@ Actor *actor_new(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ suLastBaddie->unk44_0 = 0; suLastBaddie->initialized = FALSE; suLastBaddie->unk16C_4 = 0; - suLastBaddie->unk60 = 0.0f; + suLastBaddie->lifetime_value = 0.0f; suLastBaddie->unk10_0 = 0; suLastBaddie->unk104 = NULL; suLastBaddie->unk100 = NULL; @@ -882,7 +882,7 @@ Actor *actor_new(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ suLastBaddie->unk14C[0] = NULL; suLastBaddie->unk14C[1] = NULL; suLastBaddie->unk138_27 = 0; - suLastBaddie->unk138_24 = 0; + suLastBaddie->is_first_encounter = FALSE; suLastBaddie->unk138_23 = 0; suLastBaddie->unk138_22 = 0; suLastBaddie->unk138_21 = 0; @@ -1059,13 +1059,15 @@ Actor *func_8032811C(enum actor_e id, s32 (* pos)[3], s32 rot){ return spawn_actor(id, pos, rot); } -Actor *func_8032813C(enum actor_e id, f32 pos[3], s32 rot){ - s32 sp24[3]; +Actor *spawn_actor_f32(enum actor_e id, f32 pos[3], s32 rot){ + s32 pos_float[3]; int i; + for(i = 0; i< 3; i++){ - sp24[i] = pos[i]; + pos_float[i] = pos[i]; } - spawn_actor(id, &sp24, rot); + + spawn_actor(id, &pos_float, rot); } Actor * spawn_child_actor(enum actor_e id, Actor ** parent){ diff --git a/src/core2/code_A4D00.c b/src/core2/code_A4D00.c index 8d1fad2f..9dd06b8f 100644 --- a/src/core2/code_A4D00.c +++ b/src/core2/code_A4D00.c @@ -247,7 +247,7 @@ bool func_8032C4AC(Actor *arg0, f32 arg1[3], s32 arg2, s32 arg3) { f32 sp30; if (arg0->unk138_8) { - arg0->position[1] = func_80309724(arg0->position); + arg0->position[1] = mapModel_getFloorY(arg0->position); } else{ sp30 = func_8033229C(arg0->marker) / 3.0; diff --git a/src/core2/code_C0CF0.c b/src/core2/code_C0CF0.c index 779dc1ac..5e989178 100644 --- a/src/core2/code_C0CF0.c +++ b/src/core2/code_C0CF0.c @@ -8,7 +8,7 @@ extern void func_80329904(ActorMarker *, s32, f32 *); /* .code */ void func_80347C80(Struct81s *arg0){ Actor *actor; - actor = func_8032813C(ACTOR_46_JIGGY, arg0->position, 0); + actor = spawn_actor_f32(ACTOR_46_JIGGY, arg0->position, 0); actor->unk54 = 3.0f; func_803333DC(arg0, actor); } diff --git a/src/core2/code_C8760.c b/src/core2/code_C8760.c index 57110965..a6cb4eb9 100644 --- a/src/core2/code_C8760.c +++ b/src/core2/code_C8760.c @@ -44,7 +44,7 @@ void func_8034F774(void){ particleEmitter_setParticleFramerateRange(D_803720A0.unk0, 15.0f, 30.0f); particleEmitter_setSpawnIntervalRange(D_803720A0.unk0, 0.0f, 1.0f); particleEmitter_setParticleLifeTimeRange(D_803720A0.unk0, 216000.0f, 216000.0f); - func_802EFB70(D_803720A0.unk0, 1.8f, 2.2f); + particleEmitter_setStartingScaleRange(D_803720A0.unk0, 1.8f, 2.2f); particleEmitter_emitUniformLine(D_803720A0.unk0, &sp38, &sp2C, 10); particleEmitter_setSpawnInterval(D_803720A0.unk0, 0.0f); D_803720A0.unk5 = func_8030D90C(); diff --git a/src/core2/code_D0CA0.c b/src/core2/code_D0CA0.c index 39cc0110..77c92a09 100644 --- a/src/core2/code_D0CA0.c +++ b/src/core2/code_D0CA0.c @@ -460,8 +460,8 @@ void func_80358684(Actor *this) { this->position[2] = this->position[2] + sp3C[2]; this->position[1] += local->unk36*sp88; local->unk36 -= 3000.0f * sp88; - if (this->position[1] < func_80309724(this->position)) { - this->position[1] = func_80309724(this->position); + if (this->position[1] < mapModel_getFloorY(this->position)) { + this->position[1] = mapModel_getFloorY(this->position); next_state = 7; FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); timed_playSfx(0.1f, SFX_66_BIRD_AUUGHH, 1.6f, 32000); diff --git a/src/core2/code_D6600.c b/src/core2/code_D6600.c index 209a7814..c13cf059 100644 --- a/src/core2/code_D6600.c +++ b/src/core2/code_D6600.c @@ -113,8 +113,8 @@ void func_8035D95C(ActorMarker *marker) { func_8034A174(marker->unk44, 5, sp34); pCtrl = func_802EDD8C(sp34, 20.0f, func_80309B24(sp34)); particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f); - func_802EFB70(pCtrl, 0.1f, 0.2f); - func_802EFB84(pCtrl, 0.1f, 0.2f); + particleEmitter_setStartingScaleRange(pCtrl, 0.1f, 0.2f); + particleEmitter_setFinalScaleRange(pCtrl, 0.1f, 0.2f); particleEmitter_emitN(pCtrl, 3); } } diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c index 60e84b3b..dca43c32 100644 --- a/src/core2/code_D89E0.c +++ b/src/core2/code_D89E0.c @@ -3,7 +3,7 @@ #include "variables.h" -extern f32 func_80309724(f32[3]); +extern f32 mapModel_getFloorY(f32[3]); extern f32 func_80257204(f32, f32, f32, f32); #define SQ(x) ((x) * (x)) @@ -330,7 +330,7 @@ bool func_8036054C(Actor *this) { s32 phi_s1; s32 phi_s2; - if (this->unk60 == 0.0f) { + if (this->lifetime_value == 0.0f) { this->yaw_ideal = func_80257204(this->position[0], this->position[2], this->unk1C[0], this->unk1C[2]); func_8035FFAC(this, func_803603AC(this, -110, 2)); } @@ -338,13 +338,13 @@ bool func_8036054C(Actor *this) { func_80328FB0(this, 5.0f); func_80360044(this); if (func_80329480(this) != 0) { - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; } else { return TRUE; } } for(phi_s2 = 0; !func_80360198(this) && phi_s2 < 1; phi_s2++){ - this->unk60 = 45.0f; + this->lifetime_value = 45.0f; func_80328CEC(this, (s32) this->yaw, 90, 180); phi_s1 = 0; do{ @@ -368,7 +368,7 @@ bool func_8036054C(Actor *this) { } else { this->velocity[1] = (f32) randi2(0, 0); } - if (this->position[1] <= func_80309724(this->position)) { + if (this->position[1] <= mapModel_getFloorY(this->position)) { this->velocity[0] = 3.0f; } return TRUE; @@ -482,7 +482,7 @@ void func_80360828(Actor *this){ sp34 = time_getDelta(); func_8032CA80(this, this->unk38_0 ? 0x13 : 0x4); if(func_8035FC98(this, this->velocity_x * sp34)){ - this->position_y = func_80309724(this->position); + this->position_y = mapModel_getFloorY(this->position); subaddie_set_state_with_direction(this, 8, 0.01f, 1); actor_playAnimationOnce(this); func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); diff --git a/src/core2/code_DA760.c b/src/core2/code_DA760.c index cf941faa..53b947a5 100644 --- a/src/core2/code_DA760.c +++ b/src/core2/code_DA760.c @@ -46,21 +46,21 @@ void func_80361870(Actor *this){ this->unk16C_4 = 1; } - if(!this->unk138_24 && func_80329530(this, 400) && !func_80329530(this, 50)){ + if(!this->is_first_encounter && func_80329530(this, 400) && !func_80329530(this, 50)){ if(this->unkF4_8 == 1 && !fileProgressFlag_get(FILEPROG_31_MM_OPEN) && level_get() == LEVEL_6_LAIR){ text_id = fileProgressFlag_get(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT)? 0xF80 : 0xF7F; if(func_80311480(text_id, 0, 0, 0, 0, 0)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } } else if(func_803616F0(this)){ sp28 = (volatileFlag_get(VOLATILE_FLAG_16)?0xf6e:0xf68) + this->unkF4_8 - 1; if(!volatileFlag_get(VOLATILE_FLAG_16) && level_get() == LEVEL_6_LAIR){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } else{ if(func_80311480(sp28, 0, 0, 0, 0, 0)){ - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; volatileFlag_set(VOLATILE_FLAG_16, 0); } } diff --git a/src/core2/code_DB010.c b/src/core2/code_DB010.c index 18d2ce2c..3663dc9f 100644 --- a/src/core2/code_DB010.c +++ b/src/core2/code_DB010.c @@ -534,11 +534,11 @@ void func_80362E94(Actor *this){ default: //L8036316C if(!this->unk16C_4){ this->unk16C_4 = 1; - this->unk60 = this->scale*10.0; + this->lifetime_value = this->scale*10.0; } - this->unk60 = MAX(0.0, this->unk60 - tick); - if(0.0f == this->unk60){ + this->lifetime_value = MAX(0.0, this->lifetime_value - tick); + if(0.0f == this->lifetime_value){ switch(this->unkF4_8){ case 2: //L8036325C func_80361FA0(this->position); diff --git a/src/core2/eggshatter.c b/src/core2/eggshatter.c index c9b30be8..73254933 100644 --- a/src/core2/eggshatter.c +++ b/src/core2/eggshatter.c @@ -26,7 +26,7 @@ void eggShatter_init(void){ particleEmitter_setModel(gEggShatter_controller, 0x360); func_802EF9F8(gEggShatter_controller, 0.6f); func_802EFA18(gEggShatter_controller, 0); - func_802EFB70(gEggShatter_controller, 0.8f, 1.0f); + particleEmitter_setStartingScaleRange(gEggShatter_controller, 0.8f, 1.0f); particleEmitter_setAngularVelocityRange(gEggShatter_controller, 400.0f, 400.0f, 400.0f, 800.0f, 800.0f, 800.0f); particleEmitter_setSpawnIntervalRange(gEggShatter_controller, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(gEggShatter_controller, 1.5f, 1.5f); diff --git a/src/core2/fx/ripple.c b/src/core2/fx/ripple.c index 2658c789..6d2c892b 100644 --- a/src/core2/fx/ripple.c +++ b/src/core2/fx/ripple.c @@ -85,8 +85,8 @@ ParticleEmitter *__fxRipple_create(s32 arg0, f32 position[3], bool arg2){ particleEmitter_setFade(p_emitter, 0.0f, var_s0->fade_out); particleEmitter_setPosition(p_emitter, spawn_position); particleEmitter_setRGB(p_emitter, rgb); - func_802EFB70(p_emitter, var_s0->unkC[0], var_s0->unkC[1]); - func_802EFB84(p_emitter, var_s0->unk14[0], var_s0->unk14[1]); + particleEmitter_setStartingScaleRange(p_emitter, var_s0->unkC[0], var_s0->unkC[1]); + particleEmitter_setFinalScaleRange(p_emitter, var_s0->unk14[0], var_s0->unk14[1]); particleEmitter_setParticleLifeTimeRange(p_emitter, var_s0->lifetime.min, var_s0->lifetime.max); func_802EFF50(p_emitter, 100.0f); return p_emitter; diff --git a/src/core2/fx/sparkle.c b/src/core2/fx/sparkle.c index 694a8e5d..85ec66e0 100644 --- a/src/core2/fx/sparkle.c +++ b/src/core2/fx/sparkle.c @@ -24,7 +24,7 @@ void fxSparkle_emptyHoneycomb(s16 position[3]){ ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368BD0); - func_802EFB70(p_emitter, 0.32f, 0.32f); + particleEmitter_setStartingScaleRange(p_emitter, 0.32f, 0.32f); particleEmitter_emitN(p_emitter, 10); } @@ -36,7 +36,7 @@ void fxSparkle_honeycomb(s16 position[3]){ ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C00); - func_802EFB70(p_emitter, 0.32f, 0.32f); + particleEmitter_setStartingScaleRange(p_emitter, 0.32f, 0.32f); particleEmitter_emitN(p_emitter, 7); } @@ -65,7 +65,7 @@ void fxSparkle_giantBlueEgg(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 25.0f, ASSET_716_SPRITE_SPARKLE_WHITE); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C30); - func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_setStartingScaleRange(p_emitter, 0.5f, 0.5f); particleEmitter_emitN(p_emitter, 12); particleEmitter_setParticleLifeTimeRange(p_emitter, 1.5f, 1.5f); } @@ -76,7 +76,7 @@ void fxSparkle_redFeather(s16 position[3]){ -75.0f, 100.0f, -75.0f, 75.0f, 250.0f, 75.0f ); - func_802EFB70(p_emitter, 0.3f, 0.3f); + particleEmitter_setStartingScaleRange(p_emitter, 0.3f, 0.3f); particleEmitter_emitN(p_emitter, 5); } @@ -87,7 +87,7 @@ void fxSparkle_giantRedFeather(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 40.0f, ASSET_715_SPRITE_SPARKLE_RED); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C60); - func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_setStartingScaleRange(p_emitter, 0.5f, 0.5f); particleEmitter_emitN(p_emitter, 10); } @@ -97,7 +97,7 @@ void fxSparkle_goldFeather(s16 position[3]){ -75.0f, 100.0f, -75.0f, 75.0f, 250.0f, 75.0f ); - func_802EFB70(p_emitter, 0.3f, 0.3f); + particleEmitter_setStartingScaleRange(p_emitter, 0.3f, 0.3f); particleEmitter_emitN(p_emitter, 5); } @@ -108,7 +108,7 @@ void fxSparkle_giantGoldFeather(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 40.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C90); - func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_setStartingScaleRange(p_emitter, 0.5f, 0.5f); particleEmitter_emitN(p_emitter, 10); } @@ -119,7 +119,7 @@ void fxSparkle_mumboToken(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_718_SPRITE_SPARKLE_WHITE_2); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368CC0); - func_802EFB70(p_emitter, 0.4f, 0.4f); + particleEmitter_setStartingScaleRange(p_emitter, 0.4f, 0.4f); particleEmitter_emitN(p_emitter, 7); particleEmitter_setParticleLifeTimeRange(p_emitter, 1.5f, 1.5f); } @@ -131,7 +131,7 @@ void fxSparkle_extraLife(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368CF0); - func_802EFB70(p_emitter, 0.27f, 0.27f); + particleEmitter_setStartingScaleRange(p_emitter, 0.27f, 0.27f); particleEmitter_emitN(p_emitter, 5); } @@ -142,7 +142,7 @@ void fxSparkle_brentilda(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368D20); - func_802EFB70(p_emitter, 0.25f, 0.3f); + particleEmitter_setStartingScaleRange(p_emitter, 0.25f, 0.3f); particleEmitter_emitN(p_emitter, 1); } @@ -153,7 +153,7 @@ void fxSparkle_chTreasure(s16 position[3]){ }; ParticleEmitter *p_emitter = __fxSparkle_create(position, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368D50); - func_802EFB70(p_emitter, 0.45f, 0.6f); + particleEmitter_setStartingScaleRange(p_emitter, 0.45f, 0.6f); particleEmitter_setParticleLifeTimeRange(p_emitter, 0.5f, 0.8f); particleEmitter_emitN(p_emitter, 3); } diff --git a/src/core2/mapModel.c b/src/core2/mapModel.c index e87f8dbd..870aefc1 100644 --- a/src/core2/mapModel.c +++ b/src/core2/mapModel.c @@ -373,7 +373,7 @@ s32 func_80309714(void){ return mapModel.collision_opa->unk12; } -f32 func_80309724(f32 arg0[3]){ +f32 mapModel_getFloorY(f32 arg0[3]){ return func_80308FDC(arg0, 0x1e0000); } diff --git a/src/core2/particle.c b/src/core2/particle.c index 4562cfe3..a80e31c4 100644 --- a/src/core2/particle.c +++ b/src/core2/particle.c @@ -323,8 +323,8 @@ ParticleEmitter * particleEmitter_new(u32 capacity){ func_802EFA20(this, 1.0f, 1.0f); particleEmitter_setStartingFrameRange(this, 0, 0); particleEmitter_setParticleFramerateRange(this, 0.0f, 0.0f); - func_802EFB70(this, 1.0f, 1.0f); - func_802EFB84(this, 0.0f, 0.0f); + particleEmitter_setStartingScaleRange(this, 1.0f, 1.0f); + particleEmitter_setFinalScaleRange(this, 0.0f, 0.0f); particleEmitter_setAngularVelocityRange(this, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); particleEmitter_setSpawnIntervalRange(this, 0.0f, 5.0f); particleEmitter_setParticleLifeTimeRange(this, 0.0f, 5.0f); @@ -449,12 +449,12 @@ void particleEmitter_setPosition(ParticleEmitter * this, f32 position[3]){ this->postion_28[2] = position[2]; } -void func_802EFB70(ParticleEmitter * this, f32 min, f32 max){ +void particleEmitter_setStartingScaleRange(ParticleEmitter * this, f32 min, f32 max){ this->particleStartingScaleRange_AC_min = min; this->particleStartingScaleRange_AC_max = max; } -void func_802EFB84(ParticleEmitter * this, f32 min, f32 max){ +void particleEmitter_setFinalScaleRange(ParticleEmitter * this, f32 min, f32 max){ this->particleFinalScaleRange_B4_min = min; this->particleFinalScaleRange_B4_max = max; } @@ -712,8 +712,8 @@ void func_802F053C(ParticleEmitter *this, f32 arg1[3]){ particleEmitter_setStartingFrameRange(this, 0, 7); particleEmitter_setParticleSpawnPositionRange(this, -80.0f, 0.0f, -80.0f, 80.0f, 60.0f, 80.0f); particleEmitter_setPosition(this, arg1); - func_802EFB70(this, 1.0f, 1.0f); - func_802EFB84(this, 2.0f, 3.0f); + particleEmitter_setStartingScaleRange(this, 1.0f, 1.0f); + particleEmitter_setFinalScaleRange(this, 2.0f, 3.0f); particleEmitter_setSpawnIntervalRange(this, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(this, 3.0f, 4.0f); particleEmitter_setParticleVelocityRange(this, -200.0f, 0.0f, -200.0f, 200.0f, 100.0f, 200.0f); @@ -729,7 +729,7 @@ void func_802F066C(ParticleEmitter *this, f32 position[3]){ 120.0f, 60.0f, 120.0f ); particleEmitter_setPosition(this, position); - func_802EFB70(this, 0.2f, 0.3f); + particleEmitter_setStartingScaleRange(this, 0.2f, 0.3f); particleEmitter_setAngularVelocityRange(this, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f diff --git a/src/core2/spawnqueue.c b/src/core2/spawnqueue.c index 83e49bdb..5bb4e4c3 100644 --- a/src/core2/spawnqueue.c +++ b/src/core2/spawnqueue.c @@ -539,7 +539,7 @@ Actor *func_802C4140(enum actor_e actor_id, s32 x, s32 y, s32 z){ position[0] = reinterpret_cast(f32, x); position[1] = reinterpret_cast(f32, y); position[2] = reinterpret_cast(f32, z); - return func_8032813C(reinterpret_cast(enum actor_e, actor_id), position, 0); + return spawn_actor_f32(reinterpret_cast(enum actor_e, actor_id), position, 0); } diff --git a/src/cutscenes/code_6730.c b/src/cutscenes/code_6730.c index 39b3c925..9e18674c 100644 --- a/src/cutscenes/code_6730.c +++ b/src/cutscenes/code_6730.c @@ -75,15 +75,15 @@ void func_8038CCA8(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = TRUE; animctrl_setSmoothTransition(this->animctrl, 0); - this->unk60 = this->yaw/4; + this->lifetime_value = this->yaw/4; local->unk0 = partEmitMgr_newEmitter(0xA0); cutscenes_func_8038CB20(local->unk0); } switch(this->state){ case 1: - this->unk60 = MAX(0.0, this->unk60 - sp24); - if(0.0f == this->unk60){ + this->lifetime_value = MAX(0.0, this->lifetime_value - sp24); + if(0.0f == this->lifetime_value){ subaddie_set_state_forward(this, 2); actor_playAnimationOnce(this); } diff --git a/src/cutscenes/code_6C90.c b/src/cutscenes/code_6C90.c index a81fa45d..3c706330 100644 --- a/src/cutscenes/code_6C90.c +++ b/src/cutscenes/code_6C90.c @@ -76,15 +76,15 @@ void func_8038D218(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = TRUE; animctrl_setSmoothTransition(this->animctrl, 0); - this->unk60 = this->yaw/4; + this->lifetime_value = this->yaw/4; local->unk0 = partEmitMgr_newEmitter(0x100); func_8038D080(local->unk0); } switch(this->state){ case 1: - this->unk60 = MAX(0.0, this->unk60 - sp24); - if(0.0f == this->unk60){ + this->lifetime_value = MAX(0.0, this->lifetime_value - sp24); + if(0.0f == this->lifetime_value){ subaddie_set_state_forward(this, 2); actor_playAnimationOnce(this); } diff --git a/src/fight/chbossjinjo.c b/src/fight/chbossjinjo.c index 9ee82135..926b2ef4 100644 --- a/src/fight/chbossjinjo.c +++ b/src/fight/chbossjinjo.c @@ -82,8 +82,8 @@ void fight_func_8038C2C0(f32 position[3], s32 count, enum asset_e id, f32 arg3){ particleEmitter_setStartingFrameRange(temp_s0, 1, 6); particleEmitter_setPosition(temp_s0, position); particleEmitter_setAngularVelocityRange(temp_s0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); - func_802EFB70(temp_s0, arg3*0.35, arg3*0.65); - func_802EFB84(temp_s0, 0.0f, 0.0f); + particleEmitter_setStartingScaleRange(temp_s0, arg3*0.35, arg3*0.65); + particleEmitter_setFinalScaleRange(temp_s0, 0.0f, 0.0f); func_802EF9F8(temp_s0, 0.5f); func_802EFA18(temp_s0, 3); particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.01f); @@ -104,8 +104,8 @@ void func_8038C424(f32 position[3], s32 count, enum asset_e id, f32 arg3){ particleEmitter_setPosition(temp_s0, position); particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_80391918); sp24 = arg3 * 5.0; - func_802EFB70(temp_s0, sp24, sp24); - func_802EFB84(temp_s0, sp24, sp24); + particleEmitter_setStartingScaleRange(temp_s0, sp24, sp24); + particleEmitter_setFinalScaleRange(temp_s0, sp24, sp24); particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.0f); particleEmitter_setParticleLifeTimeRange(temp_s0, (arg3*0.5), (arg3*0.5)*1.5); particleEmitter_setFade(temp_s0, 0.7f, 0.8f); @@ -199,7 +199,7 @@ void chBossJinjo_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; func_80324CFC(0.0f, SFX_JINJO_STATUE_POWERUP, 32000); - func_80324D2C(this->unk60 + 2.26, SFX_JINJO_STATUE_POWERUP); + func_80324D2C(this->lifetime_value + 2.26, SFX_JINJO_STATUE_POWERUP); }//L8038C8A4 func_8028E964(sp68); func_80257F18(this->position, sp68, &sp4C); @@ -208,10 +208,10 @@ void chBossJinjo_update(Actor *this){ switch(this->state){ case 1: //8038C92C animctrl_setAnimTimer(this->animctrl, 0.0f); - if(this->unk60 < 0.0) + if(this->lifetime_value < 0.0) subaddie_set_state_with_direction(this, 2, 0.001f, 1); else//L8038C974 - this->unk60 -= sp74; + this->lifetime_value -= sp74; break; diff --git a/src/fight/chbossjinjobase.c b/src/fight/chbossjinjobase.c index ded84712..a3205903 100644 --- a/src/fight/chbossjinjobase.c +++ b/src/fight/chbossjinjobase.c @@ -130,8 +130,8 @@ void chBossJinjoBase_update(Actor *this) { func_8038D3DC(this, 0x19a, 0.0f, -200.0f, 0.0f); TUPLE_COPY(this->unk1C, this->position); this->position_y = -400.0f; - if(0.0f != this->unk60) - this->velocity_y = 400.0f/this->unk60; + if(0.0f != this->lifetime_value) + this->velocity_y = 400.0f/this->lifetime_value; else this->velocity_y = 100.0f; diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index fef65890..a9c86e64 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -299,8 +299,8 @@ void func_8038679C(f32 arg0[3], s32 arg1, f32 arg2[4]) { particleEmitter_setStartingFrameRange(temp_s0, 0, 7); particleEmitter_setPosition(temp_s0, arg0); particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_803915B8); - func_802EFB70(temp_s0, arg2[0], arg2[1]); - func_802EFB84(temp_s0, arg2[2], arg2[3]); + particleEmitter_setStartingScaleRange(temp_s0, arg2[0], arg2[1]); + particleEmitter_setFinalScaleRange(temp_s0, arg2[2], arg2[3]); particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(temp_s0, 2.8f, 3.2f); particleEmitter_setFade(temp_s0, 0.3f, 0.4f); @@ -447,7 +447,7 @@ void chfinalboss_spawnFlightPad(s32 arg0) { s16 *temp_v1; Actor *flight_pad; - flight_pad = func_8032813C(ACTOR_39F_FIGHT_FLIGHT_PAD, D_80391700, D_8039170C); + flight_pad = spawn_actor_f32(ACTOR_39F_FIGHT_FLIGHT_PAD, D_80391700, D_8039170C); flight_pad->alpha_124_19 = 0; flight_pad->unk38_31 = 6; __chFinalBossFlightPadMarker = flight_pad->marker; @@ -456,7 +456,7 @@ void chfinalboss_spawnFlightPad(s32 arg0) { void func_80386EC0(s32 arg0) { ActorMarker *marker; - marker = func_8032813C(0x38A, D_80392758, 0)->marker; + marker = spawn_actor_f32(0x38A, D_80392758, 0)->marker; func_8030E878(SFX_147_GRUNTY_SPELL_ATTACK_2, randf2(0.95f, 1.05f), 32000, D_80392758, 5000.0f, 12000.0f); fight_func_803900DC(marker, D_80392758, D_80392768[1], D_80392768[2]); } @@ -474,7 +474,7 @@ void func_80386F5C(ActorMarker * arg0, f32 arg1[3], f32 arg2, f32 arg3) { void func_80386FD8(s32 arg0) { ActorMarker *marker; - marker = func_8032813C(0x389, D_80392758, 0)->marker; + marker = spawn_actor_f32(0x389, D_80392758, 0)->marker; func_8030E878(SFX_146_GRUNTY_SPELL_ATTACK_1, randf2(0.95f, 1.05f), 32000, D_80392758, 5000.0f, 12000.0f); fight_func_8038FB84(marker, D_80392758, D_80392768, D_80392778); } @@ -482,7 +482,7 @@ void func_80386FD8(s32 arg0) { void func_80387074(s32 arg0) { ActorMarker *marker; - marker = func_8032813C(0x3AA, D_80392758, 0)->marker; + marker = spawn_actor_f32(0x3AA, D_80392758, 0)->marker; func_8030E878(SFX_146_GRUNTY_SPELL_ATTACK_1, randf2(0.95f, 1.05f), 32000, D_80392758, 5000.0f, 12000.0f); fight_func_8038FB84(marker, D_80392758, D_80392768, D_80392778); } @@ -681,7 +681,7 @@ void chfinalboss_setPhase(ActorMarker *this, u32 phase_id) actor->unk1C_x = D_803927D0[(local->unk5)][0]; actor->unk1C_y = D_803927D0[(local->unk5)][1]; actor->unk1C_z = D_803927D0[(local->unk5)][2]; - actor->unk60 = 15.0f; + actor->lifetime_value = 15.0f; return; case 4: @@ -876,7 +876,7 @@ void chfinalboss_phase1_setState(Actor *this, s32 next_state) { func_8030E878(SFX_14B_GRUNTY_LAUGH_4, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); } this->unk28 = 0.0f; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; break; case 6: local = local; @@ -1011,16 +1011,16 @@ void chfinalboss_phase1_update(ActorMarker *marker) { break; case 5: func_80387B00(this); - this->unk60 += sp54; - if (this->unk60 < 0.3333333333333333) { + this->lifetime_value += sp54; + if (this->lifetime_value < 0.3333333333333333) { this->unk28 += 3300.0 * sp54; - } else if (0.7333333333333334 < this->unk60) { + } else if (0.7333333333333334 < this->lifetime_value) { this->unk28 -= 3300.0 * sp54; } local->unk20 += this->unk28 * sp54; func_80387BFC(this, 45.0f * sp54); func_80328FB0(this, 30.0f * sp54); - if (this->unk60 > 1.0) { + if (this->lifetime_value > 1.0) { chfinalboss_phase1_setState(this, 6); } break; @@ -1085,13 +1085,13 @@ void chfinalboss_phase1_update(ActorMarker *marker) { if (this->unk28 < 0) { chfinalboss_phase1_setState(this, 9); func_80386654(2.0f, fight_D_80391390, fight_D_80391380); - this->unk60 = 4.0f; + this->lifetime_value = 4.0f; } break; case 9: func_803885DC(this); - if (this->unk60 > 0.0) { - this->unk60 -= sp54; + if (this->lifetime_value > 0.0) { + this->lifetime_value -= sp54; } else{ if (actor_animationIsAt(this, 0.9999f)) { @@ -1215,10 +1215,10 @@ void chfinalboss_phase2_update(ActorMarker *marker) { local->unk3++; if (local->unk3 >= 4) { local->unk3 = 0U; - this->unk60 = D_80391748[sp48] * 3.0f; + this->lifetime_value = D_80391748[sp48] * 3.0f; } else{ - this->unk60 = D_80391748[sp48]; + this->lifetime_value = D_80391748[sp48]; } } break; @@ -1231,8 +1231,8 @@ void chfinalboss_phase2_update(ActorMarker *marker) { break; case 18: fight_func_80386BEC(this, 3.0f); - if (this->unk60 > 0.0) { - this->unk60 = this->unk60 - sp4C; + if (this->lifetime_value > 0.0) { + this->lifetime_value = this->lifetime_value - sp4C; break; } if (fight_func_80386BEC(this, 3.0f)) { @@ -1270,31 +1270,31 @@ void __chfinalboss_spawnStatue(enum bossjinjo_e statue_id) { switch (statue_id) { case BOSSJINJO_ORANGE: - sp1C = func_8032813C(ACTOR_3A2_JINJO_STATUE_BASE, D_80391768, 135); + sp1C = spawn_actor_f32(ACTOR_3A2_JINJO_STATUE_BASE, D_80391768, 135); __chFinalBossJinjoStatueMarker[0] = sp1C->marker; break; case BOSSJINJO_GREEN: - sp1C = func_8032813C(ACTOR_3A2_JINJO_STATUE_BASE, D_80391774, 45); + sp1C = spawn_actor_f32(ACTOR_3A2_JINJO_STATUE_BASE, D_80391774, 45); __chFinalBossJinjoStatueMarker[1] = sp1C->marker; break; case BOSSJINJO_PINK: - sp1C = func_8032813C(ACTOR_3A2_JINJO_STATUE_BASE, D_80391780, 315); + sp1C = spawn_actor_f32(ACTOR_3A2_JINJO_STATUE_BASE, D_80391780, 315); __chFinalBossJinjoStatueMarker[2] = sp1C->marker; break; case BOSSJINJO_YELLOW: - sp1C = func_8032813C(ACTOR_3A2_JINJO_STATUE_BASE, D_8039178C, 225); + sp1C = spawn_actor_f32(ACTOR_3A2_JINJO_STATUE_BASE, D_8039178C, 225); __chFinalBossJinjoStatueMarker[3] = sp1C->marker; break; case BOSSJINJO_JINJONATOR: *D_80392750_ptr = ((local->mirror_phase5) ? 0.0f : 180.0f); - sp1C = func_8032813C(ACTOR_3A9_JINJONATOR_STATUE_BASE, D_80391798, (s32)*D_80392750_ptr); + sp1C = spawn_actor_f32(ACTOR_3A9_JINJONATOR_STATUE_BASE, D_80391798, (s32)*D_80392750_ptr); break; } - sp1C->unk60 = (statue_id == BOSSJINJO_JINJONATOR) ? 5.25f : 1.54f; + sp1C->lifetime_value = (statue_id == BOSSJINJO_JINJONATOR) ? 5.25f : 1.54f; sp1C->unkF4_8 = statue_id; } @@ -1382,13 +1382,13 @@ void chfinalboss_phase3_update(ActorMarker *marker) { switch (this->state) { case 21: func_803869BC(this); - this->unk60 -= sp3C; - if (this->unk60 < 0.0) { + this->lifetime_value -= sp3C; + if (this->lifetime_value < 0.0) { if (local->unkA) { chfinalboss_phase3_setState(this, 0x17); } else { chfinalboss_phase3_setState(this, 0x16); - this->unk60 = D_803917B4[local->hits]; + this->lifetime_value = D_803917B4[local->hits]; } local->unkA = NOT(local->unkA); break; @@ -1402,10 +1402,10 @@ void chfinalboss_phase3_update(ActorMarker *marker) { } break; case 22: - this->unk60 -= sp3C; - if (this->unk60 < 0.0) { + this->lifetime_value -= sp3C; + if (this->lifetime_value < 0.0) { chfinalboss_phase3_setState(this, 0x15); - this->unk60 = 5.0f; + this->lifetime_value = 5.0f; } break; case 23: @@ -1424,7 +1424,7 @@ void chfinalboss_phase3_update(ActorMarker *marker) { chfinalboss_phase3_setState(this, 0x1A); } else{ - this->unk60 = 5.0f; + this->lifetime_value = 5.0f; chfinalboss_phase3_setState(this, 0x15); } } @@ -1668,7 +1668,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) { if (actor_animationIsAt(this, 0.9999f)) { local->unk3++; chfinalboss_phase4_setState(this, 0x1F); - this->unk60 = D_803917D0[sp70]; + this->lifetime_value = D_803917D0[sp70]; } } else { chfinalboss_phase4_setState(this, 0x1D); @@ -1677,8 +1677,8 @@ void chfinalboss_phase4_update(ActorMarker *marker) { case 31: fight_func_80386BEC(this, 3.0f); - if (this->unk60 > 0.0) { - this->unk60 -= sp74; + if (this->lifetime_value > 0.0) { + this->lifetime_value -= sp74; break; } if (fight_func_80386BEC(this, 3.0f)) { @@ -1697,7 +1697,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) { sp5C[0] = this->position[0] + (this->velocity[0] * sp74); sp5C[1] = this->position[1] + (this->velocity[1] * sp74); sp5C[2] = this->position[2] + (this->velocity[2] * sp74); - temp_f2 = func_80309724(sp5C); + temp_f2 = mapModel_getFloorY(sp5C); if (sp5C[1] < temp_f2) { this->position[0] = sp5C[0]; this->position[1] = sp5C[1]; @@ -1920,7 +1920,7 @@ void chfinalboss_phase5_update(ActorMarker *marker) { func_803873DC(this, 700.0f, 2400.0f); if (actor_animationIsAt(this, 0.9999f)) { chfinalboss_phase5_setState(this, 0x27); - this->unk60 = 4.0f; + this->lifetime_value = 4.0f; } break; @@ -1930,8 +1930,8 @@ void chfinalboss_phase5_update(ActorMarker *marker) { } else { fight_func_80386BEC(this, 3.0f); } - if (this->unk60 > 0.0) { - this->unk60 -= dt; + if (this->lifetime_value > 0.0) { + this->lifetime_value -= dt; break; } if (local->unk8 == 0) { diff --git a/src/fight/chgreenblast.c b/src/fight/chgreenblast.c index 468a57a8..08ca7396 100644 --- a/src/fight/chgreenblast.c +++ b/src/fight/chgreenblast.c @@ -105,7 +105,7 @@ void chGreenBlast_update(Actor *this){ marker_setCollisionScripts(this->marker, NULL, NULL, chGreenBlast_collisionDie); this->marker->propPtr->unk8_3 = 0; actor_collisionOn(this); - this->unk60 = 10.0f; + this->lifetime_value = 10.0f; this->scale = (f64)this->scale + this->scale; } @@ -134,8 +134,8 @@ void chGreenBlast_update(Actor *this){ chGreenBlast_collisionDie(this->marker, 0); } else { - if(0.0 <= this->unk60) { - this->unk60 -= delta_time; + if(0.0 <= this->lifetime_value) { + this->lifetime_value -= delta_time; } else { chGreenBlast_collisionDie(this->marker, 0); diff --git a/src/fight/chjinjonator.c b/src/fight/chjinjonator.c index eaf721fc..bf9ec3d9 100644 --- a/src/fight/chjinjonator.c +++ b/src/fight/chjinjonator.c @@ -76,8 +76,8 @@ void chjinjonator_80390130(f32 position[3], int count, enum asset_e sprite_id){ particleEmitter_setPosition(s0, position); particleEmitter_setParticleAccelerationRange(s0, 0.0f, -200.0f, 0.0f, 0.0f, -200.0f, 0.0f); particleEmitter_setParticleVelocityRange(s0, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f); - func_802EFB70(s0, 0.5f, 0.65f); - func_802EFB84(s0, 0.0f, 0.0f); + particleEmitter_setStartingScaleRange(s0, 0.5f, 0.65f); + particleEmitter_setFinalScaleRange(s0, 0.0f, 0.0f); particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(s0, 0.65f, 0.85f); particleEmitter_setFade(s0, 0.0f, 0.35f); @@ -161,7 +161,7 @@ void chjinjonator_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; - local->unk18 = 0.40000000000000013 / (this->unk60 + 3.3); + local->unk18 = 0.40000000000000013 / (this->lifetime_value + 3.3); local->unk14 = 0.7f; func_8025A6EC(JINGLE_MENACING_GRUNTILDA_B, 20000); func_8025A58C(0, 0x7fff); @@ -182,8 +182,8 @@ void chjinjonator_update(Actor *this){ case 1: //803905D4 chjinjonator_8039040C(this); animctrl_setAnimTimer(this->animctrl, 0.0f); - this->unk60 -= sp58; - if(this->unk60 < 0.0){ + this->lifetime_value -= sp58; + if(this->lifetime_value < 0.0){ subaddie_set_state_with_direction(this, 2, 0.001f, 1); actor_playAnimationOnce(this); } diff --git a/src/fight/chjinjonatorbase.c b/src/fight/chjinjonatorbase.c index 64e7113f..b9b011aa 100644 --- a/src/fight/chjinjonatorbase.c +++ b/src/fight/chjinjonatorbase.c @@ -136,7 +136,7 @@ void chjinjonatorbase_update(Actor *this){ temp_s0 = func_802F9AA8(0x3EC); func_802F9DB8(temp_s0, 0.5f, 0.5f, 0.0f); func_802F9EC4(temp_s0, this->position, 5000, 15000); - func_802F9FD0(temp_s0, 0.25f, this->unk60 - 1.0, 1); + func_802F9FD0(temp_s0, 0.25f, this->lifetime_value - 1.0, 1); func_802FA060(temp_s0, 17000, 17000, 0.0f); func_8025A6EC(JINGLE_MENACING_GRUNTILDA_A, 15000); func_8032BB88(this, 0, 0x7fff); @@ -146,15 +146,15 @@ void chjinjonatorbase_update(Actor *this){ this->unk1C[2] = this->position_z; this->position_y = -600.0f; FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 25000); - if(0.0f != this->unk60){ - this->velocity_y = 600.0f/this->unk60; + if(0.0f != this->lifetime_value){ + this->velocity_y = 600.0f/this->lifetime_value; }else{ this->velocity_y = 100.0f; } - timedFunc_set_1(this->unk60* 0.05, (GenFunction_1)func_8038E260, reinterpret_cast(s32,this->marker)); - timedFunc_set_1(this->unk60* 0.28, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); - timedFunc_set_1(this->unk60* 0.46, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); - timedFunc_set_1(this->unk60* 0.58, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); + timedFunc_set_1(this->lifetime_value* 0.05, (GenFunction_1)func_8038E260, reinterpret_cast(s32,this->marker)); + timedFunc_set_1(this->lifetime_value* 0.28, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); + timedFunc_set_1(this->lifetime_value* 0.46, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); + timedFunc_set_1(this->lifetime_value* 0.58, (GenFunction_1) func_8038E260, reinterpret_cast(s32,this->marker)); SPAWNQUEUE_ADD_1(chjinjonatorbase_spawnStoneJinjo, this->marker); } diff --git a/src/fight/chspellbarrier.c b/src/fight/chspellbarrier.c index 8777a948..5ecc6b37 100644 --- a/src/fight/chspellbarrier.c +++ b/src/fight/chspellbarrier.c @@ -98,7 +98,7 @@ void chspellbarrier_update(Actor *this){ local->unk4 = 1; actor_setOpacity(this, 0); this->unk58_0 = 0; - this->unk60 = 2.0f; + this->lifetime_value = 2.0f; } } //L8038E9F4 if(this->state == 1){ @@ -107,9 +107,9 @@ void chspellbarrier_update(Actor *this){ this->scale = MIN(1.0, this->scale + ((f64)sp38 + (f64)sp38)); }//L8038EA68 - if(0.0 < this->unk60){ + if(0.0 < this->lifetime_value){ this->unk58_0 = 0; - this->unk60 -= sp38; + this->lifetime_value -= sp38; } else{ //L8038EAA4 this->unk58_0 = 1; @@ -125,7 +125,7 @@ void chspellbarrier_update(Actor *this){ if(local->unk0 <= 0){ local->unk0 = 0; local->unk4 = 1; - this->unk60 = 0.25f; + this->lifetime_value = 0.25f; } }//L8038EB74 actor_setOpacity(this, local->unk0); diff --git a/src/fight/chspellfireball.c b/src/fight/chspellfireball.c index b2f879c8..5b071972 100644 --- a/src/fight/chspellfireball.c +++ b/src/fight/chspellfireball.c @@ -109,8 +109,8 @@ void chSpellFireball_emitSparkles(f32 position[3], u32 count, enum asset_e sprit particleEmitter_setParticleAccelerationRange(pe, acceleration_range[0], acceleration_range[1], acceleration_range[2], acceleration_range[3], acceleration_range[4], acceleration_range[5]); particleEmitter_setParticleVelocityRange(pe, velocity_range[0], velocity_range[1], velocity_range[2], velocity_range[3], velocity_range[4], velocity_range[5]); particleEmitter_setAngularVelocityRange(pe, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); - func_802EFB70(pe, scale_range[0], scale_range[1]); - func_802EFB84(pe, scale_range[2], scale_range[3]); + particleEmitter_setStartingScaleRange(pe, scale_range[0], scale_range[1]); + particleEmitter_setFinalScaleRange(pe, scale_range[2], scale_range[3]); func_802EF9F8(pe, 0.5f); func_802EFA18(pe, 3); particleEmitter_setSpawnIntervalRange(pe, lifetime_range[0], lifetime_range[1]); @@ -130,8 +130,8 @@ void chSpellFireball_emitExplosion(f32 position[3], enum asset_e sprite, s32 cou particleEmitter_setPosition(pe, position); particleEmitter_setParticleSpawnPositionRange(pe, position_range[0], position_range[1], position_range[2], position_range[3], position_range[4], position_range[5]); particleEmitter_setParticleVelocityRange(pe, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - func_802EFB70(pe, scale_range[0], scale_range[1]); - func_802EFB84(pe, scale_range[2], scale_range[3]); + particleEmitter_setStartingScaleRange(pe, scale_range[0], scale_range[1]); + particleEmitter_setFinalScaleRange(pe, scale_range[2], scale_range[3]); particleEmitter_setSpawnIntervalRange(pe, lifetime_range[0], lifetime_range[1]); particleEmitter_setParticleLifeTimeRange(pe, lifetime_range[2], lifetime_range[3]); particleEmitter_setFade(pe, fade[0], fade[1]); @@ -149,8 +149,8 @@ void chSpellFireball_emitSmoke(f32 position[3], u32 count, f32 *lifetime_and_spa particleEmitter_setStartingFrameRange(pe, 0, 7); particleEmitter_setPosition(pe, position); particleEmitter_setPositionAndVelocityRanges(pe, &D_80391B54); - func_802EFB70(pe, 0.1f, 0.2f); - func_802EFB84(pe, 3.6f, 4.6f); + particleEmitter_setStartingScaleRange(pe, 0.1f, 0.2f); + particleEmitter_setFinalScaleRange(pe, 3.6f, 4.6f); particleEmitter_setSpawnIntervalRange(pe, lifetime_and_spawn_range[0], lifetime_and_spawn_range[1]); particleEmitter_setParticleLifeTimeRange(pe, lifetime_and_spawn_range[2], lifetime_and_spawn_range[3]); particleEmitter_setFade(pe, 0.05f, 0.1f); @@ -281,7 +281,7 @@ void func_8038F620(Actor *this){ marker_setCollisionScripts(this->marker, NULL, NULL, func_8038F3B4); this->marker->propPtr->unk8_3 = 0; actor_collisionOn(this); - this->unk60 = 8.0f; + this->lifetime_value = 8.0f; this->scale = 0.1f; if( this->marker->id == MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){ actor_collisionOff(this); @@ -365,8 +365,8 @@ void func_8038F620(Actor *this){ func_8038F084(this->marker); } else { - if(0.0 <= this->unk60){ - this->unk60 -= sp40; + if(0.0 <= this->lifetime_value){ + this->lifetime_value -= sp40; }else{ func_8038F084(this->marker); } diff --git a/src/fight/chstonejinjo.c b/src/fight/chstonejinjo.c index 00211318..dd5e00cf 100644 --- a/src/fight/chstonejinjo.c +++ b/src/fight/chstonejinjo.c @@ -35,7 +35,7 @@ void chstonejinjo_spawnJinjo(ActorMarker *marker) { jinjo = spawn_child_actor((this->unkF4_8) + 0x3A4, &this); } jinjo->unkF4_8 = this->unkF4_8; - jinjo->unk60 = this->unk1C[0]; + jinjo->lifetime_value = this->unk1C[0]; jinjo->scale = this->scale; } diff --git a/src/lair/ch/brentilda.c b/src/lair/ch/brentilda.c index c9a4be87..c0afae4c 100644 --- a/src/lair/ch/brentilda.c +++ b/src/lair/ch/brentilda.c @@ -143,10 +143,10 @@ void chBrentilda_update(Actor *this) { if (phi_f2 < 500.0) { if (sp74 < 0xFF) { sp74 = (sp74 + 0xC < 0xFF) ? sp74 + 0xC : 0xFF; - if (!this->unk138_24) { + if (!this->is_first_encounter) { func_8025A70C(COMUSIC_81_ACTIVATING_BRENTILDA); func_80324D2C(1.0f, COMUSIC_81_ACTIVATING_BRENTILDA); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; this->unk138_23 = FALSE; } } @@ -159,7 +159,7 @@ void chBrentilda_update(Actor *this) { func_8025A70C(COMUSIC_8B_DEACTIVATE_BRENTILDA); func_80324D2C(1.0f, COMUSIC_8B_DEACTIVATE_BRENTILDA); this->unk138_23 = TRUE; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; } } } diff --git a/src/lair/ch/cauldron.c b/src/lair/ch/cauldron.c index 6eb18d47..0eda875e 100644 --- a/src/lair/ch/cauldron.c +++ b/src/lair/ch/cauldron.c @@ -180,13 +180,13 @@ void func_8038AC7C(Actor *this) { && func_80329530(this, 1200) && !fileProgressFlag_get(FILEPROG_FC_DEFEAT_GRUNTY) ) { - this->unk60 += time_getDelta(); - if (35.0 < this->unk60) { + this->lifetime_value += time_getDelta(); + if (35.0 < this->lifetime_value) { sp2C = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFB7 : 0xFAE; sp28 = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFBC : 0xFB7; if (func_80311480(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) { this->unk38_31++; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; if (sp2C + this->unk38_31 >= sp28) { this->unk38_31 = 0; } @@ -231,7 +231,7 @@ void chWarpCauldron_update(Actor *this) { if (fileProgressFlag_get(FILEPROG_F3_MET_DINGPOT)) { sp4C = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFB7 : 0xFAE; phi_v0 = (fileProgressFlag_get(FILEPROG_CF_HAS_ENTERED_FINAL_FIGHT)) ? 0xFBC : 0xFB7; - this->unk60 = 35.0f; + this->lifetime_value = 35.0f; this->unk38_31 = randi2(0, phi_v0 - sp4C); } this->scale = 1.8f; diff --git a/src/lair/code_0.c b/src/lair/code_0.c index 082285ff..35a48d13 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -353,7 +353,7 @@ void func_803867A8(Actor *this) { this->initialized = TRUE; this->alpha_124_19 = 0; - this->unk60 = this->yaw; + this->lifetime_value = this->yaw; this->yaw = 0.0f; this->velocity[0] = 0.0f; return; @@ -394,20 +394,20 @@ void func_803867A8(Actor *this) { } } - this->unk60 += 2.5; - while(this->unk60 >= 360.0f){ this->unk60 -= 360.0f;} + this->lifetime_value += 2.5; + while(this->lifetime_value >= 360.0f){ this->lifetime_value -= 360.0f;} this->position_y = this->unk1C[1]; sp5C[1] = sp5C[2] =0.0f; sp5C[0] = this->unkF4_8*2; - ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->unk60); + ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->lifetime_value); this->position[0] = this->unk1C[0] + sp5C[0]; this->position[2] = this->unk1C[2] + sp5C[2]; if (this->marker->unk14_21) { sp44 = this->unk158[globalTimer_getTime() & 1]; if (sp44 != NULL) { particleEmitter_setAlpha(sp44, this->alpha_124_19); - phi_f0 = this->unk60 - 10.0f; + phi_f0 = this->lifetime_value - 10.0f; while(phi_f0 < 0.0f) {phi_f0 += 360.0f;} sp50[1] = this->unk1C[1]; @@ -466,16 +466,16 @@ void func_80386D78(Actor *this) { if (volatileFlag_get(VOLATILE_FLAG_8A_SANDCASTLE_FLIGHT_UNLOCKED)) { ability_unlock(ABILITY_9_FLIGHT); mapSpecificFlags_set(0, TRUE); - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; this->position[1] = this->unk1C[1]; this->scale = 1.0f; } } if ((this->unk1C[1] - 150.0f) <= this->position[1]) { if (!volatileFlag_get(VOLATILE_FLAG_8A_SANDCASTLE_FLIGHT_UNLOCKED)) { - if (this->unk60 != 0.0f) { - this->unk60 -= 1.0f; - if (this->unk60 == 0.0f) { + if (this->lifetime_value != 0.0f) { + this->lifetime_value -= 1.0f; + if (this->lifetime_value == 0.0f) { FUNC_8030E624(SFX_25_METAL_SLIDING_OVER_SMTH, 0.8f, 32000); } } else { @@ -505,7 +505,7 @@ void func_80386D78(Actor *this) { } } else if (mapSpecificFlags_get(0)) { this->scale = 0.0001f; - this->unk60 = 26.0f; + this->lifetime_value = 26.0f; this->position[1] = this->unk1C[1]; func_802BAFE4(0x80); timedFunc_set_0(3.0f, func_80386D40); @@ -537,13 +537,13 @@ void func_803870DC(Actor *this) { } if ((this->alpha_124_19 == 0) && (phi_v1)) { this->alpha_124_19 = 1; - this->unk60 = 23.0f; + this->lifetime_value = 23.0f; } phi_a0 = this->alpha_124_19; if (phi_a0 == 1) { - this->unk60 -= 1.0f; - if (this->unk60 == 0.0f) { + this->lifetime_value -= 1.0f; + if (this->lifetime_value == 0.0f) { this->alpha_124_19 = 2; func_80324CFC(0, COMUSIC_43_ENTER_LEVEL_GLITTER, 32700); func_80324D2C(1.3f, COMUSIC_43_ENTER_LEVEL_GLITTER); @@ -563,8 +563,8 @@ void func_803870DC(Actor *this) { func_8034A174(func_80329934(), 5, sp90); func_8034A174(func_80329934(), 6, sp84); particleEmitter_setSprite(temp_s5, ASSET_710_SPRITE_SPARKLE_PURPLE); - func_802EFB70(temp_s5, 0.13f, 0.18f); - func_802EFB84(temp_s5, 0.08f, 0.13f); + particleEmitter_setStartingScaleRange(temp_s5, 0.13f, 0.18f); + particleEmitter_setFinalScaleRange(temp_s5, 0.08f, 0.13f); particleEmitter_setParticleAccelerationRange(temp_s5, -500.0f, -1800.0f, -500.0f, 500.0f, 1800.0f, 500.0f); particleEmitter_setSpawnIntervalRange(temp_s5, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(temp_s5, 0.9f, 0.9f); @@ -721,8 +721,8 @@ void func_80387730(Actor *this) { temp_s5 = partEmitMgr_newEmitter((s32)((f32) this->alpha_124_19 / 11.0)); sp6C[2] = 0; particleEmitter_setSprite(temp_s5, ASSET_710_SPRITE_SPARKLE_PURPLE); - func_802EFB70(temp_s5, 0.13f, 0.18f); - func_802EFB84(temp_s5, 0.08f, 0.13f); + particleEmitter_setStartingScaleRange(temp_s5, 0.13f, 0.18f); + particleEmitter_setFinalScaleRange(temp_s5, 0.08f, 0.13f); particleEmitter_setParticleAccelerationRange(temp_s5, -10.0f, 0.0f, -10.0f, 10.0f, 1600.0f, 10.0f); particleEmitter_setSpawnIntervalRange(temp_s5, 0.0f, 0.01f); particleEmitter_setParticleLifeTimeRange(temp_s5, 1.4f, 1.4f); @@ -799,7 +799,7 @@ void func_80387E94(s32 arg0) marker = reinterpret_cast(ActorMarker *, arg0); actor1 = marker_getActor(marker); - actorNew = func_8032813C(0x25A, actor1->position, actor1->yaw); + actorNew = spawn_actor_f32(0x25A, actor1->position, actor1->yaw); // Grab the same pointer again for good measure :^) actor2 = marker_getActor(marker); @@ -941,7 +941,7 @@ void func_803882B0(Actor *this) if (fileProgressFlag_get(FILEPROG_48_FP_WITCH_SWITCH_ADVENT_DOOR_OPEN)) this->pitch = 90.f; - this->unk60 = 0; + this->lifetime_value = 0; } if (this->pitch == 90.f || !volatileFlag_get(VOLATILE_FLAG_BB_WITCH_SWITCH_PRESSED_FP)) @@ -952,9 +952,9 @@ void func_803882B0(Actor *this) this->pitch += 1.1; - if (this->unk60 == 0 && this->pitch > 42.f) + if (this->lifetime_value == 0 && this->pitch > 42.f) { - this->unk60 = 1.f; + this->lifetime_value = 1.f; func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); } @@ -1298,16 +1298,16 @@ void func_80388FC8(Actor *this) this->unk1C[1] = this->position_y; this->position_y -= 500.f; - this->unk60 = 0; + this->lifetime_value = 0; if (volatileFlag_get(VOLATILE_FLAG_7D_SANDCASTLE_RAISE_PIPES_TO_CC)) { this->position_y = this->unk1C[1]; - this->unk60 = 1.f; + this->lifetime_value = 1.f; } } - if (this->unk60) + if (this->lifetime_value) return; if (!this->unk16C_4) @@ -1360,7 +1360,7 @@ void func_80388FC8(Actor *this) func_8030E540(SFX_7F_HEAVYDOOR_SLAM); } - this->unk60 = 1.f; + this->lifetime_value = 1.f; } } } @@ -1375,16 +1375,16 @@ void lair_func_80389204(Actor *this) this->unk1C[1] = this->position_y; this->position_y -= 280.f; - this->unk60 = 0; + this->lifetime_value = 0; if (volatileFlag_get(VOLATILE_FLAG_7E_SANDCASTLE_RAISE_PIPE_TO_BRENTILDA)) { this->position_y = this->unk1C[1]; - this->unk60 = 1.f; + this->lifetime_value = 1.f; } } - if (this->unk60) + if (this->lifetime_value) return; if (!this->unk16C_4) @@ -1425,7 +1425,7 @@ void lair_func_80389204(Actor *this) func_802D48B8(this); func_8030E540(SFX_7F_HEAVYDOOR_SLAM); - this->unk60 = 1.f; + this->lifetime_value = 1.f; } } } @@ -1544,7 +1544,7 @@ void func_803897D4(s32 arg0) marker1 = reinterpret_cast(ActorMarker *, arg0); actor1 = marker_getActor(marker1); - actor1 = func_8032813C(0x258, actor1->position, actor1->yaw); + actor1 = spawn_actor_f32(0x258, actor1->position, actor1->yaw); // Grab the same pointer again for good measure actor2 = marker_getActor(marker1); @@ -1710,7 +1710,7 @@ f32 func_80389AAC(Actor *this, f32 a1) func_8030E878(SFX_82_METAL_BREAK, randf2(0.93f, 1.07f), 32760, this->position, 100, 1350.0f); - this->unk60 = 1; + this->lifetime_value = 1; } a1 -= 4.5; // f64 @@ -1728,7 +1728,7 @@ void func_80389D08(Actor *this) func_802D3CE8(this); this->unk16C_4 = TRUE; - this->unk60 = 0; + this->lifetime_value = 0; if (fileProgressFlag_get(0xA5)) { @@ -1741,12 +1741,12 @@ void func_80389D08(Actor *this) { case 1: { - if (this->unk60) + if (this->lifetime_value) { subaddie_set_state_forward(this, 4); this->unk38_31 = 0; - this->unk60 = 0; + this->lifetime_value = 0; } break; @@ -1779,7 +1779,7 @@ Actor *func_80389E10(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { this = actor_drawFullDepth(marker, gfx, mtx, vtx); - if (marker->unk14_21 && (this->unk60 != 0.0f)) { + if (marker->unk14_21 && (this->lifetime_value != 0.0f)) { func_8034A174((struct5Bs *) marker->unk44, 5, sp84); func_8034A174((struct5Bs *) marker->unk44, 6, sp78); diff --git a/src/lair/code_86F0.c b/src/lair/code_86F0.c index ad7b2e89..a1c89318 100644 --- a/src/lair/code_86F0.c +++ b/src/lair/code_86F0.c @@ -197,7 +197,7 @@ void func_8038EFD8(Actor *this) { f32 sp30[3]; f32 sp24[3]; - this->unk138_24 = FALSE; + this->is_first_encounter = FALSE; player_getPosition(sp30); sp24[0] = this->position[0]; sp24[1] = this->position[1]; @@ -312,7 +312,7 @@ void func_8038F350(Actor *this, s32 next_state){ case 8: //L8038F4AC if (local->unk4 > 0) { func_8025A70C(SFX_REMOVE_JIGGY); - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; temp_s1 = func_8038F0EC(this); func_8038F1EC(this, temp_s1, 0); local->unk4--; @@ -325,7 +325,7 @@ void func_8038F350(Actor *this, s32 next_state){ case 5: //L8038F550 if (local->unk4 < func_8038EB24(this)) { func_8025A70C(COMUSIC_67_INSERTING_JIGGY); - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; local->unk4++; temp_s1 = func_8038F0EC(this); func_8038F1EC(this, temp_s1, 1); @@ -345,7 +345,7 @@ void func_8038F350(Actor *this, s32 next_state){ sp4C = item_getCount(ITEM_26_JIGGY_TOTAL); } func_8025A70C(COMUSIC_67_INSERTING_JIGGY); - this->unk60 = 1.0f; + this->lifetime_value = 1.0f; for(phi_s0 = 0; phi_s0 < sp4C; phi_s0++){ local->unk4++; temp_s1 = func_8038F0EC(this); @@ -366,7 +366,7 @@ void func_8038F350(Actor *this, s32 next_state){ func_80324DBC(1.0f, 0xFAC, 4, NULL, this->marker, func_8038F0C0, NULL); } timedFunc_set_1(2.0f, (GenFunction_1) func_8038EBEC, (s32) this->marker); - this->unk60 = 3.0f; + this->lifetime_value = 3.0f; break; } subaddie_set_state(this, next_state); @@ -421,7 +421,7 @@ void lair_func_8038F924(Actor *this) { local->unk0 = 0; local->unk4 = 0; local->unk8 = (func_8038ECA8(this->marker)) ? 0xff : 1; - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; for(phi_v1 = 0; phi_v1 < sp64; phi_v1 ++){ local->unk4++; local->unk0 |= (1 << func_8038F0EC(this)); @@ -473,8 +473,8 @@ void lair_func_8038F924(Actor *this) { func_8038EDBC(this); switch(this->state){ case 1://L8038FCD0 - if (!this->unk138_24 && (!func_8028F20C() || !func_8028FB48(0x08000000))) { - this->unk138_24 = TRUE; + if (!this->is_first_encounter && (!func_8028F20C() || !func_8028FB48(0x08000000))) { + this->is_first_encounter = TRUE; } if (func_80329530(this, 300)) { if ((this->unkF4_8 == 0xA) && !fileProgressFlag_get(FILEPROG_F6_SEEN_DOOR_OF_GRUNTY_PUZZLE_PODIUM)) { @@ -486,7 +486,7 @@ void lair_func_8038F924(Actor *this) { func_8035644C(FILEPROG_A7_NEAR_PUZZLE_PODIUM_TEXT); } } - if (func_8038ECA8(this->marker) && this->unk138_24 && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) { + if (func_8038ECA8(this->marker) && this->is_first_encounter && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) { func_8038F350(this, 2); } break; @@ -513,16 +513,16 @@ void lair_func_8038F924(Actor *this) { case 5: //L8038FF00 case 6: //L8038FF00 case 8: //L8038FF00 - if (this->unk60 > 0.0f) { - this->unk60 -= sp68; + if (this->lifetime_value > 0.0f) { + this->lifetime_value -= sp68; } else { func_8038F350(this, func_8038EB58(this) ? 7 :4); } break; case 7: //L8038FF50 - if (this->unk60 > 0.0f) { - this->unk60 -= sp68; + if (this->lifetime_value > 0.0f) { + this->lifetime_value -= sp68; } else { func_8038F350(this, 1); } diff --git a/src/lair/code_9C40.c b/src/lair/code_9C40.c index 3e458c1b..7f0442e8 100644 --- a/src/lair/code_9C40.c +++ b/src/lair/code_9C40.c @@ -91,11 +91,11 @@ void func_803902B8(Actor *this) { sp54 = this->marker->id - 0x16D; if (!this->initialized) { marker_setFreeMethod(this->marker, func_80390298); - this->unk138_24 = volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE); + this->is_first_encounter = volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE); this->initialized = TRUE; } _player_getPosition(sp5C); - sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->unk138_24; + sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->is_first_encounter; if (sp58 && !this->unk38_0) { func_8032BB88(this, 0, 0x1F4); func_8025A6EC(COMUSIC_79_CHEATO, 0); diff --git a/src/lair/code_A4A0.c b/src/lair/code_A4A0.c index 23fd075b..e96d8d33 100644 --- a/src/lair/code_A4A0.c +++ b/src/lair/code_A4A0.c @@ -56,7 +56,7 @@ void func_80390890(ActorMarker *marker, ActorMarker *other_marker) { func_8030E878(SFX_C2_GRUBLIN_EGH, local->unkC_27*0.1 + 0.8, 32000, this->position, 1250.0f, 2500.0f); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); actor_collisionOff(this); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } void func_80390994(Actor *this) { diff --git a/src/lair/code_AD70.c b/src/lair/code_AD70.c index 7d801c5a..df15e3f4 100644 --- a/src/lair/code_AD70.c +++ b/src/lair/code_AD70.c @@ -76,8 +76,8 @@ void lair_func_80391254(f32 pos[3], u32 count, enum asset_e sprite) particleEmitter_setParticleSpawnPositionRange(p, -80, 0, -80, 80, 0, 80); particleEmitter_setPosition(p, pos); particleEmitter_setFade(p, 0.6f, 0.7f); - func_802EFB70(p, 3, 3); - func_802EFB84(p, 4, 4); + particleEmitter_setStartingScaleRange(p, 3, 3); + particleEmitter_setFinalScaleRange(p, 4, 4); particleEmitter_setParticleLifeTimeRange(p, 1, 1); particleEmitter_emitN(p, count); } @@ -106,8 +106,8 @@ void func_8039144C(f32 pos[3], u32 count) particleEmitter_setAngularVelocityRange(p, 0, 0, 200, 0, 0, 300); particleEmitter_setFade(p, 0.1f, 0.2f); particleEmitter_setParticleLifeTimeRange(p, 0.75f, 0.75f); - func_802EFB70(p, 0.5f, 0.5f); - func_802EFB84(p, 0.2f, 0.2f); + particleEmitter_setStartingScaleRange(p, 0.5f, 0.5f); + particleEmitter_setFinalScaleRange(p, 0.2f, 0.2f); particleEmitter_setParticleAccelerationRange(p, 0, -50, 0, 0, -100, 0); particleEmitter_emitN(p, count); } @@ -121,8 +121,8 @@ void func_803915A4(f32 pos[3], s32 count, f32 scale) particleEmitter_setStartingFrameRange(p, 2, 8); particleEmitter_setParticleFramerateRange(p, 8, 8); particleEmitter_setPosition(p, pos); - func_802EFB70(p, scale * 2.0, scale * 2.0); - func_802EFB84(p, scale * 0.4, scale * 0.4); + particleEmitter_setStartingScaleRange(p, scale * 2.0, scale * 2.0); + particleEmitter_setFinalScaleRange(p, scale * 0.4, scale * 0.4); particleEmitter_setParticleLifeTimeRange(p, 0.5f, 0.5f); particleEmitter_emitN(p, count); } @@ -136,8 +136,8 @@ void func_803916BC(f32 position[3], s32 cnt){ particleEmitter_setStartingFrameRange(pCtrl, 0, 6); particleEmitter_setParticleFramerateRange(pCtrl, 5.0f, 8.0f); particleEmitter_setPosition(pCtrl, position); - func_802EFB70(pCtrl, 2.0f, 2.0f); - func_802EFB84(pCtrl, 4.0f, 4.0f); + particleEmitter_setStartingScaleRange(pCtrl, 2.0f, 2.0f); + particleEmitter_setFinalScaleRange(pCtrl, 4.0f, 4.0f); particleEmitter_setParticleLifeTimeRange(pCtrl, 1.0f, 1.5f); particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80394B78); particleEmitter_emitN(pCtrl, cnt); @@ -173,7 +173,7 @@ void func_80391810(Actor *this, s32 next_state) { this->velocity[0] /= local->unk0; this->velocity[2] /= local->unk0; local->unk4 *= local->unk0; - this->unk60 = 0.0f; + this->lifetime_value = 0.0f; local->unk8 = this->position[1] * 0.5; sp38[0] = this->position[0]; sp38[1] = this->position[1]; @@ -190,7 +190,7 @@ void func_80391810(Actor *this, s32 next_state) { func_8039137C(this->position, 4, 0x712); func_803917B0(this); timedFunc_set_0(4.0f, func_803917DC); - this->unk60 = 4.0f; + this->lifetime_value = 4.0f; break; case 3: FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 0.8f, 25000, this->position, 1500, 3000); @@ -258,14 +258,14 @@ void func_80391B04(Actor *this) { func_8039144C(sp34, 1); } if (local->unk4 > 0.0) { - this->unk60 += sp44; - if (local->unk4 < this->unk60) { + this->lifetime_value += sp44; + if (local->unk4 < this->lifetime_value) { func_80391810(this, 2); } } - if ((local->unk8 < this->position[1]) && !this->unk138_24) { + if ((local->unk8 < this->position[1]) && !this->is_first_encounter) { FUNC_8030E8B4(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000); - this->unk138_24 = TRUE; + this->is_first_encounter = TRUE; } break; case 3: @@ -273,9 +273,9 @@ void func_80391B04(Actor *this) { marker_despawn(this->marker); break; case 2: - this->unk60 -= sp44; - if (this->unk60 > 0.0f) { - temp_f0_2 = (f32) ((f64) this->unk60 * 0.25); + this->lifetime_value -= sp44; + if (this->lifetime_value > 0.0f) { + temp_f0_2 = (f32) ((f64) this->lifetime_value * 0.25); D_80394BD4[0] = (s32) ((f32) D_80394BD4[0] * temp_f0_2); D_80394BD4[1] = (s32) ((f32) D_80394BD4[1] * temp_f0_2); D_80394BD4[2] = (s32) ((f32) D_80394BD4[2] * temp_f0_2); diff --git a/src/lair/code_BBD0.c b/src/lair/code_BBD0.c index fddd6426..7d1afd44 100644 --- a/src/lair/code_BBD0.c +++ b/src/lair/code_BBD0.c @@ -130,9 +130,9 @@ void func_8039217C(Actor *this) { } if ((randf() < 0.1) || mapSpecificFlags_get(5)) { this->unk38_0 = mapSpecificFlags_get(5); - this->unk60 = randf2(2.0f, 4.0f); + this->lifetime_value = randf2(2.0f, 4.0f); subaddie_set_state(this, 6U); - func_803920E0(this, SFX_134_FREEZING_SHIVER, 1.1f, 1.2f, 15000, this->unk60); + func_803920E0(this, SFX_134_FREEZING_SHIVER, 1.1f, 1.2f, 15000, this->lifetime_value); break; } if (randf() < 0.1) { @@ -141,8 +141,8 @@ void func_8039217C(Actor *this) { break; case 6: //L803924EC - if (this->unk60 > 0.0f) { - this->unk60 -= time_getDelta(); + if (this->lifetime_value > 0.0f) { + this->lifetime_value -= time_getDelta(); break; } if (actor_animationIsAt(this, 0.999f) || (mapSpecificFlags_get(5) != this->unk38_0)) { diff --git a/src/lair/code_C1C0.c b/src/lair/code_C1C0.c index d2666612..d8516b1d 100644 --- a/src/lair/code_C1C0.c +++ b/src/lair/code_C1C0.c @@ -104,8 +104,8 @@ void func_80392918(Actor *this) { return; } func_80326224(this); - if ((this->unk48 > 0.5) && !this->unk138_24) { - this->unk138_24 = TRUE; + if ((this->unk48 > 0.5) && !this->is_first_encounter) { + this->is_first_encounter = TRUE; ncStaticCamera_setToNode(0x1E); } if ((0.999 < this->unk48) && !this->unk38_0) {