r2060 - in branches/nexuiz-2.0/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Dec 21 04:44:39 EST 2006
Author: div0
Date: 2006-12-21 04:44:39 -0500 (Thu, 21 Dec 2006)
New Revision: 2060
Modified:
branches/nexuiz-2.0/data/default.cfg
branches/nexuiz-2.0/data/qcsrc/server/t_plats.qc
Log:
door crusher patch
Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg 2006-12-21 04:59:15 UTC (rev 2059)
+++ branches/nexuiz-2.0/data/default.cfg 2006-12-21 09:44:39 UTC (rev 2060)
@@ -731,6 +731,7 @@
set nextmap "" // override the maplist when switching to the next map
set lastlevel ""
+set quit_when_empty "0" // set to 1, then the server exits when the next level starts
// singleplayer campaign
set g_campaign 0
Modified: branches/nexuiz-2.0/data/qcsrc/server/t_plats.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_plats.qc 2006-12-21 04:59:15 UTC (rev 2059)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_plats.qc 2006-12-21 09:44:39 UTC (rev 2060)
@@ -5,6 +5,8 @@
float STATE_DOWN = 3;
.entity trigger_field;
+//.float dmgtime;
+.float dmgtime2;
void() plat_center_touch;
void() plat_outside_touch;
@@ -111,12 +113,23 @@
void() plat_crush =
{
- if (self.state == 4)
- plat_go_down ();
- else if (self.state == 3)
- plat_go_up ();
- else
- objerror ("plat_crush: bad self.state\n");
+ if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
+ Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ } else {
+ if((self.dmg) && (other.takedamage != DAMAGE_NO)) { // Shall we bite?
+ Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ // Gib dead/dying stuff
+ if(other.deadflag != DEAD_NO)
+ Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ }
+
+ if (self.state == 4)
+ plat_go_down ();
+ else if (self.state == 3)
+ plat_go_up ();
+ else
+ objerror ("plat_crush: bad self.state\n");
+ }
};
void() plat_use =
@@ -140,6 +153,12 @@
if (self.sounds == 0)
self.sounds = 2;
+ if(self.spawnflags & 4)
+ self.dmg = 10000;
+
+ if(self.dmg && (!self.message))
+ self.message = "was in the wrong place.";
+
if (self.sounds == 1)
{
precache_sound ("plats/plat1.wav");
@@ -178,8 +197,10 @@
setsize (self, self.mins , self.maxs);
self.blocked = plat_crush;
+
if (!self.speed)
self.speed = 150;
+
self.pos1 = self.origin;
self.pos2 = self.origin;
self.pos2_z = self.origin_z - self.size_z + 8;
@@ -356,11 +377,33 @@
self.think = func_train_find;
};
+
+
+void() rotating_blocked =
+{
+
+ if(self.dmg && other.takedamage != DAMAGE_NO) {
+ if(self.dmgtime2 < time) {
+ Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ self.dmgtime2 = time + self.dmgtime;
+ }
+
+ // Gib dead/dying stuff
+ if(other.deadflag != DEAD_NO)
+ Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ }
+
+
+}
+
/*QUAKED func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
Brush model that spins in place on one axis (default Z).
-speed : speed to rotate (in degrees per second)
-noise : path/name of looping .wav file to play.
+speed : speed to rotate (in degrees per second)
+noise : path/name of looping .wav file to play.
+dmg : Do this mutch dmg every .dmgtime intervall when blocked
+dmgtime : See above.
*/
+
void() func_rotating =
{
if (self.noise)
@@ -380,6 +423,16 @@
else // Z
self.avelocity = '0 1 0' * self.speed;
+ if(self.dmg & (!self.message))
+ self.message = " was in the wrong place.";
+
+
+ if(self.dmg && (!self.dmgtime))
+ self.dmgtime = 0.25;
+
+ self.dmgtime2 = time;
+
+
self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH;
@@ -387,6 +440,8 @@
setsize(self, self.mins, self.maxs);
setorigin(self, self.origin);
+ self.blocked = rotating_blocked;
+
// wait for targets to spawn
self.nextthink = self.ltime + 999999999;
self.think = SUB_Null;
@@ -633,17 +688,41 @@
void() door_blocked =
{
+
+ if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
+ Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ } else {
+
+ if((self.dmg) && (other.takedamage == DAMAGE_YES)) // Shall we bite?
+ Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+
+ //Dont chamge direction for dead or dying stuff
+ if(other.deadflag != DEAD_NO && (other.takedamage == DAMAGE_NO)) {
+ if (self.wait >= 0)
+ {
+ if (self.state == STATE_DOWN)
+ door_go_up ();
+ else
+ door_go_down ();
+ }
+ } else {
+ //gib dying stuff just to make sure
+ if((self.dmg) && (other.takedamage != DAMAGE_NO)) // Shall we bite?
+ Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+ }
+ }
+
//T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic);
-
// if a door has a negative wait, it would never come back if blocked,
// so let it just squash the object to death real fast
- if (self.wait >= 0)
+/* if (self.wait >= 0)
{
if (self.state == STATE_DOWN)
door_go_up ();
else
door_go_down ();
}
+*/
};
@@ -991,14 +1070,27 @@
self.blocked = door_blocked;
self.use = door_use;
-
+
+ if(self.targetname == "") {
+ self.spawnflags = 0;
+ self.dmg = 0;
+ }
+
+ if(self.spawnflags & 4)
+ self.dmg = 10000;
+
+ if(self.dmg & (!self.message))
+ self.message = "was in the wrong place.";
+
+
+
if (self.sounds > 0)
{
precache_sound ("plats/medplat1.wav");
precache_sound ("plats/medplat2.wav");
self.noise2 = "plats/medplat1.wav";
self.noise1 = "plats/medplat2.wav";
- }
+ }
if (!self.speed)
self.speed = 100;
More information about the nexuiz-commits
mailing list