r4353 - in trunk/data: . qcsrc/client qcsrc/server scripts
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Sep 5 09:01:27 EDT 2008
Author: div0
Date: 2008-09-05 09:01:26 -0400 (Fri, 05 Sep 2008)
New Revision: 4353
Modified:
trunk/data/qcsrc/client/View.qc
trunk/data/qcsrc/server/g_triggers.qc
trunk/data/qcsrc/server/portals.qc
trunk/data/qcsrc/server/t_items.qc
trunk/data/qcsrc/server/w_porto.qc
trunk/data/scripts/entities.def
trunk/data/weapons.cfg
trunk/data/weaponsPro.cfg
Log:
more portal race fixes
Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/qcsrc/client/View.qc 2008-09-05 13:01:26 UTC (rev 4353)
@@ -73,7 +73,7 @@
p = polyline[idx-2];
q = polyline[idx-1];
if(idx == 2)
- p = p - '0 0 16';
+ p = p - view_up * 16;
if(idx-1 >= portal1_idx)
{
Draw_CylindricLine(p, q, 4, "", 1, 0, '0 0 1', 0.5, DRAWFLAG_NORMAL);
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/qcsrc/server/g_triggers.qc 2008-09-05 13:01:26 UTC (rev 4353)
@@ -469,16 +469,34 @@
}
-void target_speaker_use() {sound(self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);}
+// TODO add a way to do looped sounds with sound(); then complete this entity
+.float volume, atten;
+void target_speaker_use() {sound(self, CHAN_TRIGGER, self.noise, VOL_BASE * self.volume, self.atten);}
void spawnfunc_target_speaker()
{
if(self.noise)
precache_sound (self.noise);
IFTARGETED
+ {
+ if(!self.atten)
+ self.atten = ATTN_NORM;
+ else if(self.atten < 0)
+ self.atten = 0;
+ if(!self.volume)
+ self.volume = 1;
self.use = target_speaker_use;
+ }
else
- ambientsound (self.origin, self.noise, VOL_BASE, ATTN_STATIC);
+ {
+ if(!self.atten)
+ self.atten = ATTN_STATIC;
+ else if(self.atten < 0)
+ self.atten = 0;
+ if(!self.volume)
+ self.volume = 1;
+ ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
+ }
};
Modified: trunk/data/qcsrc/server/portals.qc
===================================================================
--- trunk/data/qcsrc/server/portals.qc 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/qcsrc/server/portals.qc 2008-09-05 13:01:26 UTC (rev 4353)
@@ -199,8 +199,8 @@
}
if(Portal_TeleportPlayer(self, other))
if(other.classname == "porto")
- if(other.cnt == 0)
- other.cnt = 1;
+ if(other.effects & EF_RED)
+ other.effects += EF_BLUE - EF_RED;
}
void Portal_MakeBrokenPortal(entity portal)
@@ -497,6 +497,7 @@
portal.portal_id = portal_id_val;
Portal_SetInPortal(own, portal);
+ sound(portal, CHAN_PROJECTILE, "misc/invshot.wav", VOL_BASE, ATTN_NORM);
return 1;
}
@@ -528,6 +529,7 @@
portal.portal_id = portal_id_val;
Portal_SetOutPortal(own, portal);
+ sound(portal, CHAN_PROJECTILE, "misc/invshot.wav", VOL_BASE, ATTN_NORM);
return 1;
}
Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/qcsrc/server/t_items.qc 2008-09-05 13:01:26 UTC (rev 4353)
@@ -887,17 +887,27 @@
float trigger_item_func_set(float a, float b)
{
- return b;
+ if(b == 0)
+ return a;
+ else if(b < 0)
+ return 0;
+ else
+ return b;
}
float trigger_item_func_min(float a, float b)
{
- return min(a, b);
+ if(b == 0)
+ return a;
+ else if(b < 0)
+ return 0;
+ else
+ return min(a, b);
}
float trigger_item_func_max(float a, float b)
{
- return min(a, b);
+ return max(a, b);
}
float trigger_item_func_and(float a, float b)
@@ -983,6 +993,11 @@
trigger_item_change(0, armorvalue, trigger_item_func_set, "misc/armor25.wav", "");
trigger_item_change(1, items, trigger_item_func_set, "misc/powerup.wav", "");
trigger_item_change(1, weapons, trigger_item_func_set, "weapons/weaponpickup.wav", "");
+
+ if((self.items & activator.items) & IT_STRENGTH)
+ activator.strength_finished = time + self.strength_finished;
+ if((self.items & activator.items) & IT_INVINCIBLE)
+ activator.invincible_finished = time + self.invincible_finished;
}
else if(self.spawnflags == 1) // AND/MIN
{
@@ -994,6 +1009,11 @@
trigger_item_change(0, armorvalue, trigger_item_func_min, "misc/armor25.wav", "");
trigger_item_change(1, items, trigger_item_func_and, "misc/powerup.wav", "");
trigger_item_change(1, weapons, trigger_item_func_and, "weapons/weaponpickup.wav", "");
+
+ if((self.items & activator.items) & IT_STRENGTH)
+ activator.strength_finished = min(activator.strength_finished, time + self.strength_finished);
+ if((self.items & activator.items) & IT_INVINCIBLE)
+ activator.invincible_finished = min(activator.invincible_finished, time + self.invincible_finished);
}
else if(self.spawnflags == 2) // OR/MAX
{
@@ -1005,6 +1025,11 @@
trigger_item_change(0, armorvalue, trigger_item_func_max, "misc/armor25.wav", "");
trigger_item_change(1, items, trigger_item_func_or, "misc/powerup.wav", "");
trigger_item_change(1, weapons, trigger_item_func_or, "weapons/weaponpickup.wav", "");
+
+ if((self.items & activator.items) & IT_STRENGTH)
+ activator.strength_finished = max(activator.strength_finished, time + self.strength_finished);
+ if((self.items & activator.items) & IT_INVINCIBLE)
+ activator.invincible_finished = max(activator.invincible_finished, time + self.invincible_finished);
}
else if(self.spawnflags == 4) // ANDNOT/MIN
{
@@ -1016,12 +1041,13 @@
trigger_item_change(0, armorvalue, trigger_item_func_min, "misc/armor25.wav", "");
trigger_item_change(1, items, trigger_item_func_andnot, "misc/powerup.wav", "");
trigger_item_change(1, weapons, trigger_item_func_andnot, "weapons/weaponpickup.wav", "");
+
+ if((self.items & activator.items) & IT_STRENGTH)
+ activator.strength_finished = min(activator.strength_finished, time + self.strength_finished);
+ if((self.items & activator.items) & IT_INVINCIBLE)
+ activator.invincible_finished = min(activator.invincible_finished, time + self.invincible_finished);
}
- if((self.items & activator.items) & IT_STRENGTH)
- activator.strength_finished = max(activator.strength_finished, time + self.strength_finished);
- if((self.items & activator.items) & IT_INVINCIBLE)
- activator.invincible_finished = max(activator.invincible_finished, time + self.invincible_finished);
if not(activator.items & IT_STRENGTH)
activator.strength_finished = 0;
if not(activator.items & IT_INVINCIBLE)
@@ -1060,7 +1086,7 @@
{
if(argv(i) == "unlimited_ammo") self.items |= IT_UNLIMITED_AMMO;
if(argv(i) == "strength") self.items |= IT_STRENGTH;
- if(argv(i) == "shield") self.items |= IT_INVINCIBLE;
+ if(argv(i) == "invincible") self.items |= IT_INVINCIBLE;
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
Modified: trunk/data/qcsrc/server/w_porto.qc
===================================================================
--- trunk/data/qcsrc/server/w_porto.qc 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/qcsrc/server/w_porto.qc 2008-09-05 13:01:26 UTC (rev 4353)
@@ -52,8 +52,6 @@
{
vector norm;
norm = trace_plane_normal;
- print(ftos(trace_dphitq3surfaceflags), "\n");
- print((trace_dphittexturename), "\n");
if(self.owner.playerid != self.playerid)
{
remove(self);
@@ -62,20 +60,20 @@
{
// just reflect
self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal);
- self.angles = vectoangles(self.velocity);
+ self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal));
}
else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
W_Porto_Fail(0);
}
- else if(self.cnt == 0)
+ else if(self.effects & EF_RED)
{
- self.cnt = 1;
+ self.effects += EF_BLUE - EF_RED;
if(Portal_SpawnInPortalAtTrace(self.owner, self.right_vector, self.portal_id))
{
trace_plane_normal = norm;
self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal);
- self.angles = vectoangles(self.velocity);
+ self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal));
}
else
{
@@ -115,7 +113,8 @@
gren.bot_dodgerating = 200;
gren.movetype = MOVETYPE_BOUNCEMISSILE;
gren.solid = SOLID_BBOX;
- gren.effects = EF_LOWPRECISION;
+ gren.effects = EF_LOWPRECISION | EF_RED;
+ gren.scale = 4;
gren.modelflags = MF_GRENADE;
setmodel(gren, "models/grenademodel.md3"); // precision set above
setsize(gren, '0 0 0', '0 0 0');
Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/scripts/entities.def 2008-09-05 13:01:26 UTC (rev 4353)
@@ -672,6 +672,8 @@
-------- KEYS --------
noise: path/name of .wav/.ogg file to play
targetname: the activating button or trigger points to this.
+atten: distance attenuation of the sound (a value from 0.1 to 3.9), default is 0.5 if targeted, 3 otherwise; set to -1 for no attenuation (global sound)
+volume: volume of the sound
*/
/*QUAKED trigger_counter (.5 .5 .5) ? NOMESSAGE
@@ -1020,14 +1022,18 @@
/*QUAKED trigger_items (0 0 1) (-8 -8 -8) (8 8 8) AND OR ANDNOT
Sets the items of any player who triggers this.
+For the number fields, not specifying a value means not changing it. To clear armor, you need to explicitly set "armor" to "-1".
-------- KEYS --------
-message: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "shield" and "strength"
+netname: space separated list of items (either weapon short names (like in g_start_weapon_* cvars), or item short names "unlimited_ammo", "invincible" and "strength"
+message: message to print
ammo_shells: amount of shells
ammo_nails: amount of bullets
ammo_rockets: amount of rockets
ammo_cells: amount of cells
health: amount of health
armorvalue: amount of armor
+strength_finished: if "strength" is specified, the time in seconds for which the strength will hold
+invincible_finished: if "invincible" is specified, the time in seconds for which the invincibility will hold
-------- SPAWNFLAGS --------
AND: any items not listed will get removed, and none will get added
OR: the player may keep items not listed
Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/weapons.cfg 2008-09-05 13:01:26 UTC (rev 4353)
@@ -217,6 +217,6 @@
// TESTING: port-o-launch
set g_balance_porto_primary_refire 1.5
-set g_balance_porto_primary_speed 700
+set g_balance_porto_primary_speed 2000
set g_balance_porto_primary_lifetime 30
set g_balance_porto_primary_ammo 25
Modified: trunk/data/weaponsPro.cfg
===================================================================
--- trunk/data/weaponsPro.cfg 2008-09-05 09:52:52 UTC (rev 4352)
+++ trunk/data/weaponsPro.cfg 2008-09-05 13:01:26 UTC (rev 4353)
@@ -217,6 +217,6 @@
// TESTING: port-o-launch
set g_balance_porto_primary_refire 1.5
-set g_balance_porto_primary_speed 700
+set g_balance_porto_primary_speed 2000
set g_balance_porto_primary_lifetime 30
set g_balance_porto_primary_ammo 25
More information about the nexuiz-commits
mailing list