]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Effects: prefer team suffixes
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 12:13:19 +0000 (22:13 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Sep 2015 12:13:19 +0000 (22:13 +1000)
qcsrc/common/effects/effects.inc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/server/mutators/mutator_nades.qc

index 663d090a810a7b906c724173ec2bc5acece06cb2..4d82087e05dc47bea1ec9eb0b08aa18cd56247f6 100644 (file)
@@ -46,15 +46,15 @@ EFFECT(0, VORTEX_IMPACT,            "nex_impact")
 EFFECT(0, VORTEX_MUZZLEFLASH,       "nex_muzzleflash")
 
 EFFECT(1, VAPORIZER_RED,            "TE_TEI_G3RED")
-EFFECT(1, VAPORIZER_RED_HIT,        "TE_TEI_G3RED_HIT")
+EFFECT(1, VAPORIZER_HIT_RED,        "TE_TEI_G3RED_HIT")
 EFFECT(1, VAPORIZER_BLUE,           "TE_TEI_G3BLUE")
-EFFECT(1, VAPORIZER_BLUE_HIT,       "TE_TEI_G3BLUE_HIT")
+EFFECT(1, VAPORIZER_HIT_BLUE,       "TE_TEI_G3BLUE_HIT")
 EFFECT(1, VAPORIZER_YELLOW,         "TE_TEI_G3YELLOW")
-EFFECT(1, VAPORIZER_YELLOW_HIT,     "TE_TEI_G3YELLOW_HIT")
+EFFECT(1, VAPORIZER_HIT_YELLOW,     "TE_TEI_G3YELLOW_HIT")
 EFFECT(1, VAPORIZER_PINK,           "TE_TEI_G3PINK")
-EFFECT(1, VAPORIZER_PINK_HIT,       "TE_TEI_G3PINK_HIT")
+EFFECT(1, VAPORIZER_HIT_PINK,       "TE_TEI_G3PINK_HIT")
 EFFECT(1, VAPORIZER_NEUTRAL,        "TE_TEI_G3")
-EFFECT(1, VAPORIZER_NEUTRAL_HIT,    "TE_TEI_G3_HIT")
+EFFECT(1, VAPORIZER_HIT_NEUTRAL,    "TE_TEI_G3_HIT")
 entity EFFECT_VAPORIZER(int teamid)
 {
     switch (teamid) {
@@ -65,6 +65,16 @@ entity EFFECT_VAPORIZER(int teamid)
         default:            return EFFECT_VAPORIZER_NEUTRAL;
     }
 }
+entity EFFECT_VAPORIZER_HIT(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_VAPORIZER_HIT_RED;
+        case NUM_TEAM_2:    return EFFECT_VAPORIZER_HIT_BLUE;
+        case NUM_TEAM_3:    return EFFECT_VAPORIZER_HIT_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_VAPORIZER_HIT_PINK;
+        default:            return EFFECT_VAPORIZER_HIT_NEUTRAL;
+    }
+}
 
 EFFECT(0, RIFLE_IMPACT,             "machinegun_impact")
 EFFECT(0, RIFLE_MUZZLEFLASH,        "rifle_muzzleflash")
@@ -134,11 +144,21 @@ EFFECT(0, SPAWN_PINK,               "spawn_event_pink")
 EFFECT(0, SPAWNPOINT_NEUTRAL,       "spawn_point_neutral")
 EFFECT(0, SPAWN_NEUTRAL,            "spawn_event_neutral")
 
-EFFECT(0, NADE_RED_EXPLODE,         "nade_red_explode")
-EFFECT(0, NADE_BLUE_EXPLODE,        "nade_blue_explode")
-EFFECT(0, NADE_YELLOW_EXPLODE,      "nade_yellow_explode")
-EFFECT(0, NADE_PINK_EXPLODE,        "nade_pink_explode")
-EFFECT(0, NADE_NEUTRAL_EXPLODE,     "nade_neutral_explode")
+EFFECT(0, NADE_EXPLODE_RED,         "nade_red_explode")
+EFFECT(0, NADE_EXPLODE_BLUE,        "nade_blue_explode")
+EFFECT(0, NADE_EXPLODE_YELLOW,      "nade_yellow_explode")
+EFFECT(0, NADE_EXPLODE_PINK,        "nade_pink_explode")
+EFFECT(0, NADE_EXPLODE_NEUTRAL,     "nade_neutral_explode")
+entity EFFECT_NADE_EXPLODE(int teamid)
+{
+    switch (teamid) {
+        case NUM_TEAM_1:    return EFFECT_NADE_EXPLODE_RED;
+        case NUM_TEAM_2:    return EFFECT_NADE_EXPLODE_BLUE;
+        case NUM_TEAM_3:    return EFFECT_NADE_EXPLODE_YELLOW;
+        case NUM_TEAM_4:    return EFFECT_NADE_EXPLODE_PINK;
+        default:                   return EFFECT_NADE_EXPLODE_NEUTRAL;
+    }
+}
 
 EFFECT(1, NADE_TRAIL_RED,           "nade_red")
 EFFECT(1, NADE_TRAIL_BLUE,          "nade_blue")
