CThug::Caution

This commit is contained in:
krystalgamer 2024-07-26 17:10:00 +02:00
parent 9ca8fc3686
commit d98fb34f88
4 changed files with 43 additions and 2 deletions

View File

@ -623,7 +623,7 @@ int CBaddy::BumpedIntoSpidey(int a2)
// @Ok
int CBaddy::PlayerIsVisible(int a2)
int CBaddy::PlayerIsVisible()
{
if (!globalSuper->IsDead() &&
Utils_LineOfSight(&this->mPos, &globalSuper->mPos, 0, 0)

View File

@ -50,7 +50,7 @@ public:
EXPORT i32 AddPointToPath(CVector*, i32);
EXPORT void GetWaypointNearTarget(CVector*, i32, i32, CVector*);
EXPORT virtual int PlayerIsVisible(int);
EXPORT virtual int PlayerIsVisible();
EXPORT virtual void CreateCombatImpactEffect(CVector*, i32);
EXPORT virtual u8 TugImpulse(CVector*, CVector*, CVector*);
EXPORT virtual void Victorious(void);

View File

@ -16,6 +16,45 @@ extern CPlayer* MechList;
EXPORT CThug* gGlobalThug;
EXPORT CThug* gThugList;
// @BIGTODO
i32 CThug::DetermineFightState(void)
{
printf("i32 CThug::DetermineFightState(void)");
return 0x26042024;
}
// @Ok
void CThug::Caution(void)
{
switch (this->dumbAssPad)
{
case 0:
this->field_310 = 0;
this->Neutralize();
SFX_PlayPos( (Rnd(3) + 14) | 0x8000, &this->mPos, 0);
if ((abs(MechList->mPos.vy - this->field_29C - 0x4000) < 409600)
&& this->PlayerIsVisible())
{
if (!this->ShouldIShootPlayer())
{
this->field_31C.bothFlags = MechList->field_57C != 0 ? 1 : 4;
this->dumbAssPad = 0;
}
}
else if (!this->DetermineFightState())
{
this->field_31C.bothFlags = 2;
this->dumbAssPad = 0;
}
break;
default:
print_if_false(0, "Unknown substate!");
break;
}
}
// @Ok
void CThug::CreateCombatImpactEffect(CVector* a2, i32 a3)
{

2
thug.h
View File

@ -46,6 +46,8 @@ public:
EXPORT i32 DrawBarrelFlash(CVector*, CVector *, SLineInfo *, u8, u8, u8);
EXPORT i32 SetUpLaser(CGPolyLine**, CVector*, CVector*);
EXPORT i32 ShouldIShootPlayer(void);
EXPORT void Caution(void);
EXPORT i32 DetermineFightState(void);
EXPORT virtual u8 Grab(CVector*);