Module dpmod: Change committed

havoc at icculus.org havoc at icculus.org
Tue Nov 19 02:50:03 EST 2002


Commiter   : havoc
CVSROOT    : /cvs/cvsroot/twilight
Module     : dpmod
Commit time: 2002-11-19 07:50:02 UTC

Log message:

Quad has become Fury once again...  Fury is a vampiric quad with rapidly rotting health.

Modified files:
     qc/client.qc qc/regen.qc qc/item_artifacts.qc qc/t_damage.qc

------=MIME.03ca866b12011cc03c7a670103acd191
Content-Type: text/plain; name="dpmod.20021119.075002.havoc.diff"
Content-Disposition: attachment; filename="dpmod.20021119.075002.havoc.diff"
Content-Transfer-Encoding: 8bit

Index: dpmod/qc/client.qc
diff -u dpmod/qc/client.qc:1.2 dpmod/qc/client.qc:1.3
--- dpmod/qc/client.qc:1.2	Fri Nov 15 07:59:54 2002
+++ dpmod/qc/client.qc	Tue Nov 19 02:49:52 2002
@@ -1220,7 +1220,7 @@
 	}
 
 	self.effects = self.effects - (self.effects & (EF_BLUE + EF_RED + EF_DIMLIGHT + EF_ADDITIVE/* + EF_REFLECTIVE*/));
-	self.items = self.items - (self.items & (IT_INVISIBILITY + IT_INVULNERABILITY + IT_QUAD + IT_SUIT));
+	self.items = self.items - (self.items & (IT_INVISIBILITY + IT_INVULNERABILITY + /*IT_QUAD + */IT_SUIT));
 
 	// invisibility
 	if (self.invisible_finished)
@@ -1294,6 +1294,7 @@
 	if (self.invincible_finished > time)
 		self.effects = self.effects | (EF_RED/* + EF_REFLECTIVE*/);
 
+	/*
 	// super damage
 	if (self.super_damage_finished)
 	{
@@ -1325,7 +1326,8 @@
 			self.super_time = 0;
 		}
 	}
-	if (self.super_damage_finished > time)
+	*/
+	if (self.items & IT_QUAD)
 		self.effects = self.effects | (EF_BLUE/* + EF_REFLECTIVE*/);
 
 	// suit
Index: dpmod/qc/item_artifacts.qc
diff -u dpmod/qc/item_artifacts.qc:1.2 dpmod/qc/item_artifacts.qc:1.3
--- dpmod/qc/item_artifacts.qc:1.2	Fri Sep 20 01:36:16 2002
+++ dpmod/qc/item_artifacts.qc	Tue Nov 19 02:49:52 2002
@@ -60,8 +60,13 @@
 
 	if (self.items & IT_QUAD)
 	{
+		/*
 		other.super_time = 1;
 		other.super_damage_finished = time + 30;
+		*/
+		other.rotthink = time + 1;
+		if (other.health < HEALTHMEGAMAX)
+			other.health = min(other.health + 100, HEALTHMEGAMAX);
 	}
 
 	activator = other;
@@ -133,7 +138,8 @@
 	precache_sound ("items/damage3.wav");
 	self.noise = "items/damage.wav";
 	setmodel (self, "progs/quaddama.mdl");
-	self.netname = "You got the Quad Damage!\n";
+	//self.netname = "You got the Quad Damage!\n";
+	self.netname = "You got the Fury!\n";
 	self.items = IT_QUAD;
 	setsize (self, '-16 -16 -24', '16 16 32');
 
