X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_hagar.qc;h=9a4b1ef4495aa95d223d7df5cd15f7e770060f0b;hb=f192c14ff0d6d3205d90f83f254ecaa637e59bbb;hp=dc2c11c9e595a83a211ebe38fd74929bf58f0c8b;hpb=368c0437b1816a8859597339e2df2401290a8ca5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index dc2c11c9e..9a4b1ef44 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -25,20 +25,21 @@ void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deat if (self.health <= 0) return; - float is_linkexplode = ((inflictor.realowner == self.realowner) - && ((inflictor.projectiledeathtype & HITTYPE_SECONDARY) && (self.projectiledeathtype & HITTYPE_SECONDARY)) - && autocvar_g_balance_hagar_secondary_load_linkexplode); - - print("is_linkexplode: ", ftos(is_linkexplode), ". \n"); - + float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : TRUE) + && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) + && (self.projectiledeathtype & HITTYPE_SECONDARY)); + + if(is_linkexplode) + is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode); + else + is_linkexplode = -1; // not secondary load, so continue as normal without exception. + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode)) return; // g_projectiles_damage says to halt self.health = self.health - damage; self.angles = vectoangles(self.velocity); - print(strcat("hagar rocket health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n")); - if (self.health <= 0) W_PrepareExplosionByDamage(attacker, self.think); } @@ -66,7 +67,7 @@ void W_Hagar_Touch2 (void) void W_Hagar_Attack (void) { - local entity missile; + entity missile; W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_reload_ammo); @@ -100,6 +101,7 @@ void W_Hagar_Attack (void) missile.angles = vectoangles (missile.velocity); missile.flags = FL_PROJECTILE; + missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE); @@ -108,7 +110,7 @@ void W_Hagar_Attack (void) void W_Hagar_Attack2 (void) { - local entity missile; + entity missile; W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo); @@ -143,6 +145,7 @@ void W_Hagar_Attack2 (void) missile.angles = vectoangles (missile.velocity); missile.flags = FL_PROJECTILE; + missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE); @@ -154,9 +157,9 @@ void W_Hagar_Attack2_Load_Release (void) { // time to release the rockets we've loaded - local entity missile; - local float counter, shots, spread_pershot; - local vector s; + entity missile; + float counter, shots, spread_pershot; + vector s; vector forward, right, up; if(!self.hagar_load) @@ -173,7 +176,7 @@ void W_Hagar_Attack2_Load_Release (void) shots = self.hagar_load; missile = world; - while (counter < shots) + for(counter = 0; counter < shots; ++counter) { missile = spawn (); missile.owner = missile.realowner = self; @@ -196,6 +199,7 @@ void W_Hagar_Attack2_Load_Release (void) setorigin (missile, w_shotorg); setsize(missile, '0 0 0', '0 0 0'); missile.movetype = MOVETYPE_FLY; + missile.missile_flags = MIF_SPLASH; // per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar) spread_pershot = ((shots - 1) / (autocvar_g_balance_hagar_secondary_load_max - 1)); @@ -222,8 +226,6 @@ void W_Hagar_Attack2_Load_Release (void) CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE); other = missile; MUTATOR_CALLHOOK(EditProjectile); - - counter = counter + 1; } weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_load_animtime, w_ready); @@ -235,12 +237,12 @@ void W_Hagar_Attack2_Load (void) { // loadable hagar secondary attack, must always run each frame - local float loaded, enough_ammo; + float loaded, enough_ammo; loaded = self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max; // this is different than WR_CHECKAMMO when it comes to reloading if(autocvar_g_balance_hagar_reload_ammo) - enough_ammo = self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo; + enough_ammo = self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo; else enough_ammo = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo; @@ -348,7 +350,7 @@ float w_hagar(float req) } else if (req == WR_THINK) { - local float loadable_secondary; + float loadable_secondary; loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary; if (loadable_secondary) @@ -406,13 +408,13 @@ float w_hagar(float req) else if (req == WR_CHECKAMMO1) { ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo; - ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_primary_ammo; + ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_primary_ammo; return ammo_amount; } else if (req == WR_CHECKAMMO2) { ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo; - ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo; + ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo; return ammo_amount; } else if (req == WR_RESETPLAYER) @@ -431,7 +433,7 @@ float w_hagar(float req) W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav"); } return TRUE; -}; +} #endif #ifdef CSQC float w_hagar(float req) @@ -458,13 +460,13 @@ float w_hagar(float req) precache_sound("weapons/hagexp3.wav"); } else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = _("%s played with tiny rockets"); + w_deathtypestring = _("%s played with tiny hagar rockets"); else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH - w_deathtypestring = _("%s hoped %s's missiles wouldn't bounce"); + w_deathtypestring = _("%s was pummeled with a burst of hagar rockets by %s"); else // unchecked: SPLASH, SECONDARY - w_deathtypestring = _("%s was pummeled by %s"); + w_deathtypestring = _("%s was pummeled with hagar rockets by %s"); } return TRUE; }