X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fw_vaporizer.qc;h=e96725b1ec8b8e002abc46a2bde0d9c29d21e6bb;hb=046bea116835a7d137712f2f1d4e6fd62cce5769;hp=90ea15d5c473dc88c4bda842d46f5114e0c816a5;hpb=2ff5923b5d3acdd9ed21ee37481c69586a6a7bf4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index 90ea15d5c..e96725b1e 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -1,4 +1,4 @@ -#ifdef REGISTER_WEAPON +#ifndef IMPLEMENTATION REGISTER_WEAPON( /* WEP_##id */ VAPORIZER, /* function */ W_Vaporizer, @@ -9,7 +9,7 @@ REGISTER_WEAPON( /* color */ '0.5 1 1', /* modelname */ "minstanex", /* simplemdl */ "foobar", -/* crosshair */ "gfx/crosshairminstanex 0.4", +/* crosshair */ "gfx/crosshairminstanex 0.6", /* wepimg */ "weaponminstanex", /* refname */ "vaporizer", /* wepname */ _("Vaporizer") @@ -46,9 +46,10 @@ VAPORIZER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) .float vaporizer_lasthit; .float jump_interval; #endif -#else +#endif +#ifdef IMPLEMENTATION #ifdef SVQC -void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); } +void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER.m_id); } void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); } void W_Vaporizer_Attack(void) @@ -56,14 +57,14 @@ 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, "", 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.m_id); if(yoda && flying) Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); @@ -113,7 +114,7 @@ void W_Vaporizer_Attack(void) WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), w_shotorg, v); break; } - + W_DecreaseAmmo(((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo))); } @@ -130,11 +131,11 @@ float W_Vaporizer(float req) case WR_AIM: { if(self.WEP_AMMO(VAPORIZER) > 0) - self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE); + self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false); else - self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), FALSE); // WEAPONTODO: replace with proper vaporizer cvars - - return TRUE; + self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars + + return true; } case WR_THINK: { @@ -158,14 +159,16 @@ float W_Vaporizer(float req) { // 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 instagib hack to reuse the fire mode of the laser + int oldwep = self.weapon; // we can't avoid this hack + self.weapon = WEP_BLASTER.m_id; W_Blaster_Attack( - WEP_VAPORIZER | HITTYPE_SECONDARY, + WEP_BLASTER.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), WEP_CVAR_SEC(vaporizer, edgedamage), @@ -176,13 +179,14 @@ float W_Vaporizer(float req) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); - + self.weapon = oldwep; + // now do normal refire weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready); } } - - return TRUE; + + return true; } case WR_INIT: { @@ -195,38 +199,38 @@ float W_Vaporizer(float req) precache_sound("weapons/nexwhoosh2.wav"); precache_sound("weapons/nexwhoosh3.wav"); //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously? - VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP) - return TRUE; + VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); + return true; } case WR_SETUP: { self.ammo_field = WEP_AMMO(VAPORIZER); self.vaporizer_lasthit = 0; - return TRUE; + return true; } case WR_CHECKAMMO1: { ammo_amount = self.WEP_AMMO(VAPORIZER) >= vaporizer_ammo; - ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= vaporizer_ammo; + ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo; return ammo_amount; } case WR_CHECKAMMO2: { if(!WEP_CVAR_SEC(vaporizer, ammo)) - return TRUE; + return true; ammo_amount = self.WEP_AMMO(VAPORIZER) >= WEP_CVAR_SEC(vaporizer, ammo); - ammo_amount += self.(weapon_load[WEP_VAPORIZER]) >= WEP_CVAR_SEC(vaporizer, ammo); + ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo); return ammo_amount; } case WR_CONFIG: { - VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS) - return TRUE; + VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); + return true; } case WR_RESETPLAYER: { self.vaporizer_lasthit = 0; - return TRUE; + return true; } case WR_RELOAD: { @@ -237,7 +241,7 @@ float W_Vaporizer(float req) used_ammo = vaporizer_ammo; W_Reload(used_ammo, "weapons/reload.wav"); - return TRUE; + return true; } case WR_SUICIDEMESSAGE: { @@ -248,7 +252,7 @@ float W_Vaporizer(float req) return WEAPON_VAPORIZER_MURDER; } } - return FALSE; + return false; } #endif #ifdef CSQC @@ -270,7 +274,7 @@ float W_Vaporizer(float req) 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; + return true; } case WR_INIT: { @@ -280,23 +284,23 @@ float W_Vaporizer(float req) { precache_pic("gfx/reticle_nex"); } - return TRUE; + return true; } case WR_ZOOMRETICLE: { if(button_zoom || zoomscript_caught) { reticle_image = "gfx/reticle_nex"; - return TRUE; + return true; } else { // no weapon specific image for this weapon - return FALSE; + return false; } } } - return FALSE; + return false; } #endif #endif