Index: dpmod/qc/regen.qc
diff -u dpmod/qc/regen.qc:1.1.1.1 dpmod/qc/regen.qc:1.2
--- dpmod/qc/regen.qc:1.1.1.1	Thu Sep 19 15:07:47 2002
+++ dpmod/qc/regen.qc	Tue Nov 19 02:49:52 2002
@@ -5,45 +5,66 @@
 void() RegenStuff =
 {
 	local float b;
-	if (time > self.rotthink)
+	if (!self.deadflag)
 	{
-		self.rotthink = time + 1;
-		// rot health
-		if (self.health > self.max_health)
+		if (time > self.rotthink)
 		{
-			self.health = self.health - 1;
-			if (self.health < self.max_health)
-				self.health = self.max_health;
-		}
-		/*
-		// rot armor
-		if (self.armorvalue > ARMORMAX)
-		{
-			self.armorvalue = self.armorvalue - 1;
-			if (self.armorvalue < ARMORMAX)
-				self.armorvalue = ARMORMAX;
-		}
-		*/
-	}
-	if (time > self.regenthink)
-	{
-		if (deathmatch)
-			self.regenthink = time + 0.1;
-		else
-			self.regenthink = time + 0.25;
-		if (!self.deadflag)
-		{
-			if (self.health < self.max_health)
+			// rot health
+			if (self.items & IT_QUAD) // Fury drains health very quickly
 			{
-				self.health = self.health + 1;
+				self.rotthink = time + 0.2;
+				if (self.health > 1)
+				{
+					self.health = self.health - 1;
+					if (self.health < 1)
+						self.health = 1;
+				}
+				else
+				{
+					self.items = self.items - IT_QUAD;
+					sprint(self, "Fury has left you weak.\n");
+				}
+			}
+			else
+			{
+				self.rotthink = time + 1;
 				if (self.health > self.max_health)
-					self.health = self.max_health;
+				{
+					self.health = self.health - 1;
+					if (self.health < self.max_health)
+						self.health = self.max_health;
+				}
+			}
+			/*
+			// rot armor
+			if (self.armorvalue > ARMORMAX)
+			{
+				self.armorvalue = self.armorvalue - 1;
+				if (self.armorvalue < ARMORMAX)
+					self.armorvalue = ARMORMAX;
 			}
-			if (self.bodyhealth < self.health + 100)
+			*/
+		}
+		if (time > self.regenthink)
+		{
+			if (deathmatch)
+				self.regenthink = time + 0.1;
+			else
+				self.regenthink = time + 0.25;
+			if (!(self.items & IT_QUAD)) // no healing with Fury
 			{
-				self.bodyhealth = self.bodyhealth + 2;
-				if (self.bodyhealth > self.health + 100)
-					self.bodyhealth = self.health + 100;
+				if (self.health < self.max_health)
+				{
+					self.health = self.health + 1;
+					if (self.health > self.max_health)
+						self.health = self.max_health;
+				}
+				if (self.bodyhealth < self.health + 100)
+				{
+					self.bodyhealth = self.bodyhealth + 2;
+					if (self.bodyhealth > self.health + 100)
+						self.bodyhealth = self.health + 100;
+				}
 			}
 		}
 	}
Index: dpmod/qc/t_damage.qc
diff -u dpmod/qc/t_damage.qc:1.3 dpmod/qc/t_damage.qc:1.4
--- dpmod/qc/t_damage.qc:1.3	Fri Nov 15 07:59:54 2002
+++ dpmod/qc/t_damage.qc	Tue Nov 19 02:49:52 2002
@@ -124,9 +124,9 @@
 .float  regenthink; // next time player will regen some health
 void(entity targ, entity inflictor, entity attacker, float healthdamage, float damage, string dethtype, float damgtype, vector damgpoint, vector force, void(entity t, entity a, string m, float dtyp) obitfunc) T_Damage =
 {
-	local   vector  dir;
-	local	entity	oldself;
-	local   float   save, htake, take, ratio;
+	local vector dir;
+	local entity oldself;
+	local float save, htake, take, ratio, f;
 
 	oldself = self;
 
@@ -217,10 +217,10 @@
 //		if (attacker.items & IT_QUAD)
 //			damage = damage * 4;
 
-		// save damage based on the target's armor level        
+		// save damage based on the target's armor level
 		save = 0;
 		if (damgtype & DTF_ARMOR)
-			save = ceil(targ.armortype * damage);
+			save = targ.armortype * damage;
 		if (targ.team > 0)
 		if (targ.team == attacker.team)
 		if (teamplay == 1 || teamplay == 3)
@@ -232,16 +232,16 @@
 		if (save > targ.armorvalue)
 			save = targ.armorvalue;
 		targ.armorvalue = targ.armorvalue - save;
-		take = ceil(damage-save); // body damage
+		take = damage - save; // body damage
 		if (take < 0)
 			take = 0;
 
-		if (take < 1)
-		if (save < 1)
+		if (take < 0.01)
+		if (save < 0.01)
 			return; // no damage to do
 
-		htake = ceil((damage-save) * ratio); // health damage
-		if (htake < 1) htake = 1;
+		htake = take * ratio; // health damage
+		if (htake < 0.01) htake = 0.01;
 
 		if (targ.bleedfunc) // telefrag doesn't cause bleeding
 		{
@@ -275,6 +275,21 @@
 
 		if (targ.flags & FL_GODMODE)
 			return;
+
+		if (attacker.items & IT_QUAD) // Fury is vampiric
+		if (attacker.classname == "player")
+		if (targ.iscreature)
+		if (targ != attacker)
+		if (targ.health > 0)
+		{
+			f = 0.1;
+			if (targ.classname == "player")
+				f = 0.5;
+			f = attacker.health + min(htake, targ.health) * f;
+			f = min(f, HEALTHMEGAMAX);
+			attacker.health = max(f, attacker.health);
+		}
+
 		// do the damage
 		targ.health = targ.health - htake;
 //		if (damgtype & DTF_RESIST_EXPLOSIVE)
@@ -311,7 +326,7 @@
 
 	if ((self.flags & FL_MONSTER) && attacker != world) // get mad unless of the same class (except for soldiers)
 	if (self != attacker && attacker != self.enemy)
-	if (self.classname != attacker.classname || self.classname == "monster_army") 
+	if (self.classname != attacker.classname || self.classname == "monster_army")
 //	//if (attacker.classname == "player")
 	if (attacker.takedamage)
 	if (attacker.havocattack == TRUE)
@@ -328,7 +343,7 @@
 		// nightmare mode monsters don't go into pain frames often
 		if (skill >= 3)
 		if (self.flags & FL_MONSTER)
-			self.pain_finished = time + 5;		
+			self.pain_finished = time + 5;
 	}
 
 	self = oldself;


More information about the twilight-commits mailing list