r4690 - in trunk/data: qcsrc/server scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Oct 9 09:51:14 EDT 2008


Author: div0
Date: 2008-10-09 09:51:13 -0400 (Thu, 09 Oct 2008)
New Revision: 4690

Modified:
   trunk/data/qcsrc/server/cl_player.qc
   trunk/data/qcsrc/server/defs.qh
   trunk/data/qcsrc/server/g_damage.qc
   trunk/data/qcsrc/server/g_triggers.qc
   trunk/data/qcsrc/server/race.qc
   trunk/data/qcsrc/server/t_plats.qc
   trunk/data/scripts/entities.def
Log:
"message2" for hurt triggers


Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/cl_player.qc	2008-10-09 13:51:13 UTC (rev 4690)
@@ -496,7 +496,7 @@
 		// throw a weapon
 		SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
 		// print an obituary message
-		Obituary (attacker, self, deathtype);
+		Obituary (attacker, inflictor, self, deathtype);
 		race_PreDie();
 		DropAllRunes(self);
 		if(self == attacker)

Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/defs.qh	2008-10-09 13:51:13 UTC (rev 4690)
@@ -497,3 +497,5 @@
 void W_Porto_Remove (entity p);
 
 .float projectiledeathtype;
+
+.string message2;

Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/g_damage.qc	2008-10-09 13:51:13 UTC (rev 4690)
@@ -146,7 +146,7 @@
 	GameLogEcho(s);
 }
 
-void Obituary (entity attacker, entity targ, float deathtype)
+void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 {
 	string	s, a;
 	float p;
@@ -315,8 +315,14 @@
 						bprint ("^1",s, "^1 was shot into space by ", a, "\n");
 					else if (deathtype == DEATH_SWAMP)
 						bprint ("^1",s, "^1 was conserved by ", a, "\n");
-					else if (deathtype == DEATH_HURTTRIGGER)
-						bprint ("^1",s, "^1 was thrown into a world of hurt by ", a, "\n");
+					else if (deathtype == DEATH_HURTTRIGGER && attacker.message2 != "")
+					{
+						p = strstrofs(inflictor.message2, "#", 0);
+						if(p < 0)
+							bprint("^1", s, "^1 ", inflictor.message2, " ", a, "\n");
+						else
+							bprint("^1", s, "^1 ", substring(inflictor.message2, 0, p), a, "^1", substring(inflictor.message2, p+1, strlen(inflictor.message2) - (p+1)), "\n");
+					}
                     else if(deathtype == DEATH_TURRET)
                         bprint ("^1",s, "^1 was pushed into the line of fire by ^1", a, "\n");
 					else

Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/g_triggers.qc	2008-10-09 13:51:13 UTC (rev 4690)
@@ -402,7 +402,9 @@
 	if (!self.dmg)
 		self.dmg = 1000;
 	if (!self.message)
-		self.message = "was in the wrong place.";
+		self.message = "was in the wrong place";
+	if (!self.message2)
+		self.message2 = "was thrown into a world of hurt by";
 
 	if(!trigger_hurt_first)
 		trigger_hurt_first = self;
@@ -923,6 +925,8 @@
 			self.colormod = '1 0 0';
 	if(!self.message)
 		self.message = "saw the light";
+	if (!self.message2)
+		self.message2 = "was pushed into a laser by";
 	self.think = misc_laser_think;
 	self.nextthink = time;
 	InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);

Modified: trunk/data/qcsrc/server/race.qc
===================================================================
--- trunk/data/qcsrc/server/race.qc	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/race.qc	2008-10-09 13:51:13 UTC (rev 4690)
@@ -420,6 +420,8 @@
 
 	if(!self.message)
 		self.message = "went backwards";
+	if (!self.message2)
+		self.message2 = "was pushed backwards by";
 	
 	self.race_checkpoint = self.cnt;
 

Modified: trunk/data/qcsrc/server/t_plats.qc
===================================================================
--- trunk/data/qcsrc/server/t_plats.qc	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/qcsrc/server/t_plats.qc	2008-10-09 13:51:13 UTC (rev 4690)
@@ -163,7 +163,9 @@
         self.dmg = 10000;
 
     if(self.dmg && (!self.message))
