mirror of
https://git.code.sf.net/p/quake/prozac-qfcc
synced 2025-01-18 23:51:53 +00:00
Make sure we get correct glows always, as well, make chaplan not glow people and not give them quad >_<
This commit is contained in:
parent
b0d2f7faa0
commit
78630514c9
8 changed files with 52 additions and 64 deletions
10
client.qc
10
client.qc
|
@ -2136,9 +2136,7 @@ void() PutClientInServer =
|
|||
//WK Give them invincibility if they are a normal class or bought it
|
||||
if ((self.playerclass >= PC_SCOUT && self.playerclass <= PC_RANDOM) ||
|
||||
self.tf_items & NIT_RESPAWN_GUARD) {
|
||||
self.items = self.items & IT_INVULNERABILITY;
|
||||
self.invincible_time = 1;
|
||||
self.invincible_finished = time + RESPAWN_GUARD_TIME;
|
||||
GivePent (self, RESPAWN_GUARD_TIME);
|
||||
if (self.custom_speed > 300)
|
||||
self.invincible_finished = self.invincible_finished - 1;
|
||||
if (self.custom_speed > 400)
|
||||
|
@ -2987,7 +2985,7 @@ void() CheckPowerups =
|
|||
if (self.tfstate & TFSTATE_INVINCIBLE)
|
||||
{
|
||||
if (self.invincible_finished < time + 10)
|
||||
self.invincible_finished = time + 666;
|
||||
GivePent (self, 666);
|
||||
}
|
||||
|
||||
// sound and screen flash when items starts to run out
|
||||
|
@ -3025,8 +3023,8 @@ void() CheckPowerups =
|
|||
// If this is being given by a goalitem, extend the time
|
||||
if (self.tfstate & TFSTATE_QUAD)
|
||||
{
|
||||
if (self.super_damage_finished == time + 10)
|
||||
self.super_damage_finished = time + 666;
|
||||
if (self.super_damage_finished < time + 10) // was ==, WTF?
|
||||
GiveQuad (self, 666);
|
||||
}
|
||||
|
||||
// sound and screen flash when items starts to run out
|
||||
|
|
22
combat.qc
22
combat.qc
|
@ -401,10 +401,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
|
|||
output = ftos(dist);
|
||||
if (dist > CHAPLAN_RADIUS) { //We've strayed from the flock
|
||||
sprint(attacker,PRINT_HIGH,"You have strayed from the flock\n");
|
||||
attacker.tfstate = attacker.tfstate - TFSTATE_INSPIRED;
|
||||
attacker.super_damage_finished = 0;
|
||||
attacker.items = attacker.items & ~IT_QUAD;
|
||||
attacker.effects &= ~EF_ANYGLOW;
|
||||
attacker.tfstate &= ~TFSTATE_INSPIRED;
|
||||
}
|
||||
}
|
||||
if (targ.classname == "player" && targ.tfstate & TFSTATE_INSPIRED) {
|
||||
|
@ -412,30 +409,25 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
|
|||
if (dist > CHAPLAN_RADIUS) { //We've strayed from the flock
|
||||
sprint(targ,PRINT_HIGH,"You have strayed from the flock\n");
|
||||
targ.tfstate = targ.tfstate - TFSTATE_INSPIRED;
|
||||
targ.super_damage_finished = 0;
|
||||
targ.items = targ.items & ~IT_QUAD;
|
||||
targ.effects &= ~EF_ANYGLOW;
|
||||
}
|
||||
}
|
||||
|
||||
// QUAD DAMAGE
|
||||
if (attacker.super_damage_finished > time) {
|
||||
if (attacker.tfstate & TFSTATE_INSPIRED)
|
||||
damage = damage * 1.5;
|
||||
if (attacker.job & JOB_BERSERKER && attacker.job & JOB_ACTIVE)
|
||||
damage = damage * 2;
|
||||
else
|
||||
damage = damage * 2;
|
||||
else
|
||||
damage = damage * 4;
|
||||
}
|
||||
|
||||
if (attacker.aura == AURA_POWER)
|
||||
if ((attacker.tfstate & TFSTATE_INSPIRED) || (attacker.aura == AURA_POWER))
|
||||
damage = damage * 1.5;
|
||||
|
||||
if (targ.aura == AURA_RESISTANCE) {
|
||||
damage = damage * 0.66;
|
||||
if (self.invincible_sound < time) {
|
||||
if (targ.invincible_sound < time) {
|
||||
sound (targ, CHAN_ITEM, "auras/aura1.wav", 1, ATTN_NORM);
|
||||
self.invincible_sound = time + 1.5;
|
||||
targ.invincible_sound = time + 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -449,7 +441,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
|
|||
damage = damage * 0.66;
|
||||
//WK Ping fairness code. LPB is < 200 ping
|
||||
//haha, yeah right.
|
||||
#if 0
|
||||
#ifdef OVER_MY_DEAD_BODY //GR
|
||||
if (attacker.classname == "player" && targ.classname == "player" && attacker != targ)
|
||||
{
|
||||
foo = infokey(attacker,"ping");
|
||||
|
|
|
@ -396,9 +396,7 @@ void() DropFromCustomClassGen =
|
|||
|
||||
//Make them invincible if they bought respawn protection
|
||||
if (self.tf_items & NIT_RESPAWN_GUARD) {
|
||||
self.items = self.items & IT_INVULNERABILITY;
|
||||
self.invincible_time = 1;
|
||||
self.invincible_finished = time + RESPAWN_GUARD_TIME;
|
||||
GivePent (self, RESPAWN_GUARD_TIME);
|
||||
if (self.custom_speed > 300)
|
||||
self.invincible_finished = self.invincible_finished - 1;
|
||||
if (self.custom_speed > 400)
|
||||
|
|
4
defs.qh
4
defs.qh
|
@ -97,6 +97,8 @@
|
|||
#define IT_QUAD 4194304
|
||||
#define IT_HOOK 8388608
|
||||
|
||||
#define IT_ITEMS (IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD)
|
||||
|
||||
// point content values
|
||||
|
||||
#define CONTENTS_EMPTY -1
|
||||
|
@ -188,6 +190,8 @@
|
|||
#define EF_ANYGLOW (EF_BRIGHTLIGHT | EF_DIMLIGHT | EF_RED | EF_BLUE)
|
||||
|
||||
float (entity e) EF_GlowColor;
|
||||
void (entity e, float secs) GivePent;
|
||||
void (entity e, float secs) GiveQuad;
|
||||
|
||||
// network writes. argument to Write*
|
||||
#define MSG_ONE 1 // reliable to one (msg_entity)
|
||||
|
|
11
items.qc
11
items.qc
|
@ -1672,8 +1672,7 @@ void() powerup_touch =
|
|||
|
||||
if (self.classname == "item_artifact_invulnerability")
|
||||
{
|
||||
other.invincible_time = 1;
|
||||
other.invincible_finished = time + 30;
|
||||
GivePent (other, 30);
|
||||
}
|
||||
|
||||
if (self.classname == "item_artifact_invisibility")
|
||||
|
@ -1684,15 +1683,9 @@ void() powerup_touch =
|
|||
|
||||
if (self.classname == "item_artifact_super_damage")
|
||||
{
|
||||
other.super_time = 1;
|
||||
other.super_damage_finished = time + 30;
|
||||
//WK Remove Inspiration when we get the real thing
|
||||
other.tfstate = other.tfstate - (other.tfstate & TFSTATE_INSPIRED);
|
||||
GiveQuad (other, 30);
|
||||
}
|
||||
|
||||
other.effects &= ~EF_ANYGLOW;
|
||||
other.effects |= EF_GlowColor (other);
|
||||
|
||||
activator = other;
|
||||
SUB_UseTargets(); // fire all targets / killtargets
|
||||
};
|
||||
|
|
17
jobs.qc
17
jobs.qc
|
@ -213,7 +213,7 @@ void() JobWarlock =
|
|||
*/
|
||||
#define GUIDE_TIME 1 //Period of how often lightning guides are shown. Must be less than...
|
||||
#define CHAPLAN_TIME 1 //Period of seconds how often it fires
|
||||
#define INSPIRE_TIME 6 //How long someone stays inspired
|
||||
//#define INSPIRE_TIME 6 //How long someone stays inspired
|
||||
#define CHAPLAN_RADIUS 320 //About the radius of brightglow
|
||||
#define CHAPLAN_HEAL 50 //If you have a medikit you'll heal friends this much
|
||||
#define CHAPLAN_HEAL_DELAY 3 //You can't have been shot in last three seconds to be healed
|
||||
|
@ -248,19 +248,14 @@ void() ChaplanInspire = {
|
|||
else if (head.classname == "player" && //Person who is...
|
||||
Teammate(head.team_no,self.team_no) && //Same Team
|
||||
head != self && //Not me
|
||||
!(head.is_undercover) && //Not a spy
|
||||
!(head.job & JOB_CHAPLAN) && //Not a chaplan
|
||||
head.playerclass != PC_CIVILIAN && //KK
|
||||
//... and not Quadded
|
||||
!(head.items & IT_QUAD && !(head.tfstate & TFSTATE_INSPIRED))
|
||||
)
|
||||
{
|
||||
head.items = head.items | IT_QUAD;
|
||||
head.inspirator = self; //We are their designated preacherman
|
||||
head.super_time = 1;
|
||||
if (head.super_damage_finished < time + INSPIRE_TIME)
|
||||
head.super_damage_finished = time + INSPIRE_TIME;
|
||||
head.tfstate = head.tfstate | TFSTATE_INSPIRED;
|
||||
head.tfstate |= TFSTATE_INSPIRED;
|
||||
//Heal them if we have automedic too
|
||||
//SB amended to medikit since there is no automedic now
|
||||
if ((self.weapons_carried & WEAP_MEDIKIT) && (self.last_attacked_time < time + CHAPLAN_HEAL_DELAY)) {
|
||||
|
@ -278,6 +273,8 @@ void() ChaplanInspire = {
|
|||
|
||||
//Draws lightning bolts towards all the friendlies we're inspiring
|
||||
//entity(entity start, .string fld, string match) find = #18;
|
||||
//Let's not and say we did, too confusing with scanner -GR
|
||||
#if 0
|
||||
void() ChaplanGuides = {
|
||||
local entity head;
|
||||
head = find(NIL,classname,"player");
|
||||
|
@ -300,13 +297,13 @@ void() ChaplanGuides = {
|
|||
head = find(head,classname,"player");
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
void() ChaplanThink = {
|
||||
local entity oself;
|
||||
oself = self;
|
||||
self = self.owner;
|
||||
|
||||
ChaplanGuides();
|
||||
oself.nextthink = time + GUIDE_TIME;
|
||||
oself.frags = oself.frags + GUIDE_TIME;
|
||||
if (oself.frags >= CHAPLAN_TIME) { //Do the full thing every second
|
||||
|
@ -414,9 +411,7 @@ void() JobMartyr =
|
|||
martyr_time = MARTYR_TIME; // don't need FORCED stuff since it's always automatic
|
||||
|
||||
sprint(self,PRINT_HIGH,"Beginning your suicide run...\n");
|
||||
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
|
||||
GivePent (self, martyr_time + 1);
|
||||
self.job = self.job | JOB_ACTIVE; //why not?
|
||||
|
||||
tWeapon = spawn();
|
||||
|
|
38
player.qc
38
player.qc
|
@ -1530,8 +1530,7 @@ float(entity e) EF_GlowColor =
|
|||
{
|
||||
local float ret = 0;
|
||||
|
||||
if (e.classname == "player")
|
||||
{
|
||||
if (e.classname == "player") {
|
||||
local entity te = NIL;
|
||||
|
||||
te = find(NIL, classname, "item_tfgoal");
|
||||
|
@ -1540,14 +1539,7 @@ float(entity e) EF_GlowColor =
|
|||
{
|
||||
if (te.owner == e && (te.goal_activation & TFGI_GLOW))
|
||||
{
|
||||
local float teamno = 0;
|
||||
|
||||
if (te.owned_by == 1)
|
||||
ret |= EF_BLUE;
|
||||
else if (te.owned_by == 2)
|
||||
ret |= EF_RED;
|
||||
else if (!ret)
|
||||
ret = EF_DIMLIGHT;
|
||||
ret |= EF_GlowColor (e);
|
||||
}
|
||||
|
||||
te = find(te, classname, "item_tfgoal");
|
||||
|
@ -1558,15 +1550,15 @@ float(entity e) EF_GlowColor =
|
|||
if (e.invincible_finished)
|
||||
ret |= EF_RED;
|
||||
if ((e.job & (JOB_CHAPLAN | JOB_ACTIVE)) == (JOB_CHAPLAN | JOB_ACTIVE))
|
||||
ret |= EF_BLUE | EF_BRIGHTLIGHT;
|
||||
ret |= EF_BRIGHTLIGHT;
|
||||
|
||||
if (ret & (EF_BLUE | EF_RED))
|
||||
ret &= ~EF_DIMLIGHT;
|
||||
|
||||
e.effects |= ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
else if (e.classname == "item_tfgoal")
|
||||
{
|
||||
} else if (e.classname == "item_tfgoal") {
|
||||
if (e.owned_by)
|
||||
{
|
||||
if (e.owned_by == 1)
|
||||
|
@ -1585,3 +1577,21 @@ float(entity e) EF_GlowColor =
|
|||
return EF_DIMLIGHT;
|
||||
}
|
||||
};
|
||||
|
||||
void(entity e, float secs) GivePent =
|
||||
{
|
||||
e.items |= IT_INVULNERABILITY;
|
||||
e.invincible_finished = time + secs;
|
||||
e.invincible_time = 1;
|
||||
e.effects &= ~EF_ANYGLOW;
|
||||
e.effects |= EF_GlowColor (e);
|
||||
};
|
||||
|
||||
void(entity e, float secs) GiveQuad =
|
||||
{
|
||||
e.items |= IT_QUAD;
|
||||
e.super_damage_finished = time + secs;
|
||||
e.super_time = 1;
|
||||
e.effects &= ~EF_ANYGLOW;
|
||||
e.effects |= EF_GlowColor (e);
|
||||
};
|
||||
|
|
10
tfortmap.qc
10
tfortmap.qc
|
@ -1056,9 +1056,7 @@ void(entity Goal, entity Player, entity AP, float addb) Apply_Results =
|
|||
// Apply any powerups
|
||||
if (Goal.invincible_finished > 0)
|
||||
{
|
||||
Player.items = Player.items | IT_INVULNERABILITY;
|
||||
Player.invincible_time = 1;
|
||||
Player.invincible_finished = time + Goal.invincible_finished;
|
||||
GivePent (Player, Goal.invincible_finished);
|
||||
// if its a GoalItem, powerup is permanent, so we use TFSTATE flags
|
||||
if (Goal.classname == "item_tfgoal")
|
||||
{
|
||||
|
@ -1082,9 +1080,7 @@ void(entity Goal, entity Player, entity AP, float addb) Apply_Results =
|
|||
{
|
||||
//WK Remove Inspiration when we get the real thing
|
||||
Player.tfstate = Player.tfstate - (Player.tfstate & TFSTATE_INSPIRED);
|
||||
Player.items = Player.items | IT_QUAD;
|
||||
Player.super_time = 1;
|
||||
Player.super_damage_finished = time + Goal.super_damage_finished;
|
||||
GiveQuad (Player, Goal.super_damage_finished);
|
||||
// if its a GoalItem, powerup is permanent, so we use TFSTATE flags
|
||||
if (Goal.classname == "item_tfgoal")
|
||||
{
|
||||
|
@ -3071,7 +3067,9 @@ void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer =
|
|||
else if (Item.goal_activation & TFGI_DROP)
|
||||
{
|
||||
tfgoalitem_drop(Item);
|
||||
Item.owner = NIL;
|
||||
AP.effects |= EF_GlowColor(AP);
|
||||
Item.owner = AP;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue