+#include "_all.qh"
+
+#include "bot/bot.qh"
+
+#include "command/common.qh"
+
+#include "g_damage.qh"
+#include "item_key.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/all.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float height;
+
.float dmgtime2;
void generic_plat_blocked()
{
tmin = self.absmin + '25 25 0';
tmax = self.absmax - '25 25 -8';
- tmin_z = tmax.z - (self.pos1_z - self.pos2_z + 8);
+ tmin.z = tmax.z - (self.pos1_z - self.pos2_z + 8);
if (self.spawnflags & PLAT_LOW_TRIGGER)
- tmax_z = tmin.z + 8;
+ tmax.z = tmin.z + 8;
if (self.size.x <= 50)
{
- tmin_x = (self.mins.x + self.maxs.x) / 2;
- tmax_x = tmin.x + 1;
+ tmin.x = (self.mins.x + self.maxs.x) / 2;
+ tmax.x = tmin.x + 1;
}
if (self.size.y <= 50)
{
- tmin_y = (self.mins.y + self.maxs.y) / 2;
- tmax_y = tmin.y + 1;
+ tmin.y = (self.mins.y + self.maxs.y) / 2;
+ tmax.y = tmin.y + 1;
}
if(tmin.x < tmax.x)
if(n > 2)
if(argv(2) == "force")
- return TRUE; // no checking, return immediately
+ return true; // no checking, return immediately
if(!cubic_speedfunc_is_sane(e.platmovetype_start, e.platmovetype_end))
{
objerror("Invalid platform move type; platform would go in reverse, which is not allowed.");
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void spawnfunc_path_corner()
else // linear movement
ang = targ.origin - (self.origin - self.view_ofs); // use the origin of the next path_corner
ang = vectoangles(ang);
- ang_x = -ang.x; // flip up / down orientation
+ ang.x = -ang.x; // flip up / down orientation
if(self.wait > 0) // slow turning
SUB_CalcAngleMove(ang, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
else // instant turning
SUB_CalcAngleMove(ang, TSPEED_TIME, 0.0000001, train_wait);
- self.train_wait_turning = TRUE;
+ self.train_wait_turning = true;
return;
}
if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
{
- self.train_wait_turning = FALSE;
+ self.train_wait_turning = false;
train_next();
}
else
if (!InitMovingBrushTrigger())
return;
self.effects |= EF_LOWPRECISION;
-
+
if (self.spawnflags & 2)
{
- self.platmovetype_turn = TRUE;
+ self.platmovetype_turn = true;
self.view_ofs = '0 0 0'; // don't offset a rotating train, origin works differently now
}
else
button_fire ();
}
-void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void button_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
// no key needed
if (!door.itemkeys)
- return TRUE;
+ return true;
// this door require a key
// only a player can have a key
if (!IS_PLAYER(other))
- return FALSE;
+ return false;
if (item_keys_usekey(door, other)) {
// some keys were used
// door is now unlocked
play2(other, "misc/talk.wav");
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_UNLOCKED);
- return TRUE;
+ return true;
} else
- return FALSE;
+ return false;
}
}
-void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void door_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
entity oself;
if(self.spawnflags & DOOR_NOSPLASH)
{
float DELTA = 4;
if (e1.absmin.x > e2.absmax.x + DELTA)
- return FALSE;
+ return false;
if (e1.absmin.y > e2.absmax.y + DELTA)
- return FALSE;
+ return false;
if (e1.absmin.z > e2.absmax.z + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.x > e1.absmax.x + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.y > e1.absmax.y + DELTA)
- return FALSE;
+ return false;
if (e2.absmin.z > e1.absmax.z + DELTA)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
/*
if((t.message != "") && (self.message == ""))
self.message = t.message;
if (t.absmin.x < cmins.x)
- cmins_x = t.absmin.x;
+ cmins.x = t.absmin.x;
if (t.absmin.y < cmins.y)
- cmins_y = t.absmin.y;
+ cmins.y = t.absmin.y;
if (t.absmin.z < cmins.z)
- cmins_z = t.absmin.z;
+ cmins.z = t.absmin.z;
if (t.absmax.x > cmaxs.x)
- cmaxs_x = t.absmax.x;
+ cmaxs.x = t.absmax.x;
if (t.absmax.y > cmaxs.y)
- cmaxs_y = t.absmax.y;
+ cmaxs.y = t.absmax.y;
if (t.absmax.z > cmaxs.z)
- cmaxs_z = t.absmax.z;
+ cmaxs.z = t.absmax.z;
if(t.enemy == self)
break;
}
else // Z
self.movedir = '0 1 0';
- if (self.angles_y ==0) self.angles_y = 90;
+ if (self.angles.y ==0) self.angles_y = 90;
self.movedir = self.movedir * self.angles.y;
self.angles = '0 0 0';
string message_save;
self.health = 10000;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
// exit if still moving around...
if (self.origin != self.oldorigin)
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
}
-void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void fd_secret_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
fd_secret_use();
}