mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-01-19 18:14:44 +00:00
Added Projectile collision shockwaves
Also fixed typemask for moving objects.
This commit is contained in:
parent
ebe6649da7
commit
529104d9f2
|
|
@ -60,6 +60,7 @@ const char* conResolveGhost(Linker::SimObject *obj, S32 argc, const char* argv[]
|
|||
// Network Commands ---------------------------------
|
||||
const char *conGetGhostIndex(Linker::SimObject *obj, S32 argc, const char* argv[]);
|
||||
bool conForceUpdate(Linker::SimObject *obj, S32 argc, const char* argv[]);
|
||||
bool conSetProjDist(Linker::SimObject *obj, S32 argc, const char* argv[]);
|
||||
// General Commands ---------------------------------
|
||||
const char* conSprintf(Linker::SimObject *obj, S32 argc, const char* argv[]);
|
||||
bool conTSExtensionUpdate(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
|
|
@ -11,6 +11,7 @@ static float counter=0;
|
|||
static float mpsx=0.0;
|
||||
static float mpsy=0.0;
|
||||
static float mpsz=0.0;
|
||||
static float projdist=0.0;
|
||||
static bool moveplayerstoo=1;
|
||||
static bool clientupdate=false;
|
||||
static float timecounter=0;
|
||||
|
|
@ -100,10 +101,12 @@ void collide(unsigned int simgroup){
|
|||
DX::MatrixF mat2=DX::MatrixF(sobj3.objtoworld);
|
||||
DX::Point3F test2;
|
||||
mat2.getColumn(3,&test2);
|
||||
if (DX::pointdistance(test,test2)<40.0) {
|
||||
if (DX::pointdistance(test,test2)<projdist) {
|
||||
char evalstring[1024]="";
|
||||
sprintf (evalstring,"ProjCollisionCallback(%d,%d);",sobj2.identifier,sobj3.identifier);
|
||||
Con::eval(evalstring, false, NULL);
|
||||
if (sobj2.identifier != sobj3.identifier) {
|
||||
sprintf (evalstring,"ProjCollisionCallback(%d,%d);",sobj2.identifier,sobj3.identifier);
|
||||
Con::eval(evalstring, false, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,7 +130,7 @@ void moveRecursive(unsigned int simgroup,float xoff, float yoff, float zoff){
|
|||
for (unsigned int x=0; x<sim2.getCount(); x++) {
|
||||
DX::SimObject obj2=DX::SimObject(sim2.getObject(x));
|
||||
if ((strcmp((obj2.getClassName()),"SimGroup")!=0)&&(strcmp((obj2.getClassName()),"SimSet")!=0)) {
|
||||
if (obj2.type&0x8){
|
||||
if ((obj2.type&0x2028)){
|
||||
DX::SceneObject sobj = DX::SceneObject(sim2.getObject(x));
|
||||
DX::MatrixF mat1=DX::MatrixF(sobj.objtoworld);
|
||||
DX::Point3F test;
|
||||
|
|
@ -432,9 +435,14 @@ bool conclientCmdSetProcessTicks(Linker::SimObject *obj, S32 argc, const char* a
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
bool conSetProjDist(Linker::SimObject *obj, S32 argc, const char* argv[]) {
|
||||
float distance = atof(argv[1]);
|
||||
projdist=distance;
|
||||
return false;
|
||||
}
|
||||
bool conSetProcessTicks(Linker::SimObject *obj, S32 argc, const char* argv[]) {
|
||||
|
||||
unsigned int result_ptr = 0;
|
||||
unsigned int result_ptr = 0;
|
||||
unsigned int my_ptr = (unsigned int) obj;
|
||||
if (atoi(argv[2])==1) {
|
||||
__asm
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ extern "C"
|
|||
Con::addMethodB(NULL,"clientCmdsetProcessTicks",&conclientCmdSetProcessTicks,"Client Command for disabling tick processing on ghost object",2,10);
|
||||
Con::addMethodB(NULL,"clientCmdsetPosition",&conclientCmdSetPosition,"Client Command for setting transform on ghost object",2,10);
|
||||
// General
|
||||
Con::addMethodB(NULL,"setCollisionDistance",&conSetProjDist, "Sets Collision Distance for Collision Detection Algorithm",2,2);
|
||||
Con::addMethodS(NULL, "sprintf", &conSprintf,"Formats a string. See the C sprintf.", 2, 20);
|
||||
Con::addMethodB(NULL, "tsExtensionUpdate", &conTSExtensionUpdate,"Updates the TSExtension.", 1, 1);
|
||||
Con::addMethodS(NULL, "getServPAddr",&congetServPAddr,"Gets the memPatch data for ServerProcess",1,1);
|
||||
|
|
|
|||
|
|
@ -23,20 +23,28 @@ function onMoveRoutine(%obj, %offset, %center, %radius){
|
|||
}
|
||||
$collidegroup = new SimSet(CollideGroup);
|
||||
|
||||
$ccd = new SimSet(ClientCommandGroup);
|
||||
|
||||
|
||||
|
||||
|
||||
function ProjCollisionCallback(%proj1, %proj2) {
|
||||
echo(%proj1 SPC "collided with" SPC %proj2);
|
||||
if (isObject(%proj1) {
|
||||
if (isObject(%proj2) {
|
||||
if (%proj1.sourceObject != %proj2.sourceObject) {
|
||||
//echo(%proj1 SPC "collided with" SPC %proj2);
|
||||
if (isObject(%proj1)) {
|
||||
if (isObject(%proj2)) {
|
||||
//if (%proj1.sourceObject != %proj2.sourceObject) {
|
||||
if (CollideGroup.isMember(%proj2)) {
|
||||
if (CollideGroup.isMember(%proj1)) {
|
||||
CollideGroup.remove(%proj1);
|
||||
CollideGroup.remove(%proj2);
|
||||
echo("Radius Explosion");
|
||||
RadiusExplosion(%proj1,%proj1.position,400,0,1000,%proj1.sourceObject,$DamageType::Default);
|
||||
RadiusExplosion(%proj2,%proj2.position,400,0,1000,%proj2.sourceObject,$DamageType::Default);
|
||||
%proj1.delete();
|
||||
%proj2.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +53,7 @@ function moveRoutineDone() {
|
|||
%obj=MoveEffectSet.getObject(%x);
|
||||
if(%obj.getType() | $TypeMasks::PlayerObjectType) {
|
||||
if (%obj.isjetting() || %obj.isjumping() ) {
|
||||
echo ("Artificial Gravity Disengaged for" SPC %obj);
|
||||
//echo ("Artificial Gravity Disengaged for" SPC %obj);
|
||||
} else {
|
||||
%obj.setPosition(VectorAdd(%obj.position,$moveoffset));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue