code_9E370.c progress

This commit is contained in:
Banjo Kazooie
2022-07-27 19:34:05 -05:00
parent f9588fa0c1
commit 19b01cf810
26 changed files with 95 additions and 48 deletions

View File

@@ -53,7 +53,7 @@ void func_802CE8D4(Actor *this){
{
case 1://L802CE9C4
if( !func_8031FF1C(BKPROG_D_BEEHIVE_TEXT)
&& func_803296B8(this, 250, 300)
&& subaddie_playerIsWithinCylinder(this, 250, 300)
){
if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){
if( player_getTransformation() == TRANSFORM_1_BANJO

View File

@@ -237,7 +237,7 @@ void func_802E20E8(Actor *this){
}
}//L802E223C
if(!actor_playerIsWithinDist(this, 4000))
if(!subaddie_playerIsWithinSphere(this, 4000))
return;
if(!local->unkB && this->marker->unk14_21){

View File

@@ -74,7 +74,7 @@ void chfirefx_update(Actor *this){
this->unk1C[0] = 0.0f;
}
}//L80359934
if(actor_playerIsWithinDist(this, 2000)){
if(subaddie_playerIsWithinSphere(this, 2000)){
if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){
if(!(func_8023DB5C() & 3) && randf() < 0.1){
__chfirefx_spawnSmoke(this->position, this->scale);

View File

@@ -262,7 +262,7 @@ void chicecube_update(Actor *this){
this->unk58_0 = TRUE;
}//L8035AAF4
if(!actor_playerIsWithinDist(this, 3000))
if(!subaddie_playerIsWithinSphere(this, 3000))
return;
func_802D729C(this, 3.4 * this->scale);

View File

@@ -114,7 +114,7 @@ Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
void func_802D9530(Actor *this){
Actor *other = func_80329980(this);
Actor *other = subaddie_getLinkedActor(this);
if(this->unk100 && other){
if(this->unk100->unk14_20 == 0xB8)
func_80328B8C(other, 3, 0.0001f, 1);
@@ -230,7 +230,7 @@ int func_802D997C(Actor *this){
}
void func_802D9ADC(Actor *this){
Actor *other = func_80329980(this);
Actor *other = subaddie_getLinkedActor(this);
if(this->unk100 && other && this->unk100->unk14_20 == 0xB8){
func_80328B8C(other, 2, 0.0001f, 1);
}
@@ -307,7 +307,7 @@ void func_802D9D60(Actor *this){
other = func_80326D68(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C);
this->unk100 = (other) ? other->marker : NULL;
if(this->unk100){
other = func_80329980(this);
other = subaddie_getLinkedActor(this);
if(other && this->unk100->unk14_20 == 0xB8){
func_80328A84(other, 1);
}

View File

@@ -322,7 +322,7 @@ void func_802CCC5C(Actor *this) {
local->unk0 = 0;
func_802CC640(this, 1);
}
if (!actor_playerIsWithinDist(this, 4000)) {
if (!subaddie_playerIsWithinSphere(this, 4000)) {
if (local->unk0 != 0) {
func_8030DA44(local->unk0);
local->unk0 = 0;

View File

@@ -418,8 +418,8 @@ void func_802CF83C(Actor *this) {
this->unk38_0 = func_803203FC(1) | func_803203FC(0x1F);
}
if (actor_playerIsWithinDist(this, 0xFA0)) {
if (!actor_playerIsWithinDist(this, 0x5DC) == 0) {
if (subaddie_playerIsWithinSphere(this, 0xFA0)) {
if (!subaddie_playerIsWithinSphere(this, 0x5DC) == 0) {
if (this->unk44_31 != 0) {
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
@@ -483,7 +483,7 @@ block_40:
switch(this->state){
case 1:
if( !func_8031FF1C(0x8F)
&& func_803296B8(this, 0xFA, 0x12C)
&& subaddie_playerIsWithinCylinder(this, 0xFA, 0x12C)
&& ((func_8028ECAC() == 0) || (func_8028ECAC() == BSGROUP_8_TROT))
&& (player_getTransformation() == TRANSFORM_1_BANJO)
&& func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL)

View File

@@ -29,7 +29,7 @@ void func_8032ACA8(Actor *arg0);
void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2);
void func_80328B8C(Actor * this, s32 arg1, f32 arg2, s32 arg3);
void func_8032BB88(Actor *this, s32 arg1, s32 arg2);
int actor_playerIsWithinDist(Actor *this, s32 dist);
int subaddie_playerIsWithinSphere(Actor *this, s32 dist);
extern void func_8033A4A0(enum asset_e mode_id, f32, f32);
extern void func_80338338(s32, s32, s32);
extern void func_803382FC(s32);
@@ -1325,15 +1325,43 @@ int func_80329210(Actor * arg0, f32 (* arg1)[3]){
|| func_80307258(arg1, arg0->unk10_25 - 1, arg0->unk10_18-1) != -1;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329260.s")
bool func_80329260(Actor *this, f32 p1[3]){
s32 var_v0;
var_v0 = func_80309D58(p1, this->unk10_18);
if(this->unk10_18 == 0){
this->unk10_18 = var_v0;
}
if(var_v0 == 0 && this->unk10_18 != 0){
return FALSE;
}
return TRUE;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803292E0.s")
bool func_803292E0(Actor *this){
f32 player_position[3];
if(this->unk10_25 == 0){
return 1;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329354.s")
_player_getPosition(player_position);
return func_80307258(player_position, this->unk10_25 - 1, this->unk10_18 - 1) != -1;
}
bool func_80329354(Actor *this){
f32 sp1C[3];
_player_getPosition(sp1C);
return func_80329260(this, sp1C);
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329384.s")
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032944C.s")
bool func_8032944C(Actor *this){
s32 v1;
v1 = this->pitch - this->unk6C;
return ((-3 <= v1) && (v1 <= 3));
}
bool func_80329480(Actor *this){
s32 v1;
@@ -1359,14 +1387,14 @@ bool func_803294F0(Actor *this, s32 arg1, s32 arg2){
bool func_80329530(Actor *this, s32 dist){
if( func_8028F098()
&& !func_803203FC(0xBF)
&& actor_playerIsWithinDist(this, dist)
&& subaddie_playerIsWithinSphere(this, dist)
){
return TRUE;
}
return FALSE;
}
bool actor_playerIsWithinDist(Actor *this, s32 dist){
bool subaddie_playerIsWithinSphere(Actor *this, s32 dist){
f32 sp24[3];
f32 sp18[3];
@@ -1383,11 +1411,30 @@ bool actor_playerIsWithinDist(Actor *this, s32 dist){
return FALSE;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329628.s")
bool subaddie_playerIsWithinAsymmetricCylinder(Actor *this, s32 radius, s32 d_upper, s32 d_lower){
f32 sp1C[3];
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803296B8.s")
player_getPosition(sp1C);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803296D8.s")
if(((this->position[1] + d_upper) < sp1C[1]) || (sp1C[1] < (this->position[1] - d_lower))){
return FALSE;
}
return subaddie_playerIsWithinSphere(this, radius);
}
bool subaddie_playerIsWithinCylinder(Actor *this, s32 radius, s32 d_y){
return subaddie_playerIsWithinAsymmetricCylinder(this, radius, d_y, d_y);
}
bool func_803296D8(Actor *this, s32 dist){
if(!this->unk124_7){
return TRUE;
}
else{
return func_80329530(this, dist);
}
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032970C.s")
@@ -1453,8 +1500,7 @@ Actor *marker_getActor(ActorMarker *this){
return &(D_8036E560->data[this->actrArrayIdx]);
}
//actor_getChild
Actor *func_80329980(Actor *this){
Actor *subaddie_getLinkedActor(Actor *this){
if(this->unk100 == NULL)
return NULL;
return marker_getActor(this->unk100);

View File

@@ -344,7 +344,7 @@ void func_80358684(Actor *this) {
func_80357F0C(this, 1);
}
if (!actor_playerIsWithinDist(this, 4000)) {
if (!subaddie_playerIsWithinSphere(this, 4000)) {
if (local->unk0 != 0) {
func_8030DA44(local->unk0);
local->unk0 = 0U;