From: Mario Date: Sun, 23 Aug 2015 06:19:32 +0000 (+1000) Subject: Add hit sound hooks for onslaught and assault objectives X-Git-Tag: xonotic-v0.8.2~2055 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=92f040813efcf4bacb3f653cfc2b7ab05c933663;p=xonotic%2Fxonotic-data.pk3dir.git Add hit sound hooks for onslaught and assault objectives --- diff --git a/qcsrc/server/mutators/gamemode_assault.qc b/qcsrc/server/mutators/gamemode_assault.qc index 40f352849..8e6228505 100644 --- a/qcsrc/server/mutators/gamemode_assault.qc +++ b/qcsrc/server/mutators/gamemode_assault.qc @@ -574,6 +574,11 @@ MUTATOR_HOOKFUNCTION(assault_BotRoles) return true; } +MUTATOR_HOOKFUNCTION(assault_PlayHitsound) +{ + return (frag_victim.classname == "func_assault_destructible"); +} + // scoreboard setup void assault_ScoreRules() { @@ -589,6 +594,7 @@ MUTATOR_DEFINITION(gamemode_assault) MUTATOR_HOOK(TurretSpawn, assault_TurretSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(VehicleSpawn, assault_VehicleSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(HavocBot_ChooseRole, assault_BotRoles, CBC_ORDER_ANY); + MUTATOR_HOOK(PlayHitsound, assault_PlayHitsound, CBC_ORDER_ANY); MUTATOR_ONADD { diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index 7c46e29f8..299656dcf 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -1690,6 +1690,12 @@ MUTATOR_HOOKFUNCTION(ons_MonsterSpawn) return false; } +MUTATOR_HOOKFUNCTION(ons_PlayHitsound) +{ + return (frag_victim.classname == "onslaught_generator" && !frag_victim.isshielded) + || (frag_victim.classname == "onslaught_controlpoint_icon" && !frag_victim.owner.isshielded); +} + MUTATOR_DEFINITION(gamemode_onslaught) { MUTATOR_HOOK(BuildMutatorsPrettyString, ons_BuildMutatorsPrettyString, CBC_ORDER_ANY); @@ -1697,6 +1703,7 @@ MUTATOR_DEFINITION(gamemode_onslaught) MUTATOR_HOOK(PlayerSpawn, ons_PlayerSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(MonsterMove, ons_MonsterThink, CBC_ORDER_ANY); MUTATOR_HOOK(MonsterSpawn, ons_MonsterSpawn, CBC_ORDER_ANY); + MUTATOR_HOOK(PlayHitsound, ons_PlayHitsound, CBC_ORDER_ANY); //MUTATOR_HOOK(Spawn_Score, ons_Spawn_Score, CBC_ORDER_ANY); MUTATOR_ONADD