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.
This commit is contained in:
Finny Merrill 2003-11-26 08:53:44 +00:00
parent a9251b65b3
commit 8c2d5fdd12
34 changed files with 895 additions and 690 deletions

8
ai.qc
View file

@ -95,7 +95,7 @@ void(entity test) AI_Check_Contents =
//CH demons (and other ai) can be hurt by liquids //- OfN completely changed!
if (pointcontents(test.origin) == CONTENTS_EMPTY && IsMonsterNonArmy(self) && self.health < self.max_health)
if (entpointcontents(test) == CONTENTS_EMPTY && IsMonsterNonArmy(self) && self.health < self.max_health)
{ // Heal it
if (self.dmgtime < time)
{
@ -133,7 +133,7 @@ void(entity test) AI_Check_Contents =
//TF_T_Damage (self, NIL, NIL, 5, 0, TF_TD_ELECTRICITY);
}
}
if (pointcontents(test.origin) == CONTENTS_LAVA)
if (entpointcontents(test) == CONTENTS_LAVA)
{ // do damage
if (self.dmgtime < time)
{
@ -177,7 +177,7 @@ void(entity test) AI_Check_Contents =
}
}
}
else if (pointcontents(test.origin) == CONTENTS_SLIME)
else if (entpointcontents(test) == CONTENTS_SLIME)
{ // do damage
if (self.dmgtime < time)
{
@ -212,7 +212,7 @@ void(entity test) AI_Check_Contents =
/* WK Removed because water is ok for monsters, sheesh
Whatever you think, ceaf it is. */
//- OfN - what the fuck means "ceaf"? heh
else if (pointcontents(test.origin) == CONTENTS_WATER && allow_watermonsters == FALSE)
else if (entpointcontents(test) == CONTENTS_WATER && allow_watermonsters == FALSE)
{
if (self.classname == "monster_demon1")
{ // do damage

View file

@ -29,6 +29,7 @@
// OfN - I fixed the "stuck in wall" stupid bug, and added more entities for airfist pushing
#define AIRG_STEPCONVERTEDTOFLY 2
#define AIRG_HIT 4
void(float nearAWall, float adjustForward, float adjustRight, float adjustUp, float positionRight, float spriteSpeed) hornBlastSprite;
float (entity e) hornInfront;
@ -103,7 +104,6 @@ void() launch_horn =
{
// Local variables used in the function
local entity e;
local entity oself;
local vector delta;
local vector dir;
local float eSpeed;
@ -118,12 +118,12 @@ void() launch_horn =
// Maximum strength of the AirFist. The strength of the affected entity's
// movement is based on the distance from the center of the shot.
local float strength;
strength = 1000; // full power of weapon
strength = AIRGUN_STRENGTH; // full power of weapon (now same as recoil - GR)
// Maximum damage that can be incurred by the AirFist. The actual entity's
// damage is based on the distance from the center of the shot.
local float inDamage;
inDamage = 20; // full damage of weapon
inDamage = 30; // full damage of weapon GR was 20
// Range of the AirFist blast.
local float inRange;
@ -131,7 +131,7 @@ void() launch_horn =
local float numBubbles = 3; // number of bubbles generated in the water
// Recoil strength of the AirFist on the player that shot the weapon.
local float recoil; // recoil strength of the gun
local float recoil = AIRGUN_STRENGTH; // recoil strength of the gun
// Reshot time for the airgun attack in seconds.
local float attackTime = 0.5;
@ -158,7 +158,6 @@ void() launch_horn =
//Set initial range
inRange = 400;
//Set intital recoil
recoil = 300;
// By default, assume not near a wall.
nearAWall = 0;
@ -235,6 +234,10 @@ void() launch_horn =
if (canairpush(e)) //Can only push things in canairpush
if(e != self) // but not myself!!
{
e.AIRG_Flags |= AIRG_HIT;
e.AIRG_FlyTracker = self; // for stuff we airfist that hurts, don't want the orig firer to get tk strikes.
// if flying creature and movetype is step then change to fly
// NOTE: For some reason the normal quakeC, flying monsters has set a
// movetype of MOVETYPE_STEP which means that changing the velocity
@ -279,36 +282,21 @@ void() launch_horn =
if (e.flags & FL_ONGROUND && !(e.classname == "player" && e.cutf_items & CUTF_HWGUY))
{
// If there on the ground, raise them up so that the velocity will
// take affect.
// raise the bugger a bit
setorigin(e, e.origin + '0 0 1'); // - OfN - And make them stuck in wall? :) nope..
oself = self;
self = e;
if (pointcontents(e.origin) == CONTENTS_SOLID)
setorigin(e, e.origin - '0 0 1');
self = oself;
// We biased the up direction when entity is on the ground.
// Looks cooler and small entitys (heath, etc) go somewhere instead
// of along the ground (cas there below the line of sight).
// If on the ground, makem go up, up, and away
e.flags = e.flags - FL_ONGROUND;
// But this makes no sense..
if (delta_z < 0)
delta_z = delta_z / -2;
delta_z = delta_z / -5;
delta = delta * 0.7;
if (delta_z < 100)
delta_z = 100;
}
if (e.classname == "player" && e.cutf_items & CUTF_HWGUY)
delta = '0 0 0';
delta *= 0.3;
if (e.classname == "player" && e.cutf_items & CUTF_GYMNAST)
delta *= 2;
@ -353,16 +341,30 @@ void() launch_horn =
// Apply the velocity adjustment
e.velocity = e.velocity + delta;
//move them 1 unit so there's no friction
if (e.flags & FL_ONGROUND)
if (e.classname != "player" || !(e.cutf_items & CUTF_HWGUY))
{
checkmove(e.origin, e.mins, e.maxs, e.origin + normalize(e.velocity), MOVE_NORMAL, e);
setorigin(e, e.origin + normalize(e.velocity)*trace_fraction); // - OfN - And make them stuck in wall? :) nope..
e.flags &= ~FL_ONGROUND;
}
// calculate the damage amount
ldmg = percent * inDamage;
if (e.classname == "player") {
if (e.cutf_items & CUTF_HWGUY) // hwguy can't get knocked, but it hurts more
ldmg *= 1.5;
ldmg *= 2;
if (e.cutf_items & CUTF_GYMNAST) // gymnast goes with the flow, less damage
ldmg *= 0.3;
}
checkmove(e.origin, e.mins, e.maxs, e.origin + e.velocity *0.2, MOVE_NORMAL, e);
ldmg *= 1.3 - trace_fraction; // extra hurt for airfist into wall!
// and less for not
// This section of code is to even of the "figure momentum add" in the
// T_Damage function that recoils damaged entity's away from the attacker.
// NOTE: If that section of code in T_Damage changesm then this will have to
@ -417,27 +419,32 @@ void() launch_horn =
hornBlastSprite(nearAWall, 50, 50, 300, 20, 1.0);
}
// recoil code
if (self.flags & FL_ONGROUND)
{
// If self on the ground, raise me up so that the velocity will
// take affect.
// raise the bugger a bit
setorigin(self, self.origin + '0 0 1'); // - OfN - And make them stuck in wall? - GR No, but that screws it up
self.flags = self.flags - FL_ONGROUND;
if (pointcontents(self.origin) == CONTENTS_SOLID)
setorigin(self, self.origin + '0 0 -1');
}
if(nearAWall)
{ // hit wall, Bounce based on the distance from the wall
recoil = recoil + (recoil * (1.0 - trace_fraction) * 3);
recoil = recoil + (recoil * (1.0 - trace_fraction)); //now recoil is in range strength - strengh*2
}
if (self.cutf_items & CUTF_HWGUY)
recoil *= 0.3;
else if (self.cutf_items & CUTF_GYMNAST)
recoil *= 2;
// recoil self
self.velocity = self.velocity + v_forward * recoil * -1;
if (self.flags & FL_ONGROUND)
{
// If self on the ground, raise me up so that the velocity will
// take affect.
// raise the bugger a bit
checkmove(self.origin, self.mins, self.maxs, self.origin + normalize(self.velocity), MOVE_NORMAL, self);
setorigin(self, self.origin + normalize(self.velocity) * trace_fraction); // - OfN - And make them stuck in wall?
self.flags = self.flags - FL_ONGROUND;
}
if(self.waterlevel > 2)
{ // below the water, play under water sound
sound (self, CHAN_AUTO, "weapons/agwater.wav", 1, ATTN_NORM);

122
client.qc
View file

@ -678,6 +678,9 @@ void() DecodeLevelParms =
else if (st == "off")
invis_only = FALSE;
if (!teamplay)
invis_only = TRUE;
// RespawnDelay
st = infokey(NIL, "rd");
if (!st)
@ -1843,7 +1846,8 @@ void() PutClientInServer =
self.reload_rocket_launcher = 0;
self.reload_light_assault = 0;
self.reload_laser_cannon = 0;
self.hover_time = MAX_HOVER_FUEL;
//self.is_undercover = 0;
//self.undercover_team = 0;
self.last_attacked_time = 0; //WK For chaplan healing purposes
@ -1865,7 +1869,15 @@ void() PutClientInServer =
TeamFortress_TeamSet(1);
}
#endif
#if 0
if (!teamplay && !self.team_no)
{
self.team_no = last_team_no;
last_team_no++;
if (last_team_no >= 1000) //hopefully this will never ever happen
last_team_no = 5;
}
#endif
// Set the Civilian Class of anyone in a Civilian Team
if (self.playerclass == PC_UNDEFINED)
{
@ -2730,10 +2742,18 @@ void() PlayerPreThink =
if (self.button2 && self.velocity_z < 0 && self.hover_time > 0 && self.waterlevel == 0)
{ //Try to hover
self.velocity_z = 100; //+10 == hover
self.hover_time = self.hover_time - 0.25; //0.1 == tick time
self.hover_time = self.hover_time - 0.5; //0.1 == tick time
if (self.hover_time <= 0) {
self.hover_time = -5; //3 second penalty for draining it
sprint(self,PRINT_HIGH,"Your boots are out of fuel, let them recharge\n");
if ((self.tf_items & NIT_HOVER_BOOTS_UPGRADE) &&
(self.ammo_cells > (0 - floor(self.hover_time * 2)))) {
self.ammo_cells += floor(self.hover_time * 2);
self.ammo_cells--;
self.hover_time = 0.5;
self.velocity_z = 60; //power running out
} else {
self.hover_time = -10; //3 second penalty for draining it GR was a lot more than 3!
sprint(self,PRINT_HIGH,"Your boots are out of fuel, let them recharge\n");
}
}
//Spit out fire from them!
if (self.search_time < time) {
@ -2743,7 +2763,7 @@ void() PlayerPreThink =
flame.owner = self;flame.movetype = MOVETYPE_FLYMISSILE;
flame.solid = SOLID_BBOX;flame.classname = "flamerflame";
makevectors (self.v_angle);
flame.velocity = -1 * v_up; flame.velocity = flame.velocity * 600;
flame.velocity = '0 0 -600';
flame.touch = Boot_Flamer_stream_touch;flame.think = s_explode1;
flame.nextthink = time + 0.1;setmodel (flame, "progs/s_explod.spr");
setsize (flame, '0 0 0', '0 0 0');
@ -2752,17 +2772,52 @@ void() PlayerPreThink =
}
}
else { //Recharger <- That's French for "recharge"
self.hover_time = self.hover_time + 0.01; //0.05 is a half-tick
self.hover_time = self.hover_time + 0.03; //0.05 is a half-tick
if (self.hover_time > MAX_HOVER_FUEL && (!(self.tf_items & NIT_HOVER_BOOTS_UPGRADE)))
self.hover_time = MAX_HOVER_FUEL;
if (self.hover_time > (MAX_HOVER_FUEL * 2) && self.tf_items & NIT_HOVER_BOOTS_UPGRADE)
self.hover_time = (MAX_HOVER_FUEL * 2);
if (self.tf_items & NIT_HOVER_BOOTS_UPGRADE) {
if (self.hover_time > (MAX_HOVER_FUEL * 2))
self.hover_time = (MAX_HOVER_FUEL * 2);
if (self.hover_time < (MAX_HOVER_FUEL / 2) && self.ammo_cells > (self.maxammo_cells * 0.8)) {
self.hover_time++;
self.ammo_cells--;
}
}
}
}
if (self.health > 0 && pointcontents (self.origin) == CONTENTS_SOLID)
TF_T_Damage (self, NIL, NIL, self.health + 100,
TF_TD_IGNOREARMOUR, TF_TD_OTHER);
if (self.health > 0)
{
// do a quick checkmove
checkmove (self.origin, self.mins, self.maxs, self.origin - '0 0 8192', MOVE_NORMAL, self);
if (trace_startsolid)
{
if (trace_ent.classname != "force_field") // hack, stuck in forcefield is okay here
self.stucktime++;
deathmsg = DMSG_PHYSICS;
if (self.stucktime >= 10) // one second until you die
{
TF_T_Damage (self, NIL, NIL, self.health + 100,
TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
else if (trace_ent.takedamage) // see if we can't get the other guy out of the way
{
TF_T_Damage (trace_ent, NIL, NIL, self.health + 100,
TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
}
else if (trace_fraction >= 1 || vlen(self.origin) > 16384) // outside the map (doesn't always catch it)
{
deathmsg = DMSG_OUTOFBOUNDS;
TF_T_Damage (self, NIL, NIL, self.health + 100,
TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
else
self.stucktime = 0;
}
};
/*
@ -3028,27 +3083,42 @@ void() PlayerPostThink =
}
// check to see if player landed and play landing sound
if (self.takedamage && (self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0))
if (self.takedamage && self.health > 0)
{
if (self.watertype == CONTENTS_WATER)
if (self.flags & FL_ONGROUND)
{
if (!(self.cutf_items & CUTF_STEALTH))
sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
}
else if (self.jump_flag < -650)
{
if (!(self.cutf_items & CUTF_STEALTH)) { //WK Judo teaches falling... SB ceaf judo
self.deathtype = "falling";
T_Damage (self, NIL, NIL, 5);
sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
if (self.watertype == CONTENTS_WATER)
{
if (!(self.cutf_items & CUTF_STEALTH))
sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
}
else if (self.movedir_z < -650)
{
if (!(self.cutf_items & CUTF_STEALTH)) { //WK Judo teaches falling... SB ceaf judo
self.deathtype = "falling";
T_Damage (self, NIL, NIL, 10);
self.leg_damage++;
if (self.leg_damage > 5)
self.leg_damage = 5;
sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
}
}
else if (self.movedir_z < -300)
if (!(self.cutf_items & CUTF_STEALTH)) //WK Judo teaches falling... SB ceaf judo
sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
}
else if (vlen(self.movedir) - vlen(self.velocity) > 550)
{
#ifdef WALL_HURT
self.deathtype = "wall";
T_Damage (self, NIL, NIL, ((vlen(self.movedir) - vlen(self.velocity)) - 550) / 10);
#endif
}
else
if (!(self.cutf_items & CUTF_STEALTH)) //WK Judo teaches falling... SB ceaf judo
sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
}
self.jump_flag = self.velocity_z;
self.movedir = self.velocity;
CheckPowerups ();

View file

@ -309,13 +309,32 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
if (!targ.takedamage)
return;
//WK Set off land mines
//WK Set off land mines GR Done with .th_pain now
#if 0
if (targ.classname == "grenade" && targ.netname == "land_mine")
{
targ.martyr_enemy = inflictor;
targ.think = GuerillaExplode;
targ.nextthink = time + 0.1;
return;
}
#endif
//Don't blame people for their airfisted rockets/grenades/detpacks if they hit a teammate
if ((inflictor.AIRG_Flags & 4) && inflictor != attacker && inflictor.AIRG_FlyTracker.classname == "player")
{
local entity targplayer = targ;
local float loopc = 0;
while (loopc < 5 && targplayer.classname != "player")
{
targplayer = targplayer.real_owner;
loopc++;
}
if (loopc < 5 && !Teammate(inflictor.AIRG_FlyTracker.team_no, targplayer.team_no) &&
Teammate(attacker.team_no, targplayer.team_no))
attacker = inflictor.AIRG_FlyTracker;
}
//BOOKKEEPING
//WK Store last person who shot martyr into .enemy
@ -325,7 +344,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
{
//if (targ.classname == "player" && attacker.classname == "player" && !Teammate(targ.team_no, attacker.team_no))
targ.martyr_enemy = attacker;
targ.stored_deathmsg = deathmsg; //- OfN - UNUSED?
targ.stored_deathmsg = deathmsg; //- OfN - UNUSED? GR yep, so is is_abouttodie pretty much
}
if (targ.classname == "player") //WK Time holding the last time we've been shot
targ.last_attacked_time = time; //WK For chaplan healing purposes
@ -489,13 +508,10 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
if (Teammate(targ.real_owner.team_no,attacker.team_no) && (targ.real_owner != attacker) && attacker.classname == "player")
TF_T_Damage (attacker, attacker, attacker, mirror, 0, TF_TD_OTHER);
}
//WK Friendly Sentrygun protection - you can't hurt friendly sentries
if (IsBuilding(targ)) {
if (Teammate(targ.team_no, attacker.team_no) && (targ != attacker) && (!(targ.tf_items & NIT_SECURITY_CAMERA))) {
return;
}
//WK Friendly Sentrygun protection - you can't hurt friendly sentries GR Why not?
if (IsBuilding(targ))
targ.armorvalue = 1; //CH so that the armors are counted
}
// SPECIAL ARMOR CALCULATIONS
if ((targ.armorclass != 0) && (T_AttackType != 0))
@ -674,6 +690,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
deathmsg = DMSG_DETPACK_DIS;
//WK Autotrigger martyr - OfN - Now exp.body
//BUG, berserk made exp body not work, fixed?
if ((targ.cutf_items & CUTF_EXPBODY) && attacker && targ.is_abouttodie == FALSE)
{
//oldself = self;

View file

@ -89,6 +89,14 @@ float(float targteam, float attackteam) Teammate =
return FALSE;
};
float(entity targ, entity attack) AreTeammates =
{
if (targ == attack)
return TRUE;
else
return Teammate(targ.team_no, attack.team_no);
};
void (string temp) DebugSprint =
{
sprint(self,PRINT_HIGH,temp);

View file

@ -422,6 +422,9 @@ float deathmatch;
.float distance;
.float volume;
// stuck time
.float stucktime;
//===========================================================================
@ -1130,3 +1133,5 @@ float deathmsg; // Global, which is set before every T_Damage, to indicate
// the death message that should be used.
float no_pogo_stick;
float last_team_no;

18
defs.qh
View file

@ -1,3 +1,4 @@
#include "extern.qh"
#include "options.qh"
// because I want a boolean type :)
@ -210,7 +211,7 @@
#define AS_FIREBALL 5
#define MAX_HOVER_FUEL 5 //Boots will recharge up to this maximum
#define MAX_HOVER_FUEL 10 //Boots will recharge up to this maximum
#define CUSTOM_ON_SPAWN 1 //When dead, rebuild
#define CUSTOM_FINISHED 2 //Normal gameplay
@ -934,7 +935,7 @@
#define PC_DEMOMAN_MAXAMMO_NAIL 50
#define PC_DEMOMAN_MAXAMMO_CELL 50
#define PC_DEMOMAN_MAXAMMO_ROCKET 50
#define PC_DEMOMAN_MAXAMMO_DETPACK 1
#define PC_DEMOMAN_MAXAMMO_DETPACK 2
#define PC_DEMOMAN_INITAMMO_SHOT 30
#define PC_DEMOMAN_INITAMMO_NAIL 0
#define PC_DEMOMAN_INITAMMO_CELL 0
@ -942,9 +943,9 @@
#define PC_DEMOMAN_INITAMMO_DETPACK 1
#define PC_DEMOMAN_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_DEMOMAN_GRENADE_TYPE_2 GR_TYPE_MIRV
#define PC_DEMOMAN_GRENADE_INIT_1 4
#define PC_DEMOMAN_GRENADE_INIT_2 3
#define PC_DEMOMAN_TF_ITEMS 0
#define PC_DEMOMAN_GRENADE_INIT_1 5
#define PC_DEMOMAN_GRENADE_INIT_2 2
#define PC_DEMOMAN_TF_ITEMS NIT_AMMO_BANDOLIER
#define PC_DEMOMAN_JOB JOB_GUERILLA
#define PC_DEMOMAN_CUTFITEMS CUTF_DETPACK | CUTF_TOSSABLEDET
@ -1001,9 +1002,9 @@
#define PC_HVYWEAP_INITAMMO_ROCKET 0
#define PC_HVYWEAP_GRENADE_TYPE_1 GR_TYPE_NORMAL
#define PC_HVYWEAP_GRENADE_TYPE_2 GR_TYPE_MIRV
#define PC_HVYWEAP_GRENADE_INIT_1 4
#define PC_HVYWEAP_GRENADE_INIT_1 5
#define PC_HVYWEAP_GRENADE_INIT_2 2
#define PC_HVYWEAP_TF_ITEMS 0
#define PC_HVYWEAP_TF_ITEMS NIT_AMMO_BANDOLIER
#define PC_HVYWEAP_JOB JOB_RUNNER
@ -1292,6 +1293,9 @@
#define DMSG_FGTRAP 67
#define DMSG_FF_HACKED 68
#define DMSG_FF_STUCK_HACKED 69
#define DMSG_PHYSICS 70
#define DMSG_OUTOFBOUNDS 71
#define DMSG_GREN_EMP_RADIUS 72
//Defs for objects a spikeshooter can spawn Misc.qc
#define SPAWNFLAG_SUPERSPIKE 1

View file

@ -133,6 +133,8 @@ void (vector org, entity shooter) MirvGrenadeLaunch =
newmis.velocity_z = zdir * 5;
newmis.avelocity='100 100 500';
newmis.AIRG_Flags = self.AIRG_Flags; //for tk stuff
newmis.AIRG_FlyTracker = self.AIRG_FlyTracker;
setmodel (newmis, "progs/grenade2.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
@ -338,12 +340,12 @@ float (vector targ, vector check) vis2orig;
// The detpack goes BOOM!
void() TeamFortress_DetpackExplode =
{
local float pos;
local integer pos;
bprint(PRINT_MEDIUM, "FIRE IN THE HOLE!\n");
// Check the pointcontents to prevent detpack outside the world
pos = pointcontents(self.origin);
pos = entpointcontents(self);
if (pos != CONTENTS_SOLID && pos != CONTENTS_SKY)
{
deathmsg = DMSG_DETPACK;

View file

@ -560,7 +560,7 @@ void() demon_fire_touch =
{
local float fire_dmg;
fire_dmg = 60 + random()*40;
if (pointcontents(self.origin) == CONTENTS_SKY)
if (entpointcontents(self) == CONTENTS_SKY)
{
dremove(self);
return;

View file

@ -27,6 +27,7 @@ void() TeamFortress_EngineerBuild;
void(float objtobuild) TeamFortress_Build;
void() TeamFortress_FinishedBuilding;
void() T_Dispenser;
void(entity atk, float dmg) Dispenser_Pain;
void() Dispenser_Die;
void(entity disp) Engineer_UseDispenser;
void(entity gun) Engineer_UseSentryGun;
@ -44,17 +45,37 @@ void(entity field) Field_Built;
void() LaserBolt_Think =
{
if (time > self.heat) {
if (self.demon_one)
dremove(self.demon_one);
dremove(self);
return;
}
self.solid = SOLID_TRIGGER;
self.movetype = MOVETYPE_FLYMISSILE;
self.velocity = self.oldorigin;
self.touch = LaserBolt_Touch;
setmodel(self, "progs/e_spike2.mdl");
self.nextthink = time + 1.0;
self.think = SUB_Remove;
self.velocity = self.oldorigin;
if (!self.demon_one) {
newmis = spawn();
setorigin(newmis, self.origin);
setsize(newmis, '0 0 0', '0 0 0');
setmodel(newmis, "");
newmis.solid = SOLID_TRIGGER;
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.touch = LaserBolt_Touch;
newmis.real_owner = self.owner;
newmis.owner = self;
newmis.heat = self.heat;
self.demon_one = newmis;
}
setorigin(self.demon_one, self.origin);
self.demon_one.velocity = self.velocity;
self.movetype = MOVETYPE_NOCLIP;
self.nextthink = time + 0.1;
self.think = LaserBolt_Think;
};
//=========================================================================
@ -65,64 +86,52 @@ void() LaserBolt_Touch =
local vector org;
if (time > self.heat) {
dremove(self.owner);
dremove(self);
return;
}
if (other == self.owner)
return;
if (other == self.enemy && self.enemy)
return; // don't explode on same person twice
if (pointcontents(self.origin) == CONTENTS_SKY)
{
if (pointcontents(self.origin)==CONTENTS_SKY) {
dremove(self.owner);
dremove(self);
return;
}
if (other.classname == "force_field") { // ff can block rails, but not easily, loses cells
other.demon_one.ammo_cells -= 15;
other.demon_two.ammo_cells -= 15;
if (other.demon_one.ammo_cells < 0)
other.demon_one.ammo_cells = 0;
if (other.demon_two.ammo_cells < 0)
other.demon_two.ammo_cells = 0;
FieldExplosion(other, self.origin, self);
PutFieldWork(other);
dremove(self.owner);
dremove(self);
return;
}
if (other == self.real_owner || other == self.enemy)
return; // don't explode on same person twice
self.enemy = other;
//WK Sweep mines at point of impact
GuerillaMineSweep(self.origin);
org = self.origin - 8*normalize(self.velocity);
if (other.health)
if (other && other.takedamage)
{
SpawnBlood (org, 15);
deathmsg = DMSG_LASERBOLT;
TF_T_Damage (other, self, self.enemy, 25, 0, TF_TD_ELECTRICITY);
self.velocity = self.oldorigin;
self.owner = other;
setmodel (self, "");
self.touch = NIL;
// self.solid = SOLID_NOT;
// self.movetype = MOVETYPE_NOCLIP;
self.nextthink = time + 0.1;
self.think = LaserBolt_Think;
return;
TF_T_Damage (other, self, self.real_owner, 25, 0, TF_TD_NAIL); // was electricity... WTF?
setmodel(self.owner, "progs/e_spike2.mdl");
}
else
{
//WK Fly through walls!
setmodel (self, "");
self.touch = NIL;
self.solid = SOLID_NOT;
self.movetype = MOVETYPE_NOCLIP;
self.nextthink = time + 0.1;
self.think = LaserBolt_Think;
return;
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_SPIKE);
WriteCoord (MSG_MULTICAST, self.origin_x);
WriteCoord (MSG_MULTICAST, self.origin_y);
WriteCoord (MSG_MULTICAST, self.origin_z);
multicast (self.origin, MULTICAST_PHS);
}
dremove(self);
};
//=========================================================================
@ -140,8 +149,8 @@ void() W_FireLaser =
newmis = spawn();
newmis.owner = self;
newmis.enemy = self; // The real owner
newmis.movetype = MOVETYPE_FLYMISSILE;
newmis.enemy = NIL; // The real owner GR uh no
newmis.movetype = MOVETYPE_NOCLIP; //was noclip. Oh well.
newmis.solid = SOLID_TRIGGER;
setmodel (newmis, "progs/e_spike1.mdl");
@ -149,15 +158,13 @@ void() W_FireLaser =
setorigin (newmis, org + '0 0 16');
newmis.velocity = vec * 1500;
newmis.angles = vectoangles(newmis.velocity);
newmis.oldorigin = newmis.velocity;
newmis.velocity = '0 0 0';
newmis.oldorigin = vec*800;
newmis.angles = vectoangles(newmis.oldorigin);
newmis.nextthink = time + 1.5;
newmis.heat = time + 1.5;
newmis.think = SUB_Remove;
newmis.touch = LaserBolt_Touch;
newmis.heat = time + 5;
newmis.nextthink = time + 0.1;
newmis.think = LaserBolt_Think;
};
//=========================================================================
@ -212,6 +219,24 @@ void() EMPGrenadeTouch =
self.avelocity = '0 0 0';
};
//=========================================================================
// EMP Scrambling effect (on players and buildings
void() EMPScramble =
{
#if 0
te = findradius(self.origin, 500);
while (te)
{
local float dist = vlen(te.origin - self.origin);
local float mult = 0.25 + (0.65 * dist / 500) + 0.15 * random();
te = te.chain;
}
#endif
dremove(self);
};
//=========================================================================
// EMP Grenade explode function, for when the PRIMETIME runs out
void() EMPGrenadeExplode =
@ -219,6 +244,7 @@ void() EMPGrenadeExplode =
local float expsize;
local entity te, oldself;
local float total_exp;
local float dist, mult;
//CH Slice gave idea of an emp gren getting rated based on blast so i added..
total_exp = 0;
@ -230,12 +256,13 @@ void() EMPGrenadeExplode =
multicast (self.origin, MULTICAST_PHS);
// Find all ammo in the area
te = findradius(self.origin, 240);
te = findradius(self.origin, 300); // was 240
while (te)
{
if (!CanDamage(te,self)) // OfN
;
else if (te.touch == ammo_touch || te.touch == weapon_touch) // Ammo/Weapon?
dist = vlen(self.origin - te.origin);
mult = 0.85 - (0.65 * dist / 300) + (0.15 * random());
if (te.touch == ammo_touch || te.touch == weapon_touch) // Ammo/Weapon?
{
// Make sure it isn't picked up in the next second
te.solid = SOLID_NOT;
@ -247,7 +274,9 @@ void() EMPGrenadeExplode =
else if (te.think == TeamFortress_DetpackExplode)
{
//te.solid = SOLID_NOT;
te.nextthink = time + 225 * random() + 30; //WK Scramble the detpack's timer. :)
local float rnd = (dist * (0.6 + random() * 0.4)) / 240;
te.nextthink = time + 1 + 120 * rnd*rnd; //chance of either exploding or lengthening timer
dremove(te.oldenemy); // Countdown ent
}
// Pipebomb?
@ -255,24 +284,25 @@ void() EMPGrenadeExplode =
{
te.nextthink = time + 0.1 + random();
}
// Mine?
else if (te.classname == "grenade" && te.netname == "land_mine")
// Mine/grenade?
else if (te.classname == "grenade")
{
te.think = GuerillaExplode;
te.nextthink = time + 0.1;
if (te.netname == "land_mine")
te.think = GuerillaExplode;
te.nextthink = time + 0.1 + random();
}
// Building?
else if (IsBuilding(te)) {
total_exp = total_exp + 120;
TF_T_Damage(te,self,self.owner, 120, 0, TF_TD_OTHER);
// just hurt dispensers now
else if (te.classname == "building_dispenser") {
TF_T_Damage(te, self, self.owner, 300 - dist, 0, TF_TD_OTHER);
}
// Ammobox?
else if (te.classname == "ammobox")
{
expsize = 0;
expsize = expsize + (te.ammo_shells * 0.75);
expsize = expsize + ((te.ammo_rockets * 0.75) * 2);
expsize = expsize + ((te.ammo_cells * 0.75) * 2);
expsize = expsize + (te.ammo_rockets * 3);
expsize = expsize + (te.ammo_cells * 0.75);
expsize *= mult;
if (expsize > 0)
{
@ -301,49 +331,80 @@ void() EMPGrenadeExplode =
{
expsize = 0;
// calculate explosion size
expsize = expsize + (te.ammo_shells * 0.75);
expsize = expsize + ((te.ammo_rockets * 0.75) * 2);
if (!(te.weapons_carried & WEAP_SPANNER || te.touch == BackpackTouch))
expsize = expsize + (te.ammo_cells * 0.75);
expsize = expsize + te.ammo_rockets * 3; // ouch, this hurts
// < 200 cells for eng = metal, so don't explode
if (!(te.weapons_carried & WEAP_SPANNER) || te.touch == BackpackTouch)
expsize += te.ammo_cells;
else
expsize += ceil(te.ammo_cells * (1 - 200 / te.maxammo_cells));
if (te.classname == "player")
{
if (te.tp_grenades_1 == GR_TYPE_MIRV)
expsize += te.no_grenades_1 * 100; // arggh, lots of damage
if (te.tp_grenades_2 == GR_TYPE_MIRV)
expsize += te.no_grenades_2 * 100; // gotta get hwguys somehow
}
expsize *= mult;
if (te.is_detpacking || te.is_toffingadet) // detpack go off in yo face
expsize += 300;
if (expsize > 0)
{
// Damage player and explode
deathmsg = DMSG_GREN_EMP;
deathmsg = DMSG_GREN_EMP_RADIUS;
total_exp = total_exp + expsize;
//WK Make players not explode radially!
if (te.touch == BackpackTouch)
T_RadiusDamage (te, self.owner, expsize / 2, te); //WK Dampen backpack damage
//WK Make players not explode radially! GR why not?
if (te.touch != BackpackTouch)
{
TF_T_Damage (te, self, self.owner, expsize, 0, TF_TD_EXPLOSION);
T_RadiusDamage (te, self.owner, expsize * 0.5, te);
deathmsg = DMSG_GREN_EMP;
TF_T_Damage (te, te, self.owner, expsize, 0, TF_TD_EXPLOSION);
// Remove ammo
te.ammo_shells = ceil(te.ammo_shells * 0.25);
te.ammo_rockets = ceil(te.ammo_rockets * 0.25);
if (!(te.cutf_items & CUTF_SENTRYGUN || te.tf_items & NIT_TESLA))
te.ammo_cells = ceil(te.ammo_cells * 0.25);
te.ammo_rockets = ceil(te.ammo_rockets * (1 - mult));
if (!(te.weapons_carried & WEAP_SPANNER))
te.ammo_cells = ceil(te.ammo_cells * (1 - mult));
else // cells under 200 max don't count for eng
{
te.ammo_cells *= 1 - 200 / te.maxammo_cells;
te.ammo_cells *= 1 - mult;
te.ammo_cells = ceil(te.ammo_cells * te.maxammo_cells / 200);
}
if (te.tp_grenades_1 == GR_TYPE_MIRV)
te.no_grenades_1 = ceil(te.no_grenades_1 *(1 - mult));
if (te.tp_grenades_2 == GR_TYPE_MIRV)
te.no_grenades_2 = ceil(te.no_grenades_2 * (1 - mult));
if (te.classname=="player")
{
// Update console
{
// Update console
oldself = self;
self = te;
W_SetCurrentAmmo();
self = oldself;
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
WriteCoord (MSG_MULTICAST, te.origin_x);
WriteCoord (MSG_MULTICAST, te.origin_y);
WriteCoord (MSG_MULTICAST, te.origin_z);
multicast (te.origin, MULTICAST_PHS);
}
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
WriteCoord (MSG_MULTICAST, te.origin_x);
WriteCoord (MSG_MULTICAST, te.origin_y);
WriteCoord (MSG_MULTICAST, te.origin_z);
multicast (te.origin, MULTICAST_PHS);
}
}
else
{
te.think = SUB_Remove;
te.nextthink = time + 0.1;
T_RadiusDamage(te, self.owner, expsize / 2, te);
if (te.classname != "player")
{
te.think = SUB_Remove;
te.nextthink = time + 0.1;
}
}
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
@ -375,7 +436,13 @@ if (total_exp > 0) {//CH Thanks Slice for the idea :)
CamProjectileLockOff();
#endif
dremove(self);
self.nextthink = time + 0.5;
self.think = EMPScramble;
self.movetype = MOVETYPE_NONE;
self.solid = SOLID_NOT;
setmodel(self, "");
setorigin(self, self.origin);
};
@ -466,53 +533,10 @@ void() TeamFortress_EngineerBuild =
float(entity obj, entity builder) CheckArea =
{
local vector src, end;
local float pos;
local integer pos;
// Check the origin
pos = pointcontents(obj.origin);
if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY)
return FALSE;
// Check the surrounding area
src_x = obj.origin_x + obj.maxs_x + 16;
src_y = obj.origin_y + obj.maxs_y + 16;
src_z = obj.origin_z + obj.maxs_z + 16; // check upwards more
pos = pointcontents(src);
if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY)
return FALSE;
end_x = obj.origin_x + obj.mins_x - 16;
end_y = obj.origin_y + obj.mins_y - 16;
end_z = obj.origin_z + obj.mins_z - 16;
traceline (src, end, TRUE, obj);
if (trace_fraction != 1)
return FALSE;
pos = pointcontents(end);
if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY)
return FALSE;
// extend the size a little
src_x = obj.origin_x + obj.mins_x - 16;
src_y = obj.origin_y + obj.maxs_y + 16;
src_z = obj.origin_z + obj.maxs_z + 16;
pos = pointcontents(src);
if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY)
return FALSE;
end_x = obj.origin_x + obj.maxs_x + 16;
end_y = obj.origin_y + obj.mins_y - 16;
end_z = obj.origin_z + obj.mins_z - 16; // check downwards less
traceline (src, end, TRUE, obj);
if (trace_fraction != 1)
return FALSE;
pos = pointcontents(end);
// Check the hull
pos = entpointcontents(obj);
if (pos == CONTENTS_SOLID || pos == CONTENTS_SKY)
return FALSE;
@ -568,7 +592,7 @@ void(float objtobuild) TeamFortress_Build =
return;
}
obj.mins = '-8 -8 0';
obj.maxs = '8 8 24';
obj.maxs = '8 8 40';
#ifdef no_new_dispenser
obj.mdl = "progs/disp.mdl";
@ -617,7 +641,7 @@ void(float objtobuild) TeamFortress_Build =
// obj.mins = '-16 -16 0'; //- OfN commented by
obj.mins = '-16 -16 -25';
// obj.maxs = '16 16 48'; //WK 62 is better, but crashes?
obj.maxs = '16 16 23';
obj.maxs = '16 16 62';
//obj.mdl = "progs/newtesla.mdl";
obj.mdl = "progs/coil.mdl";
obj.netname = "tesla";
@ -697,7 +721,7 @@ void(float objtobuild) TeamFortress_Build =
} else if (trace_startsolid) {
checkmove (trace_endpos, obj.mins, obj.maxs, trace_endpos,
MOVE_NORMAL, self);
printtrace (TRUE);
//printtrace (TRUE); // annoying
if (trace_startsolid) {
sprint (self, PRINT_HIGH, "Not enough room to build here\n");
dremove (obj);
@ -840,7 +864,8 @@ void() TeamFortress_FinishedBuilding =
oldself.think = DispenserThink;
oldself.nextthink = time + 5;
oldself.th_die = Dispenser_Die; // Death function
oldself.th_pain = Dispenser_Pain;
#ifdef no_new_dispenser
oldself.mdl = "progs/disp.mdl"; // Actual mdl
#else
@ -1173,6 +1198,16 @@ void() Dispenser_Explode =
dremove(self); // remove explosion timer for this dispenser
};
void(entity atk, float dmg) Dispenser_Pain =
{
if (self.health < 0)
{
// give credit to the guy blowing up the disp
self.martyr_enemy = atk;
self.is_malfunctioning = 0;
}
};
void() Dispenser_Die =
{
local float damg;

View file

@ -177,20 +177,6 @@ void() Field_think =
float(entity e1, entity e2) EntsTouching2 =
{
if (e1.absmin_x > e2.absmax_x)
return FALSE;
if (e1.absmin_y > e2.absmax_y)
return FALSE;
if (e1.absmin_z > e2.absmax_z)
return FALSE;
if (e1.absmax_x < e2.absmin_x)
return FALSE;
if (e1.absmax_y < e2.absmin_y)
return FALSE;
if (e1.absmax_z < e2.absmin_z)
return FALSE;
if (hullpointcontents (e2, e1.mins, e1.maxs, e1.origin) != CONTENTS_SOLID)
return FALSE;
return TRUE;
@ -283,9 +269,11 @@ void() Field_touch_SUB =
deathmsg = DMSG_FF_HACKED;
else /* if (deathmsg == DMSG_FORCEFIELD_STUCK) */
deathmsg = DMSG_FF_STUCK_HACKED;
TF_T_Damage (other, self, self, self.dmg, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
TF_T_Damage (other, self, self.martyr_enemy, self.dmg, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
}
}
if (shoulddamage)
self.demon_one.has_camera = self.demon_two.has_camera = 0;
}
}
else if (other.classname != "force_field") // non player entities
@ -308,7 +296,7 @@ void() Field_touch_SUB =
deathmsg = DMSG_FF_HACKED;
else /* if (deathmsg == DMSG_FORCEFIELD_STUCK) */
deathmsg = DMSG_FF_STUCK_HACKED;
TF_T_Damage (other, self, self, self.dmg, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
TF_T_Damage (other, self, self.martyr_enemy, self.dmg, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
}
}
}
@ -321,18 +309,13 @@ void() Field_touch_SUB =
if (IsBuilding(other))
return;
other.velocity_z = other.velocity_z + 100;
if (other.origin_x < self.origin_x)
other.velocity_x = other.velocity_x - 200 * random();
else
other.velocity_x = other.velocity_x + 200 * random();
if (other.origin_y < self.origin_y)
other.velocity_y = other.velocity_y - 200 * random();
else
other.velocity_y = other.velocity_y + 200 * random();
}
other.velocity_x = -other.velocity_x;
other.velocity_y = -other.velocity_y;
other.velocity += 200*normalize(other.velocity);
FieldExplosion(self,other.origin,other);
PutFieldWork(self);
};
@ -529,9 +512,12 @@ void() Field_touch =
{
if (other.classname == "force_field") return; //avoid weird loops with other fields
self.dmg = FIELDGEN_DMG;
deathmsg = DMSG_FORCEFIELD;
if (self.dmg == FIELDGEN_DMGINSIDE)
deathmsg = DMSG_STUCK_FORCEFIELD;
else
self.dmg = FIELDGEN_DMG;
Field_touch_SUB();
};
@ -1122,8 +1108,8 @@ void(entity field) Engineer_UseFieldGen =
sprint(self,PRINT_HIGH,"Trapped field generator, have a nice day!\n");
deathmsg = DMSG_FGTRAP;
T_RadiusDamage (self.building, self.building, FGTRAP_DMG, NIL);
// TF_T_Damage(self.building, self.building, self.building, 2000, 0, TF_TD_OTHER);
//used to do radius damage
TF_T_Damage(self, self.building, self.building.martyr_enemy, FGTRAP_DMG, 0, TF_TD_ELECTRICITY);
return;
//}
}

View file

@ -1126,7 +1126,7 @@ float() CheckHaxxx =
if (!self.martyr_enemy) // BUG!
retval = FALSE;
else if (!(IsBuilding(self.martyr_enemy))) // BUG! 2
else if (!(IsBuilding(self.martyr_enemy)) && self.martyr_enemy.classname != "player") // BUG! GR what about cyberaug?
retval = FALSE;
else if (self.martyr_enemy.health <= 0)
{
@ -1251,7 +1251,7 @@ void() JobHacker =
if ( (IsBuilding(trace_ent) && trace_ent.classname != "building_sentrygun_base") || trace_ent.classname == "player")
{
if (!Teammate(trace_ent.team_no,self.team_no))
if (!Teammate(trace_ent.team_no,self.team_no) && trace_ent.real_owner != self)
{
if (trace_ent.is_malfunctioning == SCREWUP_ONE + SCREWUP_TWO + SCREWUP_THREE + SCREWUP_FOUR)
{

36
hook.qc
View file

@ -216,8 +216,6 @@ void () Build_Chain =
//
float () Check_Overhead =
{
local vector src;
local vector end;
makevectors (self.owner.angles);
@ -225,35 +223,11 @@ float () Check_Overhead =
// SRC and END, and plugging the values directly into the traceline
// function calls. Using SRC and END made debugging easier. You
// decide if it's worth it.
// argh, checkmove makes this SO much easier
// quick check right above head
src = self.owner.origin - '0 0 24';
end = self.owner.origin - '0 0 24';
traceline (src, end, FALSE, self.owner);
if (trace_fraction != 1.0)
return FALSE;
checkmove(self.owner.origin, self.owner.mins, self.owner.maxs, self.owner.origin + '0 0 1', MOVE_NORMAL, self.owner);
src = self.owner.origin - '0 0 24' - v_forward * 16;
end = self.owner.origin - '0 0 24' - v_forward * 16 + '0 0 58';
traceline (src, end, FALSE, self.owner);
if (trace_fraction != 1.0)
return FALSE;
src = self.owner.origin - '0 0 24' + v_forward * 16;
end = self.owner.origin - '0 0 24' + v_forward * 16 + '0 0 58';
traceline (src, end, FALSE, self.owner);
if (trace_fraction != 1.0)
return FALSE;
src = self.owner.origin - '0 0 24' - v_right * 16;
end = self.owner.origin - '0 0 24' - v_right * 16 + '0 0 58';
traceline (src, end, FALSE, self.owner);
if (trace_fraction != 1.0)
return FALSE;
src = self.owner.origin - '0 0 24' + v_right * 16;
end = self.owner.origin - '0 0 24' + v_right * 16 + '0 0 58';
traceline (src, end, FALSE, self.owner);
if (trace_fraction != 1.0)
return FALSE;
@ -283,8 +257,8 @@ void () Anchor_Grapple =
|| other.classname == "force_field") //CH maybe fix crash?
return;
//if (isBuilding(other)) //WK don't hook onto buildings?
// return;
if (IsBuilding(other)) //WK don't hook onto buildings? GR Yes, this caused bug
return;
// Don't stick the the sky.
if (pointcontents(self.origin) == CONTENTS_SKY)

62
jobs.qc
View file

@ -384,7 +384,7 @@ void() MartyrThink =
//Self.owner is the guy who became a martyr
//Clean these up so we can kill him
//self.job = self.job - (self.job & JOB_ACTIVE);
self.job = self.job - (self.job & JOB_ACTIVE); //why not?
self.owner.items = self.items & ~IT_INVULNERABILITY;
self.owner.invincible_time = 0;
self.owner.invincible_finished = 0;
@ -416,8 +416,7 @@ void() JobMartyr =
self.items = self.items | IT_INVULNERABILITY;
self.invincible_time = 1;
self.invincible_finished = time + martyr_time + 1; //Overlap so we can't die till end
//self.job = self.job | JOB_ACTIVE;
//self.job_finished = time + martyr_time + 1;
self.job = self.job | JOB_ACTIVE; //why not?
tWeapon = spawn();
tWeapon.owner = self;
@ -447,8 +446,7 @@ void() BerserkerKillTimer =
TF_T_Damage(self.owner, self.owner, self.owner, self.owner.health, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
self.job = self.job - (self.job & JOB_ACTIVE); //- OfN
self.owner.is_abouttodie = FALSE;
self.owner.job &= ~JOB_ACTIVE; //- OfN is a tard, should be self.owner idiot -Griev
dremove(self);
};
@ -456,8 +454,6 @@ void() JobBerserker =
{
if (self.super_damage_finished > 0)
return;
if (self.is_abouttodie)
return;
newmis = spawn();
newmis.classname = "berserker_timer";
@ -466,7 +462,7 @@ void() JobBerserker =
newmis.owner = self;
if (self.health > BERSERKER_HP_COST)
TF_T_Damage(self, self, self, BERSERKER_HP_COST, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
self.health -= BERSERKER_HP_COST;
else
{
self.health = 1;
@ -475,9 +471,8 @@ void() JobBerserker =
self.super_time = 1;
self.super_damage_finished = time + BERSERK_TIME + 1;
self.items = self.items | IT_QUAD;
self.is_abouttodie = TRUE;
self.job = self.job | JOB_ACTIVE; //- OfN
self.job_finished = time + BERSERK_TIME * 3;
self.job_finished = time + BERSERK_TIME * 2; // GR was * 3
stuffcmd(self, "v_idlescale 30\n");
};
@ -576,6 +571,9 @@ void() JobJudoka =
local entity tWeapon,oself;
local entity te;
if (self.attack_finished > time)
return;
makevectors(self.v_angle);
source = self.origin + '0 0 16';
@ -750,9 +748,9 @@ void() GuerillaExplode =
// if has_tesla is 1 print nothing, as this is set by DetonateMines() and GuerillaThink
if (time < self.heat + ACTIVATE_TIME) //If not charged, do less damage when blowing up
T_RadiusDamage (self, self.owner, 80, NIL); //- damage was 80
T_RadiusDamage (self, self.martyr_enemy, MINE_DMG / 2, NIL); //- damage was 80
else
T_RadiusDamage (self, self.owner, MINE_DMG, NIL); //- damage was 160
T_RadiusDamage (self, self.martyr_enemy, MINE_DMG, NIL); //- damage was 160
// num_mines is the number of mines the player has
self.owner.num_mines = self.owner.num_mines - 1;
@ -796,7 +794,18 @@ void(entity mine_owner) DetonateMines =
void(vector startpos) GuerillaMineSweep =
{
local entity head;
local entity inf = self;
local float loopc = 0;
head = findradius(startpos, 30);
while (loopc < 5 && inf.classname != "player")
{
inf = inf.real_owner;
loopc++;
if (loopc >= 5)
inf = NIL;
}
while (head)
{
if (head.classname == "grenade" && head.netname == "land_mine") {
@ -804,7 +813,7 @@ void(vector startpos) GuerillaMineSweep =
head.has_tesla = 2; // "mine is destroyed" message on guerillaexplode()
head.think = GuerillaExplode;
head.nextthink = time + 0.1;
head.martyr_enemy = inf;
}
head = head.chain;
}
@ -816,6 +825,7 @@ void() GuerillaThink = //Every second see if we have enemy nearby
local float finished; //Only blow up once
finished = 0;
self.nextthink = time + MINE_SCANRATE;
self.martyr_enemy = NIL;
if (time < self.heat + ACTIVATE_TIME)
return;
if (time > self.last_attacked_time) {
@ -876,22 +886,31 @@ void() GuerillaThink = //Every second see if we have enemy nearby
}
};
void() GuerillaTouch = //What happens when someone runs it over
void(entity inflictor, float amt) GuerillaPain = //What happens when someone hurts it
{
if (time < self.heat + ACTIVATE_TIME)
return;
self.martyr_enemy = inflictor;
GuerillaExplode();
};
void() GuerillaTouch = // what happens when someone runs it over
{
GuerillaPain(other, 100);
};
void() GuerillaTossTouch =
{
if (other) {
GuerillaTouch();
self.solid = SOLID_BBOX;
setsize(self, self.mins, self.maxs);
if (other && other != self.owner) {
GuerillaPain(other, 100);
return;
}
if (pointcontents(self.origin) == CONTENTS_SKY || pointcontents(self.origin) == CONTENTS_SOLID) { //CH if in wall or sky
if (entpointcontents(self) == CONTENTS_SKY || entpointcontents(self) == CONTENTS_SOLID) {
self.health = 0; //CH needed for tesla
// OfN CAUSES ANY PROBLEM? Is this needed?
@ -908,6 +927,8 @@ void() GuerillaTossTouch =
sound (self, CHAN_WEAPON, "weapons/guerilla_set.wav", 1, ATTN_NORM);
self.touch = GuerillaTouch;
self.think = GuerillaThink;
self.takedamage = DAMAGE_AIM;
self.th_pain = GuerillaPain;
self.nextthink = time + 1;
};
@ -944,17 +965,16 @@ void() JobGuerilla =
//Set all the critical crap on the mine
newmis = spawn();
newmis.movetype = MOVETYPE_BOUNCE;
newmis.solid = SOLID_BBOX;
newmis.solid = SOLID_TRIGGER;
newmis.takedamage = DAMAGE_AIM;
newmis.classname = "grenade";
newmis.netname = "land_mine";
setsize (newmis, '0 0 0', '0 0 0');
// setsize (newmis, '-0.5 -0.5 -0.5', '1 1 1');
setorigin (newmis, self.origin);
setsize (newmis, '-0.5 -0.5 -0.5', '1 1 1');
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;
setorigin (newmis, self.origin + (normalize(newmis.velocity) * 5));
newmis.angles = vectoangles(newmis.velocity);
// newmis.skin = self.team_no - 1;
newmis.skin = 1;

18
menu.qc
View file

@ -2429,7 +2429,7 @@ void(float inp) Menu_EngineerFix_Tesla_Input2 =
self.building.flags = self.building.flags - (self.building.flags & FL_ONGROUND);
self.building.movetype = MOVETYPE_FLY;
self.building.velocity_z = 200;
setsize (self.building, '-16 -16 10', '16 16 40');//35');//'-16 -16 -40', '16 16 -10'); //WK -40, -10
setsize (self.building, '-16 -16 10', '16 16 62');
self.building.tf_items = self.building.tf_items | NIT_TURRET;
self.building.is_haxxxoring=1; //flag determines if flying and it's used for cloaking teslas, set to 0 when landed
@ -2578,7 +2578,7 @@ void(float inp) Menu_Dispenser_Input =
if (self.building.is_malfunctioning & SCREWUP_FOUR)
{
sprint(self,PRINT_HIGH,"Trapped dispenser, have a nice day!\n");
TF_T_Damage(self.building, self.building, self.building, 500, 0, TF_TD_OTHER);
TF_T_Damage(self.building, self.building, self.building.martyr_enemy, 500, 0, TF_TD_OTHER);
return;
}
@ -3776,12 +3776,12 @@ l1 = grenstr(GR_TYPE_NORMAL, GR_TYPE_FLAME,
" .. Normal ­ 500\n2 .. Flame ­ 750\n");
l2 = grenstr(GR_TYPE_GAS, GR_TYPE_EMP,
" •.. Gas ­ 1200\n .. EMP ­ 1200\n",
"1 •.. Gas ­ 1200\n .. EMP ­ 1200\n",
" •.. Gas ­ 1200\n1 .. EMP ­ 1200\n",
"1 •.. Gas ­ 1200\n1 .. EMP ­ 1200\n",
"2 •.. Gas ­ 1200\n .. EMP ­ 1200\n",
" •.. Gas ­ 1200\n2 .. EMP ­ 1200\n");
" •.. Gas ­ 1200\n .. EMP ­ 1300\n",
"1 •.. Gas ­ 1200\n .. EMP ­ 1300\n",
" •.. Gas ­ 1200\n1 .. EMP ­ 1300\n",
"1 •.. Gas ­ 1200\n1 .. EMP ­ 1300\n",
"2 •.. Gas ­ 1200\n .. EMP ­ 1300\n",
" •.. Gas ­ 1200\n2 .. EMP ­131200\n");
l3 = grenstr(GR_TYPE_FRAG, GR_TYPE_NAIL,
" —.. Frag ­ 1300\n ˜.. Nail ­ 1400\n",
@ -3834,7 +3834,7 @@ void(float inp) Menu_Gren1_Input =
sprint(self,PRINT_HIGH,"The admin has disabled spam devices on this map.\n");
return;
}
BuyGren(1200,GR_TYPE_EMP);
BuyGren(1300,GR_TYPE_EMP);
}
else if (inp == 5)
{

View file

@ -539,42 +539,8 @@ void() walkmonster_start_go =
self.origin_z = self.origin_z + 1; // raise off floor a bit
droptofloor();
/* failure = 1;
test = self.origin;
test_z = test_z - self.mins_z - 1;
if (pointcontents(test) == CONTENT_SOLID)
failure = 0;
test = self.origin - self.mins;
test_z = test_z - 1;
if (pointcontents(test) == CONTENT_SOLID)
failure = 0;
test_x = test_x - self.mins_x + self.maxs_x;
if (pointcontents(test) == CONTENT_SOLID)
failure = 0;
test_y = test_y - self.mins_y + self.maxs_y;
if (pointcontents(test) == CONTENT_SOLID)
failure = 0;
test_x = test_x - self.maxs_x + self.mins_x;
if (pointcontents(test) == CONTENT_SOLID)
failure = 0;*/
if (!walkmove(0,0))
// if (failure)
if (entpointcontents(self) == CONTENTS_SOLID)
{
/* RPrint ("walkmonster in wall at: ");
RPrint (vtos(self.origin));
RPrint ("\n"); */
//- OfN - if (self.classname == "monster_demon1" || self.classname == "monster_army" || self.classname == "monster_shambler")
if (IsMonster(self))
if (self.real_owner.classname == "player")

View file

@ -62,6 +62,115 @@ void (entity targ, entity attacker) Obituary_Building_by_Teledeath;
void (entity targ, entity attacker) Obituary_Building_by_Player;
void (entity targ, entity attacker) Obituary_Building_by_Army;
/*
===========
Give_Frags_xxx
Called from Obituary(), doles out frags.
Unlike Obituary_xxx, the xxx means the ATTACKER here.
It's cleaner that way.
===========
*/
void(entity atk, entity targ) Give_Frags_Player =
{
local float numfrags = 1, chkvamp = 1;
if (targ.classname == "monster_shambler")
numfrags = (targ.has_tesla - 4) / 4;
if (targ.classname == "monster_demon1")
numfrags = 2;
if (targ.classname == "building_tesla" && targ.tf_items & NIT_SECURITY_CAMERA) //shortcut for rogue tes
return;
if (targ.classname != "player")
{
targ = targ.real_owner;
chkvamp = 0; // don't vamp building/monster kills
}
if (atk == targ || Teammate(atk.team_no, targ.team_no))
{
chkvamp = 0; // don't vamp neg frags
numfrags *= -1;
}
atk.real_frags += numfrags;
if (chkvamp && (teamplay & TEAMPLAY_VAMPIRE))
targ.real_frags -= numfrags;
if (!(toggleflags & TFLAG_TEAMFRAGS))
{
atk.frags = atk.real_frags;
if (chkvamp)
targ.frags = targ.real_frags;
}
if (numfrags > 0)
logfrag (targ, atk);
if (numfrags < 0)
logfrag (targ, targ);
};
void (entity atk, entity targ) Give_Frags_Monster =
{
if (atk == targ)
return; // no neg frags to monsters
if (((targ.classname == "player") && Teammate(atk.real_owner.team_no, targ.team_no)) ||
Teammate(atk.real_owner.team_no, targ.real_owner.team_no))
{
if (targ.classname == "player") // More the victim than the owner's fault
{
targ.real_frags--;
if (!(toggleflags & TFLAG_TEAMFRAGS))
targ.frags = targ.real_frags;
logfrag (targ, targ);
}
return;
}
Give_Frags_Player(atk, targ);
};
void (entity atk, entity targ) Give_Frags_Building =
{
if (atk == targ)
return;
atk.owner = atk.real_owner;
if (atk.classname == "building_dispenser" && atk.martyr_enemy != atk.real_owner)
atk.real_owner = atk.martyr_enemy;
if ((((targ.classname == "player") && Teammate(atk.real_owner.team_no, targ.team_no)) ||
Teammate(atk.real_owner.team_no, targ.real_owner.team_no)) && ((deathmsg != DMSG_TESLA) ||
!(atk.tf_items & NIT_SECURITY_CAMERA)))
{
if (targ.classname == "player") // More the victim than the owner's fault
{
targ.real_frags--;
if (!(toggleflags & TFLAG_TEAMFRAGS))
targ.frags = targ.real_frags;
}
}
if (targ.classname == "monster_shambler")
atk.frags += (targ.has_tesla - 4) / 4;
else if (targ.classname == "monster_demon1")
atk.frags += 2;
else
atk.frags++;
if (atk.real_owner != atk.owner)
atk.real_owner = atk.owner;
Give_Frags_Player(atk.real_owner, atk);
};
/*
===========
@ -81,6 +190,20 @@ void (entity targ, entity attacker) Obituary =
Obituary_Monster (targ, attacker);
else if (IsBuilding (targ) && targ.classname != "building_sentrygun_base")
Obituary_Building (targ, attacker);
if (attacker.classname == "player")
Give_Frags_Player (targ, attacker);
else if (IsMonster (attacker))
Give_Frags_Monster (targ, attacker);
else if (IsBuilding (attacker) && targ.classname != "building_sentrygun_base" || targ.classname == "force_field")
Give_Frags_Building (targ, attacker);
else if (targ.classname == "player") // Player died and can't give credit to anyone. Nothing to do but -1
{
targ.real_frags--;
if (toggleflags & TFLAG_TEAMFRAGS)
targ.frags = targ.real_frags;
logfrag(targ, targ);
}
};
void (entity targ, entity attacker) Obituary_Player =
@ -88,7 +211,8 @@ void (entity targ, entity attacker) Obituary_Player =
//WK No Obituary for the cursed!
if (targ.penance_time > time - 1)
{
Give_Frags_Out (targ, targ, -1, 0, 1, 1, 0);
//Give_Frags (targ, targ, -1);
return;
}
if (targ.martyr_enemy != targ)
@ -133,8 +257,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Cybernet =
{
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " will abort the hack next time\n");
Give_Frags_Out (targ, targ, -1, 0, 1, 1, 0);
};
void (entity targ, entity attacker) Obituary_Player_by_Antihack =
@ -157,7 +279,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Antihack =
bprint (PRINT_MEDIUM, "\n");
}
Give_Frags_Out (targ, targ, -1, 0, 1, 1, 0);
//Give_Frags(attacker.real_owner, targ, 1);
};
void (entity targ, entity attacker) Obituary_Player_by_Antidismantle =
@ -180,7 +302,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Antidismantle =
bprint (PRINT_MEDIUM, "\n");
}
Give_Frags_Out (targ, targ, -1, 0, 1, 1, 0);
//Give_Frags (attacker.real_owner, targ, 1);
};
void (entity targ, entity attacker) Obituary_Player_by_Wizard =
@ -188,8 +310,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Wizard =
custom_demon_name (attacker); //CH
if (attacker.real_owner == targ) {
Give_Frags_Out (attacker.real_owner, attacker.real_owner, -2, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, "The scrag ");
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " kills his owner, ");
@ -221,7 +341,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Wizard =
bprint (PRINT_MEDIUM, "\n");
}
Give_Frags_Out (attacker.real_owner, attacker.real_owner, 1, 0, 1, 1, 0);
//Give_Frags(attacker.real_owner, targ, 1)
} else if (Teammate (targ.team_no, attacker.real_owner.team_no)) {
if (random () < FRAC (1, 2)) {
bprint (PRINT_MEDIUM, "The supposed friendly scrag ");
@ -248,7 +368,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Demon1 =
custom_demon_name (attacker); //CH
if (attacker.real_owner == targ) {
Give_Frags_Out (attacker.real_owner, attacker.real_owner, -2, 0, 1, 1, 0);
if (deathmsg == DMSG_DEMON_FIRE) {
bprint (PRINT_MEDIUM, attacker.netname);
@ -330,9 +449,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Demon1 =
}
}
if (!Teammate (targ.team_no, attacker.real_owner.team_no)
|| attacker.real_owner.team_no < 1)
Give_Frags_Out (attacker.real_owner, attacker.real_owner, 1, 0, 1, 1, 0);
};
void (entity targ, entity attacker) Obituary_Player_by_Army =
@ -341,7 +457,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Army =
GetRank (attacker); // Sponsored by SB-1 Tech
if (attacker.real_owner == targ) {
Give_Frags_Out (attacker.real_owner, attacker.real_owner, -2, 0, 1, 1, 0);
//Give_Frags (attacker, targ, -1);
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " is killed by his own mercenary ");
@ -422,8 +538,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Army =
bprint (PRINT_MEDIUM, ") buckshot\n");
}
Give_Frags_Out (attacker.real_owner, attacker.real_owner, 1, 0, 1, 1, 0);
Give_Frags_Out (attacker, attacker, 1, 0, 1, 1, 0);
//Give_Frags(attacker, targ);
}
};
@ -431,10 +546,9 @@ void (entity targ, entity attacker) Obituary_Player_by_Shambler =
{
custom_demon_name (attacker); //CH
if (attacker.real_owner == targ || (attacker.is_malfunctioning && attacker.martyr_enemy == targ)) {
if (attacker.real_owner == targ) {
if (!attacker.is_malfunctioning)
Give_Frags_Out (attacker.real_owner, attacker.real_owner, -2, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1);
if (deathmsg == DMSG_LIGHTNING) {
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " annihilates its owner ");
@ -564,8 +678,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Shambler =
}
}
if (!Teammate (targ.team_no, attacker.real_owner.team_no) || attacker.real_owner.team_no < 1)
Give_Frags_Out (attacker.real_owner, attacker.real_owner, 1, 0, 1, 1, 0);
}
};
@ -576,8 +688,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Teledeath =
bprint (PRINT_MEDIUM, attacker.owner.netname);
bprint (PRINT_MEDIUM, "\n");
if (!Teammate (targ.team_no, attacker.owner.team_no) || attacker.owner.team_no < 1)
Give_Frags_Out (attacker.owner, attacker.owner, 1, 0, 1, 1, 0);
};
void (entity targ, entity attacker) Obituary_Player_by_Teledeath2 =
@ -586,7 +696,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Teledeath2 =
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, "'s telefrag\n");
Give_Frags_Out (targ, targ, -1, 1, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
};
void (entity targ, entity attacker) Obituary_Player_by_Goal =
@ -605,7 +715,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Player =
local string deathstring;
// killed self
Give_Frags_Out (attacker, attacker, -1, 0, 1, 1, 1);
//Give_Frags (attacker, attacker, -1);
if (deathmsg == DMSG_GREN_HAND)
deathstring = " grenades himself\n";
@ -630,6 +740,8 @@ void (entity targ, entity attacker) Obituary_Player_by_Player =
deathstring = " chokes on his own gas\n";
else if (deathmsg == DMSG_GREN_EMP)
deathstring = " explodes his ammo and body\n";
else if (deathmsg == DMSG_GREN_EMP_RADIUS)
deathstring = " blows himself up with another player's ammo\n";
else if (deathmsg == DMSG_GREN_FLASH)
deathstring = " is charred by his own flash grenade\n";
else if (deathmsg == DMSG_GREN_EMP_AMMO)
@ -690,10 +802,6 @@ void (entity targ, entity attacker) Obituary_Player_by_Player =
bprint (PRINT_MEDIUM, deathstring);
} else if (teamplay && Teammate (targ.team_no, attacker.team_no)) {
// killed a team member
if (Teammate (targ.team_no, attacker.team_no) )
Give_Frags_Out (attacker, attacker, -1, 0, 1, 1, 0);
else
Give_Frags_Out (attacker, attacker, 1, 0, 1, 1, 0);
if (deathmsg == DMSG_MEDIKIT) {
bprint (PRINT_MEDIUM, targ.netname);
@ -735,7 +843,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Player =
deathstring = deathstring2 = "WASN'T FALSE POSITIVE";
Give_Frags_Out (attacker, targ, 1, 1, 1, 1, 1);
//Give_Frags (attacker, targ, 1);
if (attacker.tfstate & TFSTATE_INSPIRED) {
attacker.inspirator.real_frags += 0.5;
@ -797,6 +905,9 @@ void (entity targ, entity attacker) Obituary_Player_by_Player =
} else if (deathmsg == DMSG_GREN_EMP) {
deathstring = "'s ammo detonates him as ";
deathstring2 = "'s EMP fries it.\n";
} else if (deathmsg == DMSG_GREN_EMP_RADIUS) {
deathstring = " eats collateral damage from ";
deathstring2 = "'s EMP\n";
} else if (deathmsg == DMSG_GREN_FLASH) {
deathstring = " is charred by ";
deathstring2 = "'s flash grenade.\n";
@ -1055,21 +1166,31 @@ void (entity targ, entity attacker) Obituary_Player_by_Dispenser =
{
if (!(attacker.is_malfunctioning & SCREWUP_TWO)
&& !(attacker.is_malfunctioning & SCREWUP_FOUR)) {
if (targ == attacker.real_owner) {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " dispenses with himself\n");
if (attacker.martyr_enemy == attacker.real_owner) {
if (targ == attacker.real_owner) {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " dispenses with himself\n");
} else {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " didn't insert the correct change into ");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s dispenser\n");
}
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
} else {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " didn't insert the correct change into ");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s dispenser\n");
if (Teammate (targ.team_no, attacker.team_no))
Give_Frags_Out (attacker, attacker, -1, 0, 1, 1, 0);
else
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
} else {
if (targ == attacker.real_owner) {
bprint (PRINT_MEDIUM, attacker.martyr_enemy.netname);
bprint (PRINT_MEDIUM, " nukes ");
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " with his own dispenser\n");
} else {
bprint (PRINT_MEDIUM, attacker.martyr_enemy.netname);
bprint (PRINT_MEDIUM, " blows ");
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " away with ");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s dispenser");
}
}
} else {
if (targ == attacker.real_owner) {
@ -1078,14 +1199,14 @@ void (entity targ, entity attacker) Obituary_Player_by_Dispenser =
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " is blown apart by his trapped dispenser\n");
Give_Frags_Out (attacker.real_owner, attacker, -1, 0, 1, 1, 0);
//Give_Frags (attacker.martyr_enemy, targ, 1);
} else if (targ == attacker.martyr_enemy) {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " should've stayed away from ");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s dispenser\n");
Give_Frags_Out (attacker.martyr_enemy, attacker, -1, 0, 1, 1, 0);
//Give_Frags (attacker.martyr_enemy, targ, -1);
} else {
bprint (PRINT_MEDIUM, attacker.martyr_enemy.netname);
bprint (PRINT_MEDIUM, " laughs as ");
@ -1094,7 +1215,7 @@ void (entity targ, entity attacker) Obituary_Player_by_Dispenser =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s trapped dispenser\n");
Give_Frags_Out (attacker.martyr_enemy, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker.martyr_enemy, targ, 1);
}
}
};
@ -1107,14 +1228,14 @@ void (entity targ, entity attacker) Obituary_Player_by_ForceField =
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " fries in his own hacked force field\n");
Give_Frags_Out (attacker.real_owner, attacker, -1, 0, 1, 1, 0);
//Give_Frags (attacker.martyr_enemy, targ, 1);
} else if (targ == attacker.martyr_enemy) {
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " hacked the wrong thing in ");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s force field generator\n");
Give_Frags_Out (attacker.martyr_enemy, attacker, -1, 0, 1, 1, 0);
//Give_Frags (attacker.martyr_enemy, targ, -1);
} else {
bprint (PRINT_MEDIUM, attacker.martyr_enemy.netname);
bprint (PRINT_MEDIUM, " laughs as ");
@ -1123,7 +1244,7 @@ void (entity targ, entity attacker) Obituary_Player_by_ForceField =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s hacked force field\n");
Give_Frags_Out (attacker.martyr_enemy, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker.martyr_enemy, targ, 1);
}
};
@ -1147,12 +1268,6 @@ void (entity targ, entity attacker) Obituary_Player_by_SentryTesla =
local string deathstring;
local string deathstring2;
if (Teammate (targ.team_no, attacker.team_no))
Give_Frags_Out (attacker.real_owner, targ, -1, 1, 1, 1, 0);
else {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //gun
Give_Frags_Out (attacker.real_owner, targ, 1, 1, 1, 1, 0);
}
if (deathmsg == DMSG_SENTRYGUN_ROCKET) {
deathstring = " hates ";
@ -1217,11 +1332,12 @@ void (entity targ, entity attacker) Obituary_Player_Misc =
{
local string deathstring;
Give_Frags_Out (targ, targ, -1, 1, 1, 1, 0);
// logfrag (targ, targ);
//Give_Frags (targ, attacker, -1);
if (pointcontents (self.origin) == CONTENTS_SOLID) {
if (deathmsg == DMSG_PHYSICS) {
deathstring = " gets a lesson in spatial physics\n";
} else if (deathmsg == DMSG_OUTOFBOUNDS) {
deathstring = " found a way out\n";
} else if (targ.watertype == CONTENTS_WATER) {
local float rnum = random ();
@ -1274,6 +1390,9 @@ void (entity targ, entity attacker) Obituary_Player_Misc =
} else if (targ.deathtype == "falling" && !attacker) {
targ.deathtype = "";
deathstring = " fell to his death\n";
} else if (targ.deathtype == "wall" && !attacker) {
targ.deathtype = "";;
deathstring = " gives a warm hello to Mister Wall\n";
} else { //- OfN - unknown death by himself
local float rnum = random ();
@ -1337,8 +1456,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Tesla =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1347,8 +1465,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Tesla =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s tesla sentry\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly scrag, ");
@ -1366,8 +1482,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Sentry =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1376,8 +1491,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Sentry =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s sentry gun\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly scrag, ");
@ -1396,7 +1509,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Player =
&& (self.real_owner.team_no > 0)) {
if (Teammate (targ.real_owner.team_no, attacker.team_no)) {
if (attacker == self.real_owner) {
Give_Frags_Out (attacker, targ, -2, 0, 1, 1, 0);
//Give_Frags (attacker, targ, -1);
bprint (PRINT_MEDIUM, attacker.netname);
if (deathmsg == DMSG_LASERCANNON)
@ -1404,7 +1517,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Player =
else
bprint (PRINT_MEDIUM, " kills his own scrag!\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, -1);
bprint (PRINT_MEDIUM, attacker.netname);
if (deathmsg == DMSG_LASERCANNON)
@ -1417,7 +1530,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Player =
bprint (PRINT_MEDIUM, ")\n");
}
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
if (deathmsg == DMSG_LASERCANNON) {
bprint (PRINT_MEDIUM, attacker.netname);
@ -1444,7 +1557,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Army =
GetRank (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint (PRINT_MEDIUM, attacker.netname);
@ -1456,7 +1568,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Army =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1474,7 +1586,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Demon1 =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -1485,7 +1596,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Demon1 =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1502,7 +1613,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Shambler =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, "The shambler ");
bprint (PRINT_MEDIUM, attacker.netname);
@ -1514,7 +1624,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Shambler =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1531,8 +1641,6 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Wizard =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
@ -1542,7 +1650,7 @@ void (entity targ, entity attacker) Obituary_Monster_Wizard_by_Wizard =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s scrag, ");
@ -1583,8 +1691,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Tesla =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags (attacker, targ, 1);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1593,8 +1700,8 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Tesla =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s tesla sentry\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
if (attacker.tf_items & NIT_SECURITY_CAMERA) //overtink
//Give_Frags_Out (attacker.real_owner, targ);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly demon, ");
@ -1612,8 +1719,8 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Sentry =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1622,9 +1729,6 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Sentry =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s sentry gun\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly demon, ");
bprint (PRINT_MEDIUM, targ.netname);
@ -1642,11 +1746,11 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Player =
&& (self.real_owner.team_no > 0)) {
if (Teammate (targ.real_owner.team_no, attacker.team_no)) {
if (attacker == self.real_owner) {
Give_Frags_Out (attacker, targ, -2, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " kills his own fiend!\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " mows down the friendly demon ");
@ -1656,7 +1760,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Player =
bprint (PRINT_MEDIUM, ")\n");
}
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1675,7 +1779,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Army =
custom_demon_name (attacker);
GetRank (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint (PRINT_MEDIUM, attacker.netname);
@ -1687,7 +1791,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Army =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1705,7 +1809,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Demon1 =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -1716,7 +1820,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Demon1 =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1733,7 +1837,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Shambler =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -1744,7 +1848,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Shambler =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1761,7 +1865,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Wizard =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -1772,7 +1876,7 @@ void (entity targ, entity attacker) Obituary_Monster_Demon1_by_Wizard =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s demon, ");
@ -1814,8 +1918,8 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Tesla =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s mercenary soldier, ");
@ -1825,8 +1929,8 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Tesla =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s tesla sentry\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
if (attacker.tf_items & NIT_SECURITY_CAMERA)
//Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly soldier, ");
@ -1845,8 +1949,8 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Sentry =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s mercenary soldier, ");
@ -1856,9 +1960,6 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Sentry =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s sentry isn't that easy to kill\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly soldier, ");
bprint (PRINT_MEDIUM, targ.undercover_name);
@ -1877,12 +1978,12 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Player =
&& (self.real_owner.team_no > 0)) {
if (Teammate (targ.real_owner.team_no, attacker.team_no)) {
if (attacker == self.real_owner) {
Give_Frags_Out (attacker, targ, -2, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " kills his own soldier!\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " mows down the friendly soldier ");
@ -1893,7 +1994,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Player =
bprint (PRINT_MEDIUM, ")\n");
}
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s mercenary soldier, ");
@ -1910,7 +2011,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Shambler =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -1922,7 +2023,8 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Shambler =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ") into oblivion\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s soldier, ");
bprint (PRINT_MEDIUM, targ.undercover_name);
@ -1939,8 +2041,6 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Demon1 =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
@ -1951,7 +2051,8 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Demon1 =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s soldier, ");
@ -1980,7 +2081,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Army =
}
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint (PRINT_MEDIUM, attacker.netname);
@ -1993,7 +2094,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Army =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s soldier, ");
@ -2012,7 +2113,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Wizard =
{
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, "The scrag ");
bprint (PRINT_MEDIUM, attacker.netname);
@ -2025,7 +2126,7 @@ void (entity targ, entity attacker) Obituary_Monster_Army_by_Wizard =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s soldier, ");
@ -2067,8 +2168,8 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Tesla =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s shambler, ");
@ -2077,8 +2178,8 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Tesla =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s tesla sentry\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Tesla
//Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly shambler, ");
bprint (PRINT_MEDIUM, targ.netname);
@ -2095,8 +2196,8 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Sentry =
&& (attacker.real_owner.team_no > 0)
&& (targ.real_owner.team_no > 0)) {
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Sentry
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s shambler, ");
@ -2105,8 +2206,8 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Sentry =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, "'s sentry gun\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Sentry
Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 2, 0, 0); //Sentry
//Give_Frags_Out (attacker.real_owner, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s friendly shambler, ");
bprint (PRINT_MEDIUM, targ.netname);
@ -2124,12 +2225,12 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Player =
&& (self.real_owner.team_no > 0)) {
if (Teammate (targ.real_owner.team_no, attacker.team_no)) {
if (attacker == self.real_owner) {
Give_Frags_Out (attacker, targ, -2, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -2, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " kills his own shambler!\n");
} else {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " mows down the friendly shambler ");
@ -2139,7 +2240,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Player =
bprint (PRINT_MEDIUM, ")\n");
}
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s shambler, ");
@ -2158,7 +2259,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Demon1 =
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
@ -2169,7 +2270,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Demon1 =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s shambler, ");
@ -2193,8 +2294,6 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Shambler =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, ") sets itself on fire one too many times.\n");
} else if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, " (");
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
@ -2204,7 +2303,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Shambler =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, "'s shambler, ");
@ -2223,8 +2322,6 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Army =
GetRank (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " (");
bprint (PRINT_MEDIUM, targ.real_owner.netname);
@ -2235,7 +2332,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Army =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint (PRINT_MEDIUM, attacker.netname);
@ -2254,8 +2351,6 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Wizard =
custom_demon_name (attacker);
if (Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)) {
Give_Frags_Out (attacker, targ, -1, 0, 1, 1, 0);
//bprint (PRINT_MEDIUM, attacker.undercover_name);
bprint (PRINT_MEDIUM, "The scrag ");
bprint (PRINT_MEDIUM, attacker.netname);
@ -2267,7 +2362,7 @@ void (entity targ, entity attacker) Obituary_Monster_Shambler_by_Wizard =
bprint (PRINT_MEDIUM, targ.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
} else {
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
bprint (PRINT_MEDIUM, targ.netname);
bprint (PRINT_MEDIUM, " (");
@ -2302,8 +2397,8 @@ void (entity targ, entity attacker) Obituary_Building_by_Tesla =
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)
&& (targ.classname == "building_sentrygun"
|| targ.classname == "building_tesla")) {
Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
//Give_Frags_Out (attacker, targ, 1, 0, 2, 0, 0); //Tesla
//Give_Frags_Out (attacker.real_owner, targ, 1, 0, 1, 1, 0);
}
if (targ.classname == "building_dispenser")
@ -2365,10 +2460,6 @@ void (entity targ, entity attacker) Obituary_Building_by_Player =
bprint (PRINT_MEDIUM, attacker.netname);
bprint (PRINT_MEDIUM, "\n");
if (!Teammate (targ.real_owner.team_no, attacker.team_no)
&& (targ.classname == "building_sentrygun"
|| targ.classname == "building_tesla"))
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
}
};
@ -2387,10 +2478,6 @@ void (entity targ, entity attacker) Obituary_Building_by_Army =
bprint (PRINT_MEDIUM, attacker.real_owner.netname);
bprint (PRINT_MEDIUM, ")\n");
if (!Teammate (targ.real_owner.team_no, attacker.real_owner.team_no)
&& (targ.classname == "building_sentrygun"
|| targ.classname == "building_tesla"))
Give_Frags_Out (attacker, targ, 1, 0, 1, 1, 0);
};
void (entity targ, entity attacker) Obituary_Monster_Misc =

View file

@ -89,3 +89,5 @@
#define pushable_fiend
#define HUNTED_YELLOWTEAM_FACTOR 0.5 // this multiplied to current red players is max for yellow team on huntedr
#define SENSOR_MINSPEED 100 // minimum speed someone has to be moving to be picked up by sense.
#define AIRGUN_STRENGTH 500 // strength of airfist (was 1000), same as recoil.

View file

@ -446,7 +446,7 @@ void(entity player) ActivateHolo =
newmis = spawn();
newmis.solid = SOLID_NOT;
newmis.movetype = MOVETYPE_NOCLIP;
newmis.movetype = MOVETYPE_NONE;
newmis.origin = player.origin;
newmis.angles = player.angles;
newmis.colormap = player.colormap;
@ -720,10 +720,12 @@ void(entity themonster) KillTheMonster =
custom_demon_die();
else if (themonster.classname == "monster_army")
custom_grunt_die();
else if (themonster.classname == "monster_knight")
#if 0 // no knights right now
else if (themonster.classname == "monster_knight")
knight_die();
else if (themonster.classname == "monster_hknight")
hknight_die();
#endif
self=oself;
@ -1079,13 +1081,15 @@ float(entity theplayer, float grenslot) GetMaxGrens =
if (theplayer.tp_grenades_2 == GR_TYPE_NAIL)
return 3;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_FRAG)
return 4;// was 1
return 3;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
return 4;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_MIRV)
return 3;// was 1
return 2;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_FLARE)
return 8;
return 8;
if (theplayer.tp_grenades_2 == GR_TYPE_EMP)
return 4;// was 5
return 5;
}
@ -1097,13 +1101,15 @@ float(entity theplayer, float grenslot) GetMaxGrens =
if (theplayer.tp_grenades_1 == GR_TYPE_NAIL)
return 3;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_FRAG)
return 4;// was 1
return 3;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_CALTROP)
return 4;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_MIRV)
return 3;// was 1
return 2;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_FLARE)
return 8;
if (theplayer.tp_grenades_1 == GR_TYPE_EMP)
return 4;// was 5
return 5;
}
@ -1117,13 +1123,15 @@ float(entity theplayer, float grenslot) GetMaxGrens =
if (theplayer.tp_grenades_2 == GR_TYPE_NAIL)
return 2;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_FRAG)
return 3;// was 1
return 2;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
return 3;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_MIRV)
return 2;// was 1
return 1;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_FLARE)
return 6;
if (theplayer.tp_grenades_2 == GR_TYPE_EMP)
return 3;
return 4;
}
@ -1135,13 +1143,15 @@ float(entity theplayer, float grenslot) GetMaxGrens =
if (theplayer.tp_grenades_1 == GR_TYPE_NAIL)
return 2;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_FRAG)
return 3;// was 1
return 2;// was 1
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
return 3;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_MIRV)
return 2;// was 1
return 1;// was 1
if (theplayer.tp_grenades_1 == GR_TYPE_FLARE)
return 6;
if (theplayer.tp_grenades_1 == GR_TYPE_EMP)
return 3;
return 4;
}

View file

@ -17,6 +17,12 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
//entity looking at, entity thats looking, (0-1) checks visible, (0-range) checks range, (0-1) do special tesla checks, (0-1) should check for ceasefire
float(entity targ, entity checker, float chkvis, float chkrng, float istesla, float chkcease) Pharse_Client =
{
local float ismotion = 0;
if (istesla == 2)
{
istesla = 0;
ismotion = 1;
}
if (targ.classname != "player")
return FALSE;
if (chkcease)
@ -54,7 +60,7 @@ float(entity targ, entity checker, float chkvis, float chkrng, float istesla, fl
}
else
{
if (! (checker.classname == "building_sensor" && checker.num_mines & IMPROVED_FOUR))
if (! (ismotion && checker.num_mines & IMPROVED_FOUR))
return FALSE;
// - OfN return FALSE;
@ -90,6 +96,7 @@ float(entity targ, entity checker, float chkvis, float chkrng, float istesla, fl
return FALSE;
if (targ.job & JOB_THIEF && (targ.job & JOB_ACTIVE || targ.job & JOB_FULL_HIDE))
{
chkrng /= 2; // harder to see
if (istesla)
{
//- OfN jammer only for scanner -// nope
@ -97,7 +104,7 @@ float(entity targ, entity checker, float chkvis, float chkrng, float istesla, fl
//if (!(checker.tf_items & NIT_AUTOID))
return FALSE;
}
else if (checker.classname != "building_sensor")// && checker.classname != "monster_army" && checker.classname != "monster_demon1")
else if (!ismotion)// && checker.classname != "monster_army" && checker.classname != "monster_demon1")
return FALSE;
}
if (chkvis && checker.classname == "building_sentrygun" && !(checker.tf_items & NIT_TURRET)) // - OfN - hackish fix for sentry gun targetting
@ -110,91 +117,62 @@ float(entity targ, entity checker, float chkvis, float chkrng, float istesla, fl
return FALSE;
if (chkrng)
{
if (ismotion && targ.cutf_items & CUTF_JAMMER) // range cut in half if victim has scan jammer
chkrng /= 2;
local float r;
r = vlen(targ.origin - checker.origin);
if (r > chkrng)
return FALSE;
if (ismotion) // motion sensor can't detect targets moving slowly or not at all
{
local float minmove = SENSOR_MINSPEED * (1.5 - r/chkrng) ;
if (vlen(targ.velocity) < minmove)
return FALSE;
}
}
return TRUE;
};
//gives entity passed into number of frags passed
//entity gets frag, entity gave frag, give this many frags, (0-1) log frags, 1=real_frag 2=frag, (0-1) checks real_frag, (0-1) check frag vamp (takes from targ)
void(entity atk, entity targ, float numfrags, float fraggetlog, float howgive, float chkreal, float chkvamp) Give_Frags_Out =
{
if (!atk) // handles cases where the attack ent may have been zeroed
return;
/*
local string st;
bprint(PRINT_HIGH, "atk:");
bprint(PRINT_HIGH, atk.classname);
bprint(PRINT_HIGH, " targ:");
bprint(PRINT_HIGH, targ.classname);
bprint(PRINT_HIGH, " Frag:");
st = ftos(numfrags);
bprint(PRINT_HIGH, st);
bprint(PRINT_HIGH, " log:");
if (fraggetlog)
bprint(PRINT_HIGH, "yes");
else
bprint(PRINT_HIGH, "no");
bprint(PRINT_HIGH, " howgive:");
if (howgive == 1)
bprint(PRINT_HIGH, "real_frags");
else if (howgive == 2)
bprint(PRINT_HIGH, "frags");
else
bprint(PRINT_HIGH, "ERROR");
bprint(PRINT_HIGH, " real:");
if (chkreal)
bprint(PRINT_HIGH, "yes");
else
bprint(PRINT_HIGH, "no");
bprint(PRINT_HIGH, " vamp:");
if (chkvamp)
bprint(PRINT_HIGH, "yes");
else
bprint(PRINT_HIGH, "no");
bprint(PRINT_HIGH, "\n");
*/
if (atk.classname == "monster_army")
{
atk.frags = atk.frags + numfrags;
atk.real_frags = atk.real_frags;
}
else
{
if (howgive == 2)
atk.frags = atk.frags + numfrags;
else if (howgive == 1)
atk.real_frags = atk.real_frags + numfrags;
else
bprint(PRINT_HIGH, "Error in Give_Frags_Out!\n");
if (fraggetlog)
{
logfrag (targ, atk);
}
if (chkvamp)
{
if (teamplay & TEAMPLAY_VAMPIRE && targ) // handle when targ is cleared
{
targ.real_frags = targ.real_frags - numfrags;
if (!(toggleflags & TFLAG_TEAMFRAGS))
targ.frags = targ.real_frags;
}
}
#if 0
void (entity atk, entity targ, float numfrags, float howgive, float chkreal, float chkvamp) Give_Frags_Out =
{
if (chkreal)
if (howgive == 2)
atk.frags = atk.frags + numfrags;
else if (howgive == 1)
atk.real_frags = atk.real_frags + numfrags;
else
bprint(PRINT_HIGH, "Error in Give_Frags_Out!\n");
if (fraggetlog)
logfrag (targ, atk);
if (chkvamp)
{
if (teamplay & TEAMPLAY_VAMPIRE && targ) // handle when targ is cleared
{
if (!(toggleflags & TFLAG_TEAMFRAGS))
{
atk.frags = atk.real_frags;
}
targ.real_frags = targ.real_frags - numfrags;
if (!(toggleflags & TFLAG_TEAMFRAGS))
targ.frags = targ.real_frags;
}
}
if (attacker.classname == "player")
{
if (!(toggleflags & TFLAG_TEAMFRAGS))
{
atk.frags = atk.real_frags;
}
}
};
#endif
//replaces det guns
//classname to find, entity checking, (0-1) check for ownership
void(string search, entity person, float chkown) Find_And_Dmg =
@ -206,11 +184,11 @@ void(string search, entity person, float chkown) Find_And_Dmg =
if (chkown)
{
if (te.real_owner == person)
TF_T_Damage(te, NIL, NIL, te.health+100, 0, 0);
TF_T_Damage(te, person, person, te.health+100, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
else
{
TF_T_Damage(te, NIL, NIL, te.health+100, 0, 0);
TF_T_Damage(te, person, person, te.health+100, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
}
te = find(te, classname, search);
}

View file

@ -118,6 +118,18 @@ void() player_touch =
{
local entity Bio;
// are we stuck inside another object?
if (other.solid != SOLID_BSP && hullpointcontents(other, self.mins, self.maxs, self.origin) == CONTENTS_SOLID)
{
deathmsg = DMSG_PHYSICS;
if (other.takedamage) // kill it! aaah!
TF_T_Damage(other, NIL, NIL, other.health + 100, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
else
TF_T_Damage(self, NIL, NIL, other.health + 100, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
return;
}
// Spies and Scouts can uncloak enemy spies
// WK Or those with Spy kits & Scanners
if (invis_only == FALSE && (self.cutf_items & CUTF_SPY_KIT || other.cutf_items & CUTF_SPY_KIT))

View file

@ -34,9 +34,6 @@ shambler.qc
grunty.qc
wizard.qc
hknight.qc
knight.qc
warlock.qc
army.qc
@ -47,7 +44,6 @@ tesla.qc
field.qc
security.qc
teleport.qc
boss.qc
airfist.qc
@ -66,7 +62,6 @@ tforthlp.qc
tfortmap.qc
hook.qc
ctf.qc
coop.qc
actions.qc

View file

@ -683,6 +683,9 @@ void() Napalm_touch =
flame.touch = OnPlayerFlame_touch;
flame.owner = self.owner;
flame.AIRG_Flags = self.AIRG_Flags;
flame.AIRG_FlyTracker = self.AIRG_FlyTracker;
vtemp=self.origin;
setorigin(flame , vtemp);
@ -828,8 +831,8 @@ void() T_IncendiaryTouch =
Napalm_touch();
if (other.classname == "player")
stuffcmd(other, "bf\nbf\n");
if (IsBuilding(other))
TF_T_Damage (head, self, self.owner, 35, TF_TD_NOTTEAM, TF_TD_FIRE);
//if (IsBuilding(other)) //this made no sense
//TF_T_Damage (head, self, self.owner, 35, TF_TD_NOTTEAM, TF_TD_FIRE);
}
head = head.chain;

View file

@ -3,6 +3,7 @@
#include "defs.qh"
// Internal prototypes
integer(entity e) entpointcontents;
void() AntiGravGrenadeExplode; // antigrav goes boom
void() AntiGravGrenadeTimer; // controls antigrav decay or whatever you call it
void(entity inflictor, entity attacker, float bounce, entity ignore) T_RadiusAntiGrav; // bang
@ -212,7 +213,6 @@ void() ThrowC4Det =
newmis.owner = user;
newmis.movetype = MOVETYPE_BOUNCE;
newmis.solid = SOLID_BBOX;
newmis.solid = SOLID_TRIGGER;
newmis.classname = "detpack";
// for identify it on airfist pushable? routine
@ -320,7 +320,8 @@ void() MotionSensorTossTouch =
{
if (other || other == self.real_owner)
return;
if (pointcontents(self.origin) == CONTENTS_SKY || pointcontents(self.origin + '0 0 18') == CONTENTS_SKY || pointcontents(self.origin) == CONTENTS_SOLID)
local integer pc = entpointcontents(self);
if (pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
{
MotionSensorDie();
return;
@ -344,7 +345,7 @@ void() MotionSensorIdle =
if (MotionSensorFindTarget())
self.nextthink = time + 2.4; //if found wait 2.5 sec before do another check
else
self.nextthink = time + 0.05; // lots per sec
self.nextthink = time + 0.2; // lots per sec GR No, too hard to get past
self.think = MotionSensorIdle;
};
@ -375,7 +376,7 @@ float() MotionSensorFindTarget =
if (!client)
gotone = FALSE;
else if (!Pharse_Client(client, self, 1, trange, 0, 1))
else if (!Pharse_Client(client, self, 1, trange, 2, 1))
gotone = FALSE;
loopc = loopc + 1;
@ -391,6 +392,10 @@ float() MotionSensorFindTarget =
// Found a Target
self.enemy = client;
if (self.enemy.cutf_items & CUTF_JAMMER) // jammer makes it hard
{
}
/*if (self.enemy.classname != "player") // OfN - wtf does this?
{
@ -449,13 +454,13 @@ void() SensorBeAlarmed =
if (!(self.is_malfunctioning & SCREWUP_ONE))
sound(self, CHAN_WEAPON, "misc/enemy.wav", 1, ATTN_NORM);
self.nextthink = 2.4;
self.nextthink = time + 2.4;
}
else
{
self.think = MotionSensorIdle;
self.effects = 0;
self.nextthink = 1;
self.nextthink = time + 0.5;
///
self.skin=1;
}

View file

@ -227,7 +227,7 @@ void() Security_Camera_Spawn =
self.has_camera = TRUE;
newmis = spawn();
newmis.movetype = MOVETYPE_BOUNCE;
setsize (newmis, '-16 -16 -6', '16 16 10');
setsize (newmis, '-16 -16 -3', '16 16 5');
// setsize (newmis, '-8 -8 -8', '8 8 8');
newmis.solid = SOLID_BBOX;
newmis.takedamage = DAMAGE_AIM;
@ -268,7 +268,8 @@ void() SecurityCameraTossTouch =
{
if (other || other == self.real_owner)
return;
if (pointcontents(self.origin) == CONTENTS_SKY || pointcontents(self.origin + '0 0 12') == CONTENTS_SKY || pointcontents(self.origin) == CONTENTS_SOLID)
local integer pc = entpointcontents(self);
if (pc == CONTENTS_SOLID || pc == CONTENTS_SKY)
{
Security_Camera_Die();
return;

View file

@ -157,18 +157,6 @@ void() lvl3_sentry_atk5 =[ $lvl3_stand1, lvl3_sentry_atk4 ]
//=============
void() Sentry_Rotate =
{
/*
// don't let them exist in walls/doors
// FIXME: pointcontents is wrong for doors
local vector testpoint = self.origin;
if (self.tf_items & NIT_TURRET)
testpoint_z -= 40;
if (pointcontents (testpoint) == CONTENTS_SOLID) {
TF_T_Damage (self, NIL, NIL, self.health + 100,
TF_TD_IGNOREARMOUR, TF_TD_OTHER);
return;
}
*/
if (self.is_malfunctioning & SCREWUP_ONE)
{
@ -465,6 +453,11 @@ void(entity attacker, float damage) Sentry_Pain =
self.real_owner.StatusRefreshTime = time + 0.2;
//CH special sbar for eng.
self.real_owner.StatusBarScreen = 1;
if (self.attack_finished < time)
{
self.enemy = attacker;
Sentry_FoundTarget();
}
};
void() Sentry_Die =
@ -741,7 +734,7 @@ float(vector vec) BadSpot =
void() Sentry_Touch =
{
//WK Check for blockage
if (pointcontents(self.origin) == CONTENTS_SKY)
if (entpointcontents(self) == CONTENTS_SKY)
{
sprint(self.real_owner, PRINT_HIGH, "Your sentry gun flew away.\n");
Sentry_Die();

View file

@ -834,7 +834,7 @@ void() shambler_fire_touch =
sprint(self.owner.real_owner, PRINT_HIGH, ".\n");
#endif
if (pointcontents(self.origin) == CONTENTS_SKY)
if (entpointcontents(self) == CONTENTS_SKY)
{
self.owner.has_fieldgen += 1;
dremove(self);

16
spy.qc
View file

@ -20,6 +20,7 @@ void() T_TranqDartTouch;
void() TranquiliserTimer;
void() TranquiliserTimer2; //CH for demons
void(entity spy) Spy_RemoveDisguise;
float(entity p) Return_Custom_Skins;
// Spy Feign Death Handling
$cd /raid/quake/id1/models/player_4
@ -581,8 +582,14 @@ void(float class) TeamFortress_SpyChangeSkin =
{
local entity te;
if (!self.is_undercover)
{
self.undercover_team = 0;
self.undercover_skin = 0;
}
// If they're returning their skin to their Spy, just reset it
if (class == PC_SPY && self.playerclass == PC_SPY) //WK
if (class == PC_SPY && (Return_Custom_Skins(self) == PC_SPY || self.playerclass == PC_SPY)) //WK
{
sprint (self, PRINT_HIGH, "Skin reset.");
self.undercover_skin = 0;
@ -590,7 +597,6 @@ void(float class) TeamFortress_SpyChangeSkin =
if (self.undercover_team == 0)
{
//WK self.items = self.items & ~IT_INVISIBILITY;
self.is_undercover = 0;
}
return;
@ -617,6 +623,12 @@ void(float teamno) TeamFortress_SpyChangeColor =
local entity te;
local float tc, tc2;
if (!self.is_undercover) // prevent confusion
{
self.undercover_skin = 0;
self.undercover_team = 0;
}
// If they're returning their color to their own team, just reset it
if (teamno == self.team_no)
{

View file

@ -333,6 +333,13 @@ void(entity attacker, float damage) Tesla_Pain =
self.real_owner.StatusRefreshTime = time + 0.2;
//CH special sbar for eng.
self.real_owner.StatusBarScreen = 4;
if (!self.waitmax && self.health > 0)
{
self.enemy = attacker;
self.waitmax = 1;
Tesla_FoundTarget();
}
};
void() Tesla_Die =
@ -417,10 +424,13 @@ float() Tesla_Fire =
{
if (self.enemy.is_feigning)
return FALSE;
if (self.enemy.is_undercover)
#if 0 // pharse handles these two, we can still hit thieves and spies if they attack us. feign still fools us tho
if (self.enemy.is_undercover) //haha, even to their own team? yeah right. No thanks
return FALSE;
if (self.enemy.job & JOB_THIEF && self.enemy.job & JOB_ACTIVE)
if (self.enemy.job & JOB_THIEF && self.enemy.job & JOB_ACTIVE) // pharse handles this
return FALSE;
#endif
}
}
//CH rechecks if target is out of range, has a little extra room added.
@ -493,13 +503,9 @@ float() Tesla_Fire =
deathmsg = DMSG_TESLA;
// OfN - Check for force field
local float shoulddmg;
shoulddmg = TRUE;
traceline (self.origin, self.enemy.origin, FALSE, self);
if (trace_ent.classname == "force_field")
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_LIGHTNING2);
WriteEntity (MSG_MULTICAST, self);
@ -514,30 +520,14 @@ float() Tesla_Fire =
WriteCoord (MSG_MULTICAST, trace_endpos_z);
multicast (self.origin, MULTICAST_PHS);
shoulddmg = FALSE;
FieldExplosion(trace_ent,trace_endpos,trace_ent);
PutFieldWork(trace_ent);
}
else
{
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
WriteByte (MSG_MULTICAST, TE_LIGHTNING2);
WriteEntity (MSG_MULTICAST, self);
WriteCoord (MSG_MULTICAST, self.origin_x);
WriteCoord (MSG_MULTICAST, self.origin_y);
if (self.tf_items & NIT_TURRET)
WriteCoord (MSG_MULTICAST, self.origin_z + 10);
else
WriteCoord (MSG_MULTICAST, self.origin_z + 30);
WriteCoord (MSG_MULTICAST, self.enemy.origin_x);
WriteCoord (MSG_MULTICAST, self.enemy.origin_y);
WriteCoord (MSG_MULTICAST, self.enemy.origin_z);
multicast (self.origin, MULTICAST_PHS);
}
if (trace_ent.classname == "force_field")
{
FieldExplosion(trace_ent,trace_endpos,trace_ent);
PutFieldWork(trace_ent);
}
sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
if (vlen(self.enemy.origin - self.origin) >= 800 && shoulddmg) //Only play end sound if far away
if (vlen(self.enemy.origin - self.origin) >= 800 && vlen(trace_endpos - self.enemy.origin) <= 100) //Only play end sound if far away
sound (self.enemy, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM); //CH at start and end of arc
/*if (self.ammo_nails == 0) damage = 40;
@ -556,8 +546,16 @@ float() Tesla_Fire =
if (self.is_malfunctioning & SCREWUP_TWO) damage = 1;
//TF_T_Damage (self.enemy, self, self.real_owner, damage, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
if (shoulddmg)
TF_T_Damage (self.enemy, self, self, damage, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
//TF_T_Damage (self.enemy, self, self, damage, TF_TD_NOTTEAM, TF_TD_ELECTRICITY);
local vector org = self.origin;
if (self.tf_items & NIT_TURRET)
org_z += 10;
else
org_z += 30;
LightningDamage(org, self.enemy.origin, self, damage);
//self.nextthink = time + ReturnTeslaDelay();
//self.has_holo = time + ReturnTeslaDelay(); //?? wTF
@ -596,7 +594,7 @@ void() Tesla_Touch =
cheater = FALSE;
//WK Check for blockage
if (pointcontents(self.origin) == CONTENTS_SKY)
if (entpointcontents(self) == CONTENTS_SKY)
{
sprint(self.real_owner, PRINT_HIGH, "Your sentry gun flew away.\n");
Tesla_Die();
@ -637,15 +635,7 @@ void() Tesla_Touch =
if (self.tf_items & NIT_TURRET && self.movetype == MOVETYPE_FLY)
{
//WK Check to see if we are blocked
if (pointcontents(self.origin) == CONTENTS_SKY ||
//pointcontents(self.origin - '0 0 10') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 5') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 10') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 15') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 20') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 30') == CONTENTS_SKY ||
//pointcontents(self.origin + '0 0 40') == CONTENTS_SKY ||
pointcontents(self.origin + '0 0 70') == CONTENTS_SKY) //- OfN
if (entpointcontents(self) == CONTENTS_SKY)
{
sprint(self.real_owner, PRINT_HIGH, "Your tesla flew away.\n");
Tesla_Die();

View file

@ -1568,32 +1568,38 @@ void() TeamFortress_SetHealth =
//CH returns value for skin. used here and tfortmap.qc
float(entity p) Return_Custom_Skins =
{
if (p.cutf_items & CUTF_SPY_KIT) // want spy to always be spy
return PC_SPY;
if (p.cutf_items & (CUTF_DETPACK | CUTF_TOSSABLEDET))
return PC_DEMOMAN;
if (p.weapons_carried & WEAP_SNIPER_RIFLE)
return PC_SNIPER;
else if (p.weapons_carried & WEAP_ASSAULT_CANNON)
if (p.weapons_carried & WEAP_ASSAULT_CANNON)
return PC_HVYWEAP;
else if (p.weapons_carried & WEAP_ROCKET_LAUNCHER)
if (p.weapons_carried & WEAP_ROCKET_LAUNCHER)
return PC_SOLDIER;
else if (p.weapons_carried & WEAP_FLAMETHROWER)
if (p.weapons_carried & WEAP_FLAMETHROWER)
return PC_PYRO;
else if (p.weapons_carried & WEAP_GRENADE_LAUNCHER)
if (p.weapons_carried & WEAP_GRENADE_LAUNCHER)
return PC_DEMOMAN;
else if (p.weapons_carried & WEAP_MEDIKIT)
if (p.weapons_carried & WEAP_MEDIKIT)
return PC_MEDIC;
else if (p.weapons_carried & WEAP_SPANNER)
if (p.weapons_carried & WEAP_SPANNER)
return PC_ENGINEER;
else if (p.weapons_carried & WEAP_NAILGUN)
if (p.weapons_carried & WEAP_NAILGUN || p.weapons_carried & WEAP_AIRF || p.tf_items & NIT_HOVER_BOOTS)
return PC_SCOUT;
else if (p.job & JOB_GUERILLA)
if (p.job & JOB_GUERILLA)
return PC_DEMOMAN;
else if (p.custom_speed > 320 || p.job & JOB_RUNNER)
return PC_SCOUT;
else if (p.cutf_items & CUTF_SPY_KIT)
return PC_SPY;
else if (p.cutf_items & CUTF_SENTRYGUN || p.tf_items & NIT_TESLA)
if (p.job & JOB_HACKER)
return PC_ENGINEER;
else
return PC_SOLDIER;
if (p.job & JOB_THIEF)
return PC_SPY;
if (p.custom_speed > 320 || p.job & JOB_RUNNER)
return PC_SCOUT;
if (p.cutf_items & CUTF_SENTRYGUN || p.tf_items & NIT_TESLA)
return PC_ENGINEER;
return PC_SOLDIER;
};
//=========================================================================

View file

@ -3494,7 +3494,7 @@ void() item_flag_team2 =
dp.activate_goal_no = CTF_SCORE1;
dp.axhitme = CTF_FLAG2;
dp.count = 10;
dp.frags = 10;
dp.frags = 0;
dp.solid = SOLID_TRIGGER;
dp.goal_state = TFGS_INACTIVE;
setsize (dp, '-16 -16 -24', '16 16 32');
@ -3562,7 +3562,7 @@ void() item_flag_team1 =
dp.activate_goal_no = CTF_SCORE2;
dp.axhitme = CTF_FLAG1;
dp.count = 10;
dp.frags = 10;
dp.frags = 0;
dp.solid = SOLID_TRIGGER;
dp.goal_state = TFGS_INACTIVE;
setsize (dp, '-16 -16 -24', '16 16 32');

View file

@ -165,7 +165,8 @@ void() trigger_multiple =
self.th_die = multi_killed;
self.takedamage = DAMAGE_YES;
self.solid = SOLID_BBOX;
setorigin (self, self.origin); // make sure it links into the world
setmodel (self, self.model); // make sure it links into the world
// let's see if it actually does this time?
}
else
{

View file

@ -2804,7 +2804,9 @@ void() W_Attack =
return;
//WK Tranq does not remove disguise
if (self.is_undercover && (self.current_weapon != WEAP_TRANQ && self.current_weapon != WEAP_MAUSER))
//GR Spy can fire and keep their skin if not color-disguised.
if (self.is_undercover && (self.current_weapon != WEAP_TRANQ && self.current_weapon != WEAP_MAUSER)
&& (self.undercover_team != self.team_no))
Spy_RemoveDisguise(self);
if (self.job & JOB_THIEF && (self.job & JOB_ACTIVE || self.job & JOB_FULL_HIDE))
@ -3923,6 +3925,14 @@ void() DeadImpulses =
return;
}
if (self.impulse == 18)
{
sprint(self, PRINT_HIGH, "Your origin is: '", ftos(self.origin_x), " ", ftos(self.origin_y));
sprint(self, PRINT_HIGH, " ", ftos(self.origin_z), "'\n");
self.impulse=0;
return;
}
//<CH>
if (self.impulse == I_CHEAT_ONE) {

View file

@ -194,6 +194,8 @@ void() worldspawn =
lastspawn = world = self;
InitBodyQue ();
last_team_no = 5;
st = infokey(NIL, "mapcfg");
if (!(st == "0" || st == "off" || st == ""))
{
@ -615,3 +617,7 @@ void(entity ent) CopyToBodyQue =
};
integer(entity e) entpointcontents = {
return hullpointcontents(world, e.mins, e.maxs, e.origin);
};