]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_crylink.qc
Merge remote-tracking branch 'origin/master' into samual/spawn_weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_crylink.qc
index 3866284a4c2007efeb3c0e55c99ec32044a2bc6e..5a19edf36040cc39537e20dcdb9e1de9b260931a 100644 (file)
@@ -69,9 +69,9 @@ void W_Crylink_LinkExplode (entity e, entity e2)
                e.realowner.crylink_lastgroup = world;
 
        if(e.projectiledeathtype & HITTYPE_SECONDARY)
-               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_damage * a, autocvar_g_balance_crylink_secondary_edgedamage * a, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * a, e.projectiledeathtype, other);
+               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_damage * a, autocvar_g_balance_crylink_secondary_edgedamage * a, autocvar_g_balance_crylink_secondary_radius, world, world, autocvar_g_balance_crylink_secondary_force * a, e.projectiledeathtype, other);
        else
-               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
+               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
 
        W_Crylink_LinkExplode(e.queuenext, e2);
 
@@ -133,6 +133,7 @@ vector W_Crylink_LinkJoin(entity e, float jspeed, float jtime)
                        p.velocity = WarpZone_RefSys_TransformVelocity(e, p, avg_velocity);
                        UpdateCSQCProjectile(p);
                }
+               targ_origin = avg_origin + 1000000000 * normalize(avg_velocity); // HUUUUUUGE
        }
        else
        {
@@ -200,7 +201,7 @@ void W_Crylink_LinkJoinEffect_Think()
                                        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,
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner, world,
                                                                        autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
@@ -213,7 +214,7 @@ void W_Crylink_LinkJoinEffect_Think()
                                        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,
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner, world,
                                                                        autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
@@ -241,7 +242,7 @@ void W_Crylink_Touch (void)
                f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
        if(a)
                f *= a;
-       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_primary_linkexplode)
+       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_primary_linkexplode)
        {
                if(self == self.realowner.crylink_lastgroup)
                        self.realowner.crylink_lastgroup = world;
@@ -282,7 +283,7 @@ void W_Crylink_Touch2 (void)
                f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
        if(a)
                f *= a;
-       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_secondary_linkexplode)
+       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_secondary_linkexplode)
        {
                if(self == self.realowner.crylink_lastgroup)
                        self.realowner.crylink_lastgroup = world;
@@ -315,9 +316,9 @@ void W_Crylink_Fadethink (void)
 
 void W_Crylink_Attack (void)
 {
-       local float counter, shots;
-       local entity proj, prevproj, firstproj;
-       local vector s;
+       float counter, shots;
+       entity proj, prevproj, firstproj;
+       vector s;
        vector forward, right, up;
        float maxdmg;
 
@@ -335,8 +336,8 @@ void W_Crylink_Attack (void)
 
        shots = autocvar_g_balance_crylink_primary_shots;
        pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
-       proj = world;
-       while (counter < shots)
+       proj = prevproj = firstproj = world;
+       for(counter = 0; counter < shots; ++counter)
        {
                proj = spawn ();
                proj.reset = W_Crylink_Reset;
@@ -408,12 +409,11 @@ void W_Crylink_Attack (void)
                //proj.glow_size = 20;
 
                proj.flags = FL_PROJECTILE;
-
+    proj.missile_flags = MIF_SPLASH;
+    
                CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
 
                other = proj; MUTATOR_CALLHOOK(EditProjectile);
-
-               counter = counter + 1;
        }
        if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
        {
@@ -425,8 +425,8 @@ void W_Crylink_Attack (void)
 
 void W_Crylink_Attack2 (void)
 {
-       local float counter, shots;
-       local entity proj, prevproj, firstproj;
+       float counter, shots;
+       entity proj, prevproj, firstproj;
        float maxdmg;
 
        W_DecreaseAmmo(ammo_cells, autocvar_g_balance_crylink_secondary_ammo, autocvar_g_balance_crylink_reload_ammo);
@@ -440,8 +440,8 @@ void W_Crylink_Attack2 (void)
 
        shots = autocvar_g_balance_crylink_secondary_shots;
        pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
-       proj = world;
-       while (counter < shots)
+       proj = prevproj = firstproj = world;
+       for(counter = 0; counter < shots; ++counter)
        {
                proj = spawn ();
                proj.reset = W_Crylink_Reset;
@@ -501,12 +501,11 @@ void W_Crylink_Attack2 (void)
                //proj.glow_size = 20;
 
                proj.flags = FL_PROJECTILE;
-
+        proj.missile_flags = MIF_SPLASH;
+        
                CSQCProjectile(proj, TRUE, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), TRUE);
 
                other = proj; MUTATOR_CALLHOOK(EditProjectile);
-
-               counter = counter + 1;
        }
        if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
        {
@@ -616,7 +615,7 @@ float w_crylink(float req)
                        return TRUE;
 
                ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
@@ -626,7 +625,7 @@ float w_crylink(float req)
                        return TRUE;
 
                ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
@@ -634,7 +633,7 @@ float w_crylink(float req)
                W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_crylink(float req)