2001-07-17 05:58:10 +00:00
|
|
|
/*======================================================
|
|
|
|
JOBS.QC Custom TeamFortress v3.2SB1
|
|
|
|
|
|
|
|
(c) William Kerney 2/9/00
|
|
|
|
(c) SB-1 Tech 25/10/00
|
|
|
|
========================================================
|
|
|
|
Functions for handling the custom class professions
|
|
|
|
======================================================*/
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
#include "defs.qh"
|
|
|
|
#include "menu.qh"
|
|
|
|
#include "jobs.qh"
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
//WK - all of this
|
|
|
|
|
<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
|
|
|
void(float delay) Attack_Finished;
|
2001-07-17 05:58:10 +00:00
|
|
|
void() DropToCustomClassGen; //Called when starting class generation
|
|
|
|
void() DropFromCustomClassGen; //Called when finished class generation
|
|
|
|
void() PrintMoney;
|
|
|
|
void(float in) PrintRefund;
|
|
|
|
void(float in) PrintNotEnoughMoney;
|
|
|
|
void(float cost, float type) BuyItem;
|
|
|
|
void(float cost, float type) BuyJob;
|
|
|
|
/*void(float cost, float type) BuyGren1;
|
|
|
|
void(float cost, float type) BuyGren2;*/
|
|
|
|
void() FragGrenadeTouch;
|
|
|
|
void() FragGrenadeExplode;
|
|
|
|
void() KracGrenadeTouch;
|
|
|
|
void() KracGrenadeExplode;
|
|
|
|
void(entity bastard,float threshold) createBastard;
|
|
|
|
void() UseJobSkill; //Function for handling professions
|
|
|
|
void (entity targ,float pain) RevealThief;
|
|
|
|
|
|
|
|
|
|
|
|
//Extern
|
|
|
|
void (vector org, entity death_owner) spawn_tdeath;
|
|
|
|
void (string gib, float health) ThrowGib;
|
|
|
|
float() W_BestWeapon;
|
|
|
|
void() W_SetCurrentAmmo;
|
|
|
|
void(entity p) TeamFortress_SetSpeed;
|
|
|
|
void(entity p) TeamFortress_SetSkin;
|
|
|
|
void () BecomeExplosion;
|
|
|
|
void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
|
|
|
|
void() SUB_regen;
|
|
|
|
float modelindex_eyes, modelindex_player, modelindex_null;
|
|
|
|
void(float inAuto) W_FireMedikit;
|
|
|
|
void(float inAuto) TeamFortress_ID;
|
|
|
|
void(float range,float inAuto) TeamFortress_Scan;
|
|
|
|
void(float points) custom_demon_create;
|
|
|
|
void() kill_my_demon;
|
|
|
|
void() player_assaultcannondown1;
|
|
|
|
void (entity rhook) Reset_Grapple;
|
|
|
|
void (string temp) DebugSprint;
|
|
|
|
void (float temp) DebugSprintFloat;
|
|
|
|
void() TeamFortress_RegenerateCells; // for thief
|
|
|
|
|
|
|
|
//- OfN Cyber Interface is now a job itself
|
|
|
|
//---- OfN
|
|
|
|
void(entity mine_owner) DetonateMines;
|
|
|
|
float(entity thing) IsMonsterNonArmy;
|
|
|
|
float(entity thing) IsMonster; // for mines
|
|
|
|
void() JobArmy;
|
|
|
|
void() JobHacker;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Functions for handling our "professions"
|
|
|
|
// which add some class-like behavior to this
|
|
|
|
// unclassy version of TF
|
|
|
|
//
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Thief Profession -
|
|
|
|
** Hides in shadows, can become fully hidden, leaves shadows if attacks or attacked
|
|
|
|
*/
|
|
|
|
void() JobThief =
|
|
|
|
{
|
|
|
|
local entity te;
|
|
|
|
//local string st;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.job & JOB_ACTIVE) { //We are hiding
|
2001-07-17 05:58:10 +00:00
|
|
|
//If we hit "skill" again and we are moving, we leave shadows
|
|
|
|
//vel = vlen(self.velocity);
|
|
|
|
/*if (vel > 100) { //Leave shadows
|
2001-07-23 20:52:47 +00:00
|
|
|
// sprint(self,PRINT_HIGH,"Leaving shadows...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
//}
|
|
|
|
else { //Become fully hidden
|
|
|
|
//RJM - Can't hide while carrying flags.
|
2003-12-03 02:43:02 +00:00
|
|
|
if (self.effects & EF_ANYGLOW) {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"Not while glowing, idiot.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You are fully hidden\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.frame = 0;
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self.modelindex = modelindex_null;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job | JOB_FULL_HIDE;
|
2001-07-17 05:58:10 +00:00
|
|
|
} */
|
2001-08-10 06:50:39 +00:00
|
|
|
if (self.invisible_time)
|
|
|
|
sprint (self, PRINT_HIGH, "Leaving shadows... just as soon as this ring wears off...\n");
|
|
|
|
else {
|
|
|
|
sprint (self, PRINT_HIGH, "Leaving shadows...\n");
|
2001-08-10 10:03:36 +00:00
|
|
|
self.items = self.items & ~IT_INVISIBILITY;
|
2001-08-10 06:50:39 +00:00
|
|
|
self.modelindex = modelindex_player;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job - JOB_ACTIVE;
|
|
|
|
self.job = self.job - (self.job & JOB_FULL_HIDE);
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 2;
|
|
|
|
TeamFortress_SetSpeed(self);
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
/*else if (self.job & JOB_FULL_HIDE) {
|
|
|
|
RevealThief(self,FALSE);
|
2001-07-17 05:58:10 +00:00
|
|
|
} */
|
|
|
|
else { //Start hiding
|
|
|
|
//RJM - Can't hide while carrying flags.
|
|
|
|
//WK - Allow them to go eyes invisible but not full hide
|
|
|
|
/*
|
2003-12-03 02:43:02 +00:00
|
|
|
if (self.effects & EF_ANYGLOW) {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Not while glowing, gimp.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
*/
|
2001-08-10 06:50:39 +00:00
|
|
|
if (self.invisible_time)
|
|
|
|
sprint (self, PRINT_HIGH, "Entering shadows... well not really...\n");
|
|
|
|
else
|
|
|
|
sprint (self, PRINT_HIGH, "Entering shadows...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.frame = 0;
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self.modelindex = modelindex_eyes;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job | JOB_ACTIVE;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 2;
|
|
|
|
TeamFortress_SetSpeed(self);
|
2001-08-10 06:50:39 +00:00
|
|
|
self.items = self.items | IT_INVISIBILITY;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
te = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
te.nextthink = time + PC_SPY_CELL_REGEN_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
te.think = TeamFortress_RegenerateCells;
|
|
|
|
te.owner = self;
|
|
|
|
te.classname = "timer";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Runner Profession -
|
|
|
|
** Sprints at +200 speed for a while, then has to rest (half speed)
|
|
|
|
*/
|
|
|
|
#define PHASE1 5
|
|
|
|
#define PHASE2 5
|
|
|
|
#define PHASE3 5
|
|
|
|
void() RunnerThink =
|
|
|
|
{
|
|
|
|
self.heat = self.heat + 1;
|
|
|
|
if (self.heat == 1) { //Initial Phase
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"Sprinting...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self.owner);
|
2001-07-23 20:52:47 +00:00
|
|
|
self.nextthink = time + PHASE1;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else if (self.heat == 2) {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"Recovering...\n");
|
|
|
|
self.owner.job = self.owner.job | JOB_TIRED;
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self.owner);
|
2001-07-23 20:52:47 +00:00
|
|
|
self.nextthink = time + PHASE2;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else if (self.heat == 3) {
|
2001-07-23 20:52:47 +00:00
|
|
|
self.owner.job = self.owner.job - (self.owner.job & JOB_ACTIVE);
|
|
|
|
self.owner.job = self.owner.job - (self.owner.job & JOB_TIRED);
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self.owner);
|
2001-07-23 20:52:47 +00:00
|
|
|
self.nextthink = time + PHASE3;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
dremove(self);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
void() JobRunner =
|
|
|
|
{
|
|
|
|
local entity RunnerTimer;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job | JOB_ACTIVE; //Timer will remove this
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
RunnerTimer = spawn ();
|
|
|
|
RunnerTimer.classname = "timer";
|
|
|
|
RunnerTimer.owner = self;
|
|
|
|
RunnerTimer.nextthink = time + 0.5; //Small delays are cool
|
|
|
|
RunnerTimer.think = RunnerThink;
|
|
|
|
RunnerTimer.heat = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job_finished = time + PHASE1 + PHASE2 + PHASE3 + 0.6;
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void() JobWarlock =
|
|
|
|
{
|
|
|
|
//local float r;
|
|
|
|
//local entity SummonTimer;
|
|
|
|
if (self.attack_finished > time)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You can't shoot and summon at the same time\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.current_menu = MENU_DEMON;
|
|
|
|
self.menu_count = MENU_REFRESH_RATE;
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Chaplan Profession -
|
|
|
|
** Dispels demons, inspires teammates to do x2 damage, but can't attack himself
|
|
|
|
** Timer triggers every so often, checking to see if you want to resume inspire
|
|
|
|
*/
|
|
|
|
#define GUIDE_TIME 1 //Period of how often lightning guides are shown. Must be less than...
|
|
|
|
#define CHAPLAN_TIME 1 //Period of seconds how often it fires
|
|
|
|
#define INSPIRE_TIME 6 //How long someone stays inspired
|
|
|
|
#define CHAPLAN_RADIUS 320 //About the radius of brightglow
|
|
|
|
#define CHAPLAN_HEAL 50 //If you have a medikit you'll heal friends this much
|
|
|
|
#define CHAPLAN_HEAL_DELAY 3 //You can't have been shot in last three seconds to be healed
|
|
|
|
|
|
|
|
//Hunt for all friendlies and power them up
|
|
|
|
//Take special care to coexist with Quad damage
|
|
|
|
void() ChaplanInspire = {
|
|
|
|
local entity head;
|
|
|
|
local float take;
|
2001-07-23 20:52:47 +00:00
|
|
|
head = findradius(self.origin, CHAPLAN_RADIUS);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
while (head)
|
|
|
|
{
|
|
|
|
//Dispel enemy demons
|
|
|
|
//- OfN - if (head.classname == "monster_demon1" || head.classname == "monster_shambler")
|
|
|
|
if (IsMonsterNonArmy(head))
|
|
|
|
{ //No short circuit evaluation, so...
|
|
|
|
if (!Teammate(head.real_owner.team_no,self.team_no))
|
|
|
|
{ //...to avoid a crash from deref
|
|
|
|
if ((head.health <= 200 && head.classname == "monster_demon1") || head.health < 500 && head.classname == "monster_shambler") {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You dispel a demon\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.real_frags = self.real_frags + 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(toggleflags & TFLAG_TEAMFRAGS))
|
2001-07-17 05:58:10 +00:00
|
|
|
self.frags = self.real_frags;
|
|
|
|
}
|
|
|
|
if (head.classname == "monster_shambler")
|
|
|
|
TF_T_Damage(head, self, self, 500, 0, 0);
|
|
|
|
else if (head.classname == "monster_demon1")
|
|
|
|
TF_T_Damage(head, self, self, 200, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (head.classname == "player" && //Person who is...
|
|
|
|
Teammate(head.team_no,self.team_no) && //Same Team
|
|
|
|
head != self && //Not me
|
|
|
|
!(head.is_undercover) && //Not a spy
|
2001-07-23 20:52:47 +00:00
|
|
|
!(head.job & JOB_CHAPLAN) && //Not a chaplan
|
|
|
|
head.playerclass != PC_CIVILIAN && //KK
|
2001-07-17 05:58:10 +00:00
|
|
|
//... and not Quadded
|
2001-07-23 20:52:47 +00:00
|
|
|
!(head.items & IT_QUAD && !(head.tfstate & TFSTATE_INSPIRED))
|
2001-07-17 05:58:10 +00:00
|
|
|
)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
head.items = head.items | IT_QUAD;
|
2001-07-17 05:58:10 +00:00
|
|
|
head.inspirator = self; //We are their designated preacherman
|
|
|
|
head.super_time = 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (head.super_damage_finished < time + INSPIRE_TIME)
|
|
|
|
head.super_damage_finished = time + INSPIRE_TIME;
|
|
|
|
head.tfstate = head.tfstate | TFSTATE_INSPIRED;
|
2001-07-17 05:58:10 +00:00
|
|
|
//Heal them if we have automedic too
|
|
|
|
//SB amended to medikit since there is no automedic now
|
2001-07-23 20:52:47 +00:00
|
|
|
if ((self.weapons_carried & WEAP_MEDIKIT) && (self.last_attacked_time < time + CHAPLAN_HEAL_DELAY)) {
|
2001-07-17 05:58:10 +00:00
|
|
|
take = head.max_health - head.health;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (take > CHAPLAN_HEAL) take = CHAPLAN_HEAL;
|
2001-07-17 05:58:10 +00:00
|
|
|
if (take < 0) take = 0;
|
|
|
|
head.health = head.health + take;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
head = head.chain;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//Draws lightning bolts towards all the friendlies we're inspiring
|
|
|
|
//entity(entity start, .string fld, string match) find = #18;
|
|
|
|
void() ChaplanGuides = {
|
|
|
|
local entity head;
|
2001-11-02 17:00:52 +00:00
|
|
|
head = find(NIL,classname,"player");
|
2001-07-17 05:58:10 +00:00
|
|
|
while (head) {
|
|
|
|
if (head.inspirator == self) {
|
|
|
|
// Create the Lightning
|
|
|
|
msg_entity = self;
|
2001-07-23 20:52:47 +00:00
|
|
|
WriteByte (MSG_ONE, SVC_TEMPENTITY);
|
|
|
|
WriteByte (MSG_ONE, TE_LIGHTNING1);
|
|
|
|
WriteEntity (MSG_ONE, self);
|
|
|
|
WriteCoord (MSG_ONE, self.origin_x);
|
|
|
|
WriteCoord (MSG_ONE, self.origin_y);
|
|
|
|
WriteCoord (MSG_ONE, self.origin_z + 8);
|
|
|
|
WriteCoord (MSG_ONE, head.origin_x);
|
|
|
|
WriteCoord (MSG_ONE, head.origin_y);
|
|
|
|
WriteCoord (MSG_ONE, head.origin_z + 8);
|
2001-11-02 17:00:52 +00:00
|
|
|
head = NIL;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else //We can only draw one lightning. :p
|
|
|
|
head = find(head,classname,"player");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void() ChaplanThink = {
|
|
|
|
local entity oself;
|
|
|
|
oself = self;
|
|
|
|
self = self.owner;
|
|
|
|
|
|
|
|
ChaplanGuides();
|
2001-07-23 20:52:47 +00:00
|
|
|
oself.nextthink = time + GUIDE_TIME;
|
|
|
|
oself.frags = oself.frags + GUIDE_TIME;
|
|
|
|
if (oself.frags >= CHAPLAN_TIME) { //Do the full thing every second
|
2001-07-17 05:58:10 +00:00
|
|
|
oself.frags = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.heat == TRUE) { //Inspire everyone again
|
|
|
|
//sprint(self,PRINT_HIGH,"Chaplan: Still Preaching\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
ChaplanInspire();
|
|
|
|
}
|
|
|
|
else { //We stopped preaching
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You finish your sermon\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
//Sync CHAN_MUSIC with disconnect and sound below
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job - (self.job & JOB_ACTIVE);
|
|
|
|
sound (self, CHAN_MUSIC, "items/r_item1.wav", 0.1, ATTN_NORM);
|
2003-12-03 02:43:02 +00:00
|
|
|
self.effects &= ~EF_ANYGLOW;
|
2001-07-23 20:52:47 +00:00
|
|
|
//self.tfstate = self.tfstate - (self.tfstate & TFSTATE_RELOADING);
|
2001-07-17 05:58:10 +00:00
|
|
|
self.current_weapon = self.weapon;
|
|
|
|
W_SetCurrentAmmo();
|
|
|
|
oself.nextthink = time + 0.1;
|
|
|
|
oself.think = SUB_Remove;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self = oself;
|
|
|
|
};
|
|
|
|
|
|
|
|
void() JobChaplan =
|
|
|
|
{
|
|
|
|
local entity tWeapon;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.job & JOB_ACTIVE) {
|
|
|
|
//self.job = self.job - JOB_ACTIVE;
|
|
|
|
if (self.heat == TRUE) //Only print this once
|
|
|
|
sprint(self,PRINT_HIGH,"You gradually stop preaching...\n");
|
|
|
|
self.heat = FALSE; //Bad to turn off active, since technically job is still on.
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 0.7; //Don't allow them to trigger too often
|
|
|
|
return;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.tfstate & TFSTATE_RELOADING || self.is_feigning || self.heat) {
|
|
|
|
sprint(self,PRINT_HIGH,"You can't preach while doing other stuff\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 0.5; //Don't allow them to trigger too often
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You begin preaching. Hit skill again to stop.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
tWeapon = spawn();
|
|
|
|
tWeapon.frags = 0; //Clear guides counter
|
|
|
|
tWeapon.owner = self;
|
|
|
|
tWeapon.classname = "timer";
|
2001-07-23 20:52:47 +00:00
|
|
|
tWeapon.nextthink = time + GUIDE_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
tWeapon.think = ChaplanThink;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job | JOB_ACTIVE;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 0.3; //Don't allow them to trigger too often
|
|
|
|
|
|
|
|
//Hide our weapon. Can't shoot while preaching.
|
|
|
|
self.weapon = self.current_weapon;
|
|
|
|
self.current_weapon = 0;
|
|
|
|
self.weaponmodel = "";
|
|
|
|
self.weaponframe = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.heat = TRUE; //We're actively preaching.
|
|
|
|
//self.tfstate = self.tfstate | TFSTATE_RELOADING;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
//Start playing preacher music, glow and inspire!
|
2001-07-23 20:52:47 +00:00
|
|
|
//sound (self, CHAN_VOICE, "ambience/orff.wav", 0.75, ATTN_NORM);
|
|
|
|
sound (self, CHAN_MUSIC, "ambience/orff.wav", 0.75, ATTN_NORM);
|
2003-12-10 03:07:19 +00:00
|
|
|
self.effects |= EF_GlowColor(self);
|
2001-07-17 05:58:10 +00:00
|
|
|
ChaplanInspire();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Martyr Proficiency -
|
|
|
|
** Becomes invincible, but dies after a few seconds
|
|
|
|
*/
|
|
|
|
#define MARTYR_TIME 3.5
|
|
|
|
void() MartyrThink =
|
|
|
|
{
|
|
|
|
//Self.owner is the guy who became a martyr
|
|
|
|
|
|
|
|
//Clean these up so we can kill him
|
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.job = self.job - (self.job & JOB_ACTIVE); //why not?
|
2001-08-10 10:03:36 +00:00
|
|
|
self.owner.items = self.items & ~IT_INVULNERABILITY;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.owner.invincible_time = 0;
|
|
|
|
self.owner.invincible_finished = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.owner.effects = self.owner.effects - (self.owner.effects & EF_DIMLIGHT);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
//if (self.owner.martyr_enemy == self.owner)
|
2001-07-23 20:52:47 +00:00
|
|
|
deathmsg = DMSG_MARTYR;
|
2001-07-17 05:58:10 +00:00
|
|
|
//else
|
|
|
|
// deathmsg = self.owner.stored_deathmsg;
|
|
|
|
//- OfN was 20
|
2001-07-23 20:52:47 +00:00
|
|
|
TF_T_Damage(self.owner, self.owner.martyr_enemy, self.owner.martyr_enemy, self.owner.health + 20, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
self.think = SUB_Remove;
|
|
|
|
self.nextthink = time + 0.1;
|
|
|
|
};
|
|
|
|
|
|
|
|
// SB I'll leave this here since it's still close to a job
|
|
|
|
void() JobMartyr =
|
|
|
|
{
|
|
|
|
local entity tWeapon;
|
|
|
|
local float martyr_time;
|
|
|
|
|
|
|
|
if (self.is_abouttodie)
|
|
|
|
return;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
martyr_time = MARTYR_TIME; // don't need FORCED stuff since it's always automatic
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"Beginning your suicide run...\n");
|
|
|
|
self.items = self.items | IT_INVULNERABILITY;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.invincible_time = 1;
|
|
|
|
self.invincible_finished = time + martyr_time + 1; //Overlap so we can't die till end
|
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.job = self.job | JOB_ACTIVE; //why not?
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
tWeapon = spawn();
|
|
|
|
tWeapon.owner = self;
|
|
|
|
tWeapon.classname = "timer";
|
|
|
|
tWeapon.nextthink = time + martyr_time;
|
|
|
|
tWeapon.think = MartyrThink;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Berserker Profession -
|
|
|
|
** A simple soul that just likes killing things
|
|
|
|
** Takes 50 self inflicted damage and gets Quad for 5 seconds
|
|
|
|
** If he can't pay up with the 50 health he gets reduced to 1 and dies after his 5 seconds
|
|
|
|
*/
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
// now takes BERSERKER_HP_COST hp
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
#define BERSERK_TIME 4
|
|
|
|
|
|
|
|
void() BerserkerKillTimer =
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (!(self.tfstate & TFSTATE_CONCUSSIONED))
|
2001-07-17 05:58:10 +00:00
|
|
|
stuffcmd(self.owner, "v_idlescale 0\n");
|
2001-08-12 22:31:50 +00:00
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
if (self.has_sensor)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
deathmsg = DMSG_BERSERK;
|
2001-08-12 22:31:50 +00:00
|
|
|
TF_T_Damage(self.owner, self.owner, self.owner, self.owner.health, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
|
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.owner.job &= ~JOB_ACTIVE; //- OfN is a tard, should be self.owner idiot -Griev
|
2001-07-17 05:58:10 +00:00
|
|
|
dremove(self);
|
|
|
|
};
|
|
|
|
|
|
|
|
void() JobBerserker =
|
|
|
|
{
|
2004-01-21 16:05:58 +00:00
|
|
|
if (self.super_damage_finished > 0 || self.tfstate & TFSTATE_CONCUSSIONED)
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
newmis = spawn();
|
2001-08-12 22:31:50 +00:00
|
|
|
newmis.classname = "berserker_timer";
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.nextthink = time + BERSERK_TIME + 1;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.think = BerserkerKillTimer;
|
|
|
|
newmis.owner = self;
|
2004-01-21 16:05:58 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.health > BERSERKER_HP_COST)
|
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.health -= BERSERKER_HP_COST;
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
self.health = 1;
|
|
|
|
newmis.has_sensor = 1;
|
|
|
|
}
|
|
|
|
self.super_time = 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.super_damage_finished = time + BERSERK_TIME + 1;
|
|
|
|
self.items = self.items | IT_QUAD;
|
|
|
|
self.job = self.job | JOB_ACTIVE; //- OfN
|
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.job_finished = time + BERSERK_TIME * 2; // GR was * 3
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
stuffcmd(self, "v_idlescale 30\n");
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Judoka Profession -
|
|
|
|
** Disarms opponents so they cannot attack
|
|
|
|
*/
|
|
|
|
//This is guaranteed to be removed if either target or owner dies or disconnects
|
|
|
|
//So we don't have to do error checking on those situations
|
|
|
|
//Four special cases, Rifle, Medikit, AC and Grapple, have side effects
|
|
|
|
// when you remove them. Need special cases to handle their theft
|
|
|
|
void() JudokaRearm =
|
|
|
|
{
|
|
|
|
//Self.owner is the guy who had his weapon taken away
|
|
|
|
//Self.enemy is the guy who took it away
|
|
|
|
local entity oself,te;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.enemy.job = self.enemy.job - (self.enemy.job & JOB_ACTIVE);
|
2001-07-17 05:58:10 +00:00
|
|
|
if (self.heat == 1) { //We have their weapon
|
|
|
|
////Fix feign while stolen
|
|
|
|
self.enemy.weapon = 0;
|
|
|
|
////Fix reloading
|
2001-11-02 17:00:52 +00:00
|
|
|
te = find(NIL, netname, "reloadtimer");
|
|
|
|
while (te)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if (te.classname == "timer" && te.owner == self.enemy) {
|
|
|
|
oself = self;
|
|
|
|
self = te;
|
|
|
|
self.think();
|
|
|
|
self = oself;
|
|
|
|
te.think = SUB_Remove;
|
|
|
|
te.nextthink = time + 0.1;
|
|
|
|
}
|
|
|
|
te = find(te, netname, "reloadtimer");
|
|
|
|
}
|
|
|
|
////Fix double weapons
|
2003-12-02 03:20:33 +00:00
|
|
|
#ifndef NO_AUTORIFLE
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.current_weapon == WEAP_SNIPER_RIFLE) {
|
|
|
|
self.owner.weapons_carried = self.owner.weapons_carried | WEAP_AUTO_RIFLE;
|
|
|
|
self.enemy.weapons_carried = self.enemy.weapons_carried - (self.enemy.weapons_carried & WEAP_AUTO_RIFLE);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
2003-12-02 03:20:33 +00:00
|
|
|
#endif
|
2001-07-17 05:58:10 +00:00
|
|
|
////Fix weird weapons
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.current_weapon == WEAP_ASSAULT_CANNON && self.enemy.current_weapon == WEAP_ASSAULT_CANNON) {
|
2001-07-17 05:58:10 +00:00
|
|
|
oself = self;
|
|
|
|
self = self.enemy;
|
|
|
|
stuffcmd(self, "v_idlescale 0\n");
|
2002-09-08 01:44:11 +00:00
|
|
|
self.tfstate &= ~TFSTATE_ASSAULTCANNON;
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self);
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self.count = 1;
|
|
|
|
self.heat = 0;
|
|
|
|
self.button0 = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.fire_held_down = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
player_assaultcannondown1();
|
|
|
|
self = oself;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.current_weapon == WEAP_HOOK && self.enemy.hook_out) {
|
2001-07-17 05:58:10 +00:00
|
|
|
oself = self;
|
|
|
|
self = self.enemy;
|
|
|
|
Reset_Grapple (self.hook);
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self = oself;
|
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"You get your weapon back\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.owner.weapons_carried = self.owner.weapons_carried | self.current_weapon;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.enemy,PRINT_HIGH,"You lose your stolen weapon\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.enemy.weapons_carried = self.enemy.weapons_carried - (self.enemy.weapons_carried & self.current_weapon);
|
|
|
|
//Fix for a bug that would let someone keep their weapon if they switched to autorifle before
|
|
|
|
//the weapon returned.
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.enemy.current_weapon == self.current_weapon || self.current_weapon == WEAP_SNIPER_RIFLE || self.current_weapon == WEAP_MEDIKIT) {
|
2001-07-17 05:58:10 +00:00
|
|
|
oself = self;
|
|
|
|
self = self.enemy;
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self.current_weapon = W_BestWeapon ();
|
|
|
|
W_SetCurrentAmmo();
|
|
|
|
self = oself;
|
|
|
|
}
|
|
|
|
//TODO: Is this really a Fix for diving?
|
|
|
|
//Should we even do this? Might cause firing skip. Evaluate
|
|
|
|
self.enemy.weaponframe = 0;
|
|
|
|
}
|
|
|
|
|
2003-12-02 03:37:29 +00:00
|
|
|
self.owner.tfstate &= ~TFSTATE_DISARMED;
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
self.think = SUB_Remove;
|
|
|
|
self.nextthink = time + 0.1;
|
|
|
|
};
|
|
|
|
void() JobJudoka =
|
|
|
|
{
|
|
|
|
//Take the weapon of any person in front of you and force a reload
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job_finished = time + MISS_DELAY; //Delay if we don't hit
|
2001-07-17 05:58:10 +00:00
|
|
|
local vector source;
|
<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
|
|
|
local vector dir;
|
|
|
|
local float chance;
|
2001-07-17 05:58:10 +00:00
|
|
|
local entity tWeapon,oself;
|
|
|
|
local entity te;
|
|
|
|
|
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.attack_finished > time)
|
|
|
|
return;
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
makevectors(self.v_angle);
|
|
|
|
source = self.origin + '0 0 16';
|
|
|
|
|
<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
|
|
|
if (self.cutf_items & CUTF_CLOSECOMBAT)
|
|
|
|
traceline(source, source + v_forward*96, FALSE, self);
|
|
|
|
else
|
|
|
|
traceline(source, source + v_forward*64, FALSE, self);
|
|
|
|
|
|
|
|
if (trace_fraction != 1.0 && trace_ent.classname == "player" && !Teammate(trace_ent.team_no, self.team_no) && trace_ent.playerclass != PC_UNDEFINED)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if (self.is_undercover) //Taking someone's weapon should give you away
|
|
|
|
Spy_RemoveDisguise(self);
|
|
|
|
|
<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
|
|
|
// Let's not make it work all the time
|
|
|
|
dir = normalize (trace_ent.origin - self.origin);
|
|
|
|
makevectors(trace_ent.v_angle);
|
|
|
|
|
|
|
|
chance = dir * normalize(v_forward);
|
|
|
|
chance *= 0.35;
|
|
|
|
if (chance > 0.25)
|
|
|
|
chance = 0.25;
|
|
|
|
if (trace_ent.job & JOB_JUDOKA)
|
|
|
|
chance += 0.2;
|
|
|
|
if (trace_ent.cutf_items & CUTF_CLOSECOMBAT)
|
|
|
|
chance += 0.25;
|
|
|
|
if (trace_ent.current_weapon == WEAP_AXE && trace_ent.cutf_items & CUTF_KNIFE)
|
|
|
|
chance += 0.1;
|
|
|
|
if (self.cutf_items & CUTF_CLOSECOMBAT)
|
|
|
|
chance -= 0.25;
|
|
|
|
|
2003-11-26 08:56:01 +00:00
|
|
|
if (random() > chance || trace_ent.invincible_finished > time)
|
<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
|
|
|
{
|
|
|
|
sprint (self, PRINT_HIGH, "Your strike is parried!\n");
|
|
|
|
Attack_Finished(3);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (trace_ent, PRINT_HIGH, "You have been disarmed by ");
|
|
|
|
sprint (trace_ent, PRINT_HIGH, self.netname);
|
|
|
|
sprint (trace_ent, PRINT_HIGH, "\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job = self.job | JOB_ACTIVE;
|
2001-07-17 05:58:10 +00:00
|
|
|
//Simplify the dual-weapon problem
|
2003-12-02 03:20:33 +00:00
|
|
|
#ifndef NO_AUTORIFLE
|
2001-07-23 20:52:47 +00:00
|
|
|
if (trace_ent.current_weapon == WEAP_AUTO_RIFLE)
|
|
|
|
trace_ent.current_weapon = WEAP_SNIPER_RIFLE;
|
2003-12-02 03:20:33 +00:00
|
|
|
#endif
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2003-12-02 03:37:29 +00:00
|
|
|
trace_ent.tfstate &= ~(TFSTATE_AIMING | TFSTATE_RL_LASER);
|
|
|
|
|
|
|
|
trace_ent.tfstate |= TFSTATE_DISARMED;
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
//If already reloading, remove that timer
|
2001-11-02 17:00:52 +00:00
|
|
|
te = find(NIL, netname, "reloadtimer");
|
|
|
|
while (te)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if (te.classname == "timer" && te.owner == trace_ent) {
|
|
|
|
oself = self;
|
|
|
|
self = te;
|
|
|
|
self.think();
|
|
|
|
self = oself;
|
|
|
|
te.think = SUB_Remove;
|
|
|
|
te.nextthink = time + 0.1;
|
|
|
|
}
|
|
|
|
te = find(te, netname, "reloadtimer");
|
|
|
|
}
|
|
|
|
|
|
|
|
tWeapon = spawn();
|
|
|
|
tWeapon.owner = trace_ent;
|
|
|
|
tWeapon.enemy = self;
|
|
|
|
tWeapon.current_weapon = trace_ent.current_weapon;
|
|
|
|
tWeapon.classname = "timer";
|
|
|
|
tWeapon.netname = "judokatimer";
|
2001-07-23 20:52:47 +00:00
|
|
|
tWeapon.nextthink = time + DISARM_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
tWeapon.think = JudokaRearm;
|
|
|
|
|
|
|
|
//Remove the weapon
|
2001-07-23 20:52:47 +00:00
|
|
|
trace_ent.attack_finished = time + CANT_ATTACK_TIME;
|
2001-09-30 22:38:44 +00:00
|
|
|
trace_ent.weaponmodel = "";
|
2001-07-17 05:58:10 +00:00
|
|
|
trace_ent.weaponframe = 0;
|
|
|
|
trace_ent.currentammo = 0;
|
|
|
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if ((trace_ent.job & JOB_JUDOKA && trace_ent.job_finished > time) || trace_ent.current_weapon == 0) {
|
2001-07-17 05:58:10 +00:00
|
|
|
//Hit fellow judoka or chaplan
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You throw him with a mighty Seoi Otoshi\n");
|
|
|
|
deathmsg = DMSG_JUDOKA;
|
|
|
|
TF_T_Damage (trace_ent, self, self, 150, TF_TD_NOTTEAM, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else if (self.weapons_carried & trace_ent.current_weapon) {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You knock his weapon out of his hands\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
tWeapon.heat = 0; //I.e., we didn't take a weapon
|
2001-07-23 20:52:47 +00:00
|
|
|
trace_ent.attack_finished = time + DISARM_TIME;
|
|
|
|
deathmsg = DMSG_JUDOKA;
|
|
|
|
TF_T_Damage (trace_ent, self, self, 100, TF_TD_NOTTEAM, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (trace_ent.current_weapon != 0 && trace_ent.current_weapon != WEAP_AXE){
|
2001-07-17 05:58:10 +00:00
|
|
|
//Steal their weapon if they have one
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You rip his weapon from his hands!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
tWeapon.heat = 1;
|
|
|
|
|
|
|
|
//Fix double weapons
|
2003-12-02 03:20:33 +00:00
|
|
|
#ifndef NO_AUTORIFLE
|
2001-07-23 20:52:47 +00:00
|
|
|
if (trace_ent.current_weapon == WEAP_SNIPER_RIFLE) {
|
|
|
|
self.weapons_carried = self.weapons_carried | WEAP_AUTO_RIFLE;
|
|
|
|
trace_ent.weapons_carried = trace_ent.weapons_carried - (trace_ent.weapons_carried & WEAP_AUTO_RIFLE);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
2003-12-02 03:20:33 +00:00
|
|
|
#endif
|
2001-07-23 20:52:47 +00:00
|
|
|
if (trace_ent.current_weapon == WEAP_MEDIKIT) {
|
2001-07-17 05:58:10 +00:00
|
|
|
self.health = self.max_health; //You heal yourself. :)
|
|
|
|
}
|
|
|
|
////Fix weird weapons
|
2001-07-23 20:52:47 +00:00
|
|
|
if (trace_ent.current_weapon == WEAP_ASSAULT_CANNON) {
|
2001-07-17 05:58:10 +00:00
|
|
|
oself = self;
|
|
|
|
self = trace_ent;
|
|
|
|
stuffcmd(self, "-attack;v_idlescale 0\n");
|
2002-09-08 01:44:11 +00:00
|
|
|
self.tfstate &= ~TFSTATE_ASSAULTCANNON;
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(self);
|
|
|
|
self.weaponframe = 0;
|
|
|
|
self.count = 1;
|
|
|
|
self.heat = 0;
|
|
|
|
self.button0 = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.fire_held_down = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
player_assaultcannondown1();
|
|
|
|
self = oself;
|
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
if (trace_ent.current_weapon == WEAP_HOOK && trace_ent.hook_out) {
|
2001-07-17 05:58:10 +00:00
|
|
|
oself = self;
|
|
|
|
self = trace_ent;
|
|
|
|
Reset_Grapple (self.hook);
|
|
|
|
self = oself;
|
|
|
|
}
|
|
|
|
|
|
|
|
self.weapons_carried = self.weapons_carried | trace_ent.current_weapon;
|
|
|
|
self.current_weapon = trace_ent.current_weapon;
|
|
|
|
W_SetCurrentAmmo();
|
|
|
|
|
|
|
|
trace_ent.weapons_carried = trace_ent.weapons_carried - (trace_ent.weapons_carried & trace_ent.current_weapon);
|
|
|
|
trace_ent.current_weapon = 0;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
deathmsg = DMSG_JUDOKA;
|
|
|
|
TF_T_Damage (trace_ent, self, self, 65, TF_TD_NOTTEAM, TF_TD_OTHER);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job_finished = time + HIT_DELAY;
|
<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
|
|
|
Attack_Finished(0.5);
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
<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
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, "You miss.\n");
|
<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
|
|
|
Attack_Finished(1.5);
|
|
|
|
}
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Guerilla Profession -
|
|
|
|
** Can set self-detonating land mines
|
|
|
|
*/
|
|
|
|
#define ACTIVATE_TIME 8 //Time until it turns on //- it was 3? prolly 10
|
|
|
|
#define BEEP_RATE 4 //Delay between beeps //- it was 3
|
|
|
|
#define MINE_DURATION 360 //Time it lasts after being activated //- it was 60 ofn
|
|
|
|
#define JOB_DELAY 4 //Time between mine placements //- it was 10
|
|
|
|
#define GUERILLA_RADIUS 135 //-it was 150 without define
|
|
|
|
#define MINE_COST 4 // OfN number of rockets a mine needs
|
|
|
|
//#define MAX_MINES 4 // OfN Maximum number of mines for player NOW A LOCALINFO
|
|
|
|
//Blow up a mine
|
|
|
|
void() GuerillaExplode =
|
|
|
|
{
|
|
|
|
self.health = 0; //CH would cause tesla to act weird without
|
2001-07-23 20:52:47 +00:00
|
|
|
deathmsg = DMSG_LAND_MINE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (self.has_tesla == 2) // set by GuerillaSwep for trace weapons
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"your mine is destroyed\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (self.has_tesla == 0) // default
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"your mine explodes\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
// if has_tesla is 1 print nothing, as this is set by DetonateMines() and GuerillaThink
|
2004-01-21 16:05:58 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
if (time < self.heat + ACTIVATE_TIME) //If not charged, do less damage when blowing up
|
2004-01-21 16:05:58 +00:00
|
|
|
T_RadiusDamage (self, self.owner, MINE_DMG * 0.5, NIL); //- damage was 80
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2004-01-21 16:05:58 +00:00
|
|
|
T_RadiusDamage (self, self.owner, MINE_DMG, NIL); //- damage was 160
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
// num_mines is the number of mines the player has
|
|
|
|
self.owner.num_mines = self.owner.num_mines - 1;
|
|
|
|
if (self.owner.num_mines < 0)
|
|
|
|
self.owner.num_mines = 0;
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// Detonate all mines the mine_owner player entity has
|
|
|
|
void(entity mine_owner) DetonateMines =
|
|
|
|
{
|
|
|
|
local entity e;
|
|
|
|
|
|
|
|
// Find any mine
|
2001-11-02 17:00:52 +00:00
|
|
|
e = find(NIL, netname, "land_mine");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
while (e)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if(e.owner == mine_owner) {
|
|
|
|
e.heat = time;
|
|
|
|
e.has_tesla = 1; //- display no message on GuerillaExplode
|
|
|
|
e.think = GuerillaExplode;
|
|
|
|
e.nextthink = time;
|
|
|
|
}
|
|
|
|
e = find(e, netname, "land_mine");
|
|
|
|
}
|
|
|
|
mine_owner.num_mines = 0;
|
|
|
|
};
|
|
|
|
//====================================================
|
|
|
|
//Code to detonate the guerilla mines on traceattack weapons.
|
|
|
|
//Has small radius, just large enough to hit what was aimed at
|
|
|
|
void(vector startpos) GuerillaMineSweep =
|
|
|
|
{
|
|
|
|
local entity head;
|
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 entity inf = self;
|
|
|
|
local float loopc = 0;
|
2001-07-17 05:58:10 +00:00
|
|
|
head = findradius(startpos, 30);
|
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
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
while (head)
|
|
|
|
{
|
|
|
|
if (head.classname == "grenade" && head.netname == "land_mine") {
|
|
|
|
|
|
|
|
head.has_tesla = 2; // "mine is destroyed" message on guerillaexplode()
|
|
|
|
head.think = GuerillaExplode;
|
|
|
|
head.nextthink = time + 0.1;
|
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
|
|
|
head.martyr_enemy = inf;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
head = head.chain;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void() GuerillaThink = //Every second see if we have enemy nearby
|
|
|
|
{
|
|
|
|
local entity head;
|
|
|
|
local float finished; //Only blow up once
|
|
|
|
finished = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.nextthink = time + MINE_SCANRATE;
|
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.martyr_enemy = NIL;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (time < self.heat + ACTIVATE_TIME)
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
if (time > self.last_attacked_time) {
|
2001-07-23 20:52:47 +00:00
|
|
|
sound (self, CHAN_WEAPON, "weapons/guerilla_blip.wav", 1, ATTN_IDLE);
|
|
|
|
self.last_attacked_time = time + BEEP_RATE;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
self.health = self.health - 1;
|
|
|
|
|
|
|
|
if (self.health <= 0) { //Detonate mine cause we ran out of time
|
|
|
|
|
2004-01-21 16:05:58 +00:00
|
|
|
self.martyr_enemy = self.owner;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.heat = time; //Make it a smaller explosion
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"Mine runs out of energy, ");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
if (self.owner.num_mines > 1) {
|
|
|
|
local string st;
|
|
|
|
st = ftos (self.owner.num_mines - 1);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"you still have ");
|
|
|
|
sprint(self.owner,PRINT_HIGH,st);
|
|
|
|
sprint(self.owner,PRINT_HIGH,"/");
|
2001-07-17 05:58:10 +00:00
|
|
|
st = ftos (max_mines);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,st);
|
|
|
|
sprint(self.owner,PRINT_HIGH," mines up\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"you currently have no mines active\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.has_tesla = 1; //- display no message on GuerillaExplode
|
|
|
|
GuerillaExplode();
|
2001-10-15 05:43:35 +00:00
|
|
|
return;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
head = findradius(self.origin,GUERILLA_RADIUS);//OfN it was 150
|
2001-11-02 17:00:52 +00:00
|
|
|
while (head && !finished) {
|
2001-07-17 05:58:10 +00:00
|
|
|
if (head.classname == "player") {
|
|
|
|
//Mines detonate on either enemies or yourself
|
|
|
|
if (CanDamage(head,self)) {
|
|
|
|
if (!Teammate(head.team_no,self.owner.team_no) && head.undercover_team == 0)
|
|
|
|
{ //Uncouvered ENEMY
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self.owner,PRINT_HIGH,"your mine explodes on ");
|
|
|
|
sprint(self.owner,PRINT_HIGH,head.netname);
|
|
|
|
sprint(self.owner,PRINT_HIGH,"'s face!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.has_tesla = 1; //- display no message on GuerillaExplode
|
2004-01-21 16:05:58 +00:00
|
|
|
self.martyr_enemy = head;
|
2001-07-17 05:58:10 +00:00
|
|
|
GuerillaExplode();
|
2001-10-15 05:43:35 +00:00
|
|
|
return;
|
2001-07-17 05:58:10 +00:00
|
|
|
} else if (head == self.owner) { // ourselves
|
2004-01-21 16:05:58 +00:00
|
|
|
self.martyr_enemy = self.owner;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.has_tesla = 1; //- display no message on GuerillaExplode
|
|
|
|
GuerillaExplode();
|
2001-10-15 05:43:35 +00:00
|
|
|
return;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (IsMonster(head) && !Teammate(head.real_owner.team_no,self.owner.team_no)) { //- OfN - monsters and grunt are affected
|
2001-07-23 20:52:47 +00:00
|
|
|
T_Damage(head,self,self.owner,MINE_DMG); //Demons are vulnerable
|
2001-07-17 05:58:10 +00:00
|
|
|
self.has_tesla = 1; //- display no message on GuerillaExplode
|
|
|
|
GuerillaExplode();
|
2001-10-15 05:43:35 +00:00
|
|
|
return;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
head = head.chain;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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
|
|
|
void(entity inflictor, float amt) GuerillaPain = //What happens when someone hurts it
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (time < self.heat + ACTIVATE_TIME)
|
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
|
|
|
self.martyr_enemy = inflictor;
|
2001-07-17 05:58:10 +00:00
|
|
|
GuerillaExplode();
|
|
|
|
};
|
|
|
|
|
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
|
|
|
void() GuerillaTouch = // what happens when someone runs it over
|
|
|
|
{
|
|
|
|
GuerillaPain(other, 100);
|
|
|
|
};
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
void() GuerillaTossTouch =
|
|
|
|
{
|
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.solid = SOLID_BBOX;
|
|
|
|
setsize(self, self.mins, self.maxs);
|
|
|
|
|
|
|
|
if (other && other != self.owner) {
|
|
|
|
GuerillaPain(other, 100);
|
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
|
|
|
if (entpointcontents(self) == CONTENTS_SKY || entpointcontents(self) == CONTENTS_SOLID) {
|
2001-07-17 05:58:10 +00:00
|
|
|
self.health = 0; //CH needed for tesla
|
|
|
|
// OfN CAUSES ANY PROBLEM? Is this needed?
|
|
|
|
|
2002-09-08 01:44:11 +00:00
|
|
|
self.owner.num_mines = self.owner.num_mines - 1;
|
|
|
|
if (self.owner.num_mines < 0)
|
|
|
|
self.owner.num_mines = 0;
|
|
|
|
|
|
|
|
dremove(self);
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
self.angles = self.velocity = self.avelocity = '0 0 0';
|
2001-07-23 20:52:47 +00:00
|
|
|
self.movetype = MOVETYPE_NONE;
|
|
|
|
sound (self, CHAN_WEAPON, "weapons/guerilla_set.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
self.touch = GuerillaTouch;
|
|
|
|
self.think = GuerillaThink;
|
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.takedamage = DAMAGE_AIM;
|
|
|
|
self.th_pain = GuerillaPain;
|
2001-07-17 05:58:10 +00:00
|
|
|
self.nextthink = time + 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
void() JobGuerilla =
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.ammo_rockets < MINE_COST) {
|
2002-09-08 01:44:11 +00:00
|
|
|
sprint(self, PRINT_HIGH, "every mine needs 4 rockets to work!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (self.num_mines >= max_mines) {
|
|
|
|
local string st;
|
|
|
|
st = ftos(max_mines);
|
2002-09-08 01:44:11 +00:00
|
|
|
sprint(self, PRINT_HIGH, "you can set upto ");
|
|
|
|
sprint(self, PRINT_HIGH, st);
|
|
|
|
sprint(self, PRINT_HIGH, " mines!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-09-08 01:44:11 +00:00
|
|
|
self.ammo_rockets = self.ammo_rockets - MINE_COST;
|
2001-07-23 20:52:47 +00:00
|
|
|
self.job_finished = time + JOB_DELAY;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2002-09-08 01:44:11 +00:00
|
|
|
// OfN - I created the field num_mines to store the number of mines the player has
|
|
|
|
self.num_mines = self.num_mines + 1;
|
|
|
|
|
|
|
|
sprint(self,PRINT_HIGH,"you place a mine...\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2002-09-08 01:44:11 +00:00
|
|
|
teamprefixsprint(self.team_no,self);
|
|
|
|
teamsprint(self.team_no,self,self.netname);
|
|
|
|
teamsprint(self.team_no,self," places a mine\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2002-09-08 01:44:11 +00:00
|
|
|
//Set all the critical crap on the mine
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.movetype = MOVETYPE_BOUNCE;
|
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
|
|
|
newmis.solid = SOLID_TRIGGER;
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.takedamage = DAMAGE_AIM;
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.classname = "grenade";
|
|
|
|
newmis.netname = "land_mine";
|
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
|
|
|
setsize (newmis, '-0.5 -0.5 -0.5', '1 1 1');
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.owner = self;
|
|
|
|
makevectors (self.v_angle);
|
|
|
|
newmis.avelocity = '300 300 300';
|
|
|
|
newmis.velocity = v_forward*600 + v_up * 200 + v_right*10 + v_up*10;
|
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
|
|
|
setorigin (newmis, self.origin + (normalize(newmis.velocity) * 5));
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.angles = vectoangles(newmis.velocity);
|
2002-09-08 01:44:11 +00:00
|
|
|
// newmis.skin = self.team_no - 1;
|
|
|
|
newmis.skin = 1;
|
|
|
|
// setmodel (newmis, "progs/lndmine.mdl");
|
|
|
|
setmodel (newmis, "progs/biggren.mdl");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
newmis.heat = time; //Controls when mine can first go off
|
|
|
|
newmis.has_tesla = 0; // OfN flag to Control what to sprint to owner of the mine when it exlodes
|
2002-09-08 01:44:11 +00:00
|
|
|
newmis.last_attacked_time = time; //Time that you were last shot at
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.health = MINE_DURATION; //Max time for mine to live
|
2001-07-17 05:58:10 +00:00
|
|
|
newmis.touch = GuerillaTossTouch;
|
|
|
|
newmis.think = GuerillaThink;
|
2001-07-23 20:52:47 +00:00
|
|
|
newmis.nextthink = time + ACTIVATE_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void() JobCrusader;
|
|
|
|
|
|
|
|
void() UseJobSkill =
|
|
|
|
{
|
|
|
|
local float myjob;
|
|
|
|
|
|
|
|
//Make sure they can do it
|
2001-07-23 20:52:47 +00:00
|
|
|
if (self.done_custom & CUSTOM_BUILDING) return;
|
2001-07-17 05:58:10 +00:00
|
|
|
if (self.job_finished > time) return;
|
|
|
|
|
|
|
|
myjob = self.job;
|
2001-07-23 20:52:47 +00:00
|
|
|
if (myjob & JOB_THIEF)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobThief();
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (myjob & JOB_RUNNER)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobRunner();
|
2002-09-08 01:44:11 +00:00
|
|
|
else if (myjob & JOB_WARLOCK) {
|
|
|
|
if (HasFlag(self.team_no) == FALSE) {
|
2001-07-17 05:58:10 +00:00
|
|
|
CenterPrint(self, "No demons until your team has the flag!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
JobWarlock();
|
2002-09-08 01:44:11 +00:00
|
|
|
} else if (myjob & JOB_CHAPLAN)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobChaplan();
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (myjob & JOB_BERSERKER)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobBerserker();
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (myjob & JOB_GUERILLA)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobGuerilla();
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (myjob & JOB_JUDOKA)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobJudoka();
|
2001-07-23 20:52:47 +00:00
|
|
|
else if (myjob & JOB_HACKER)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobHacker();
|
2002-09-08 01:44:11 +00:00
|
|
|
else if (myjob & JOB_MARTYR)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobMartyr();
|
2002-09-08 01:44:11 +00:00
|
|
|
else if (myjob & JOB_ARMY)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobArmy();
|
2002-09-08 01:44:11 +00:00
|
|
|
else if (myjob & JOB_CRUSADER)
|
2001-07-17 05:58:10 +00:00
|
|
|
JobCrusader();
|
|
|
|
else {
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self,PRINT_HIGH,"You don't have a job. Go get employed.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
self.job_finished = time + 5; //Don't let them print this message that often
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NOHIDE_TIME 8
|
|
|
|
#define EXPOSURE_NOHIDE_TIME 20
|
|
|
|
#define EXPOSURE_NORELOAD_TIME 7
|
|
|
|
#define FULLH_NORELOAD_TIME 1.5
|
2002-09-08 01:44:11 +00:00
|
|
|
void (entity targ, float pain) RevealThief =
|
|
|
|
{
|
2001-08-10 06:50:39 +00:00
|
|
|
if (targ.classname != "player")
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!targ.invisible_time) {
|
|
|
|
targ.modelindex = modelindex_player;
|
2001-08-10 10:03:36 +00:00
|
|
|
targ.items = targ.items & ~IT_INVISIBILITY;
|
2001-08-10 06:50:39 +00:00
|
|
|
}
|
2001-07-17 05:58:10 +00:00
|
|
|
if (pain) {
|
2001-08-10 06:50:39 +00:00
|
|
|
if (targ.invisible_time)
|
|
|
|
sprint (targ, PRINT_HIGH, "You have been uncovered, or would have if you didn't have that ring.\n");
|
|
|
|
else
|
|
|
|
sprint(targ,PRINT_HIGH,"You have been uncovered!\n");
|
2001-07-23 20:52:47 +00:00
|
|
|
targ.attack_finished = time + EXPOSURE_NORELOAD_TIME;
|
|
|
|
targ.job_finished = time + EXPOSURE_NOHIDE_TIME;
|
2002-09-08 01:44:11 +00:00
|
|
|
} else {
|
2001-08-10 06:50:39 +00:00
|
|
|
if (targ.invisible_time)
|
|
|
|
sprint (targ, PRINT_HIGH, "Leaving shadows... just as soon as this ring wears off...\n");
|
|
|
|
else
|
|
|
|
sprint (targ, PRINT_HIGH, "Leaving shadows...\n");
|
2001-07-23 20:52:47 +00:00
|
|
|
targ.job_finished = time + NOHIDE_TIME;
|
|
|
|
if (targ.job & JOB_FULL_HIDE)
|
|
|
|
targ.attack_finished = time + FULLH_NORELOAD_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
2001-07-23 20:52:47 +00:00
|
|
|
targ.job = targ.job - (targ.job & JOB_FULL_HIDE);
|
|
|
|
targ.job = targ.job - (targ.job & JOB_ACTIVE);
|
2001-07-17 05:58:10 +00:00
|
|
|
TeamFortress_SetSpeed(targ);
|
|
|
|
};
|