X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_rocketlauncher.qc;h=11b39527ede1326f9f3e2cf42d553f02a50c728c;hb=a8f44b0e98aedacaae872b937ee023e24fc30878;hp=0269fd18fc8bff348f1e6e168f595a88270e4673;hpb=5184882771b05f1267c4a267f6298c1516cd2b0a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index 0269fd18f..11b39527e 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -209,7 +209,7 @@ void W_Rocket_Think (void) { pointparticles(particleeffectnum("rocket_guide"), self.origin, self.velocity, 1); // TODO add a better sound here - sound (self.realowner, CHAN_WEAPON2, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM); + sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM); self.count = 1; } } @@ -238,20 +238,25 @@ void W_Rocket_Damage (entity inflictor, entity attacker, float damage, float dea { if (self.health <= 0) return; + + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions + return; // g_projectiles_damage says to halt + self.health = self.health - damage; self.angles = vectoangles(self.velocity); + if (self.health <= 0) W_PrepareExplosionByDamage(attacker, W_Rocket_Explode); } void W_Rocket_Attack (void) { - local entity missile; - local entity flash; + entity missile; + entity flash; W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo); - W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, autocvar_g_balance_rocketlauncher_damage); + W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, autocvar_g_balance_rocketlauncher_damage); pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); missile = WarpZone_RefSys_SpawnSameRefSys(self); @@ -270,6 +275,7 @@ void W_Rocket_Attack (void) missile.damageforcescale = autocvar_g_balance_rocketlauncher_damageforcescale; missile.health = autocvar_g_balance_rocketlauncher_health; missile.event_damage = W_Rocket_Damage; + missile.damagedbycontents = TRUE; missile.movetype = MOVETYPE_FLY; PROJECTILE_MAKETRIGGER(missile); @@ -314,9 +320,9 @@ float w_rlauncher(float req) if(skill >= 2) // skill 0 and 1 bots won't detonate rockets! { // decide whether to detonate rockets - local entity missile, targetlist, targ; - local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d; - local float selfdamage, teamdamage, enemydamage; + entity missile, targetlist, targ; + float edgedamage, coredamage, edgeradius, recipricoledgeradius, d; + float selfdamage, teamdamage, enemydamage; edgedamage = autocvar_g_balance_rocketlauncher_edgedamage; coredamage = autocvar_g_balance_rocketlauncher_damage; edgeradius = autocvar_g_balance_rocketlauncher_radius; @@ -349,7 +355,7 @@ float w_rlauncher(float req) } missile = find(missile, classname, "rocket"); } - local float desirabledamage; + float desirabledamage; desirabledamage = enemydamage; if (time > self.invincible_finished && time > self.spawnshieldtime) desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent; @@ -378,7 +384,7 @@ float w_rlauncher(float req) targ = targ.chain; } }else{ - local float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000); + float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000); //As the distance gets larger, a correct detonation gets near imposible //Bots are assumed to use the rocket spawnfunc_light to see if the rocket gets near a player if(v_forward * normalize(missile.origin - self.enemy.origin)< 0.1) @@ -433,7 +439,7 @@ float w_rlauncher(float req) } } if(rockfound) - sound (self, CHAN_WEAPON2, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM); } } } @@ -461,7 +467,7 @@ float w_rlauncher(float req) { if(autocvar_g_balance_rocketlauncher_reload_ammo) { - if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.weapon_load[WEP_ROCKET_LAUNCHER] < autocvar_g_balance_rocketlauncher_ammo) + if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.(weapon_load[WEP_ROCKET_LAUNCHER]) < autocvar_g_balance_rocketlauncher_ammo) ammo_amount = TRUE; } else if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo) @@ -480,7 +486,7 @@ float w_rlauncher(float req) W_Reload(autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav"); } return TRUE; -}; +} #endif #ifdef CSQC float w_rlauncher(float req) @@ -491,7 +497,7 @@ float w_rlauncher(float req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); } else if(req == WR_PRECACHE) {