X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_hagar.qc;h=472a1e0d5154c8870c141d4466804be75ccc47d5;hb=ff2155c8fbc6602d7001cd6180eac2465cf4bdc6;hp=83e1cf0821965e51242cb6ae23d2d3a06c011f6e;hpb=079c02f9a7c398d6c433f8ead73a244a6833b77b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 83e1cf0821..472a1e0d51 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -6,7 +6,7 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLI void W_Hagar_Explode (void) { self.event_damage = SUB_Null; - RadiusDamage (self, self.realowner, cvar("g_balance_hagar_primary_damage"), cvar("g_balance_hagar_primary_edgedamage"), cvar("g_balance_hagar_primary_radius"), world, cvar("g_balance_hagar_primary_force"), self.projectiledeathtype, other); + RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_primary_damage, autocvar_g_balance_hagar_primary_edgedamage, autocvar_g_balance_hagar_primary_radius, world, autocvar_g_balance_hagar_primary_force, self.projectiledeathtype, other); remove (self); } @@ -14,7 +14,7 @@ void W_Hagar_Explode (void) void W_Hagar_Explode2 (void) { self.event_damage = SUB_Null; - RadiusDamage (self, self.realowner, cvar("g_balance_hagar_secondary_damage"), cvar("g_balance_hagar_secondary_edgedamage"), cvar("g_balance_hagar_secondary_radius"), world, cvar("g_balance_hagar_secondary_force"), self.projectiledeathtype, other); + RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_secondary_damage, autocvar_g_balance_hagar_secondary_edgedamage, autocvar_g_balance_hagar_secondary_radius, world, autocvar_g_balance_hagar_secondary_force, self.projectiledeathtype, other); remove (self); } @@ -45,8 +45,8 @@ void W_Hagar_Attack (void) local entity missile; if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo"); - W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_primary_damage")); + self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_primary_ammo; + W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_primary_damage); pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); @@ -54,11 +54,11 @@ void W_Hagar_Attack (void) missile.owner = missile.realowner = self; missile.classname = "missile"; missile.bot_dodge = TRUE; - missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage"); + missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage; missile.touch = W_Hagar_Touch; missile.use = W_Hagar_Explode; missile.think = adaptor_think2use_hittype_splash; - missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime"); + missile.nextthink = time + autocvar_g_balance_hagar_primary_lifetime; PROJECTILE_MAKETRIGGER(missile); missile.projectiledeathtype = WEP_HAGAR; setorigin (missile, w_shotorg); @@ -71,6 +71,8 @@ void W_Hagar_Attack (void) missile.flags = FL_PROJECTILE; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE); + + other = missile; MUTATOR_CALLHOOK(EditProjectile); } void W_Hagar_Attack2 (void) @@ -78,9 +80,8 @@ void W_Hagar_Attack2 (void) local entity missile; if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo"); - W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", cvar("g_balance_hagar_secondary_damage")); - //W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right + self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_secondary_ammo; + W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage); pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); @@ -88,12 +89,12 @@ void W_Hagar_Attack2 (void) missile.owner = missile.realowner = self; missile.classname = "missile"; missile.bot_dodge = TRUE; - missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage"); + missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage; missile.touch = W_Hagar_Touch2; missile.cnt = 0; missile.use = W_Hagar_Explode2; missile.think = adaptor_think2use_hittype_splash; - missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand"); + missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand; PROJECTILE_MAKETRIGGER(missile); missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY; setorigin (missile, w_shotorg); @@ -106,6 +107,8 @@ void W_Hagar_Attack2 (void) missile.flags = FL_PROJECTILE; CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR_BOUNCING, TRUE); + + other = missile; MUTATOR_CALLHOOK(EditProjectile); } void spawnfunc_weapon_hagar (void) @@ -117,25 +120,25 @@ float w_hagar(float req) { if (req == WR_AIM) if (random()>0.15) - self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE); + self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE); else { // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming - self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE); + self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE); } else if (req == WR_THINK) { if (self.BUTTON_ATCK) - if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire"))) + if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire)) { W_Hagar_Attack(); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready); + weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hagar_primary_refire, w_ready); } - if (self.BUTTON_ATCK2 && cvar("g_balance_hagar_secondary")) - if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire"))) + if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary) + if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire)) { W_Hagar_Attack2(); - weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hagar_secondary_refire"), w_ready); + weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready); } } else if (req == WR_PRECACHE) @@ -148,24 +151,45 @@ float w_hagar(float req) else if (req == WR_SETUP) weapon_setup(WEP_HAGAR); else if (req == WR_CHECKAMMO1) - return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo"); + return self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo; else if (req == WR_CHECKAMMO2) - return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo"); - else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = "played with tiny rockets"; - else if (req == WR_KILLMESSAGE) - { - if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH - w_deathtypestring = "hoped #'s missiles wouldn't bounce"; - else // unchecked: SPLASH, SECONDARY - w_deathtypestring = "was pummeled by"; - } + return self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo; return TRUE; }; #endif #ifdef CSQC float w_hagar(float req) { + if(req == WR_IMPACTEFFECT) + { + vector org2; + org2 = w_org + w_backoff * 6; + pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1); + if(!w_issilent) + { + if (w_random<0.15) + sound(self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM); + else if (w_random<0.7) + sound(self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM); + else + sound(self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM); + } + } + else if(req == WR_PRECACHE) + { + precache_sound("weapons/hagexp1.wav"); + precache_sound("weapons/hagexp2.wav"); + precache_sound("weapons/hagexp3.wav"); + } + else if (req == WR_SUICIDEMESSAGE) + w_deathtypestring = "%s played with tiny 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"; + else // unchecked: SPLASH, SECONDARY + w_deathtypestring = "%s was pummeled by %s"; + } return TRUE; } #endif