2001-07-17 05:58:10 +00:00
|
|
|
/* SB Items. New items for use with Custom TF 3.2 (or something) */
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
#include "defs.qh"
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
// Internal prototypes
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
integer(entity e) entpointcontents;
|
2001-07-17 05:58:10 +00:00
|
|
|
void() AntiGravGrenadeExplode; // antigrav goes boom
|
|
|
|
void() AntiGravGrenadeTimer; // controls antigrav decay or whatever you call it
|
|
|
|
void(entity inflictor, entity attacker, float bounce, entity ignore) T_RadiusAntiGrav; // bang
|
|
|
|
|
|
|
|
void() MotionSensorIdle; // motion sensor sitting
|
|
|
|
float() MotionSensorFindTarget; // sensor scans for target
|
|
|
|
void() MotionSensorDie; // I wonder what this does
|
|
|
|
void() MotionSensorSpawn; // let's make a sensor
|
|
|
|
void() SensorBeAlarmed; // very alarming
|
|
|
|
void() TeamFortress_C4DetpackTouch;
|
|
|
|
void() ThrowC4Det;
|
|
|
|
//void() SBInitiateInterface;
|
|
|
|
float(entity hacked, float r) ReturnHackDelay;
|
|
|
|
void() SBHackDotTimerThink;
|
|
|
|
/*void() SwitchToCamera;
|
|
|
|
void() SwitchFromCamera;
|
|
|
|
void() CameraSwitchView;*/
|
|
|
|
// External functions
|
|
|
|
|
|
|
|
void() ConcussionGrenadeTouch;
|
2001-10-17 07:48:11 +00:00
|
|
|
void(entity attacker, float damage) Security_Camera_Pain;
|
2001-07-23 05:33:21 +00:00
|
|
|
void(float tno, entity ignore, string st) teamsprint;
|
2001-07-17 05:58:10 +00:00
|
|
|
void() TeamFortress_DetpackTouch;
|
|
|
|
void() TeamFortress_DetpackCountDown;
|
|
|
|
void() TeamFortress_DetpackExplode;
|
|
|
|
void() TeamFortress_DetpackDisarm;
|
|
|
|
void() SBFireInterface;
|
|
|
|
|
|
|
|
// -- OfN --
|
|
|
|
void(float tno, entity ignore) teamprefixsprint;
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
void() CameraSwitchView =
|
|
|
|
{
|
|
|
|
if (!self.has_camera)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (self.is_cameraviewing)
|
|
|
|
SwitchFromCamera();
|
|
|
|
else
|
|
|
|
SwitchToCamera();
|
|
|
|
};
|
|
|
|
|
|
|
|
void() SwitchToCamera =
|
|
|
|
{
|
|
|
|
local entity camera;
|
|
|
|
local float done;
|
|
|
|
|
|
|
|
if (!self.has_camera)
|
|
|
|
return;
|
|
|
|
if (self.is_cameraviewing)
|
|
|
|
return;
|
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
camera = find(NIL, classname, "building_camera");
|
2001-07-17 05:58:10 +00:00
|
|
|
if (camera.real_owner == self)
|
2001-07-23 20:52:47 +00:00
|
|
|
done = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
while (!done)
|
|
|
|
{
|
|
|
|
camera = find(camera, classname, "building_camera");
|
|
|
|
if (camera.real_owner == self)
|
2001-07-23 20:52:47 +00:00
|
|
|
done = TRUE;
|
2001-11-02 17:00:52 +00:00
|
|
|
if (!camera)
|
2001-07-23 20:52:47 +00:00
|
|
|
done = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
if (!camera)
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
msg_entity = self;
|
2001-07-23 20:52:47 +00:00
|
|
|
WriteByte(MSG_ONE, SVC_SETVIEWPORT);
|
|
|
|
WriteEntity(MSG_ONE, camera);
|
|
|
|
WriteByte(MSG_ONE, SVC_SETANGLES);
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_x);
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_y);
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_z);
|
|
|
|
self.fixangle = TRUE;
|
|
|
|
self.is_cameraviewing = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.t_s_h = self.weaponmodel;
|
|
|
|
self.weaponmodel= "";
|
|
|
|
self.view_ofs = '0 0 0';
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Camera view activated.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void() SwitchFromCamera =
|
|
|
|
{
|
|
|
|
if (!self.has_camera)
|
|
|
|
return;
|
|
|
|
if (!self.is_cameraviewing)
|
|
|
|
return;
|
|
|
|
msg_entity = self;
|
2001-07-23 20:52:47 +00:00
|
|
|
WriteByte(MSG_ONE, SVC_SETVIEWPORT);
|
|
|
|
WriteEntity(MSG_ONE, self);
|
|
|
|
WriteByte(MSG_ONE, SVC_SETANGLES);
|
|
|
|
WriteAngle(MSG_ONE, self.angles_x);
|
|
|
|
WriteAngle(MSG_ONE, self.angles_y);
|
|
|
|
WriteAngle(MSG_ONE, self.angles_z);
|
|
|
|
self.fixangle = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.weaponmodel = self.t_s_h;
|
|
|
|
self.view_ofs = '0 0 22';
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.is_cameraviewing = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// SB Tossable Detpack!
|
|
|
|
// A 10 second detpack that can be thrown around corners
|
|
|
|
|
|
|
|
void() PrimeC4Det =
|
|
|
|
{
|
|
|
|
local entity te;
|
2001-07-25 17:03:53 +00:00
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
if (infokey (NIL, "no_spam") == "on")
|
2001-07-25 17:03:53 +00:00
|
|
|
{
|
|
|
|
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
|
|
|
|
return;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(self.cutf_items & CUTF_TOSSABLEDET))
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You do not have the C4 tossable detpack.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (self.ammo_c4det < 1)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "Looks like you're out of C4.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (self.is_detpacking || self.is_toffingadet)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You can only set one detpack at once, throwable or otherwise!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (self.is_haxxxoring)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You can't set a detpack while hacking.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
te = spawn();
|
|
|
|
te.owner = self;
|
2001-07-23 20:52:47 +00:00
|
|
|
te.nextthink = time + WEAP_DETPACK_SETTIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
te.think = ThrowC4Det;
|
|
|
|
te.classname = "timer";
|
|
|
|
te.netname = "C4detpack_timer";
|
|
|
|
self.is_toffingadet = 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.tfstate = self.tfstate | TFSTATE_C4THROW;
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Arming detpack...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void() TeamFortress_C4DetpackTouch =
|
|
|
|
{
|
|
|
|
local entity disarm;
|
|
|
|
|
|
|
|
if (other.classname != "player")
|
|
|
|
return;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
//WK if (other.playerclass != PC_SCOUT)
|
|
|
|
if (!(other.tf_items & NIT_SCANNER))
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (self.weaponmode == 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (Teammate(self.owner.team_no,other.team_no))
|
|
|
|
return;
|
|
|
|
|
|
|
|
makeImmune(other,time + 2);
|
|
|
|
//other.immune_to_check = time + 2;
|
2001-07-23 20:52:47 +00:00
|
|
|
other.tfstate = other.tfstate | TFSTATE_CANT_MOVE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(other, PRINT_HIGH, "Disarming detpack...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(other);
|
|
|
|
|
|
|
|
// Spawn disarming entity
|
|
|
|
disarm = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
disarm.movetype = MOVETYPE_NONE; //WK M3 Bug Hunt
|
2001-07-17 05:58:10 +00:00
|
|
|
disarm.owner = other; // the scout
|
|
|
|
disarm.enemy = self; // the detpack
|
|
|
|
disarm.classname = "timer";
|
2001-07-23 20:52:47 +00:00
|
|
|
disarm.nextthink = time + WEAP_DETPACK_DISARMTIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
disarm.think = TeamFortress_DetpackDisarm;
|
|
|
|
|
|
|
|
self.weaponmode = 1; // indicates disarming
|
|
|
|
self.enemy = other; // points to scout
|
|
|
|
self.observer_list = disarm;
|
|
|
|
};
|
|
|
|
|
|
|
|
void(entity ignore, string st, string st2, string st3, string st4, string st5, string st6) teamsprint6;
|
|
|
|
|
|
|
|
void() ThrowC4Det =
|
|
|
|
{
|
|
|
|
local entity user;
|
|
|
|
|
|
|
|
self.owner.is_toffingadet = 0;
|
|
|
|
|
|
|
|
self.owner.ammo_c4det = self.owner.ammo_c4det - 1;
|
|
|
|
|
|
|
|
user = self.owner;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sound (user, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
KickPlayer(-1, user);
|
|
|
|
|
|
|
|
newmis = spawn ();
|
|
|
|
newmis.owner = user;
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.movetype = MOVETYPE_BOUNCE;
|
|
|
|
newmis.solid = SOLID_BBOX;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.classname = "detpack";
|
|
|
|
|
|
|
|
// for identify it on airfist pushable? routine
|
|
|
|
//newmis.netname = "C4";
|
|
|
|
|
|
|
|
// set grenade speed
|
|
|
|
makevectors (user.v_angle);
|
|
|
|
|
|
|
|
if (user.deadflag)
|
|
|
|
{
|
|
|
|
// if user is dead, throw grenade directly up
|
|
|
|
newmis.velocity = '0 0 200';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (user.v_angle_x)
|
|
|
|
{
|
|
|
|
newmis.velocity = v_forward*600 + v_up * 200 + random()*v_right*10 + random()*v_up*10;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
newmis.velocity = aim(user, 10000);
|
|
|
|
newmis.velocity = newmis.velocity * 600;
|
|
|
|
newmis.velocity_z = 200;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newmis.angles = vectoangles(newmis.velocity);
|
|
|
|
|
|
|
|
newmis.touch = TeamFortress_C4DetpackTouch;
|
|
|
|
newmis.think = TeamFortress_DetpackExplode;
|
|
|
|
newmis.nextthink = time + 10;
|
|
|
|
|
|
|
|
newmis.avelocity = '300 300 300';
|
|
|
|
setmodel (newmis, "progs/detpack.mdl");
|
|
|
|
|
|
|
|
setsize (newmis, '-16 -16 -8', '16 16 8');
|
|
|
|
setorigin (newmis, user.origin);
|
|
|
|
|
2002-08-21 20:25:10 +00:00
|
|
|
dremove (self);
|
2001-07-17 05:58:10 +00:00
|
|
|
self = user;
|
|
|
|
|
|
|
|
#ifdef DEMO_STUFF
|
|
|
|
if (live_camera)
|
|
|
|
CamProjectileLockOn();
|
|
|
|
#endif
|
|
|
|
local entity countd;
|
|
|
|
|
|
|
|
newmis.weaponmode = 0; // Detpack weaponmode = 1 when disarming
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sound (newmis, CHAN_WEAPON, "doors/medtry.wav", 1, ATTN_NORM); //CH play set detpack sound
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Create the CountDown entity
|
|
|
|
countd = spawn();
|
|
|
|
newmis.linked_list = countd; // attach count to its detpack
|
|
|
|
countd.think = TeamFortress_DetpackCountDown;
|
|
|
|
countd.health = 9;
|
|
|
|
countd.nextthink = time + 1;
|
|
|
|
countd.owner = newmis.owner;
|
2001-07-23 20:52:47 +00:00
|
|
|
countd.movetype = MOVETYPE_BOUNCE;
|
2001-07-17 05:58:10 +00:00
|
|
|
countd.classname = "countdown_timer"; // Don't call it timer, because we
|
|
|
|
// don't want it removed if player dies
|
|
|
|
countd.enemy = newmis;
|
|
|
|
newmis.oldenemy = countd;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Detpack armed!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
teamprefixsprint(self.team_no,self);
|
|
|
|
teamsprint6(self,self.netname," throws a C4!\n","","","","");
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.tfstate = self.tfstate - (self.tfstate & TFSTATE_C4THROW);
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self); // let's roll
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// SB Motion Sensor
|
|
|
|
// Sits in shadows and lights up and makes noise when player goes near
|
|
|
|
|
|
|
|
void() SBBuildSensor =
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.ammo_cells >= BUILD_COST_SENSOR && self.has_sensor == 0)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
self.ammo_cells = self.ammo_cells - BUILD_COST_SENSOR;
|
2001-07-17 05:58:10 +00:00
|
|
|
MotionSensorSpawn();
|
|
|
|
self.has_sensor = 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "You place the motion sensor.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.option = time + 2;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (self.ammo_cells < BUILD_COST_SENSOR && self.has_sensor == 0)
|
|
|
|
sprint(self, PRINT_HIGH, "You do not have enough metal to build a motion sensor.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (self.option < time) // avoids ppl overflowing by destroying/building it repeatedly
|
|
|
|
{
|
|
|
|
Find_And_Dmg("building_sensor", self, 1);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "You detonate your motion sensor.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.has_sensor = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void() MotionSensorTossTouch =
|
|
|
|
{
|
2001-11-02 17:00:52 +00:00
|
|
|
if (other || other == self.real_owner)
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
local integer pc = entpointcontents(self);
|
|
|
|
if (pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
MotionSensorDie();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
teamprefixsprint(self.real_owner.team_no,self.real_owner); //- OfN
|
|
|
|
teamsprint(self.real_owner.team_no, self.real_owner, self.real_owner.netname);
|
|
|
|
teamsprint(self.real_owner.team_no, self.real_owner, " has built a Motion Sensor.\n");
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.movetype = MOVETYPE_NONE;
|
2001-07-17 05:58:10 +00:00
|
|
|
setsize (self, '-16 -16 -6', '16 16 10');
|
2001-07-23 20:52:47 +00:00
|
|
|
self.solid = SOLID_BBOX;
|
|
|
|
self.takedamage = DAMAGE_AIM;
|
|
|
|
sound (self, CHAN_WEAPON, "weapons/guerilla_set.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
self.think = MotionSensorIdle;
|
|
|
|
self.nextthink = time + 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
void() MotionSensorIdle =
|
|
|
|
{
|
|
|
|
if (MotionSensorFindTarget())
|
|
|
|
self.nextthink = time + 2.4; //if found wait 2.5 sec before do another check
|
|
|
|
else
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
self.nextthink = time + 0.2; // lots per sec GR No, too hard to get past
|
2001-07-17 05:58:10 +00:00
|
|
|
self.think = MotionSensorIdle;
|
|
|
|
};
|
|
|
|
|
|
|
|
float() MotionSensorFindTarget =
|
|
|
|
{
|
2001-11-02 17:00:52 +00:00
|
|
|
local entity client = NIL;
|
2001-07-17 05:58:10 +00:00
|
|
|
local float r, gotone, loopc;
|
|
|
|
|
|
|
|
// Try a few checks to make it react faster
|
|
|
|
r = 0;
|
|
|
|
loopc = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
gotone = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.is_malfunctioning & SCREWUP_THREE)
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
local float trange; //- OfN - Hack
|
|
|
|
trange=300; // was 250
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.num_mines & IMPROVED_ONE)
|
2001-07-17 05:58:10 +00:00
|
|
|
trange=500; // was 400
|
|
|
|
|
|
|
|
//CH Theortetically this will check every client on the server now
|
2001-07-23 20:52:47 +00:00
|
|
|
while (loopc < 32 && gotone == FALSE)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
client = checkclient();
|
2001-07-23 20:52:47 +00:00
|
|
|
gotone = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (!client)
|
2001-07-23 20:52:47 +00:00
|
|
|
gotone = FALSE;
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
else if (!Pharse_Client(client, self, 1, trange, 2, 1))
|
2001-07-23 20:52:47 +00:00
|
|
|
gotone = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
loopc = loopc + 1;
|
|
|
|
if (gotone) loopc = 1000;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gotone)
|
|
|
|
{
|
|
|
|
self.effects = 0;
|
|
|
|
self.skin=1;
|
2001-07-23 20:52:47 +00:00
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Found a Target
|
|
|
|
self.enemy = client;
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
|
|
|
|
if (self.enemy.cutf_items & CUTF_JAMMER) // jammer makes it hard
|
|
|
|
{
|
|
|
|
}
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
/*if (self.enemy.classname != "player") // OfN - wtf does this?
|
|
|
|
{
|
|
|
|
self.enemy = self.enemy.enemy;
|
|
|
|
if (self.enemy.classname != "player")
|
|
|
|
{
|
2001-11-02 17:00:52 +00:00
|
|
|
self.enemy = NIL;
|
2001-07-23 20:52:47 +00:00
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}*/ // OfN - wtf does this?
|
|
|
|
|
|
|
|
// SPIES, only returned by pharseclient if sensor is able to uncover them -changed
|
2001-07-23 20:52:47 +00:00
|
|
|
if (Teammate(self.enemy.undercover_team,self.team_no) && self.num_mines & IMPROVED_FOUR)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
/*if (!(self.enemy.cutf_items & CUTF_JAMMER)) // if they dont have a scanner jammer remove their disguise
|
2001-07-17 05:58:10 +00:00
|
|
|
{*/
|
|
|
|
Spy_RemoveDisguise(self.enemy);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.real_owner, PRINT_HIGH, "Your motion sensor detects a spy!\n");
|
|
|
|
sprint(self.enemy, PRINT_HIGH, "That motion sensor knows you are a spy!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
//}
|
|
|
|
//else
|
2001-07-23 20:52:47 +00:00
|
|
|
// return FALSE; // removed cause sensors alarm is activated anyway, even if they will not uncover them
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// THIEVES, ALWAYS DETECTED BUT SENSOR ONLY UNCOVERS THEM IF HACKED TO DO- changed
|
|
|
|
if (self.enemy.classname=="player")
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.enemy.job & JOB_THIEF && (self.enemy.job & JOB_ACTIVE || self.enemy.job & JOB_FULL_HIDE))
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.num_mines & IMPROVED_SEVEN)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.real_owner, PRINT_HIGH, "Your motion sensor detects a thief!\n");
|
|
|
|
sprint(self.enemy, PRINT_HIGH, "That motion sensor can see you!\n");
|
|
|
|
RevealThief(self.enemy,TRUE);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(self.is_malfunctioning & SCREWUP_ONE))
|
|
|
|
sound(self, CHAN_WEAPON, "misc/enemy.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(self.is_malfunctioning & SCREWUP_TWO))
|
|
|
|
{ self.effects = EF_BRIGHTLIGHT; self.skin=0;}
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.real_owner,PRINT_HIGH,"Your motion sensor reports enemy presence!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
self.think = SensorBeAlarmed;
|
2001-07-23 20:52:47 +00:00
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void() SensorBeAlarmed =
|
|
|
|
{
|
|
|
|
if (MotionSensorFindTarget())
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(self.is_malfunctioning & SCREWUP_ONE))
|
|
|
|
sound(self, CHAN_WEAPON, "misc/enemy.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
self.nextthink = time + 2.4;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self.think = MotionSensorIdle;
|
|
|
|
self.effects = 0;
|
1) Attempted to give players positive frags whenever possible. You now
should get frags for blowing people up with others' dispensers/mines/expbody,
airfisting rockets, etc.
2) Redid Give_Frags_Out
3) Changed many uses of pointcontents and ugly hacks to use hullpointcontents
and checkmove, now a lot cleaner and less buggy
4) You can grapple builds again. This caused really odd bugs.
5) You can now damage your own buildings again (gasp). Any time a tesla or sentry
is damaged it turns on its attacker, friendly or otherwise. This is both a counter-TK
and counter-spy mechanism.
6) Teslas are now entirely inside their bounding box
7) Now check every frame for players startsolid and for outside of the map cube.
8) #define WALL_HURT to make it hurt when you hit a wall
9) Used some cool ideas (aka laws of physics) to make the airfist a little less annoying
10) You now only get 1 mirv per slot without bandolier. Demoman and hwguy gain bandolier.
demoman loses his extra mirv but gains an extra grenade and pair of detpacks. Hwguy
gets extra grenade.
11) New and improved EMP grenade now does damage based on range. no longer blows up shells.
Doesn't directly damage sentries anymore, but does significant damage to dispensers.
EMP someone who's setting a det and it blows up in their face.
12) Players now do radius damage from getting EMPed (again)
13) EMPs now go through walls (again)
14) EMP number lowered by one (3 without, 4 with bandolier) and cost raised by $100
15) You can only have 2 frag grens, 3 with bandolier now.
16) Hover boots will now eat cells if they get low on charge. In addition, the silly bug
where their charge wasn't restored when you die is fixed now.
17) EMPing a detpack now sets its timer to anywhere between 1 and 121 seconds from current time,
with a logarithmic probability of it being lower. (random() * random() * 120 + 1). Also, probably
more time the closer it is to the EMP.
18) Judo can now be blocked by people with close combat, knife or judo. Blocked judo means that the
attacker loses 3 seconds of attack.
19) Judo missing now makes them unable to fire.
20) Shortened judo range (back to normal if w/ close combat)
21) Attempted to rework the railgun. Seems to be okay now.
Probably still a lot of bugs in here, but since this is the devel version I thought I would commit
all my changes so people could start testing it. I'll commit fixes as soon as I find the bugs.
2003-11-26 08:53:44 +00:00
|
|
|
self.nextthink = time + 0.5;
|
2001-07-17 05:58:10 +00:00
|
|
|
///
|
|
|
|
self.skin=1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void() MotionSensorSpawn =
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
self.has_sensor = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.movetype = MOVETYPE_BOUNCE;
|
<Grievre> lemme see... fixes: stuck shamblers, cheat teslas, camming and
sensing
<Grievre> give mirvs the right death message, make them a little weaker and
more spread out
<Grievre> increased damage done by exp body... fixes not being able to use
airfist if you have daedalus or lg with no cells
<Grievre> made it so missing judo = you can't fire for 1.5 seconds, also
judo doesn't always work, less chance of it working a) if they're facing
you b) if they have knife, judo, or close combat
<Grievre> you lose speed the more armor you have (so upgraded people can
buy cougar and cheetah now)
<Grievre> attempted to fix the respawn guard not telefragging bug (if it
was still there)
<Grievre> made it so you can tell a shambler to come, stop, or patrol even
if it is fighting someone, doesn't really work most of the time but can
"wake up" your shambler if it's being screwy
<Grievre> (works for all demons)
<Grievre> made it so a monster goes back to what it was doing before
(following you, patrolling etc) once it's done with its enemy
<Grievre> made the sniper rifle less cheap (or tried to), charging now =
more accuracy, rather than more damage. OTR now does slightly less damage
than regular, but isn't blocked by armor as much.
<Grievre> autorifle now has half the rate of fire but does same damage as
sniper rifle, but less accurate
<Grievre> headshots always ignore armor if target has green armor, legshots
always ignore armor except for red
<Grievre> added bshams and shambler kings (can be disabled with infokeys)
<Grievre> increased max knife blood to 32
<Grievre> made it so airfist bounces gymnasts twice as much, and bounces
everyone a little more (I think), may cause stuck bugs but I think it
won't. airfist does half damage to gymnasts and slightly more to hwguys
<Grievre> made shamblers a little smarter and more powerful in general
<Grievre> they now attack buildings (only bshams/kings) if they are
attacked by them first
<Grievre> bsham/king fireball now sets things on fire
<Grievre> shamblers will generally attack the person who last hit them
<Grievre> shortened judoka range (they have the old range if they get close
combat
<Grievre> shamblers will cycle the left-right slash or fireball longer than
they did (but they won't keep doing it if their enemy is not visible)
<Grievre> fixed shambler fireball so it doesn't miss and hurt itself so
much
<Grievre> #define OLD_AUTORIFLE
<Grievre> will go to the old behavior of the auto rifle
<Grievre> I think that's it
<Grievre> oh, I changed the intro message and version string a little, you
might want to change that
2003-11-12 04:58:19 +00:00
|
|
|
setsize (newmis, '-16 -16 -6', '16 16 10');
|
2001-07-17 05:58:10 +00:00
|
|
|
// setsize (newmis, '-8 -8 -8', '8 8 8');
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.solid = SOLID_BBOX;
|
|
|
|
newmis.takedamage = DAMAGE_AIM;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.classname = "building_sensor";
|
|
|
|
newmis.netname = "motion_sensor";
|
<Grievre> lemme see... fixes: stuck shamblers, cheat teslas, camming and
sensing
<Grievre> give mirvs the right death message, make them a little weaker and
more spread out
<Grievre> increased damage done by exp body... fixes not being able to use
airfist if you have daedalus or lg with no cells
<Grievre> made it so missing judo = you can't fire for 1.5 seconds, also
judo doesn't always work, less chance of it working a) if they're facing
you b) if they have knife, judo, or close combat
<Grievre> you lose speed the more armor you have (so upgraded people can
buy cougar and cheetah now)
<Grievre> attempted to fix the respawn guard not telefragging bug (if it
was still there)
<Grievre> made it so you can tell a shambler to come, stop, or patrol even
if it is fighting someone, doesn't really work most of the time but can
"wake up" your shambler if it's being screwy
<Grievre> (works for all demons)
<Grievre> made it so a monster goes back to what it was doing before
(following you, patrolling etc) once it's done with its enemy
<Grievre> made the sniper rifle less cheap (or tried to), charging now =
more accuracy, rather than more damage. OTR now does slightly less damage
than regular, but isn't blocked by armor as much.
<Grievre> autorifle now has half the rate of fire but does same damage as
sniper rifle, but less accurate
<Grievre> headshots always ignore armor if target has green armor, legshots
always ignore armor except for red
<Grievre> added bshams and shambler kings (can be disabled with infokeys)
<Grievre> increased max knife blood to 32
<Grievre> made it so airfist bounces gymnasts twice as much, and bounces
everyone a little more (I think), may cause stuck bugs but I think it
won't. airfist does half damage to gymnasts and slightly more to hwguys
<Grievre> made shamblers a little smarter and more powerful in general
<Grievre> they now attack buildings (only bshams/kings) if they are
attacked by them first
<Grievre> bsham/king fireball now sets things on fire
<Grievre> shamblers will generally attack the person who last hit them
<Grievre> shortened judoka range (they have the old range if they get close
combat
<Grievre> shamblers will cycle the left-right slash or fireball longer than
they did (but they won't keep doing it if their enemy is not visible)
<Grievre> fixed shambler fireball so it doesn't miss and hurt itself so
much
<Grievre> #define OLD_AUTORIFLE
<Grievre> will go to the old behavior of the auto rifle
<Grievre> I think that's it
<Grievre> oh, I changed the intro message and version string a little, you
might want to change that
2003-11-12 04:58:19 +00:00
|
|
|
newmis.origin = self.origin;
|
2001-11-02 17:00:52 +00:00
|
|
|
newmis.owner = NIL;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.real_owner = self;
|
|
|
|
makevectors (self.v_angle);
|
|
|
|
newmis.avelocity = '0 0 0';
|
|
|
|
newmis.velocity = v_forward*800 + v_up * 200 + v_right*10 + v_up*10;
|
<Grievre> lemme see... fixes: stuck shamblers, cheat teslas, camming and
sensing
<Grievre> give mirvs the right death message, make them a little weaker and
more spread out
<Grievre> increased damage done by exp body... fixes not being able to use
airfist if you have daedalus or lg with no cells
<Grievre> made it so missing judo = you can't fire for 1.5 seconds, also
judo doesn't always work, less chance of it working a) if they're facing
you b) if they have knife, judo, or close combat
<Grievre> you lose speed the more armor you have (so upgraded people can
buy cougar and cheetah now)
<Grievre> attempted to fix the respawn guard not telefragging bug (if it
was still there)
<Grievre> made it so you can tell a shambler to come, stop, or patrol even
if it is fighting someone, doesn't really work most of the time but can
"wake up" your shambler if it's being screwy
<Grievre> (works for all demons)
<Grievre> made it so a monster goes back to what it was doing before
(following you, patrolling etc) once it's done with its enemy
<Grievre> made the sniper rifle less cheap (or tried to), charging now =
more accuracy, rather than more damage. OTR now does slightly less damage
than regular, but isn't blocked by armor as much.
<Grievre> autorifle now has half the rate of fire but does same damage as
sniper rifle, but less accurate
<Grievre> headshots always ignore armor if target has green armor, legshots
always ignore armor except for red
<Grievre> added bshams and shambler kings (can be disabled with infokeys)
<Grievre> increased max knife blood to 32
<Grievre> made it so airfist bounces gymnasts twice as much, and bounces
everyone a little more (I think), may cause stuck bugs but I think it
won't. airfist does half damage to gymnasts and slightly more to hwguys
<Grievre> made shamblers a little smarter and more powerful in general
<Grievre> they now attack buildings (only bshams/kings) if they are
attacked by them first
<Grievre> bsham/king fireball now sets things on fire
<Grievre> shamblers will generally attack the person who last hit them
<Grievre> shortened judoka range (they have the old range if they get close
combat
<Grievre> shamblers will cycle the left-right slash or fireball longer than
they did (but they won't keep doing it if their enemy is not visible)
<Grievre> fixed shambler fireball so it doesn't miss and hurt itself so
much
<Grievre> #define OLD_AUTORIFLE
<Grievre> will go to the old behavior of the auto rifle
<Grievre> I think that's it
<Grievre> oh, I changed the intro message and version string a little, you
might want to change that
2003-11-12 04:58:19 +00:00
|
|
|
newmis.origin += normalize(newmis.velocity) * 20;
|
|
|
|
setorigin(newmis, newmis.origin);
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.angles = '0 0 0';
|
|
|
|
newmis.angles_y = anglemod(self.angles_y + 180);
|
|
|
|
// newmis.skin = 1;
|
|
|
|
newmis.th_die = MotionSensorDie; // Death function
|
|
|
|
newmis.th_pain = Security_Camera_Pain; // may as well use this eh
|
|
|
|
//newmis.mdl = "progs/s_light.spr"; //CH temp model
|
|
|
|
|
|
|
|
newmis.mdl = "progs/sencer.mdl";
|
|
|
|
newmis.skin=1;
|
|
|
|
|
|
|
|
setmodel (newmis, newmis.mdl);
|
|
|
|
newmis.team_no = self.team_no;
|
|
|
|
newmis.colormap = self.colormap;
|
|
|
|
newmis.heat = 0; //Beeps
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.health = newmis.max_health = BUILD_HEALTH_SENSOR;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.touch = MotionSensorTossTouch;
|
|
|
|
|
|
|
|
newmis.num_mines=0; // OfN - reset HACKER improvements
|
|
|
|
|
|
|
|
W_SetCurrentAmmo();
|
|
|
|
};
|
|
|
|
|
|
|
|
void() MotionSensorDie =
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.real_owner, PRINT_HIGH, "Your motion sensor was destroyed.\n");
|
|
|
|
self.real_owner.has_sensor = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
// ThrowGib("progs/tgib1.mdl", -70);
|
|
|
|
// ThrowGib("progs/tgib2.mdl", -70);
|
|
|
|
// ThrowGib("progs/tgib3.mdl", -70);
|
|
|
|
|
2001-10-13 23:02:22 +00:00
|
|
|
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
|
|
|
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_x);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_y);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_z);
|
2001-07-23 20:52:47 +00:00
|
|
|
multicast (self.origin, MULTICAST_PHS);
|
2001-07-17 05:58:10 +00:00
|
|
|
dremove(self);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// SB AntiGrav Grenade(tm)
|
|
|
|
// Screws over a player's gravity for a short time
|
|
|
|
//
|
|
|
|
// Uses the conc gren's touch function - why repeat it with an identical one?
|
|
|
|
|
|
|
|
void() AntiGravGrenadeExplode =
|
|
|
|
{
|
2001-11-02 17:00:52 +00:00
|
|
|
T_RadiusAntiGrav (self, self.owner, 100, NIL);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
#ifdef DEMO_STUFF
|
|
|
|
// Remove any camera's locks on this missile
|
|
|
|
if (self.enemy)
|
|
|
|
CamProjectileLockOff();
|
|
|
|
#endif
|
|
|
|
|
2001-10-13 23:02:22 +00:00
|
|
|
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
|
|
|
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_x);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_y);
|
|
|
|
WriteCoord (MSG_MULTICAST, self.origin_z);
|
2001-07-23 20:52:47 +00:00
|
|
|
multicast (self.origin, MULTICAST_PHS);
|
2001-07-17 05:58:10 +00:00
|
|
|
dremove(self);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Bounces the enemy a bit and screws over their gravity :)
|
|
|
|
|
|
|
|
void(entity inflictor, entity attacker, float bounce, entity ignore) T_RadiusAntiGrav =
|
|
|
|
{
|
|
|
|
local float points;
|
|
|
|
local entity head, te;
|
|
|
|
local vector org;
|
|
|
|
|
|
|
|
head = findradius(inflictor.origin, bounce+40);
|
|
|
|
|
|
|
|
while (head)
|
|
|
|
{
|
|
|
|
if (head != ignore)
|
|
|
|
{
|
|
|
|
if (head.takedamage)
|
|
|
|
{
|
|
|
|
org = head.origin + (head.mins + head.maxs)*0.5;
|
|
|
|
points = 0.5*vlen (org - inflictor.origin);
|
|
|
|
if (points < 0)
|
|
|
|
points = 0;
|
|
|
|
points = bounce - points;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.cutf_items & CUTF_GYMNAST)
|
2001-07-17 05:58:10 +00:00
|
|
|
points = points * 2;
|
|
|
|
|
|
|
|
if (!IsBuilding(head) && points > 0)
|
|
|
|
{
|
|
|
|
// Bounce!!
|
|
|
|
head.velocity = org - inflictor.origin;
|
|
|
|
head.velocity = head.velocity * (points / 20);
|
|
|
|
|
|
|
|
if (head.classname != "player")
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if(head.flags & FL_ONGROUND)
|
|
|
|
head.flags = head.flags - FL_ONGROUND;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//WK Add cheat immunity since they fly
|
|
|
|
makeImmune(head,time+3);
|
|
|
|
|
|
|
|
// Turn on antigrav
|
|
|
|
// If it's already on, restore it to full time
|
|
|
|
// Try to find a concusstimer entity for this player
|
2001-11-02 17:00:52 +00:00
|
|
|
te = find(NIL, classname, "timer");
|
|
|
|
while (((te.owner != head) || (te.think != AntiGravGrenadeTimer)) && (te))
|
2001-07-17 05:58:10 +00:00
|
|
|
te = find(te, classname, "timer");
|
2001-11-02 17:00:52 +00:00
|
|
|
if (te)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
head.gravity = 0.3 * random();
|
2004-01-21 16:05:58 +00:00
|
|
|
te.health += GR_ANTIGRAV_AMOUNT;
|
|
|
|
te.nextthink = time + GR_ANTIGRAV_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
head.gravity = 0.3 * random();
|
|
|
|
stuffcmd(head,"bf\n");
|
|
|
|
// Create a timer entity
|
|
|
|
te = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
te.nextthink = time + GR_CONCUSS_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
te.think = AntiGravGrenadeTimer;
|
|
|
|
te.team_no = attacker.team_no;
|
|
|
|
te.classname = "timer";
|
|
|
|
te.owner = head;
|
2004-01-21 16:05:58 +00:00
|
|
|
te.health = GR_ANTIGRAV_AMOUNT;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
head = head.chain;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Timer used to control antigrav effects
|
|
|
|
|
|
|
|
void() AntiGravGrenadeTimer =
|
|
|
|
{
|
|
|
|
if (self.owner.invincible_finished > time)
|
|
|
|
{
|
|
|
|
self.owner.gravity = 1;
|
|
|
|
dremove(self);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-01-21 16:05:58 +00:00
|
|
|
self.health = self.health - GR_ANTIGRAV_DEC * 2;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
// hwguy recovers twice as fast - heh heh
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.owner.cutf_items & CUTF_HWGUY)
|
2004-01-21 16:05:58 +00:00
|
|
|
self.health = self.health - GR_ANTIGRAV_DEC * 2;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (self.health < 0)
|
|
|
|
self.health = 0;
|
2004-01-21 16:05:58 +00:00
|
|
|
self.nextthink = time + GR_ANTIGRAV_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (self.health == 0)
|
|
|
|
{
|
|
|
|
self.owner.gravity = 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner, PRINT_HIGH, "Your weight feels normal again.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
dremove(self);
|
|
|
|
}
|
|
|
|
};
|