]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_crylink.qc
make weapon death messages translatable
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_crylink.qc
index d1f4e5d5ecc9b04852885fb5c26f1809bc820374..8a3380eae4356b657f00f04e1a936d2eb67c7107 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", "Crylink");
+REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "crylink", "crylink", _("Crylink"));
 #else
 #ifdef SVQC
 .float gravity;
@@ -177,27 +177,27 @@ void W_Crylink_LinkJoinEffect_Think()
                                if(autocvar_g_balance_crylink_secondary_joinexplode)
                                {
                                        n = n / autocvar_g_balance_crylink_secondary_shots;
-                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n, 
-                                                                       autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n, 
-                                                                       autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner, 
+                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n,
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n,
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner,
                                                                        autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
-                               }                               
+                               }
                        }
                        else
                        {
                                if(autocvar_g_balance_crylink_primary_joinexplode)
                                {
                                        n = n / autocvar_g_balance_crylink_primary_shots;
-                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n, 
-                                                                       autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n, 
-                                                                       autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner, 
+                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n,
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n,
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner,
                                                                        autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
-                               }                               
-                       }                       
+                               }
+                       }
                }
        }
        remove(self);
@@ -397,6 +397,7 @@ void W_Crylink_Attack (void)
                        proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
                        proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
                }
+               proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
                proj.cnt = autocvar_g_balance_crylink_primary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
@@ -484,6 +485,7 @@ void W_Crylink_Attack2 (void)
                        proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
                        proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
                }
+               proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
                proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
@@ -511,7 +513,7 @@ float w_crylink(float req)
 {
        if (req == WR_AIM)
        {
-               if (random() > 0.15)
+               if (random() < 0.10)
                        self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
                else
                        self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
@@ -542,33 +544,30 @@ float w_crylink(float req)
                }
                else
                {
-                       if (self.crylink_waitrelease)
+                       if (self.crylink_waitrelease && (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time))
                        {
                                // fired and released now!
                                if(self.crylink_lastgroup)
                                {
                                        vector pos;
                                        entity linkjoineffect;
-                                       
-                                       
+
                                        if(self.crylink_waitrelease == 1)
                                        {
                                                pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
-                                               
+
                                        }
                                        else
                                        {
                                                pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_secondary_joinspread * autocvar_g_balance_crylink_secondary_speed, autocvar_g_balance_crylink_secondary_jointime);
                                        }
-                                       
+
                                        linkjoineffect = spawn();
                                        linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
-                                       linkjoineffect.classname = "linkjoineffect";                                    
+                                       linkjoineffect.classname = "linkjoineffect";
                                        linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
                                        linkjoineffect.owner = self;
                                        setorigin(linkjoineffect, pos);
-
-
                                }
                                self.crylink_waitrelease = 0;
                                if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
@@ -635,16 +634,16 @@ float w_crylink(float req)
        }
        else if (req == WR_SUICIDEMESSAGE)
        {
-               w_deathtypestring = "%s succeeded at self-destructing themself with the Crylink";
+               w_deathtypestring = _("%s succeeded at self-destructing themself with the Crylink");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE)
-                       w_deathtypestring = "%s could not hide from %s's Crylink"; // unchecked: SPLASH (SECONDARY can't be)
+                       w_deathtypestring = _("%s could not hide from %s's Crylink"); // unchecked: SPLASH (SECONDARY can't be)
                else if(w_deathtype & HITTYPE_SPLASH)
-                       w_deathtypestring = "%s was too close to %s's Crylink"; // unchecked: SECONDARY
+                       w_deathtypestring = _("%s was too close to %s's Crylink"); // unchecked: SECONDARY
                else
-                       w_deathtypestring = "%s took a close look at %s's Crylink"; // unchecked: SECONDARY
+                       w_deathtypestring = _("%s took a close look at %s's Crylink"); // unchecked: SECONDARY
        }
        return TRUE;
 }