Document ch Vegetables

This commit is contained in:
Owlenuff
2024-10-07 20:44:57 +02:00
parent 9ad2471044
commit de99e04f6c
4 changed files with 413 additions and 341 deletions

View File

@@ -1980,7 +1980,8 @@ enum actor_e
ACTOR_166_TOPPER_A, ACTOR_166_TOPPER_A,
ACTOR_167_ATTACK_TUTORIAL, ACTOR_167_ATTACK_TUTORIAL,
ACTOR_16F_QUARRIE = 0x16F, ACTOR_16E_UNKNOWN = 0x16E,
ACTOR_16F_QUARRIE,
ACTOR_172_RBB_EGG_TOLL = 0x172, ACTOR_172_RBB_EGG_TOLL = 0x172,
@@ -2942,6 +2943,11 @@ enum asset_e
ASSET_220_ANIM_SIR_SLUSH_DIE = 0x220, ASSET_220_ANIM_SIR_SLUSH_DIE = 0x220,
ASSET_221_ANIM_WOZZA_IN_CAVE, ASSET_221_ANIM_WOZZA_IN_CAVE,
ASSET_223_ANIM_TOPPER_UNKNOWN = 0x223,
ASSET_224_ANIM_TOPPER_UNKNOWN,
ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN,
ASSET_226_ANIM_BAWL_UNKNOWN,
ASSET_227_ANIM_BAWL_UNKNOWN,
ASSET_228_ANIM_BANJO_SLED = 0x228, ASSET_228_ANIM_BANJO_SLED = 0x228,
ASSET_229_ANIM_WHIPCRACK_ATTACK, ASSET_229_ANIM_WHIPCRACK_ATTACK,
ASSET_22A_ANIM_WHIPCRACK_IDLE, ASSET_22A_ANIM_WHIPCRACK_IDLE,
@@ -3525,14 +3531,14 @@ enum asset_e
// 4ea FP Finish Banner // 4ea FP Finish Banner
// 4eb FP Start Banner // 4eb FP Start Banner
// 4ec FP Race Rostrum // 4ec FP Race Rostrum
MODEL_TOPPER = 0x4ed, ASSET_4ED_MODEL_TOPPER = 0x4ed,
MODEL_COLLYWOBBLE = 0x4ee, ASSET_4EE_MODEL_COLLYWOBBLE,
MODEL_BAWL = 0x4ef, ASSET_4EF_MODEL_BAWL,
// 4f0 Colliwobble Large Stem (Upon Death) ASSET_4F0_MODEL_UNKNOWN, // 4f0 Colliwobble Large Stem (Upon Death)
// 4f1 Colliwobble Small Stem (Upon Death) ASSET_4F1_MODEL_UNKNOWN, // 4f1 Colliwobble Small Stem (Upon Death)
// 4f2 Colliwobble Large Leaf (Upon Death) ASSET_4F2_MODEL_UNKNOWN, // 4f2 Colliwobble Large Leaf (Upon Death)
// 4f3 Colliwobble Small Leaf (Upon Death) ASSET_4F3_MODEL_UNKNOWN, // 4f3 Colliwobble Small Leaf (Upon Death)
// 4f4 Colliwobble Stem (Upon Death) ASSET_4F4_MODEL_UNKNOWN, // 4f4 Colliwobble Stem (Upon Death)
// 4f5 CCW Spring Switch // 4f5 CCW Spring Switch
// 4f6 CCW Summer Switch // 4f6 CCW Summer Switch
// 4f7 CCW Autumn Switch // 4f7 CCW Autumn Switch
@@ -4878,13 +4884,15 @@ enum marker_e{
MARKER_124_BOGGY_1 = 0x124, MARKER_124_BOGGY_1 = 0x124,
MARKER_126_UNKNOWN = 0x126,
MARKER_127_BAT = 0x127, MARKER_127_BAT = 0x127,
MARKER_128_COLLYWOBBLE_A, MARKER_128_COLLYWOBBLE_A,
MARKER_129_BAWL_A, MARKER_129_BAWL_A,
MARKER_12A_TOPPER_A, MARKER_12A_TOPPER_A,
MARKER_12B_ATTACK_TUTORIAL, MARKER_12B_ATTACK_TUTORIAL,
MARKER_135_QUARRIE = 0x135, MARKER_134_UNKNOWN = 0x134,
MARKER_135_QUARRIE,
MARKER_161_GV_WITCH_SWITCH = 0x161, MARKER_161_GV_WITCH_SWITCH = 0x161,
MARKER_162_BGS_WITCH_SWITCH, MARKER_162_BGS_WITCH_SWITCH,
@@ -5160,6 +5168,11 @@ enum marker_collision_func_type_e {
MARKER_COLLISION_FUNC_2_DIE MARKER_COLLISION_FUNC_2_DIE
}; };
enum vegetable_e {
VEGETABLE_1_TOPPER = 1,
VEGETABLE_2_BAWL,
VEGETABLE_3_COLLY_WOBBLE
};
#endif #endif

View File

