]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add hit sound hooks for onslaught and assault objectives
authorMario <zacjardine@y7mail.com>
Sun, 23 Aug 2015 06:19:32 +0000 (16:19 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 23 Aug 2015 06:19:32 +0000 (16:19 +1000)
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_onslaught.qc

index 40f3528496b013fefc438dc28d705c2826306bc3..8e62285058de9f79322785969e22986660e01236 100644 (file)
@@ -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
        {
index 7c46e29f8ec28d0fb76116105997a6985f14dea5..299656dcff0f7ed6b14a689f3f3b4f90fd7069e0 100644 (file)
@@ -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