diff --git a/rhino.cpp b/rhino.cpp index 97d3fbd..1f8b1a8 100644 --- a/rhino.cpp +++ b/rhino.cpp @@ -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(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(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(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(*stack); + int v3 = static_cast(stack[1]); + + if (v2) + { + *result = reinterpret_cast(new CRhino(v2, v3)); + } + else + { + *result = reinterpret_cast(new CRhino()); + } +} void validate_CRhino(void){ VALIDATE_SIZE(CRhino, 0x424); -} \ No newline at end of file + + VALIDATE(CRhino, field_344, 0x344); +} diff --git a/rhino.h b/rhino.h index b9fde73..f69572d 100644 --- a/rhino.h +++ b/rhino.h @@ -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); \ No newline at end of file +void validate_CRhino(void); +EXPORT void Rhino_CreateRhino(const unsigned int *stack, unsigned int *result); diff --git a/utils.cpp b/utils.cpp index 7fb1e68..4dca59b 100644 --- a/utils.cpp +++ b/utils.cpp @@ -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; +} diff --git a/utils.h b/utils.h index 0ee3a39..befd5b5 100644 --- a/utils.h +++ b/utils.h @@ -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