@@ -20,12 +20,6 @@ enum chAttackTutorial_state_e {
ATTACK_TUTORIAL_STATE_5_UNKNOWN ATTACK_TUTORIAL_STATE_5_UNKNOWN
}; };
enum chAttackTutorial_enemy_e {
ATTACK_TUTORIAL_ENEMY_1_TOPPER = 1,
ATTACK_TUTORIAL_ENEMY_2_BAWL,
ATTACK_TUTORIAL_ENEMY_3_COLLY_WOBBLE
};
ActorInfo D_8038AC20 = { ActorInfo D_8038AC20 = {
MARKER_12B_ATTACK_TUTORIAL, ACTOR_167_ATTACK_TUTORIAL, NULL, MARKER_12B_ATTACK_TUTORIAL, ACTOR_167_ATTACK_TUTORIAL, NULL,
1, NULL, 1, NULL,
@@ -34,7 +28,7 @@ ActorInfo D_8038AC20 = {
}; };
/* .code */ /* .code */
void __chAttackTutorial_enemy(ActorMarker *marker, s32 enemy_id) { void __chAttackTutorial_enemy(ActorMarker *marker, enum actor_e enemy_id) {
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
s32 pad; s32 pad;
Actor *enemy = spawn_child_actor(enemy_id, &actor); Actor *enemy = spawn_child_actor(enemy_id, &actor);
@@ -42,24 +36,24 @@ void __chAttackTutorial_enemy(ActorMarker *marker, s32 enemy_id) {
actor->unk100 = enemy->marker; actor->unk100 = enemy->marker;
enemy->unk100 = actor->marker; enemy->unk100 = actor->marker;
if (actor->unk10_12 == ATTACK_TUTORIAL_ENEMY_3_COLLY_WOBBLE && actor->unk38_31 == 1) { if (actor->unk10_12 == VEGETABLE_3_COLLY_WOBBLE && actor->unk38_31 == 1) {
enemy->unk38_31 = 1; enemy->unk38_31 = 1;
} }
else {//L803871D4 else {//L803871D4
enemy->unk38_31 = 0; enemy->unk38_31 = 0;
} }
enemy->unk10_12 = ATTACK_TUTORIAL_ENEMY_1_TOPPER; enemy->unk10_12 = VEGETABLE_1_TOPPER;
if (marker); if (marker);
} }
s32 __chAttackTutorial_spawnEnemy(Actor *this, enum chAttackTutorial_enemy_e enemy) { s32 __chAttackTutorial_spawnEnemy(Actor *this, enum vegetable_e vegetable_id) {
volatile s32 sp1C; volatile enum actor_e enemy_id;
sp1C = enemy == ATTACK_TUTORIAL_ENEMY_1_TOPPER ? ACTOR_166_TOPPER_A : enemy_id = vegetable_id == VEGETABLE_1_TOPPER ? ACTOR_166_TOPPER_A :
enemy == ATTACK_TUTORIAL_ENEMY_2_BAWL ? ACTOR_165_BAWL_A : ACTOR_164_COLLYWOBBLE_A; vegetable_id == VEGETABLE_2_BAWL ? ACTOR_165_BAWL_A : ACTOR_164_COLLYWOBBLE_A;
__spawnQueue_add_2(__chAttackTutorial_enemy, this->marker, sp1C); __spawnQueue_add_2(__chAttackTutorial_enemy, this->marker, enemy_id);
} }
void __chAttackTutorial_learnedTextActions(ActorMarker *marker, enum asset_e text_id, s32 arg2) { void __chAttackTutorial_learnedTextActions(ActorMarker *marker, enum asset_e text_id, s32 arg2) {
@@ -93,7 +87,7 @@ void chAttackTutorial_setState(Actor *this, s32 state) {
gcdialog_showText(ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, __chAttackTutorial_learnedTextActions); gcdialog_showText(ASSET_DFF_TEXT_BOTTLES_CLAW_SWIPE_LEARN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, __chAttackTutorial_learnedTextActions);
} }
else { else {
gcdialog_showText(this->unk10_12 == ATTACK_TUTORIAL_ENEMY_1_TOPPER ? ASSET_E15_TEXT_UNKNOWN : ASSET_E17_TEXT_UNKNOWN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, NULL); gcdialog_showText(this->unk10_12 == VEGETABLE_1_TOPPER ? ASSET_E15_TEXT_UNKNOWN : ASSET_E17_TEXT_UNKNOWN, 0xE, this->unk1C, this->marker, __chAttackTutorial_learnedTextCallback, NULL);
} }
break; break;
@@ -112,7 +106,7 @@ void chAttackTutorial_setState(Actor *this, s32 state) {
mapSpecificFlags_set(SM_SPECIFIC_FLAG_C, TRUE); mapSpecificFlags_set(SM_SPECIFIC_FLAG_C, TRUE);
if (!honeycombscore_get(HONEYCOMB_17_SM_COLIWOBBLE)) { if (!honeycombscore_get(HONEYCOMB_17_SM_COLIWOBBLE)) {
this->unk10_12 = ATTACK_TUTORIAL_ENEMY_3_COLLY_WOBBLE; this->unk10_12 = VEGETABLE_3_COLLY_WOBBLE;
this->unk38_31 = 1; this->unk38_31 = 1;
__chAttackTutorial_spawnEnemy(this, this->unk10_12); __chAttackTutorial_spawnEnemy(this, this->unk10_12);
} }
@@ -146,8 +140,8 @@ void chAttackTutorial_update(Actor *this) {
this->unk1C_z = this->position_z; this->unk1C_z = this->position_z;
} }
this->unk10_12 = ability_isUnlocked(ABILITY_C_ROLL) ? ATTACK_TUTORIAL_ENEMY_2_BAWL : this->unk10_12 = ability_isUnlocked(ABILITY_C_ROLL) ? VEGETABLE_2_BAWL :
ability_isUnlocked(ABILITY_4_CLAW_SWIPE) ? ATTACK_TUTORIAL_ENEMY_1_TOPPER : NULL; ability_isUnlocked(ABILITY_4_CLAW_SWIPE) ? VEGETABLE_1_TOPPER : NULL;
this->initialized = TRUE; this->initialized = TRUE;
} }
@@ -221,15 +215,15 @@ void chAttackTutorial_talk(ActorMarker *marker) {
} }
switch (actor->unk10_12) { switch (actor->unk10_12) {
case ATTACK_TUTORIAL_ENEMY_1_TOPPER: //L803877D8 case VEGETABLE_1_TOPPER: //L803877D8
text_id = try_count ? ASSET_E15_TEXT_UNKNOWN : ASSET_E14_TEXT_UNKNOWN; text_id = try_count ? ASSET_E15_TEXT_UNKNOWN : ASSET_E14_TEXT_UNKNOWN;
break; break;
case ATTACK_TUTORIAL_ENEMY_2_BAWL: //L803877F4 case VEGETABLE_2_BAWL: //L803877F4
text_id = try_count ? ASSET_E17_TEXT_UNKNOWN : ASSET_E16_TEXT_UNKNOWN; text_id = try_count ? ASSET_E17_TEXT_UNKNOWN : ASSET_E16_TEXT_UNKNOWN;
break; break;
case ATTACK_TUTORIAL_ENEMY_3_COLLY_WOBBLE: //L80387810 case VEGETABLE_3_COLLY_WOBBLE: //L80387810
text_id = try_count ? ASSET_E19_TEXT_UNKNOWN : ASSET_E18_TEXT_UNKNOWN; text_id = try_count ? ASSET_E19_TEXT_UNKNOWN : ASSET_E18_TEXT_UNKNOWN;
break; break;

View File

@@ -2,203 +2,223 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
/* extern functions */
f32 mapModel_getFloorY(f32 *);
//external
f32 mapModel_getFloorY(f32*);
void spawnQueue_bundle_f32(s32, f32, f32, f32); void spawnQueue_bundle_f32(s32, f32, f32, f32);
void timed_mapSpecificFlags_setTrue(f32, s32); void timed_mapSpecificFlags_setTrue(f32, s32);
void subaddie_set_state_with_direction(Actor *, s32, f32, s32); void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
//typedefs /* typedefs and declarations */
typedef struct ch_vegatable{ enum chVegetables_state_e {
VEGETABLES_STATE_1_UNKNOWN = 1,
VEGETABLES_STATE_2_UNKNOWN,
VEGETABLES_STATE_3_UNKNOWN,
VEGETABLES_STATE_4_UNKNOWN
};
typedef struct ch_vegetable {
TUPLE(f32, unk0); TUPLE(f32, unk0);
s32 unkC; s32 vegetable_id;
u32 pad10_31: 19; u32 pad10_31: 19;
u32 unk10_12: 4; u32 unk10_12: 4;
u32 pad10_8: 9; u32 pad10_8: 9;
} ChVeg; } ChVeg;
//public /* public functions */
Actor *func_80387DF4(ActorMarker *, Gfx**, Mtx**, Vtx **); Actor *chVegetablesDraw(ActorMarker *, Gfx **, Mtx **, Vtx **);
void func_80388080(Actor *); void chVegetablesUpdate(Actor *);
/* .data */ /* .data */
ActorAnimationInfo chCarrotAnimations[5] = { ActorAnimationInfo chTopperAnimations[5] = {
{0, 0.0f}, {NULL, 0.0f},
{0x223, 1000000.0f}, {ASSET_223_ANIM_TOPPER_UNKNOWN, 1000000.0f},
{0x223, 1.0f}, {ASSET_223_ANIM_TOPPER_UNKNOWN, 1.0f},
{0x224, 0.75f}, {ASSET_224_ANIM_TOPPER_UNKNOWN, 0.75f},
{0x223, 1.0f} {ASSET_223_ANIM_TOPPER_UNKNOWN, 1.0f}
}; };
ActorInfo D_8038AC78 = { MARKER_12A_TOPPER_A, ACTOR_166_TOPPER_A, MODEL_TOPPER, 1, chCarrotAnimations, ActorInfo D_8038AC78 = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_12A_TOPPER_A, ACTOR_166_TOPPER_A, ASSET_4ED_MODEL_TOPPER,
1, chTopperAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
2000, 0, 1.0f, 0 2000, 0, 1.0f, 0
}; };
ActorInfo D_8038AC9C = { MARKER_1E6_TOPPER_B, ACTOR_TOPPER_B, MODEL_TOPPER, 1, chCarrotAnimations, ActorInfo D_8038AC9C = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_1E6_TOPPER_B, ACTOR_TOPPER_B, ASSET_4ED_MODEL_TOPPER,
1, chTopperAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
2000, 0, 1.0f, 0 2000, 0, 1.0f, 0
}; };
ActorAnimationInfo chOnionAnimations[5] = { ActorAnimationInfo chBawlAnimations[5] = {
{0, 0.0f}, {NULL, 0.0f},
{0x226, 1000000.0f}, {ASSET_226_ANIM_BAWL_UNKNOWN, 1000000.0f},
{0x226, 1.0f}, {ASSET_226_ANIM_BAWL_UNKNOWN, 1.0f},
{0x227, 0.75f}, {ASSET_227_ANIM_BAWL_UNKNOWN, 0.75f},
{0x226, 1.0f} {ASSET_226_ANIM_BAWL_UNKNOWN, 1.0f}
}; };
ActorInfo D_8038ACE8 = { MARKER_129_BAWL_A, ACTOR_165_BAWL_A, MODEL_BAWL, 1, chOnionAnimations, ActorInfo D_8038ACE8 = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_129_BAWL_A, ACTOR_165_BAWL_A, ASSET_4EF_MODEL_BAWL,
1, chBawlAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
0, 0, 1.0f, 0 0, 0, 1.0f, 0
}; };
ActorInfo D_8038AD0C = { MARKER_1E7_BAWL_B, ACTOR_BAWL_B, MODEL_BAWL, 1, chOnionAnimations, ActorInfo D_8038AD0C = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_1E7_BAWL_B, ACTOR_BAWL_B, ASSET_4EF_MODEL_BAWL,
1, chBawlAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
0, 0, 1.0f, 0 0, 0, 1.0f, 0
}; };
ActorAnimationInfo chCauliflowerAnimations[5] = { ActorAnimationInfo chCollywobbleAnimations[5] = {
{0, 0.0f}, {NULL, 0.0f},
{0x225, 10000000.0f}, {ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 10000000.0f},
{0x225, 1.0f}, {ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 1.0f},
{0x225, 10000000.0f}, {ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 10000000.0f},
{0x225, 1.0f} {ASSET_225_ANIM_COLLYWOBBLE_UNKNOWN, 1.0f}
}; };
ActorInfo D_8038AD58 = { MARKER_128_COLLYWOBBLE_A, ACTOR_164_COLLYWOBBLE_A, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations, ActorInfo D_8038AD58 = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_128_COLLYWOBBLE_A, ACTOR_164_COLLYWOBBLE_A, ASSET_4EE_MODEL_COLLYWOBBLE,
1, chCollywobbleAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
0, 0, 2.0f, 0 0, 0, 2.0f, 0
}; };
ActorInfo D_8038AD7C = { MARKER_1E8_COLLYWOBBLE_B, ACTOR_COLLYWOBBLE_B, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations, ActorInfo D_8038AD7C = {
func_80388080, actor_update_func_80326224, func_80387DF4, MARKER_1E8_COLLYWOBBLE_B, ACTOR_COLLYWOBBLE_B, ASSET_4EE_MODEL_COLLYWOBBLE,
1, chCollywobbleAnimations,
chVegetablesUpdate, actor_update_func_80326224, chVegetablesDraw,
0, 0, 2.0f, 0 0, 0, 2.0f, 0
}; };
s32 D_8038ADA0[3] = {0xFF, 0xFF, 0xFF}; s32 D_8038ADA0[3] = {0xFF, 0xFF, 0xFF};
ParticleScaleAndLifetimeRanges D_8038ADAC = { ParticleScaleAndLifetimeRanges D_8038ADAC = {
{0.1f, 0.5f}, {0.1f, 0.5f},
{1.5f, 3.0f}, {1.5f, 3.0f},
{0.0f, 0.01f}, {0.0f, 0.01f},
{1.0f, 1.5f}, {1.0f, 1.5f},
0.0f, 0.01f, 0.0f, 0.01f,
}; };
ParticleSettingsVelocityPosition D_8038ADD4 = { ParticleSettingsVelocityPosition D_8038ADD4 = {
{{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
{{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}} {{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}}
}; };
ParticleScaleAndLifetimeRanges D_8038AE04 = { ParticleScaleAndLifetimeRanges D_8038AE04 = {
{0.5f, 0.75f}, {0.5f, 0.75f},
{0.4f, 0.6f}, {0.4f, 0.6f},
{0.0f, 0.01f}, {0.0f, 0.01f},
{4.0f, 4.0f}, {4.0f, 4.0f},
0.0f, 0.2f 0.0f, 0.2f
}; };
ParticleSettingsVelocityAccelerationPosition D_8038AE2C = { ParticleSettingsVelocityAccelerationPosition D_8038AE2C = {
{{-100.0f, 200.0f, -100.0f}, {100.0f, 400.0f, 100.0f}}, {{-100.0f, 200.0f, -100.0f}, {100.0f, 400.0f, 100.0f}},
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}}, {{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
{{-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}} {{-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}}
}; };
ParticleScaleAndLifetimeRanges D_8038AE74 = { ParticleScaleAndLifetimeRanges D_8038AE74 = {
{1.0f, 1.0f}, {1.0f, 1.0f},
{1.0f, 1.0f}, {1.0f, 1.0f},
{0.0f, 0.01f}, {0.0f, 0.01f},
{2.0f, 2.0f}, {2.0f, 2.0f},
0.0f, 0.5f 0.0f, 0.5f
}; };
ParticleSettingsVelocityAccelerationPosition D_8038AE9C = { ParticleSettingsVelocityAccelerationPosition D_8038AE9C = {
{{-100.0f, 400.0f, -100.0f}, {100.0f, 600.0f, 100.0f}}, {{-100.0f, 400.0f, -100.0f}, {100.0f, 600.0f, 100.0f}},
{{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}}, {{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}},
{{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}} {{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}}
}; };
ParticleScaleAndLifetimeRanges D_8038AEE4 = { ParticleScaleAndLifetimeRanges D_8038AEE4 = {
{0.6f, 0.8f}, {0.6f, 0.8f},
{0.5f, 0.7f}, {0.5f, 0.7f},
{0.0f, 0.01f}, {0.0f, 0.01f},
{4.0f, 4.0f}, {4.0f, 4.0f},
0.0f, 0.5f 0.0f, 0.5f
}; };
ParticleSettingsVelocityAccelerationPosition D_8038AF0C ={ ParticleSettingsVelocityAccelerationPosition D_8038AF0C = {
{{-200.0f, 200.0f, -200.0f}, {200.0f, 600.0f, 200.0f}}, {{-200.0f, 200.0f, -200.0f}, {200.0f, 600.0f, 200.0f}},
{{0.0f, -900.0f, 0.0f}, {0.0f, -900.0f, 0.0f}}, {{ 0.0f, -900.0f, 0.0f}, { 0.0f, -900.0f, 0.0f}},
{{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}},
}; };
/* .code */ /* .code */
void func_80387910(ParticleEmitter *arg0, f32 *arg1, s32 arg2){ void __chVegetables_emitDust(ParticleEmitter *pCtrl, f32 *pos, s32 n) {
s32 sp24[3] = D_8038ADA0; s32 sp24[3] = D_8038ADA0;
particleEmitter_setRGB(arg0, sp24); particleEmitter_setRGB(pCtrl, sp24);
particleEmitter_setSprite(arg0, ASSET_700_SPRITE_DUST); particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
particleEmitter_setStartingFrameRange(arg0, 0, 7); particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(arg0, arg1); particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038ADAC); particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038ADAC);
particleEmitter_setPositionAndVelocityRanges(arg0, &D_8038ADD4); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038ADD4);
particleEmitter_emitN(arg0, arg2); particleEmitter_emitN(pCtrl, n);
} }
void func_803879B8(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){ void func_803879B8(ParticleEmitter *pCtrl, f32 *pos, s32 n, enum asset_e model_id) {
particleEmitter_func_802EF9F8(arg0, 0.6f); particleEmitter_func_802EF9F8(pCtrl, 0.6f);
particleEmitter_func_802EFA18(arg0, 2); particleEmitter_func_802EFA18(pCtrl, 2);
particleEmitter_setModel(arg0, model_id); particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(arg0, arg1); particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setDrawMode(arg0, 2); particleEmitter_setDrawMode(pCtrl, 2);
particleEmitter_setAngularVelocityRange(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AE04); particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AE04);
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AE2C); particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AE2C);
particleEmitter_emitN(arg0, arg2); particleEmitter_emitN(pCtrl, n);
} }
void func_80387A80(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){ void func_80387A80(ParticleEmitter *pCtrl, f32 *pos, s32 n, enum asset_e model_id) {
particleEmitter_func_802EF9F8(arg0, 0.6f); particleEmitter_func_802EF9F8(pCtrl, 0.6f);
particleEmitter_func_802EFA18(arg0, 3); particleEmitter_func_802EFA18(pCtrl, 3);
particleEmitter_setModel(arg0, model_id); particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(arg0, arg1); particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setDrawMode(arg0, 2); particleEmitter_setDrawMode(pCtrl, 2);
particleEmitter_setAngularVelocityRange(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); particleEmitter_setAngularVelocityRange(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f);
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AE74); particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AE74);
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AE9C); particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AE9C);
particleEmitter_emitN(arg0, arg2); particleEmitter_emitN(pCtrl, n);
} }
void func_80387B48(ParticleEmitter *arg0, f32 arg1[3], s32 arg2, enum asset_e model_id){ void func_80387B48(ParticleEmitter *pCtrl, f32 pos[3], s32 n, enum asset_e model_id) {
particleEmitter_func_802EF9F8(arg0, 0.7f); particleEmitter_func_802EF9F8(pCtrl, 0.7f);
particleEmitter_func_802EFA18(arg0, 4); particleEmitter_func_802EFA18(pCtrl, 4);
particleEmitter_setModel(arg0, model_id); particleEmitter_setModel(pCtrl, model_id);
particleEmitter_setPosition(arg0, arg1); particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setDrawMode(arg0, 2); particleEmitter_setDrawMode(pCtrl, 2);
particleEmitter_setAngularVelocityRange(arg0, 150.0f, -300.0f, -300.0f, 300.0f, 300.0f, -150.0f); particleEmitter_setAngularVelocityRange(pCtrl, 150.0f, -300.0f, -300.0f, 300.0f, 300.0f, -150.0f);
particleEmitter_setSfx(arg0, SFX_1F_HITTING_AN_ENEMY_3, 8000); particleEmitter_setSfx(pCtrl, SFX_1F_HITTING_AN_ENEMY_3, 8000);
particleEmitter_setScaleAndLifetimeRanges(arg0, &D_8038AEE4); particleEmitter_setScaleAndLifetimeRanges(pCtrl, &D_8038AEE4);
particleEmitter_setVelocityAccelerationAndPositionRanges(arg0, &D_8038AF0C); particleEmitter_setVelocityAccelerationAndPositionRanges(pCtrl, &D_8038AF0C);
particleEmitter_emitN(arg0, arg2); particleEmitter_emitN(pCtrl, n);
} }
void func_80387C28(Actor * this){ void __chVegetables_dieActor(Actor *this) {
ChVeg * local = (ChVeg *)&this->local; ChVeg *local = (ChVeg *) &this->local;
f32 sp30[3]; f32 pos[3];
FUNC_8030E8B4(SFX_111_WHIPCRACK_DEATH, 1.0f, 32000, this->position, 1000, 2000); FUNC_8030E8B4(SFX_111_WHIPCRACK_DEATH, 1.0f, 32000, this->position, 1000, 2000);
if(local->unkC == 3){
sp30[0] = this->position_x; if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE) {
sp30[1] = this->position_y; pos[0] = this->position_x;
sp30[2] = this->position_z; pos[1] = this->position_y;
sp30[1] += 50.0f; pos[2] = this->position_z;
func_80387B48(partEmitMgr_newEmitter(0xC), sp30, 0xC, 0x4F4); pos[1] += 50.0f;
func_803879B8(partEmitMgr_newEmitter(4), sp30, 0x4, 0x4F2);
func_803879B8(partEmitMgr_newEmitter(4), sp30, 0x4, 0x4F3); func_80387B48(partEmitMgr_newEmitter(12), pos, 0xC, ASSET_4F4_MODEL_UNKNOWN);
sp30[1] += 50.0f; func_803879B8(partEmitMgr_newEmitter(4), pos, 0x4, ASSET_4F2_MODEL_UNKNOWN);
func_80387910(partEmitMgr_newEmitter(8), sp30, 8); func_803879B8(partEmitMgr_newEmitter(4), pos, 0x4, ASSET_4F3_MODEL_UNKNOWN);
pos[1] += 50.0f;
__chVegetables_emitDust(partEmitMgr_newEmitter(8), pos, 8);
}//L80387D18 }//L80387D18
if (this->unk38_31) { if (this->unk38_31) {
@@ -206,34 +226,38 @@ void func_80387C28(Actor * this){
func_802CA1CC(HONEYCOMB_17_SM_COLIWOBBLE); func_802CA1CC(HONEYCOMB_17_SM_COLIWOBBLE);
__spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, BUNDLE_1F_SM_EMPTY_HONEYCOMB, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)); __spawnQueue_add_4((GenFunction_4) spawnQueue_bundle_f32, BUNDLE_1F_SM_EMPTY_HONEYCOMB, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z));
}//L80387D64 }//L80387D64
timed_mapSpecificFlags_setTrue(1.5f, SM_SPECIFIC_FLAG_7); timed_mapSpecificFlags_setTrue(1.5f, SM_SPECIFIC_FLAG_7);
actor_collisionOff(this); actor_collisionOff(this);
if(local->unkC != 3){
subaddie_set_state_with_direction(this, 3, 0.0f, 1); if (local->vegetable_id != VEGETABLE_3_COLLY_WOBBLE) {
subaddie_set_state_with_direction(this, VEGETABLES_STATE_3_UNKNOWN, 0.0f, 1);
actor_playAnimationOnce(this); actor_playAnimationOnce(this);
} }
else{ else {
marker_despawn(this->marker); marker_despawn(this->marker);
} }
} }
void func_80387DCC(ActorMarker *marker, ActorMarker *other_marker){ void __chVegetables_die(ActorMarker *marker, ActorMarker *other_marker) {
func_80387C28(marker_getActor(marker)); __chVegetables_dieActor(marker_getActor(marker));
} }
Actor *func_80387DF4(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor *chVegetablesDraw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3) {
Actor *actor = marker_getActor(marker); Actor *actor = marker_getActor(marker);
if(actor->has_met_before) if (actor->has_met_before) {
func_8033A470(3, 7); func_8033A470(3, 7);
else }
else {
func_8033A45C(3, 0); func_8033A45C(3, 0);
}
return actor_draw(marker, gdl, mptr, arg3); return actor_draw(marker, gdl, mptr, arg3);
} }
void func_80387E64(Actor *this){ void func_80387E64(Actor *this) {
ChVeg *local = (ChVeg *)&this->local; ChVeg *local = (ChVeg *) &this->local;
this->unk1C_x = randf2(-50.0f, 50.0f); this->unk1C_x = randf2(-50.0f, 50.0f);
this->unk1C_y = randf2(-50.0f, 50.0f); this->unk1C_y = randf2(-50.0f, 50.0f);
@@ -244,252 +268,293 @@ void func_80387E64(Actor *this){
this->unk1C_z = local->unk0_z + this->unk1C_z; this->unk1C_z = local->unk0_z + this->unk1C_z;
} }
void func_80387F00(Actor *this){ void func_80387F00(Actor *this) {
ChVeg *local = (ChVeg *)&this->local; ChVeg *local = (ChVeg *) &this->local;
this->position_y += (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) ? 120.0 : 180.0; this->position_y += mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) ? 120.0 : 180.0;
local->unk0_x = this->position_x; local->unk0_x = this->position_x;
local->unk0_y = this->position_y; local->unk0_y = this->position_y;
local->unk0_z = this->position_z; local->unk0_z = this->position_z;
this->velocity_x = 0.0f; this->velocity_x = 0.0f;
this->velocity_y = 0.0f; this->velocity_y = 0.0f;
this->velocity_z = 0.0f; this->velocity_z = 0.0f;
func_80387E64(this); func_80387E64(this);
} }
int func_80387FA8(Actor *this, ChVeg *local, s32 yaw, s32 arg3){ int func_80387FA8(Actor *this, ChVeg *local, s32 yaw, s32 arg3) {
f32 sp24[3]; f32 sp24[3];
f32 sp18[3]; f32 sp18[3];
sp18[0] = arg3; sp18[0] = arg3;
sp18[1] = 0.0f; sp18[1] = 0.0f;
sp18[2] = 0.0f; sp18[2] = 0.0f;
ml_vec3f_yaw_rotate_copy(sp18, sp18, yaw - 90.0); ml_vec3f_yaw_rotate_copy(sp18, sp18, yaw - 90.0);
sp24[0] = sp18[0] + local->unk0_x; sp24[0] = sp18[0] + local->unk0_x;
sp24[1] = sp18[1] + local->unk0_y; sp24[1] = sp18[1] + local->unk0_y;
sp24[2] = sp18[2] + local->unk0_z; sp24[2] = sp18[2] + local->unk0_z;
if(func_80307258(sp24, this->unk10_25 - 1, this->unk10_18 - 1) == -1)
if (func_80307258(sp24, this->unk10_25 - 1, this->unk10_18 - 1) == -1) {
return 0; return 0;
else }
else {
return 1; return 1;
}
} }
void func_80388080(Actor *this){ void chVegetablesUpdate(Actor *this) {
f32 temp_velZ; f32 temp_velZ;
f32 temp_velX; f32 temp_velX;
f32 temp_f0; f32 temp_f0;
f32 sp78; f32 tick;
f32 sp6C[3]; f32 sp6C[3];
f32 sp60[3]; f32 sp60[3];
f32 sp54[3]; f32 position[3];
ChVeg *local = (ChVeg *)&this->local; //sp38 ChVeg *local = (ChVeg *) &this->local; //sp38
f32 sp30; f32 unused;
if (!this->initialized) {
switch (this->marker->id) {
if(!this->initialized){
switch(this->marker->id){
default: default:
local->unkC = 3; //cauliflower local->vegetable_id = VEGETABLE_3_COLLY_WOBBLE; //cauliflower
break; break;
case 0x12A: //L803880F0
case 0x1E6: //L803880F0 case MARKER_12A_TOPPER_A: //L803880F0
local->unkC = 1; //carrot case MARKER_1E6_TOPPER_B: //L803880F0
local->vegetable_id = VEGETABLE_1_TOPPER; //carrot
break; break;
case 0x129: //L80388100
case 0x1E7: //L80388100 case MARKER_129_BAWL_A: //L80388100
local->unkC = 2; //onion case MARKER_1E7_BAWL_B: //L80388100
local->vegetable_id = VEGETABLE_2_BAWL; //onion
break; break;
} }
actor_collisionOff(this); actor_collisionOff(this);
marker_setCollisionScripts(this->marker, NULL, NULL, func_80387DCC); marker_setCollisionScripts(this->marker, NULL, NULL, __chVegetables_die);
this->unk1C_x = this->position_x; this->unk1C_x = this->position_x;
this->unk1C_y = this->position_y; this->unk1C_y = this->position_y;
this->unk1C_z = this->position_z; this->unk1C_z = this->position_z;
this->position_y -= 200.f; this->position_y -= 200.f;
do{//L80388154 do {//L80388154
temp_velX = randf2(-10.0f, 10.0f); temp_velX = randf2(-10.0f, 10.0f);
temp_f0 =(0.0f <= temp_velX) ? temp_velX : -temp_velX; temp_f0 = 0.0f <= temp_velX ? temp_velX : -temp_velX;
}while(temp_f0 < 5.0); } while (temp_f0 < 5.0);
do{//L803881AC do {//L803881AC
temp_velZ = randf2(-10.0f, 10.0f); temp_velZ = randf2(-10.0f, 10.0f);
temp_f0 =(0.0f <= temp_velZ) ? temp_velZ : -temp_velZ; temp_f0 = 0.0f <= temp_velZ ? temp_velZ : -temp_velZ;
}while(temp_f0 < 5.0); } while (temp_f0 < 5.0);
this->velocity_x = temp_velX; this->velocity_x = temp_velX;
this->velocity_y = (local->unkC == 3) ? 90.0f : 70.0f; this->velocity_y = local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 90.0f : 70.0f;
this->velocity_z = temp_velZ; this->velocity_z = temp_velZ;
this->has_met_before = TRUE; this->has_met_before = TRUE;
this->unk138_23 = 0; this->unk138_23 = 0;
this->unk38_0 = 0; this->unk38_0 = 0;
this->initialized = TRUE; this->initialized = TRUE;
this->scale = 0.5; this->scale = 0.5;
}//L80388278 }//L80388278
switch (this->state)
{
case 1: //L803882B0
if(mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) || this->unk10_12){
//L803882E4
if(mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){ //L8038830C
this->unk1C_y += (local->unkC == 3)? 120.0 : 0.0;
}else{//L80388350
this->unk1C_y += (local->unkC == 3)? 270.0 : 85.0;
}
//L80388384
subaddie_set_state(this, 4);
}
break;
case 4: //L8038839C
this->position_x = this->velocity_x + this->position_x;
this->position_y = this->velocity_y + this->position_y;
this->position_z = this->velocity_z + this->position_z;
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 = mapModel_getFloorY(this->position);
if(local->unkC == 3)
func_80387F00(this);
actor_collisionOn(this); switch (this->state) {
subaddie_set_state(this, 2); case VEGETABLES_STATE_1_UNKNOWN: //L803882B0
}//L80388494 if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(
VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) || this->unk10_12) {//L803882E4
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) { //L8038830C
this->unk1C_y += local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 120.0 : 0.0;
}
else {//L80388350
this->unk1C_y += local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE ? 270.0 : 85.0;
}
//L80388384
subaddie_set_state(this, VEGETABLES_STATE_4_UNKNOWN);
}
break;
if(!this->unk138_23){ case VEGETABLES_STATE_4_UNKNOWN: //L8038839C
if(0.0f < this->position_y){ this->position_x = this->velocity_x + this->position_x;
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1000, 2000); this->position_y = this->velocity_y + this->position_y;
this->unk138_23 = 1; this->position_z = this->velocity_z + this->position_z;
this->scale = 1.0f;
}
}
break; this->velocity_y -= 5.0f;
case 2: //L803884E4 this->scale = MIN(this->scale + 0.05, 1.0);
if(this->unk38_0){
if(func_80329480(this)){ if (this->velocity_y < 0.0f && this->position_y < this->unk1C_y) {
this->unk38_0 = 0; this->position_y = mapModel_getFloorY(this->position);
}
}else{//L80388520 if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE) {
if(local->unkC == 1){ func_80387F00(this);
this->actor_specific_1_f = 3.0f;
if(mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)){//L80388554
if(!func_80329030(this, 0) && func_80329480(this)){
func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4);
this->unk38_0 = 1;
}//L803885A0
if(func_803292E0(this)){
this->yaw_ideal = func_80329784(this);
}
else{//L803885CC
if(randf() < 0.02){
func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A);
}
}//L80388B68
} }
else{//L80388618
this->yaw_ideal = func_80329784(this); actor_collisionOn(this);
subaddie_set_state(this, VEGETABLES_STATE_2_UNKNOWN);
}//L80388494
if (!this->unk138_23) {
if (0.0f < this->position_y) {
FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1000, 2000);
this->unk138_23 = 1;
this->scale = 1.0f;
} }
} }
else if(local->unkC == 2){//L80388634 break;
this->actor_specific_1_f = 4.0f;
if(!func_80329030(this, 0) && func_80329480(this)){ case VEGETABLES_STATE_2_UNKNOWN: //L803884E4
func_80328CEC(this, (s32)this->yaw, 0x78, 0xB4); if (this->unk38_0) {
this->unk38_0 = 1; if (func_80329480(this)) {
}//L80388698 this->unk38_0 = 0;
if(mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) && func_803292E0(this))){
this->yaw_ideal = func_80329784(this);
}else{//L803886E4
if(randf() < 0.02){//D_8038B1D0){
func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A);
}
} }
}else{//L80388730 }
sp78 = time_getDelta(); else {//L80388520
sp6C[0] = this->unk1C_x - this->position_x; if (local->vegetable_id == VEGETABLE_1_TOPPER) {
sp6C[1] = this->unk1C_y - this->position_y; this->actor_specific_1_f = 3.0f;
sp6C[2] = this->unk1C_z - this->position_z;
if( LENGTH_VEC3F(sp6C) < 40.0f){ if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE)) {//L80388554
ml_vec3f_set_length(sp6C, 400.0f); if (!func_80329030(this, 0) && func_80329480(this)) {
} func_80328CEC(this, (s32) this->yaw, 0x78, 0xb4);
else{
ml_vec3f_set_length(sp6C, 100.0f);
}
this->position_x += this->velocity_x*sp78 + sp6C[0]*sp78*sp78;
this->position_y += this->velocity_y*sp78 + sp6C[1]*sp78*sp78;
this->position_z += this->velocity_z*sp78 + sp6C[2]*sp78*sp78;
this->velocity_x += sp6C[0]*sp78;
this->velocity_y += sp6C[1]*sp78;
this->velocity_z += sp6C[2]*sp78;
if(gu_sqrtf(this->velocity_z*this->velocity_z + (this->velocity_x*this->velocity_x + this->velocity_y*this->velocity_y)) > 50.0f){
ml_vec3f_set_length(this->velocity, 50.0f);
}
if(ml_distance_vec3f(this->position, this->unk1C) < 20.0f){
func_80387E64(this);
}
this->actor_specific_1_f = 5.0f;
if(mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))){ //L8038892C
if(!func_80387FA8(this, local, (s32)this->yaw, (s32)this->actor_specific_1_f)){
if(func_80329480(this)){
func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4);
this->unk38_0 = 1; this->unk38_0 = 1;
}//L80388994 }//L803885A0
}else{ //L803889A0
this->position_x -= local->unk0_x; if (func_803292E0(this)) {
this->position_y -= local->unk0_y; this->yaw_ideal = func_80329784(this);
this->position_z -= local->unk0_z; }//L803885CC
this->unk1C_x -= local->unk0_x; else if (randf() < 0.02) {
this->unk1C_y -= local->unk0_y; func_80328CEC(this, (s32) this->yaw, 0x1E, 0x5A);
this->unk1C_z -= local->unk0_z; }//L80388B68
TUPLE_ASSIGN(sp60, this->actor_specific_1_f, 0.0f, 0.0f); }
ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0); else {//L80388618
local->unk0_x = sp60[0] + local->unk0_x;
local->unk0_y = sp60[1] + local->unk0_y;
local->unk0_z = sp60[2] + local->unk0_z;
this->position_x = local->unk0_x + this->position_x;
this->position_y = local->unk0_y + this->position_y;
this->position_z = local->unk0_z + this->position_z;
this->unk1C_x = local->unk0_x + this->unk1C_x;
this->unk1C_y = local->unk0_y + this->unk1C_y;
this->unk1C_z = local->unk0_z + this->unk1C_z;
}//L80388AD8
if(func_803292E0(this)){
this->yaw_ideal = func_80329784(this); this->yaw_ideal = func_80329784(this);
}else{//L80388B04 }
if(randf() < 0.01){ }
func_80328CEC(this, (s32)this->yaw, 0x1e, 0x5A); else if (local->vegetable_id == VEGETABLE_2_BAWL) {//L80388634
this->actor_specific_1_f = 4.0f;
if (!func_80329030(this, 0) && func_80329480(this)) {
func_80328CEC(this, (s32) this->yaw, 0x78, 0xB4);
this->unk38_0 = 1;
}//L80388698
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) && func_803292E0(
this))) {
this->yaw_ideal = func_80329784(this);
}//L803886E4
else if (randf() < 0.02) {//D_8038B1D0){
func_80328CEC(this, (s32) this->yaw, 0x1E, 0x5A);
}
}
else {//L80388730
tick = time_getDelta();
sp6C[0] = this->unk1C_x - this->position_x;
sp6C[1] = this->unk1C_y - this->position_y;
sp6C[2] = this->unk1C_z - this->position_z;
if (LENGTH_VEC3F(sp6C) < 40.0f) {
ml_vec3f_set_length(sp6C, 400.0f);
}
else {
ml_vec3f_set_length(sp6C, 100.0f);
}
this->position_x += this->velocity_x * tick + sp6C[0] * tick * tick;
this->position_y += this->velocity_y * tick + sp6C[1] * tick * tick;
this->position_z += this->velocity_z * tick + sp6C[2] * tick * tick;
this->velocity_x += sp6C[0] * tick;
this->velocity_y += sp6C[1] * tick;
this->velocity_z += sp6C[2] * tick;
if (gu_sqrtf(SQ(this->velocity_z) + (SQ(this->velocity_x) + SQ(this->velocity_y))) > 50.0f) {
ml_vec3f_set_length(this->velocity, 50.0f);
}
if (ml_distance_vec3f(this->position, this->unk1C) < 20.0f) {
func_80387E64(this);
}
this->actor_specific_1_f = 5.0f;
if (mapSpecificFlags_get(SM_SPECIFIC_FLAG_C) || (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE))) { //L8038892C
if (!func_80387FA8(this, local, (s32) this->yaw, (s32) this->actor_specific_1_f)) {
if (func_80329480(this)) {
func_80328CEC(this, (s32) this->yaw, 0x78, 0xb4);
this->unk38_0 = 1;
}//L80388994
}
else { //L803889A0
this->position_x -= local->unk0_x;
this->position_y -= local->unk0_y;
this->position_z -= local->unk0_z;
this->unk1C_x -= local->unk0_x;
this->unk1C_y -= local->unk0_y;
this->unk1C_z -= local->unk0_z;
TUPLE_ASSIGN(sp60, this->actor_specific_1_f, 0.0f, 0.0f)
ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0);
local->unk0_x = sp60[0] + local->unk0_x;
local->unk0_y = sp60[1] + local->unk0_y;
local->unk0_z = sp60[2] + local->unk0_z;
this->position_x = local->unk0_x + this->position_x;
this->position_y = local->unk0_y + this->position_y;
this->position_z = local->unk0_z + this->position_z;
this->unk1C_x = local->unk0_x + this->unk1C_x;
this->unk1C_y = local->unk0_y + this->unk1C_y;
this->unk1C_z = local->unk0_z + this->unk1C_z;
}//L80388AD8
if (func_803292E0(this)) {
this->yaw_ideal = func_80329784(this);
}//L80388B04
else if (randf() < 0.01) {
func_80328CEC(this, (s32) this->yaw, 0x1e, 0x5A);
} }
} }
}else{ else { //L80388B50
//L80388B50 this->yaw_ideal = func_80329784(this);
this->yaw_ideal = func_80329784(this); }
}
}//L80388B68
func_80328FB0(this, 2.0f);
if (local->vegetable_id != VEGETABLE_3_COLLY_WOBBLE && actor_animationIsAt(this, 0.3f)) {
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.0f, 22000, this->position, 1000, 2000);
}
if (local->vegetable_id == VEGETABLE_3_COLLY_WOBBLE && actor_animationIsAt(this, 0.4f)) {
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.9f, 8000, this->position, 1000, 2000);
}
break;
case VEGETABLES_STATE_3_UNKNOWN: //L80388BFC
if (actor_animationIsAt(this, local->vegetable_id == VEGETABLE_2_BAWL ? 0.4 : 0.05)) {
position[0] = this->position_x;
position[1] = this->position_y;
position[2] = this->position_z;
if (local->vegetable_id == VEGETABLE_1_TOPPER) {
position[1] += 150.0f;
} }
this->has_met_before = FALSE;
func_80387A80(partEmitMgr_newEmitter(3), position, 3,
local->vegetable_id == VEGETABLE_1_TOPPER ? ASSET_4F0_MODEL_UNKNOWN : ASSET_4F1_MODEL_UNKNOWN);
}//L80388CC4
if (actor_animationIsAt(this, 0.75f)) {
func_80326310(this);
} }
}//L80388B68 break;
func_80328FB0(this, 2.0f);
if(local->unkC != 3 && actor_animationIsAt(this, 0.3f))
FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.0f, 22000, this->position, 1000, 2000);
if(local->unkC == 3 && actor_animationIsAt(this, 0.4f)){
FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.9f, 8000, this->position, 1000, 2000);
}
break;
case 3: //L80388BFC
if(actor_animationIsAt(this, (local->unkC == 2) ? 0.4 : 0.05)){
sp54[0] = this->position_x;
sp54[1] = this->position_y;
sp54[2] = this->position_z;
if(local->unkC == 1)
sp54[1] += 150.0f;
this->has_met_before = FALSE;
func_80387A80(partEmitMgr_newEmitter(3), sp54, 3, (local->unkC == 1)? 0x4f0: 0x4f1);
}//L80388CC4
if(actor_animationIsAt(this, 0.75f))
func_80326310(this);
break;
}//L80388CE0 }//L80388CE0
}//*/ }//*/

View File

@@ -6,7 +6,7 @@ void SM_func_80386FE0(Actor *this);
/* .data */ /* .data */
ActorInfo D_8038ABF0 = { ActorInfo D_8038ABF0 = {
0x134, 0x16E, 0, MARKER_134_UNKNOWN, ACTOR_16E_UNKNOWN, NULL,
1, NULL, 1, NULL,
SM_func_80386FE0, actor_update_func_80326224, func_80325340, SM_func_80386FE0, actor_update_func_80326224, func_80325340,
2000, 0, 0.0f, 0 2000, 0, 0.0f, 0