Documented ch Flowerpot

This commit is contained in:
Owlenuff
2024-10-01 09:21:23 +02:00
parent da234765d7
commit ecac4dde39
6 changed files with 82 additions and 70 deletions

View File

@@ -1191,7 +1191,7 @@ enum sfx_e
SFX_12C_FF_QUESTION_START,
SFX_12D_CAMERA_ZOOM_CLOSEST,
SFX_12E_CAMERA_ZOOM_MEDIUM,
SFX_12F_FUUUCK_YOUUU,
SFX_12F_THAAANK_YOOOUUU,
// from her final fall
SFX_130_GRUNTY_ECHOING_CRY = 0x0130,
SFX_131_GRUNTY_WEEEGH,
@@ -4553,8 +4553,8 @@ enum marker_e{
MARKER_AB_RUBEES_EGG_POT,
MARKER_AD_SLAPPA = 0xAD,
MARKER_AF_MAGIC_CARPET_SHADOW = 0xAF,
MARKER_AE_UNKNOWN,
MARKER_AF_MAGIC_CARPET_SHADOW,
MARKER_B0_MAGIC_CARPET_2,
MARKER_B1_SIR_SLUSH,
MARKER_B2_SNOWBALL,
@@ -4566,8 +4566,8 @@ enum marker_e{
MARKER_B9_FP_SNOWMAN_BUTTON = 0xB9,
MARKER_BA_XMAS_TREE,
MARKER_BC_GOBI_1 = 0xBC,
MARKER_BB_UNKNOWN,
MARKER_BC_GOBI_1,
MARKER_BD_GOBI_ROPE,
MARKER_BE_GOBI_ROCK,
MARKER_BF_GOBI_2,

View File

@@ -2,9 +2,15 @@
#include "functions.h"
#include "variables.h"
void func_80387280(Actor *this);
/* public functions */
void chFlowerpot_update(Actor *this);
/* .data */
enum chFlowerpot_state_e {
FLOWER_POT_STATE_1_IDLE = 1,
FLOWER_POT_STATE_2_FLOWERED
};
ActorAnimationInfo D_8038BA50[] = {
{0x00, 0.0f},
{ASSET_A9_ANIM_FLOWER_POT, 2.0f},
@@ -14,81 +20,86 @@ ActorAnimationInfo D_8038BA50[] = {
ActorInfo D_8038BA68 = {
MARKER_34_CEMETARY_POT, ACTOR_25_CEMETARY_POT, ASSET_3AE_MODEL_GRAVE_FLOWER_POT,
0x1, D_8038BA50,
func_80387280, func_80326224, actor_draw,
chFlowerpot_update, func_80326224, actor_draw,
0, 0, 0.0f, 0
};
/* .code */
//chflowerpots_getRemaining
s32 func_803871B0(void) {
s32 chFlowerpot_getRemaining(void) {
return levelSpecificFlags_getN(0x39, 3);
}
//chflowerpots_setRemaining
void func_803871D4(s32 arg0) {
void chFlowerpot_setRemaining(s32 arg0) {
levelSpecificFlags_setN(0x39, arg0, 3);
}
void MMM_func_803871FC(Actor *this) {
switch (this->state) {
case 1:
case FLOWER_POT_STATE_1_IDLE:
func_8033A45C(3, FALSE);
break;
case 2:
case FLOWER_POT_STATE_2_FLOWERED:
func_8033A45C(3, TRUE);
break;
}
func_803255FC(this);
}
void mmm_resetFlowerPots() {
func_803871D4(5);
void chFlowerpot_reset() {
chFlowerpot_setRemaining(5);
}
//chflowerpots_update
void func_80387280(Actor *this){
void chFlowerpot_update(Actor *this) {
this->marker->propPtr->unk8_3 = TRUE;
if (!this->initialized) {
this->initialized = TRUE;
this->unk130 = MMM_func_803871FC;
}
switch (this->state) {
case 1:
case FLOWER_POT_STATE_1_IDLE:
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
break;
case 2:
case FLOWER_POT_STATE_2_FLOWERED:
if (actor_animationIsAt(this, 0.2f)) {
FUNC_8030E8B4(SFX_12F_FUUUCK_YOUUU, 1.0f, 30000, this->position, 300, 2000);
FUNC_8030E8B4(SFX_12F_THAAANK_YOOOUUU, 1.0f, 30000, this->position, 300, 2000);
}
break;
}
}
bool MMM_func_80387340(ActorMarker *marker){
bool chFlowerpot_eggCollision(ActorMarker *marker) {
Actor *actor = marker_getActor(marker);
f32 sp20[3];
s32 sp1C;
f32 position[3];
s32 remaining;
if(actor->state == 2)
if (actor->state == FLOWER_POT_STATE_2_FLOWERED) {
return FALSE;
}
subaddie_set_state(actor, 2);
subaddie_set_state(actor, FLOWER_POT_STATE_2_FLOWERED);
animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE);
sp1C = func_803871B0();
if(sp1C != 0){
sp1C--;
if(sp1C == 0){
ml_vec3f_copy(sp20, actor->position);
sp20[1] += 80.0f;
remaining = chFlowerpot_getRemaining();
if (remaining != 0) {
remaining--;
if (remaining == 0) {
ml_vec3f_copy(position, actor->position);
position[1] += 80.0f;
comusic_playTrack(COMUSIC_2D_PUZZLE_SOLVED_FANFARE);
jiggy_spawn(JIGGY_63_MMM_FLOWER_POTS, sp20);
jiggy_spawn(JIGGY_63_MMM_FLOWER_POTS, position);
}
else {
comusic_playTrack(COMUSIC_2B_DING_B);
}
}
func_803871D4(sp1C);
chFlowerpot_setRemaining(remaining);
return TRUE;
}

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2);
int collisionTri_isHitFromAbove_actor(f32 arg0[3], Actor *arg1, s32 arg2);
extern bool func_80320DB0(f32[3], f32, f32[3], u32);
extern bool func_80323240(struct56s *, f32, f32[3]);
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
@@ -309,30 +309,31 @@ BKCollisionTri *func_802457C4(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32
}
void collisionTri_copy(BKCollisionTri *dst, BKCollisionTri *src) {
dst->unk0[0] = src->unk0[0];
dst->unk0[1] = src->unk0[1];
dst->unk0[2] = src->unk0[2];
TUPLE_COPY(dst->unk0, src->unk0)
dst->flags = src->flags;
dst->unk6 = src->unk6;
}
int func_802458A8(f32 arg0[3], ActorMarker *arg1, s32 arg2){
return func_802458E0(arg0, marker_getActor(arg1), arg2);
int collisionTri_isHitFromAbove_marker(f32 position[3], ActorMarker *marker, s32 verticalOffset) {
return collisionTri_isHitFromAbove_actor(position, marker_getActor(marker), verticalOffset);
}
int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2){
int collisionTri_isHitFromAbove_actor(f32 position[3], Actor *actor, s32 verticalOffset) {
f32 sp34[3];
f32 sp28[3];
f32 sp1C[3];
f32 tmp_position[3];
f32 adjusted_actor_position[3];
ml_vec3f_copy(sp28, arg0);
ml_vec3f_copy(sp1C, arg1->position);
sp1C[1] += (f32)arg2;
if(sp1C[1] < sp28[1])
return FALSE;
ml_vec3f_copy(tmp_position, position);
ml_vec3f_copy(adjusted_actor_position, actor->position);
adjusted_actor_position[1] += (f32) verticalOffset;
if(func_80320B98(sp28, sp1C, sp34, 0x25e0000)){
if (adjusted_actor_position[1] < tmp_position[1]) {
return FALSE;
}
if (func_80320B98(tmp_position, adjusted_actor_position, sp34, 0x25e0000)) {
return FALSE;
}
return TRUE;
}

View File

@@ -388,7 +388,7 @@ void __baMarker_resolveCollision(Prop *other_prop){
return;
player_getPosition(spAC);
spAC[1] += 40.0f;
if(func_802458E0(spAC, actor, 0x87) == 0)
if(collisionTri_isHitFromAbove_actor(spAC, actor, 0x87) == 0)
return;
volatileFlag_set(VOLATILE_FLAG_1E, 1);
if(fileProgressFlag_get(((actor->unkF4_8 - 1) ^ 1) + 0x49)){

View File

@@ -57,7 +57,7 @@ void func_803216D0(enum map_e map){
ttc_resetTresureHunt();
break;
case MAP_1B_MMM_MAD_MONSTER_MANSION:
mmm_resetFlowerPots();
chFlowerpot_reset();
break;
}
}

View File

@@ -51,7 +51,7 @@ void fxegg_shatter(u8 projectile_indx){
s32 func_803531C8(u8 projectile_indx, s32 arg1){
ActorProp *prop;
f32 sp40[3];
f32 egg_position[3];
ActorMarker * marker;
ActorMarker * other_marker;
s32 sp34;
@@ -63,7 +63,7 @@ s32 func_803531C8(u8 projectile_indx, s32 arg1){
marker = func_8033E840();
sp34 = 0;
projectile_getPosition(projectile_indx, sp40);
projectile_getPosition(projectile_indx, egg_position);
marker->unk38[1] = 0x1E;
prop = func_80320EB0(marker, 30.0f, 1);
if(prop != NULL && prop->unk8_0){
@@ -84,7 +84,7 @@ s32 func_803531C8(u8 projectile_indx, s32 arg1){
break;
case MARKER_33_LEAKY: //L80353350
if(func_802458A8(sp40, other_marker, 0x32) && chLeaky_eggCollision(other_marker)){
if (collisionTri_isHitFromAbove_marker(egg_position, other_marker, 0x32) && chLeaky_eggCollision(other_marker)) {
func_8033E984();
}
break;
@@ -94,7 +94,7 @@ s32 func_803531C8(u8 projectile_indx, s32 arg1){
func_803870EC(1);
break;
case 0x1ae: //L8035339C //zubba?
case MARKER_1AE_ZUBBA: //L8035339C //zubba?
func_8033E984();
fxegg_shatter(projectile_indx);
break;
@@ -109,26 +109,26 @@ s32 func_803531C8(u8 projectile_indx, s32 arg1){
func_8038685C(other_marker);
break;
case 0xbb: //L803533E4 //"BIG_JINXYHEAD"
case MARKER_BB_UNKNOWN: //L803533E4 //"BIG_JINXYHEAD"
other_actor = marker_getActor(other_marker);
*(s32 *)&other_actor->local = 1;
func_8033E984();
break;
case MARKER_34_CEMETARY_POT: //L80353400
if(func_802458A8(sp40, other_marker, 0x3C) && MMM_func_80387340(other_marker)){
if (collisionTri_isHitFromAbove_marker(egg_position, other_marker, 0x3C) && chFlowerpot_eggCollision(other_marker)) {
func_8033E984();
}
break;
case MARKER_AB_RUBEES_EGG_POT: //L80353434
if(func_802458A8(sp40, other_marker, 0x1E) && (func_8038E178() < func_8038E184())){
if (collisionTri_isHitFromAbove_marker(egg_position, other_marker, 0x1E) && (func_8038E178() < func_8038E184())) {
func_8033E984();
func_8038E140();
}
break;
case 0xae: //L80353480 //big_jynxy_head
case MARKER_AE_UNKNOWN: //L80353480 //big_jynxy_head
if(func_8038E344(other_marker)){
func_8033E984();
func_8038E2FC(other_marker);