[nexuiz-commits] r8311 - in trunk/data: . qcsrc/client qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Nov 22 12:48:30 EST 2009
Author: div0
Date: 2009-11-22 12:48:29 -0500 (Sun, 22 Nov 2009)
New Revision: 8311
Modified:
trunk/data/balance.cfg
trunk/data/balance25.cfg
trunk/data/balanceHavoc.cfg
trunk/data/balanceNexrun.cfg
trunk/data/balanceSamual.cfg
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/client/tuba.qc
trunk/data/qcsrc/server/constants.qh
trunk/data/qcsrc/server/t_teleporters.qc
Log:
telefrag avoidance feature
Modified: trunk/data/balance.cfg
===================================================================
--- trunk/data/balance.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/balance.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit the other balance*.cfg too.
-set cvar_check_balance d036fc18c02bcfd6f91f57ff88ba941e
+set cvar_check_balance 84d3d5976dd5870e8fc739c8f2a6451a
// {{{ weapon replacement
// NOTE: this only replaces weapons on the map
@@ -542,6 +542,7 @@
set g_balance_tuba_animtime 0.05
set g_balance_tuba_attenuation 0.5
set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
set g_balance_tuba_damage 5
set g_balance_tuba_edgedamage 0
set g_balance_tuba_radius 200
Modified: trunk/data/balance25.cfg
===================================================================
--- trunk/data/balance25.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/balance25.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit the other balance*.cfg too.
-set cvar_check_balance d036fc18c02bcfd6f91f57ff88ba941e
+set cvar_check_balance 84d3d5976dd5870e8fc739c8f2a6451a
// {{{ weapon replacement
// NOTE: this only replaces weapons on the map
@@ -542,6 +542,7 @@
set g_balance_tuba_animtime 0.05
set g_balance_tuba_attenuation 0.5
set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
set g_balance_tuba_damage 5
set g_balance_tuba_edgedamage 0
set g_balance_tuba_radius 200
Modified: trunk/data/balanceHavoc.cfg
===================================================================
--- trunk/data/balanceHavoc.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/balanceHavoc.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit the other balance*.cfg too.
-set cvar_check_balance d036fc18c02bcfd6f91f57ff88ba941e
+set cvar_check_balance 84d3d5976dd5870e8fc739c8f2a6451a
// {{{ weapon replacement
// NOTE: this only replaces weapons on the map
@@ -542,6 +542,7 @@
set g_balance_tuba_animtime 0.05
set g_balance_tuba_attenuation 0.5
set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
set g_balance_tuba_damage 5
set g_balance_tuba_edgedamage 0
set g_balance_tuba_radius 200
Modified: trunk/data/balanceNexrun.cfg
===================================================================
--- trunk/data/balanceNexrun.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/balanceNexrun.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit the other balance*.cfg too.
-set cvar_check_balance d036fc18c02bcfd6f91f57ff88ba941e
+set cvar_check_balance 84d3d5976dd5870e8fc739c8f2a6451a
// {{{ weapon replacement
// NOTE: this only replaces weapons on the map
@@ -543,6 +543,7 @@
set g_balance_tuba_animtime 0.05
set g_balance_tuba_attenuation 0.5
set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
set g_balance_tuba_damage 5
set g_balance_tuba_edgedamage 0
set g_balance_tuba_radius 200
Modified: trunk/data/balanceSamual.cfg
===================================================================
--- trunk/data/balanceSamual.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/balanceSamual.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit the other balance*.cfg too.
-set cvar_check_balance d036fc18c02bcfd6f91f57ff88ba941e
+set cvar_check_balance 84d3d5976dd5870e8fc739c8f2a6451a
// {{{ weapon replacement
// NOTE: this only replaces weapons on the map
@@ -543,6 +543,7 @@
set g_balance_tuba_animtime 0.05
set g_balance_tuba_attenuation 0.5
set g_balance_tuba_volume 1
+set g_balance_tuba_fadetime 0.25
set g_balance_tuba_damage 5
set g_balance_tuba_edgedamage 0
set g_balance_tuba_radius 200
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/defaultNexuiz.cfg 2009-11-22 17:48:29 UTC (rev 8311)
@@ -26,7 +26,7 @@
seta g_configversion 0 "Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1 Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
// default.cfg versioning (update using update-cvarcount.sh, run that every time after adding a new cvar)
-set cvar_check_default 429d65b4aa48a0c795e0a98ea5311240
+set cvar_check_default 183061c914dc70b947ff76dfb9c52781
// Nexuiz version (formatted for machines)
// used to determine if a client version is compatible
@@ -310,6 +310,7 @@
set sv_qcweaponanimation 0
set g_telefrags 1
+set g_telefrags_avoid 0
// fragmessage: This allows extra information to be displayed with the frag centerprints.
set sv_fragmessage_information_ping 0 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
set sv_fragmessage_information_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
Modified: trunk/data/qcsrc/client/tuba.qc
===================================================================
--- trunk/data/qcsrc/client/tuba.qc 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/qcsrc/client/tuba.qc 2009-11-22 17:48:29 UTC (rev 8311)
@@ -3,7 +3,12 @@
void Ent_TubaNote_Think()
{
- self.cnt -= frametime * self.count * 3;
+ float f;
+ f = cvar("g_balance_tuba_fadetime");
+ if(f > 0)
+ self.cnt -= frametime * self.count / f;
+ else
+ self.cnt = 0;
self.nextthink = time;
if(self.cnt <= 0)
{
Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/qcsrc/server/constants.qh 2009-11-22 17:48:29 UTC (rev 8311)
@@ -1,5 +1,5 @@
-string CVAR_CHECK_DEFAULT = "429d65b4aa48a0c795e0a98ea5311240";
-string CVAR_CHECK_BALANCE = "d036fc18c02bcfd6f91f57ff88ba941e";
+string CVAR_CHECK_DEFAULT = "183061c914dc70b947ff76dfb9c52781";
+string CVAR_CHECK_BALANCE = "84d3d5976dd5870e8fc739c8f2a6451a";
float FALSE = 0;
float TRUE = 1;
Modified: trunk/data/qcsrc/server/t_teleporters.qc
===================================================================
--- trunk/data/qcsrc/server/t_teleporters.qc 2009-11-22 12:31:25 UTC (rev 8310)
+++ trunk/data/qcsrc/server/t_teleporters.qc 2009-11-22 17:48:29 UTC (rev 8311)
@@ -4,42 +4,59 @@
self.team = activator.team;
}
+#define TDEATHLOOP(o) \
+ entity head; \
+ vector deathmin; \
+ vector deathmax; \
+ float deathradius; \
+ deathmin = (o) + player.mins; \
+ deathmax = (o) + player.maxs; \
+ if(telefragmin != telefragmax) \
+ { \
+ if(deathmin_x > telefragmin_x) deathmin_x = telefragmin_x; \
+ if(deathmin_y > telefragmin_y) deathmin_y = telefragmin_y; \
+ if(deathmin_z > telefragmin_z) deathmin_z = telefragmin_z; \
+ if(deathmax_x < telefragmax_x) deathmax_x = telefragmax_x; \
+ if(deathmax_y < telefragmax_y) deathmax_y = telefragmax_y; \
+ if(deathmax_z < telefragmax_z) deathmax_z = telefragmax_z; \
+ } \
+ deathradius = max(vlen(deathmin), vlen(deathmax)); \
+ for(head = findradius(o, deathradius); head; head = head.chain) \
+ if(head != player) \
+ if(head.takedamage) \
+ if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
+
+
+float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
+{
+ TDEATHLOOP(org)
+ {
+ if ((player.classname == "player") && (player.health >= 1))
+ {
+ if(head.classname == "player")
+ if(head.health >= 1)
+ return 1;
+ }
+ }
+ return 0;
+}
float tdeath_hit;
void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)
{
- entity head;
- vector deathmin;
- vector deathmax;
- float deathradius;
- deathmin = player.absmin;
- deathmax = player.absmax;
- if(telefragmin != telefragmax)
+ TDEATHLOOP(player.origin)
{
- if(deathmin_x > telefragmin_x) deathmin_x = telefragmin_x;
- if(deathmin_y > telefragmin_y) deathmin_y = telefragmin_y;
- if(deathmin_z > telefragmin_z) deathmin_z = telefragmin_z;
- if(deathmax_x < telefragmax_x) deathmax_x = telefragmax_x;
- if(deathmax_y < telefragmax_y) deathmax_y = telefragmax_y;
- if(deathmax_z < telefragmax_z) deathmax_z = telefragmax_z;
+ if ((player.classname == "player") && (player.health >= 1))
+ {
+ if(head.classname == "player")
+ if(head.health >= 1)
+ ++tdeath_hit;
+ Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ }
+ else if (telefragger.health < 1) // corpses gib
+ Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+ else // dead bodies and monsters gib themselves instead of telefragging
+ Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0');
}
- deathradius = max(vlen(deathmin), vlen(deathmax));
- for(head = findradius(player.origin, deathradius); head; head = head.chain)
- if(head != player)
- if(head.takedamage)
- if(boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
- {
- if ((player.classname == "player") && (player.health >= 1))
- {
- if(head.classname == "player")
- if(head.health >= 1)
- ++tdeath_hit;
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
- }
- else if (telefragger.health < 1) // corpses gib
- Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
- else // dead bodies and monsters gib themselves instead of telefragging
- Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0');
- }
}
void spawn_tdeath(vector v0, entity e, vector v)
@@ -119,6 +136,8 @@
void Teleport_Touch (void)
{
entity oldself, e;
+ vector o;
+ float p;
if (other.health < 1)
return;
@@ -135,6 +154,8 @@
if(other.classname == "player")
RemoveGrapplingHook(other);
+
+ o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
if(self.enemy)
{
@@ -145,10 +166,14 @@
RandomSelection_Init();
for(e = world; (e = find(e, targetname, self.target)); )
{
+ p = 1;
+ if(cvar("g_telefrag_avoid"))
+ if(check_tdeath(other, o, '0 0 0', '0 0 0'))
+ p = 0;
if(e.cnt)
- RandomSelection_Add(e, 0, string_null, e.cnt, 0);
+ RandomSelection_Add(e, 0, string_null, e.cnt, p);
else
- RandomSelection_Add(e, 0, string_null, 1, 0);
+ RandomSelection_Add(e, 0, string_null, 1, p);
}
e = RandomSelection_chosen_ent;
}
@@ -162,7 +187,7 @@
if(vlen(other.velocity) > e.speed)
other.velocity = normalize(other.velocity) * max(0, e.speed);
- TeleportPlayer(self, other, e.origin + '0 0 1' * (1 - other.mins_z - 24), e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0');
+ TeleportPlayer(self, other, o, e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0');
if(e.target)
{
More information about the nexuiz-commits
mailing list