mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-01-19 18:14:44 +00:00
Added a working setMaskBits and a cloaking test command
This commit is contained in:
parent
4c716d90c8
commit
831d49cc20
Binary file not shown.
|
|
@ -8,8 +8,10 @@ namespace DX
|
|||
{
|
||||
public:
|
||||
ShapeBase(unsigned int obj);
|
||||
|
||||
float &cloak_level;
|
||||
bool &cloaked;
|
||||
//! Heat Level
|
||||
float &heat_level;
|
||||
void setMaskBits(int value);
|
||||
};
|
||||
} // End NameSpace DX
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <LinkerAPI.h>
|
||||
void serverProcessReplacement(unsigned int timeDelta) ;
|
||||
bool conShapeBaseSetCloakValue(Linker::SimObject *obj, S32 argc, const char* argv[]);
|
||||
const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
// Returns the address of an object in memory
|
||||
const char* conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,21 @@
|
|||
#include <DXAPI/ShapeBase.h>
|
||||
|
||||
#define CloakMask 0x40
|
||||
namespace DX
|
||||
{
|
||||
ShapeBase::ShapeBase(unsigned int obj) : GameBase(obj),
|
||||
heat_level(*(float*)(obj + 1972))
|
||||
heat_level(*(float*)(obj + 1972)), cloak_level(*(float*)(obj+0x810)), cloaked(*(bool*)(obj+0x80D))
|
||||
{
|
||||
}
|
||||
void ShapeBase::setMaskBits(int value){
|
||||
unsigned int addr=this->base_pointer_value;
|
||||
unsigned int bits=value;
|
||||
unsigned int funcaddr=0x585BE0;
|
||||
__asm {
|
||||
mov eax,bits
|
||||
push eax
|
||||
mov ecx,addr
|
||||
mov eax,funcaddr
|
||||
call eax
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -42,7 +42,18 @@ const char *conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[])
|
|||
sprintf(result, "%x", obj);
|
||||
return result;
|
||||
}
|
||||
bool conShapeBaseSetCloakValue(Linker::SimObject *obj, S32 argc, const char* argv[])
|
||||
{
|
||||
DX::ShapeBase operand = DX::ShapeBase((unsigned int)obj);
|
||||
operand.cloaked=dAtob(argv[2]);
|
||||
if (operand.cloaked==true) {
|
||||
operand.cloak_level=atof(argv[3]);
|
||||
} else {
|
||||
operand.cloak_level=atof(argv[3]);
|
||||
}
|
||||
operand.setMaskBits(0x40);
|
||||
|
||||
}
|
||||
bool conPlayerGetJumpingState(Linker::SimObject *obj, S32 argc, const char* argv[])
|
||||
{
|
||||
DX::Player operand = DX::Player((unsigned int)obj);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ extern "C"
|
|||
Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2);
|
||||
Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2);
|
||||
Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3);
|
||||
|
||||
Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4);
|
||||
Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
||||
Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3);
|
||||
Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);
|
||||
|
|
|
|||
Loading…
Reference in a new issue