+#include "cheats.qh"
+#include "_all.qh"
+
+#include "g_damage.qh"
+#include "race.qh"
+#include "../common/triggers/teleporters.qh"
+
+#include "mutators/mutators_include.qh"
+
+#include "weapons/tracing.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/effects.qh"
+#include "../common/util.qh"
+
+#include "../common/monsters/all.qh"
+
+#include "../common/weapons/all.qh"
+
+#include "../common/triggers/subs.qh"
+
+#include "../common/triggers/func/breakable.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/util_server.qh"
+
void CopyBody(float keepvelocity);
#ifdef NOCHEATS
.float maycheat;
float gamestart_sv_cheats;
-const float CHIMPULSE_SPEEDRUN_INIT = 30;
-const float CHIMPULSE_GIVE_ALL = 99;
-const float CHIMPULSE_CLONE_MOVING = 140;
-const float CHIMPULSE_SPEEDRUN = 141;
-const float CHIMPULSE_CLONE_STANDING = 142;
-const float CHIMPULSE_TELEPORT = 143;
-const float CHIMPULSE_R00T = 148;
-const float CHRAME_DRAG = 8;
void CheatInit()
{
return;
}
vector a = vectoangles(e.origin - self.origin);
- a_x = -a.x; // don't ask
+ a.x = -a.x; // don't ask
self.angles_x = a.x;
self.angles_y = a.y;
// we leave Rick Roll alone
IS_CHEAT(i, 0, 0);
if(self.personal)
{
- self.speedrunning = TRUE;
+ self.speedrunning = true;
tracebox(self.personal.origin, self.mins, self.maxs, self.personal.origin, MOVE_WORLDONLY, self);
if(trace_startsolid)
{
setorigin(self, self.personal.origin);
self.oldvelocity = self.velocity = self.personal.velocity;
self.angles = self.personal.v_angle;
- self.fixangle = TRUE;
+ self.fixangle = true;
- MUTATOR_CALLHOOK(AbortSpeedrun);
+ MUTATOR_CALLHOOK(AbortSpeedrun, self);
}
self.ammo_rockets = self.personal.ammo_rockets;
self.angles = e.angles;
remove(e);
// should we? self.angles_x = -self.angles_x;
- self.fixangle = TRUE;
+ self.fixangle = true;
self.velocity = '0 0 0';
DID_CHEAT();
break;
{
sprint(self, "Emergency teleport used random location\n");
self.angles_x = -self.angles.x;
- self.fixangle = TRUE;
+ self.fixangle = true;
self.velocity = '0 0 0';
DID_CHEAT();
break;
else
e = self;
- pointparticles(particleeffectnum("rocket_explode"), e.origin, '0 0 0', 1);
- sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+ Send_Effect("rocket_explode", e.origin, '0 0 0', 1);
+ sound(e, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
e2 = spawn();
setorigin(e2, e.origin);
// origin (0..1, on crosshair line)
// velocity
// howmany
- effectnum = particleeffectnum(argv(1));
f = stof(argv(2));
crosshair_trace(self);
start = (1-f) * self.origin + f * trace_endpos;
end = stov(argv(3));
f = stof(argv(4));
- pointparticles(effectnum, start, end, f);
+ Send_Effect(argv(1), start, end, f);
DID_CHEAT();
break;
}
// arguments:
// effectname
effectnum = particleeffectnum(argv(1));
- W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
trailparticles(self, effectnum, w_shotorg, trace_endpos);
DID_CHEAT();
// arguments:
// modelname mode
f = stof(argv(2));
- W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
+ W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self);
if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
{
e.enemy.skin = 1;
setsize(e.enemy, '0 0 0', '0 0 0');
end = normalize(self.origin + self.view_ofs - e.aiment.origin);
- end_x = (end.x > 0) * 2 - 1;
- end_y = (end.y > 0) * 2 - 1;
- end_z = (end.z > 0) * 2 - 1;
+ end.x = (end.x > 0) * 2 - 1;
+ end.y = (end.y > 0) * 2 - 1;
+ end.z = (end.z > 0) * 2 - 1;
if(argc == 4)
setorigin(e.enemy, stov(argv(3)));
else
{
// use cheat dragging if cheats are enabled
crosshair_trace_plusvisibletriggers(self);
- Drag(TRUE, TRUE);
+ Drag(true, true);
}
else
{
- Drag(FALSE, FALSE); // execute dragging
+ Drag(false, false); // execute dragging
}
break;
}
// ENTITY DRAGGING
+// on dragger:
+.float draggravity;
+.float dragspeed; // speed of mouse wheel action
+.float dragdistance; // distance of dragentity's draglocalvector from view_ofs
+.vector draglocalvector; // local attachment vector of the dragentity
+.float draglocalangle;
+// on draggee:
+.entity draggedby;
+.float dragmovetype;
+
float Drag(float force_allow_pick, float ischeat)
{
BEGIN_CHEAT_FUNCTION();
- // returns TRUE when an entity has been picked up
- // If pick is TRUE, the object can also be picked up if it's not being held already
- // If pick is FALSE, only keep dragging the object if it's already being held
+ // returns true when an entity has been picked up
+ // If pick is true, the object can also be picked up if it's not being held already
+ // If pick is false, only keep dragging the object if it's already being held
switch(0)
{
float pick = force_allow_pick;
if (e && !pick)
{
- // pick is TRUE if the object can be picked up. While an object is being carried, the Drag() function
+ // pick is true if the object can be picked up. While an object is being carried, the Drag() function
// must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
// This also makes sure that an object can only pe picked up if in range, but does not get dropped if
// it goes out of range while slinging it around.
break;
case 1: // owner can grab
if(e.owner == self || e.realowner == self)
- pick = TRUE;
+ pick = true;
break;
case 2: // owner and team mates can grab
if(SAME_TEAM(e.owner, self) || SAME_TEAM(e.realowner, self) || e.team == self.team)
- pick = TRUE;
+ pick = true;
break;
case 3: // anyone can grab
- pick = TRUE;
+ pick = true;
break;
default:
break;
Drag_Begin(self, e, trace_endpos);
if(ischeat)
DID_CHEAT();
- return TRUE;
+ return true;
}
}
}
break;
}
- return FALSE;
+ return false;
}
-// on dragger:
-.float draggravity;
-.float dragspeed; // speed of mouse wheel action
-.float dragdistance; // distance of dragentity's draglocalvector from view_ofs
-.vector draglocalvector; // local attachment vector of the dragentity
-.float draglocalangle;
-// on draggee:
-.entity draggedby;
-.float dragmovetype;
void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
{
float tagscale;
{
// TODO add more checks for bad stuff here
if(draggee == world)
- return FALSE;
+ return false;
if(draggee.classname == "func_bobbing")
- return FALSE;
+ return false;
if(draggee.classname == "door") // FIXME find out why these must be excluded, or work around the problem (trying to drag these causes like 4 fps)
- return FALSE;
+ return false;
if(draggee.classname == "plat")
- return FALSE;
+ return false;
if(draggee.classname == "func_button")
- return FALSE;
+ return false;
// if(draggee.model == "")
-// return FALSE;
+// return false;
if(IS_SPEC(draggee))
- return FALSE;
+ return false;
if(IS_OBSERVER(draggee))
- return FALSE;
+ return false;
if(draggee.classname == "exteriorweaponentity")
- return FALSE;
+ return false;
if(draggee.classname == "weaponentity")
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
float Drag_MayChangeAngles(entity draggee)
{
// TODO add more checks for bad stuff here
if(substring(draggee.model, 0, 1) == "*")
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
void Drag_MoveForward(entity dragger)
float Drag_IsDragging(entity dragger)
{
if(!dragger.dragentity)
- return FALSE;
+ return false;
if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
{
dragger.dragentity = world;
- return FALSE;
+ return false;
}
if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity))
{
Drag_Finish(dragger);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void Drag_MoveDrag(entity from, entity to)