X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fgamemode_keepaway.qc;h=9134353e015574860dc4478938633ba80e3a56ec;hp=5a3c42e3f192c3e52b16e364a50cae7eb15cf895;hb=a7b24450e4c7ca75636df1375d01d2266bd00c8c;hpb=2ebfd693ebec1b6cf708c58a3330d836d979cd82 diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 5a3c42e3f1..9134353e01 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -3,6 +3,7 @@ void ka_TouchEvent(void); void ka_RespawnBall(void); void ka_DropEvent(entity); void ka_TimeScoring(void); +void ka_EventLog(string, entity); entity ka_ball; @@ -78,7 +79,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1'); WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); - sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) + sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) } else { @@ -99,7 +100,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth if(other.classname != "player") { // The ball just touched an object, most likely the world pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1); - sound(self, CHAN_AUTO, "keepaway/touch.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTN_NORM); return; } else if(self.wait > time) { return; } @@ -125,10 +126,11 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth other.effects |= autocvar_g_keepaway_ballcarrier_effects; // messages and sounds + ka_EventLog("pickup", other); Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!")); - sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) + sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) // scoring PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1); @@ -167,10 +169,11 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects; // messages and sounds + ka_EventLog("dropped", plyr); Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!")); - sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) + sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) // scoring // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless. @@ -205,6 +208,12 @@ void ka_TimeScoring() } } +void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later +{ + if(autocvar_sv_eventlog) + GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); +} + MUTATOR_HOOKFUNCTION(ka_Scoring) { if((frag_attacker != frag_target) && (frag_attacker.classname == "player"))