CRhino::CRhino(void), CRhino::CRhino(int*,int) and Rhino_CreateRhino

This commit is contained in:
krystalgamer 2024-05-16 19:15:32 +02:00
parent daedcbc8b0
commit 721837d78d
4 changed files with 110 additions and 3 deletions

View File

@ -1,7 +1,100 @@
#include "rhino.h"
#include "validate.h"
#include "utils.h"
#include "panel.h"
static __int16 * const word_682B64 = (__int16*)0x682B64;
// @NotOk
// globals
CRhino::CRhino(int* a2, int a3)
{
__int16 *v5 = this->SquirtAngles(reinterpret_cast<__int16*>(this->SquirtPos(a2)));
this->InitItem("rhino");
this->mFlags |= 0x480;
this->field_3C = 0x552080;
this->AttachTo(reinterpret_cast<CBody**>(0x56E990));
this->field_21E = 100;
this->field_1F4 = a3;
this->field_DE = a3;
this->field_DC = 175;
this->field_230 = 0;
this->field_216 = 32;
this->field_D8 = 64;
this->field_31C.bothFlags = 0;
this->field_2A8 |= 0x2000201;
this->field_38 = 307;
this->field_E2 = Utils_GetValueFromDifficultyLevel(1400, 1400, 1400, 1400);
unsigned char * ptr = reinterpret_cast<unsigned char*>(0x552008);
this->field_294 = ptr[0];
this->field_295 = ptr[1];
this->field_296 = ptr[2];
this->field_297 = ptr[3];
this->field_298 = ptr[4];
this->field_299 = ptr[5];
this->field_29A = ptr[6];
this->field_29B = ptr[7];
this->field_344 = *dword_5FCCF4 + 0xFFFFFF10;
int i = 0;
while (i < 5)
{
word_682B64[i++] = Rnd(4096);
}
int v7 = 0;
int *v8 = (int*)0x552210;
do
{
if (*v8 != v7)
print_if_false(0, "Fire Matt, he fucked up the rhino XA. Actually, kick him in the nuts first.");
v8 += 3;
v7++;
}
while(v7 < 0x17);
this->ParseScript(reinterpret_cast<unsigned __int16*>(v5));
Panel_CreateHealthBar(this, 307);
}
// @NotOk
// globals
CRhino::CRhino(void)
{
this->InitItem("rhino");
this->mFlags |= 0x480;
this->field_3C = 0x552080;
this->field_38 = 307;
}
// @Ok
void Rhino_CreateRhino(const unsigned int *stack, unsigned int *result)
{
int* v2 = reinterpret_cast<int*>(*stack);
int v3 = static_cast<int>(stack[1]);
if (v2)
{
*result = reinterpret_cast<unsigned int>(new CRhino(v2, v3));
}
else
{
*result = reinterpret_cast<unsigned int>(new CRhino());
}
}
void validate_CRhino(void){
VALIDATE_SIZE(CRhino, 0x424);
}
VALIDATE(CRhino, field_344, 0x344);
}

11
rhino.h
View File

@ -4,7 +4,14 @@
#include "baddy.h"
class CRhino : public CBaddy {
unsigned char padAll[0x424-0x324];
public:
EXPORT CRhino(int*, int);
EXPORT CRhino(void);
unsigned char padTop[0x344 - 0x324];
int field_344;
unsigned char padAfter344[0x424-0x344-4];
};
void validate_CRhino(void);
void validate_CRhino(void);
EXPORT void Rhino_CreateRhino(const unsigned int *stack, unsigned int *result);

View File

@ -221,3 +221,9 @@ int Utils_CalcAim(CSVector* a1, CVector* a2, CVector* a3)
a1->vz = 0;
return v7;
}
// @TODO
int Utils_GetValueFromDifficultyLevel(int, int, int, int)
{
return 0x16052024;
}

View File

@ -18,5 +18,6 @@ EXPORT CBody* Utils_CheckObjectCollision(CVector*, CVector*, CBody*, CBody*);
EXPORT int Utils_GetGroundHeight(CVector*, int, int, CBody**);
EXPORT int Utils_LineOfSight(CVector*, CVector*, CVector*, int);
EXPORT int Utils_CalcAim(CSVector*, CVector*, CVector*);
EXPORT int Utils_GetValueFromDifficultyLevel(int, int, int, int);
#endif