r4763 - in trunk/data: qcsrc/server sound/announcer/male sound/misc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Oct 16 05:56:34 EDT 2008
Author: div0
Date: 2008-10-16 05:56:34 -0400 (Thu, 16 Oct 2008)
New Revision: 4763
Added:
trunk/data/sound/announcer/male/airshot.ogg
trunk/data/sound/announcer/male/headshot.ogg
trunk/data/sound/announcer/male/impressive.ogg
trunk/data/sound/misc/typehit.wav
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_world.qc
trunk/data/qcsrc/server/teamplay.qc
trunk/data/qcsrc/server/w_minstanex.qc
Log:
more sounds by tenshihan: male/impressive, male/airshot, male/headshot, misc/typehit
airshot still unused (maybe replace electrobitch, or yoda?)
Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/cl_player.qc 2008-10-16 09:56:34 UTC (rev 4763)
@@ -751,6 +751,8 @@
return 0;
if(type == "teamshoot")
return 2;
+ if(type == "teamshoot_auto")
+ return 3;
return 1;
}
@@ -763,17 +765,18 @@
GetPlayerSoundSampleField_fixed = 0;
switch(type)
{
- case "attack": return playersound_attack;
- case "attackinfive": return playersound_attackinfive;
- case "coverme": return playersound_coverme;
- case "defend": return playersound_defend;
- case "freelance": return playersound_freelance;
- case "incoming": return playersound_incoming;
- case "meet": return playersound_meet;
- case "needhelp": return playersound_needhelp;
- case "seenflag": return playersound_seenflag;
- case "taunt": return playersound_taunt;
- case "teamshoot": return playersound_teamshoot;
+ case "attack": return playersound_attack;
+ case "attackinfive": return playersound_attackinfive;
+ case "coverme": return playersound_coverme;
+ case "defend": return playersound_defend;
+ case "freelance": return playersound_freelance;
+ case "incoming": return playersound_incoming;
+ case "meet": return playersound_meet;
+ case "needhelp": return playersound_needhelp;
+ case "seenflag": return playersound_seenflag;
+ case "taunt": return playersound_taunt;
+ case "teamshoot": return playersound_teamshoot;
+ case "teamshoot_auto": return playersound_teamshoot;
}
GetPlayerSoundSampleField_notFound = 1;
return playersound_taunt;
@@ -910,17 +913,28 @@
else
sample = strcat(argv(0), ".wav"); // randomization
- if(teamsay == 2) // only to last attacker
+ if(teamsay == 3) // only to last attacker
{
- if(teams_matter)
- if(self.pusher)
- if(self.pusher.team == self.team)
- {
- msg_entity = self.pusher;
+ if(self.pusher)
+ if(self.pusher.team == self.team)
+ {
+ msg_entity = self.pusher;
+ if(clienttype(msg_entity) == CLIENTTYPE_REAL)
soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
- msg_entity = self;
+ }
+ }
+ else if(teamsay == 2) // only to last attacker and self
+ {
+ if(self.pusher)
+ if(self.pusher.team == self.team)
+ {
+ msg_entity = self.pusher;
+ if(clienttype(msg_entity) == CLIENTTYPE_REAL)
soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
- }
+ msg_entity = self;
+ if(clienttype(msg_entity) == CLIENTTYPE_REAL)
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+ }
}
else if(teamsay == 0) // to everyone
{
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/defs.qh 2008-10-16 09:56:34 UTC (rev 4763)
@@ -168,7 +168,7 @@
.float dmgtime;
.float killcount;
-.float hitsound;
+.float hitsound, typehitsound;
.float watersound_finished;
.float iscreature;
Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/g_damage.qc 2008-10-16 09:56:34 UTC (rev 4763)
@@ -5,7 +5,10 @@
float damage_gooddamage;
float headshot;
+.float teamkill_complain;
+.entity pusher;
+
float IsDifferentTeam(entity a, entity b)
{
if(teams_matter)
@@ -672,34 +675,57 @@
// count the damage
if(attacker)
- if(targ.classname == "player")
- if(IsDifferentTeam(targ, attacker))
if(!targ.deadflag)
if(targ.takedamage == DAMAGE_AIM)
- if(damage > 0)
+ if(targ != attacker)
+ if(targ.classname == "player")
{
- attacker.hitsound += 1;
+ if(IsDifferentTeam(targ, attacker))
+ {
+ if(damage > 0)
+ {
+ if(targ.BUTTON_CHAT)
+ attacker.typehitsound += 1;
+ else
+ attacker.hitsound += 1;
- damage_goodhits += 1;
- damage_gooddamage += damage;
+ damage_goodhits += 1;
+ damage_gooddamage += damage;
- if(!g_minstagib)
- if(IsFlying(targ))
- yoda = 1;
+ if(!g_minstagib)
+ if(IsFlying(targ))
+ yoda = 1;
- if(g_minstagib)
- if(targ.items & IT_STRENGTH)
- yoda = 1;
+ if(g_minstagib)
+ if(targ.items & IT_STRENGTH)
+ yoda = 1;
- // HEAD SHOT:
- // find height of hit on player axis
- // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
- vector headmins, headmaxs, org;
- org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
- headmins = org + '0.5 0 0' * targ.mins_x + '0 0.5 0' * targ.mins_y + '0 0 1' * targ.view_ofs_z;
- headmaxs = org + '0.5 0 0' * targ.maxs_x + '0 0.5 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
- if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
- headshot = 1;
+ // HEAD SHOT:
+ // find height of hit on player axis
+ // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
+ vector headmins, headmaxs, org;
+ org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
+ headmins = org + '0.5 0 0' * targ.mins_x + '0 0.5 0' * targ.mins_y + '0 0 1' * targ.view_ofs_z;
+ headmaxs = org + '0.5 0 0' * targ.maxs_x + '0 0.5 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+ if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
+ headshot = 1;
+ }
+ }
+ else
+ {
+ attacker.typehitsound += 1; // TODO possibly trigger teamkill complain sound!
+ if(time > attacker.teamkill_complain)
+ {
+ entity oldpusher;
+
+ // note: here, self is actually targ!
+ oldpusher = self.pusher; self.pusher = attacker;
+ VoiceMessage("teamshoot_auto");
+ self.pusher = oldpusher;
+
+ attacker.teamkill_complain = time + 5;
+ }
+ }
}
}
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/g_world.qc 2008-10-16 09:56:34 UTC (rev 4763)
@@ -2237,17 +2237,24 @@
{
if(self.classname == "spectator")
{
- if(self.enemy.hitsound)
+ if(self.enemy.typehitsound)
+ play2(self, "misc/typehit.wav");
+ else if(self.enemy.hitsound)
play2(self, "misc/hit.wav");
}
else
{
- if(self.hitsound)
+ if(self.typehitsound)
+ play2(self, "misc/typehit.wav");
+ else if(self.hitsound)
play2(self, "misc/hit.wav");
}
}
FOR_EACH_CLIENT(self)
+ {
self.hitsound = FALSE;
+ self.typehitsound = FALSE;
+ }
}
Modified: trunk/data/qcsrc/server/teamplay.qc
===================================================================
--- trunk/data/qcsrc/server/teamplay.qc 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/teamplay.qc 2008-10-16 09:56:34 UTC (rev 4763)
@@ -172,12 +172,13 @@
ReadGameCvars();
WriteGameCvars();
+ // find out good world mins/maxs bounds, either the static bounds found by looking for solid, or the mapinfo specified bounds
+ get_mi_min_max(1);
+ world.mins = mi_min;
+ world.maxs = mi_max;
+
MapInfo_LoadMapSettings(mapname);
- if(MapInfo_Map_mins_x < MapInfo_Map_maxs_x)
- {
- world.mins = MapInfo_Map_mins;
- world.maxs = MapInfo_Map_maxs;
- }
+
if not(cvar_value_issafe(world.fog))
{
print("The current map contains a potentially harmful fog setting, ignored\n");
Modified: trunk/data/qcsrc/server/w_minstanex.qc
===================================================================
--- trunk/data/qcsrc/server/w_minstanex.qc 2008-10-15 06:07:01 UTC (rev 4762)
+++ trunk/data/qcsrc/server/w_minstanex.qc 2008-10-16 09:56:34 UTC (rev 4763)
@@ -22,7 +22,10 @@
if(yoda && flying)
announce(self, "announcer/male/yoda.ogg");
if(headshot)
+ {
announce(self, "announcer/male/headshot.ogg");
+ print("h\n");
+ }
if(damage_goodhits && self.minstanex_lasthit)
{
if(announce(self, "announcer/male/impressive.ogg"))
Added: trunk/data/sound/announcer/male/airshot.ogg
===================================================================
(Binary files differ)
Property changes on: trunk/data/sound/announcer/male/airshot.ogg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/sound/announcer/male/headshot.ogg
===================================================================
(Binary files differ)
Property changes on: trunk/data/sound/announcer/male/headshot.ogg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/sound/announcer/male/impressive.ogg
===================================================================
(Binary files differ)
Property changes on: trunk/data/sound/announcer/male/impressive.ogg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/data/sound/misc/typehit.wav
===================================================================
(Binary files differ)
Property changes on: trunk/data/sound/misc/typehit.wav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the nexuiz-commits
mailing list