-		self.message = "was in the wrong place.";
+		self.message = "was squished";
+    if(self.dmg && (!self.message2))
+		self.message2 = "was squished by";
 
 	if (self.sounds == 1)
 	{
@@ -334,7 +336,9 @@
 		self.avelocity = '0 1 0' * self.speed;
 
     if(self.dmg & (!self.message))
-        self.message = " was in the wrong place.";
+        self.message = " was squished";
+    if(self.dmg && (!self.message2))
+		self.message2 = "was squished by";
 
 
     if(self.dmg && (!self.dmgtime))
@@ -399,7 +403,9 @@
 	// damage when blocked
 	self.blocked = bobbing_blocked;
 	if(self.dmg & (!self.message))
-		self.message = " was in the wrong place.";
+		self.message = " was squished";
+    if(self.dmg && (!self.message2))
+		self.message2 = "was squished by";
 	if(self.dmg && (!self.dmgtime))
 		self.dmgtime = 0.25;
 	self.dmgtime2 = time;
@@ -808,7 +814,7 @@
 
 	self.owner.attack_finished_single = time + 2;
 
-	if (self.owner.message != "")
+	if (!self.dmg && self.owner.message != "")
 	{
 		if (other.flags & FL_CLIENT)
 			centerprint (other, self.owner.message);
@@ -996,11 +1002,11 @@
     if(self.spawnflags & 8)
         self.dmg = 10000;
 
-    if(self.dmg & (!self.message))
-		self.message = "was in the wrong place.";
+    if(self.dmg && (!self.message))
+		self.message = "was squished";
+    if(self.dmg && (!self.message2))
+		self.message2 = "was squished by";
 
-
-
 	if (self.sounds > 0)
 	{
 		precache_sound ("plats/medplat1.wav");

Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def	2008-10-09 11:29:03 UTC (rev 4689)
+++ trunk/data/scripts/entities.def	2008-10-09 13:51:13 UTC (rev 4690)
@@ -51,6 +51,7 @@
 dmg: damage a player who gets crushed by it receives
 dmgtime: interval to apply dmg to a player who is s in the way
 message: death message when a player gets crushed
+message2: death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 -------- SPAWNFLAGS --------
 X_AXIS: entity will bob along the X axis.
 Y_AXIS: entity will bob along the Y axis.
@@ -71,7 +72,8 @@
 Normal sliding door entity. By default, the door will activate when player walks close to it or when damage is inflicted to it.
 If DOOR_DONT_LINK is not set, the door will be linked with all doors it touches.
 -------- KEYS --------
-message: is printed when the door is touched if it is a trigger door and it hasn't been fired yet
+message: is printed when the door is touched if it is a trigger door and it hasn't been fired yet, or death message if dmg is set
+message2: death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 angle: determines the opening direction
 targetname: if set, no touch field will be spawned and a remote button or trigger field activates the door.
 health: if set, door must be shot open
@@ -97,7 +99,8 @@
 t_width: override WIDTH to move back (or height if going down)
 t_length: override LENGTH to move sideways
 dmg: damage to inflict when blocked (2 default)
-message: text to display when activating the door
+message: text to display when activating the door, or death message if dmg is set
+message2: death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 noise1: sound when opening backwards or closing
 noise2: sound when opening sideways
 noise3: sound when stopping
@@ -140,6 +143,7 @@
 sound1: platform starts moving sound
 sound2: platform stop sound
 message: kill message, when someone gets killed by this plat
+message2: death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 -------- SPAWNFLAGS --------
 CRUSH: crush players hit by the platform instantly
 -------- NOTES --------
@@ -163,6 +167,7 @@
 dmg: Do this much dmg every .dmgtime interval when blocked
 dmgtime: See above. (0.25s default)
 message: kill message when crushed by this
+message2: death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 -------- SPAWNFLAGS --------
 X_AXIS: rotate around the X axis
 Y_AXIS: rotate around the Y axis
@@ -736,7 +741,8 @@
 Has the useful effect of automatically returning flags, keys and runes when they touch it.
 -------- KEYS --------
 dmg: amount of damage to deal (default: 1000)
-message: kill message when someone gets killed by this (default: "was in the wrong place.")
+message: kill message when someone gets killed by this (default: "was in the wrong place")
+message2: kill message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 */
 
 /*QUAKED trigger_impulse (.5 .5 .5) ? 
@@ -955,6 +961,7 @@
 -------- KEYS --------
 cnt: Number of the checkpoint. 0 for finish line, and at least two other checkpoints have to exist. They MUST be touched in sequential order!
 message: Death message, when touching checkpoints in the wrong order.
+message2: Death message when someone gets pushed into this (default: "was thrown into a world of hurt by"). The # character is replaced by the attacker name if present (and it instead does not get appended to the end)
 targetname: Name of the checkpoint. info_player_race can target this to assign a spawn to a checkpoint. Also used for triggering a checkpoint by an event.
 target: when the checkpoint is passed, these entities are triggered. Useful for forcing items in certain areas using trigger_items
 -------- SPAWNFLAGS --------




More information about the nexuiz-commits mailing list