X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fw_vaporizer.qc;h=90ea15d5c473dc88c4bda842d46f5114e0c816a5;hb=8f8c153ded2fc16282faf86ec673b3d44120801c;hp=674ecc7eefa09ca5c9764552049ff9a10c15a95b;hpb=9e9ae52d6c468d5bbd43df53e54fc8d6c7276175;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index 674ecc7ee..90ea15d5c 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -38,7 +38,8 @@ REGISTER_WEAPON( w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \ w_prop(id, sn, string, weaponreplace, weaponreplace) \ w_prop(id, sn, float, weaponstart, weaponstart) \ - w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) + w_prop(id, sn, float, weaponstartoverride, weaponstartoverride) \ + w_prop(id, sn, float, weaponthrowable, weaponthrowable) #ifdef SVQC VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) @@ -47,19 +48,22 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif #else #ifdef SVQC -void spawnfunc_weapon_vaporizer (void) { weapon_defaultspawnfunc(WEP_VAPORIZER); } -void spawnfunc_weapon_minstanex () { spawnfunc_weapon_vaporizer(); } +void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); } +void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); } -void W_Vaporizer_Attack (void) +void W_Vaporizer_Attack(void) { float flying; flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last - W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000); + W_SetupShot(self, TRUE, 0, "", CH_WEAPON_A, 10000); + // handle sound separately so we can change the volume + // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway) + sound (self, CH_WEAPON_A, "weapons/minstanexfire.wav", VOL_BASE * 0.8, ATTEN_NORM); yoda = 0; damage_goodhits = 0; - FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER); + FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER); if(yoda && flying) Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); @@ -110,7 +114,7 @@ void W_Vaporizer_Attack (void) break; } - W_DecreaseAmmo(((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo))); + W_DecreaseAmmo(((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo))); } float W_Vaporizer(float req) @@ -119,7 +123,7 @@ float W_Vaporizer(float req) float vaporizer_ammo; // now multiple WR_s use this - vaporizer_ammo = ((g_minstagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); + vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); switch(req) { @@ -139,31 +143,29 @@ float W_Vaporizer(float req) WEP_ACTION(self.weapon, WR_RELOAD); else if(WEP_CVAR(vaporizer, reload_ammo) && self.clip_load < vaporizer_ammo) // forced reload WEP_ACTION(self.weapon, WR_RELOAD); - else if (self.BUTTON_ATCK) + else if(self.BUTTON_ATCK) { - if (weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire))) + if(weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire))) { W_Vaporizer_Attack(); weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready); } } - else if (self.BUTTON_ATCK2) + else if(self.BUTTON_ATCK2) { - if (self.jump_interval <= time) - if (weapon_prepareattack(1, -1)) + if(self.jump_interval <= time) + if(weapon_prepareattack(1, -1)) { - // handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib) + // handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib) self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor(); // decrease ammo for the laser? if(WEP_CVAR_SEC(vaporizer, ammo)) W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo)); - // ugly minstagib hack to reuse the fire mode of the laser - float w; - w = self.weapon; - self.weapon = WEP_BLASTER; + // ugly instagib hack to reuse the fire mode of the laser W_Blaster_Attack( + WEP_VAPORIZER | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), WEP_CVAR_SEC(vaporizer, edgedamage), @@ -174,7 +176,6 @@ float W_Vaporizer(float req) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); - self.weapon = w; // now do normal refire weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready); @@ -247,7 +248,7 @@ float W_Vaporizer(float req) return WEAPON_VAPORIZER_MURDER; } } - return TRUE; + return FALSE; } #endif #ifdef CSQC @@ -259,14 +260,21 @@ float W_Vaporizer(float req) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); - if(!w_issilent) - sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); - + if(w_deathtype & HITTYPE_SECONDARY) + { + pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); + if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); } + } + else + { + pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); + if(!w_issilent) { sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); } + } return TRUE; } case WR_INIT: { + precache_sound("weapons/laserimpact.wav"); precache_sound("weapons/neximpact.wav"); if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { @@ -288,7 +296,7 @@ float W_Vaporizer(float req) } } } - return TRUE; + return FALSE; } #endif #endif