CSimbyShoot

This commit is contained in:
krystalgamer 2024-06-19 20:55:34 +01:00
parent f88c97df8b
commit 78bbb775da
3 changed files with 80 additions and 9 deletions

View File

@ -326,6 +326,7 @@ int main()
validate_CAIProc_MoveTo();
validate_CNonRenderedBit();
validate_SPSXRegion();
validate_CSimbyShot();
puts("[*] Validation done!");

View File

@ -6,9 +6,64 @@
#include "ps2redbook.h"
#include "ps2lowsfx.h"
#include "ai.h"
#include "utils.h"
static SStateFlags gSimbyFlags;
extern CBody* MechList[1];
// @TODO
CSimbyShot::CSimbyShot(CVector*)
{}
// @TODO
void CSimby::SetUpHandPos(void)
{}
void CSimby::Shoot(void)
{
switch (this->dumbAssPad)
{
case 0:
this->Neutralize();
this->CycleAnim(this->field_298.Bytes[0], 1);
new CAIProc_LookAt(
this,
MechList[0],
0,
2,
80,
0);
this->dumbAssPad++;
break;
case 1:
if (this->field_288 & 2)
{
this->field_288 &= 0xFFFFFFFD;
this->RunAnim(0x2B, 0, -1);
this->dumbAssPad++;
}
break;
case 2:
if (this->field_128 >= 14)
{
this->SetUpHandPos();
new CSimbyShot(&this->field_3DC);
SFX_PlayPos(0x815C, &this->mPos, 0);
this->dumbAssPad++;
}
break;
case 3:
if (this->field_142)
{
this->field_31C.bothFlags = 4;
this->field_324 = 450 - Rnd(150);
this->dumbAssPad = 0;
}
break;
default:
print_if_false(0, "Unknown substate.");
break;
}
}
// @Ok
void CSimby::TakeHit(void)
@ -175,9 +230,10 @@ CSimby::CSimby(void)
this->field_38C = 0;
this->field_390 = 0;
this->field_394 = 0;
this->field_3DC = 0;
this->field_3E0 = 0;
this->field_3E4 = 0;
this->field_3DC.vx = 0;
this->field_3DC.vy = 0;
this->field_3DC.vz = 0;
this->field_3F8 = 0;
this->field_3FC = 0;
this->field_400 = 0;
@ -326,6 +382,8 @@ void validate_CPunchOb(void){
void validate_CSimby(void){
VALIDATE_SIZE(CSimby, 0x460);
VALIDATE(CSimby, field_324, 0x324);
VALIDATE(CSimby, field_328, 0x328);
VALIDATE(CSimby, field_32A, 0x32A);
VALIDATE(CSimby, field_32C, 0x32C);
@ -362,8 +420,6 @@ void validate_CSimby(void){
VALIDATE(CSimby, field_3D0, 0x3D0);
VALIDATE(CSimby, field_3DC, 0x3DC);
VALIDATE(CSimby, field_3E0, 0x3E0);
VALIDATE(CSimby, field_3E4, 0x3E4);
VALIDATE(CSimby, field_3F0, 0x3F0);
@ -391,3 +447,8 @@ void validate_CEmber(void)
{
VALIDATE_SIZE(CEmber, 0x90);
}
void validate_CSimbyShot(void)
{
VALIDATE_SIZE(CSimbyShot, 0xB8);
}

17
simby.h
View File

@ -29,9 +29,11 @@ public:
EXPORT i32 PlayAndAttachXAPlease(i32, i32, CBody*, i32);
EXPORT void PlayGruntSound(void);
EXPORT void TakeHit(void);
EXPORT void Shoot(void);
EXPORT void SetUpHandPos(void);
u8 padTop[0x328-0x324];
i32 field_324;
i16 field_328;
u16 field_32A;
u16 field_32C;
@ -69,9 +71,7 @@ public:
i32 field_3D0;
u8 padAfter3D0[0x3DC-0x3D0-4];
i32 field_3DC;
i32 field_3E0;
i32 field_3E4;
CVector field_3DC;
u8 padAfter3E4[0x3F0-0x3E4-4];
i32 field_3F0;
@ -114,11 +114,20 @@ class CEmber : public CFlatBit
unsigned char pad[0x28];
};
class CSimbyShot : public CQuadBit
{
public:
EXPORT CSimbyShot(CVector*);
u8 padFull[0x34];
};
void validate_CPunchOb(void);
void validate_CSimby(void);
void validate_CSimbyBase(void);
void validate_CSimbySlimeBase(void);
void validate_CEmber(void);
void validate_CSimbyShot(void);
EXPORT void MakeVertexWibbler(void);
EXPORT void Simby_CreateSimby(const unsigned int *stack, unsigned int *result);