@@ -195,11 +215,11 @@ entity EFFECT_FLAG_TOUCH(int teamid)
     }
 }
 
-EFFECT(1, RED_PASS,                 "red_pass")
-EFFECT(1, BLUE_PASS,                "blue_pass")
-EFFECT(1, YELLOW_PASS,              "yellow_pass")
-EFFECT(1, PINK_PASS,                "pink_pass")
-EFFECT(1, NEUTRAL_PASS,             "neutral_pass")
+EFFECT(1, PASS_RED,                 "red_pass")
+EFFECT(1, PASS_BLUE,                "blue_pass")
+EFFECT(1, PASS_YELLOW,              "yellow_pass")
+EFFECT(1, PASS_PINK,                "pink_pass")
+EFFECT(1, PASS_NEUTRAL,             "neutral_pass")
 
 EFFECT(0, CAP_RED,                  "red_cap")
 EFFECT(0, CAP_BLUE,                 "blue_cap")
index 2abddeace2d8b03d30cc8dd150286f15f8a2b173..d27f99180f2b0964a840944fd6af12dd8622ddb5 100644 (file)
@@ -96,41 +96,8 @@ void W_Vaporizer_Attack(void)
        Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
        // teamcolor / hit beam effect
-       vector v;
-       v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-       switch(self.team)
-       {
-               case NUM_TEAM_1:   // Red
-                       if(damage_goodhits)
-                               Send_Effect(EFFECT_VAPORIZER_RED_HIT, w_shotorg, v, 1);
-                       else
-                               Send_Effect(EFFECT_VAPORIZER_RED, w_shotorg, v, 1);
-                       break;
-               case NUM_TEAM_2:   // Blue
-                       if(damage_goodhits)
-                               Send_Effect(EFFECT_VAPORIZER_BLUE_HIT, w_shotorg, v, 1);
-                       else
-                               Send_Effect(EFFECT_VAPORIZER_BLUE, w_shotorg, v, 1);
-                       break;
-               case NUM_TEAM_3:   // Yellow
-                       if(damage_goodhits)
-                               Send_Effect(EFFECT_VAPORIZER_YELLOW_HIT, w_shotorg, v, 1);
-                       else
-                               Send_Effect(EFFECT_VAPORIZER_YELLOW, w_shotorg, v, 1);
-                       break;
-               case NUM_TEAM_4:   // Pink
-                       if(damage_goodhits)
-                               Send_Effect(EFFECT_VAPORIZER_PINK_HIT, w_shotorg, v, 1);
-                       else
-                               Send_Effect(EFFECT_VAPORIZER_PINK, w_shotorg, v, 1);
-                       break;
-               default:
-                       if(damage_goodhits)
-                               Send_Effect_("TE_TEI_G3_HIT", w_shotorg, v, 1);
-                       else
-                               Send_Effect_("TE_TEI_G3", w_shotorg, v, 1);
-                       break;
-       }
+       vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+       Send_Effect((damage_goodhits ? EFFECT_VAPORIZER_HIT(self.team) : EFFECT_VAPORIZER(self.team)), w_shotorg, v, 1);
 
        if(autocvar_g_rm)
        if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
index 99941a100b5d6d51c76731cb74ea17b2c8abfcbf..19a0aa462c688f842043f9a703cc8bfd50862e44 100644 (file)
@@ -250,15 +250,7 @@ void nade_ice_think()
        {
                if ( autocvar_g_nades_ice_explode )
                {
-                       entity expef = NULL;
-                       switch(self.realowner.team)
-                       {
-                               case NUM_TEAM_1: expef = EFFECT_NADE_RED_EXPLODE; break;
-                               case NUM_TEAM_2: expef = EFFECT_NADE_BLUE_EXPLODE; break;
-                               case NUM_TEAM_3: expef = EFFECT_NADE_YELLOW_EXPLODE; break;
-                               case NUM_TEAM_4: expef = EFFECT_NADE_PINK_EXPLODE; break;
-                               default:                 expef = EFFECT_NADE_NEUTRAL_EXPLODE; break;
-                       }
+                       entity expef = EFFECT_NADE_EXPLODE(self.realowner.team);
                        Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
                        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 
@@ -517,14 +509,8 @@ void nade_boom()
 
                default:
                case NADE_TYPE_NORMAL:
-                       switch(self.realowner.team)
-                       {
-                               case NUM_TEAM_1: expef = EFFECT_NADE_RED_EXPLODE; break;
-                               case NUM_TEAM_2: expef = EFFECT_NADE_BLUE_EXPLODE; break;
-                               case NUM_TEAM_3: expef = EFFECT_NADE_YELLOW_EXPLODE; break;
-                               case NUM_TEAM_4: expef = EFFECT_NADE_PINK_EXPLODE; break;
-                               default:                 expef = EFFECT_NADE_NEUTRAL_EXPLODE; break;
-                       }
+                       expef = EFFECT_NADE_EXPLODE(self.realowner.team);
+                       break;
        }
 
        if(expef)