]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/vaporizer.qc
Move DMG_NOWEP to defs.qh to reduce compilation unit madness
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / vaporizer.qc
1 #include "vaporizer.qh"
2
3 REGISTER_NET_TEMP(TE_CSQC_VAPORBEAMPARTICLE)
4
5 #if defined(SVQC)
6 void SendCSQCVaporizerBeamParticle(entity player, int hit) {
7         vector v;
8         v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
9         WriteHeader(MSG_BROADCAST, TE_CSQC_VAPORBEAMPARTICLE);
10         WriteCoord(MSG_BROADCAST, w_shotorg.x);
11         WriteCoord(MSG_BROADCAST, w_shotorg.y);
12         WriteCoord(MSG_BROADCAST, w_shotorg.z);
13         WriteCoord(MSG_BROADCAST, v.x);
14         WriteCoord(MSG_BROADCAST, v.y);
15         WriteCoord(MSG_BROADCAST, v.z);
16         WriteByte(MSG_BROADCAST, hit);
17         WriteByte(MSG_BROADCAST, etof(player));
18         WriteByte(MSG_BROADCAST, player.team);
19 }
20 #elif defined(CSQC)
21 bool autocvar_cl_vaporizerbeam_particle = false;
22 float autocvar_cl_vaporizerbeam_lifetime = 0.8;
23 float autocvar_cl_vaporizerbeam_colorboost = 0.7;
24
25 string Draw_VaporizerBeam_trace_callback_tex;
26 float Draw_VaporizerBeam_trace_callback_rnd;
27 vector Draw_VaporizerBeam_trace_callback_rgb;
28 float Draw_VaporizerBeam_trace_callback_a;
29 void Draw_VaporizerBeam_trace_callback(vector start, vector hit, vector end)
30 {
31         float i;
32         vector vorg;
33         vorg = WarpZone_TransformOrigin(WarpZone_trace_transform, view_origin);
34         for(i = 0; i < Draw_VaporizerBeam_trace_callback_a; ++i)
35                 Draw_CylindricLine(hit, start, 8, Draw_VaporizerBeam_trace_callback_tex, 0.25, Draw_VaporizerBeam_trace_callback_rnd, Draw_VaporizerBeam_trace_callback_rgb, min(1, Draw_VaporizerBeam_trace_callback_a - i), DRAWFLAG_NORMAL, vorg);
36         Draw_VaporizerBeam_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
37 }
38
39 .vector vorg1, vorg2;
40 .float spawn_time;
41 void VaporizerBeam_Draw(entity this)
42 {
43         //draw either the old v2.3 beam or the new beam
44         particles_alphamin = particles_alphamax = particles_fade = 1;
45
46         string tex = "particles/lgbeam";
47         if(this.cnt)
48                 tex = "particles/gauntletbeam";
49         vector rgb;
50         //entity e = CSQCModel_server2csqc(this.sv_entnum - 1);
51         //if (e == NULL)
52         //{
53                 rgb = colormapPaletteColor(entcs_GetClientColors(this.sv_entnum - 1) & 0x0F, true);
54                 //rgb = '1 1 1';
55         //}
56         //else
57         //      rgb = e.glowmod;
58         rgb *= (1 + autocvar_cl_vaporizerbeam_colorboost);
59
60         float fail = (this.nextthink - time);
61
62         Draw_VaporizerBeam_trace_callback_tex = tex;
63         Draw_VaporizerBeam_trace_callback_rnd = 0;
64         Draw_VaporizerBeam_trace_callback_rgb = rgb;
65         Draw_VaporizerBeam_trace_callback_a = bound(0, fail, 1);
66         WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, NULL, NULL, Draw_VaporizerBeam_trace_callback);
67         Draw_VaporizerBeam_trace_callback_tex = string_null;
68
69         /*if(!MUTATOR_CALLHOOK(Particles_VaporizerBeam, this.vorg1, this.vorg2))
70         if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
71                 WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
72         else
73                 WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/
74 }
75
76 NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
77 {
78         Net_Accept(vortex_beam);
79         setthink(this, SUB_Remove);
80         this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10);
81         this.draw = VaporizerBeam_Draw;
82         if (isNew) IL_PUSH(g_drawables, this);
83         this.drawmask = MASK_NORMAL;
84
85         this.vorg1_x = ReadCoord(); this.vorg1_y = ReadCoord(); this.vorg1_z = ReadCoord();
86         this.vorg2_x = ReadCoord(); this.vorg2_y = ReadCoord(); this.vorg2_z = ReadCoord();
87         this.cnt = ReadByte();
88         int myowner = ReadByte();
89         this.owner = playerslots[myowner - 1];
90         this.sv_entnum = myowner;
91         this.team = ReadByte() - 1;
92
93         pointparticles(EFFECT_VORTEX_MUZZLEFLASH, this.vorg1, normalize(this.vorg2 - this.vorg1) * 1000, 1);
94
95         if(autocvar_cl_vaporizerbeam_particle)
96         {
97                 WarpZone_TrailParticles(NULL, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2);
98                 this.draw = func_null;
99                 this.drawmask = MASK_NORMAL;
100                 delete(this);
101         }
102
103         return true;
104 }
105 #endif
106
107 #ifdef SVQC
108
109 void W_RocketMinsta_Explosion(entity actor, .entity weaponentity, vector loc)
110 {
111         if(accuracy_canbegooddamage(actor))
112                 accuracy_add(actor, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0);
113         entity dmgent = spawn();
114         dmgent.owner = dmgent.realowner = actor;
115         setorigin(dmgent, loc);
116         RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, NULL, NULL, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, weaponentity, NULL);
117         delete(dmgent);
118 }
119
120 void W_Vaporizer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
121 {
122         bool flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
123         float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000);
124
125         W_SetupShot(actor, weaponentity, true, 0, SND_Null, CH_WEAPON_A, vaporizer_damage);
126         // handle sound separately so we can change the volume
127         // added bonus: no longer plays the strength sound (strength gives no bonus to instakill anyway)
128         sound (actor, CH_WEAPON_A, SND_MINSTANEXFIRE, VOL_BASE * 0.8, ATTEN_NORM);
129
130         yoda = 0;
131         damage_goodhits = 0;
132         FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, vaporizer_damage, 800, 0, 0, 0, 0, WEP_VAPORIZER.m_id);
133
134         // do this now, as goodhits is disabled below
135         SendCSQCVaporizerBeamParticle(actor, damage_goodhits);
136
137         if(yoda && flying)
138                 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
139         if(damage_goodhits && actor.vaporizer_lasthit)
140         {
141                 Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
142                 damage_goodhits = 0; // only every second time
143         }
144
145         actor.vaporizer_lasthit = damage_goodhits;
146
147         if(autocvar_g_rm)
148         if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
149                 W_RocketMinsta_Explosion(actor, weaponentity, trace_endpos);
150
151         W_DecreaseAmmo(thiswep, actor, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)), weaponentity);
152 }
153
154 void W_RocketMinsta_Laser_Explode (entity this, entity directhitentity)
155 {
156         if(directhitentity.takedamage == DAMAGE_AIM)
157                 if(IS_PLAYER(directhitentity))
158                         if(DIFF_TEAM(this.realowner, directhitentity))
159                                 if(!IS_DEAD(directhitentity))
160                                         if(IsFlying(directhitentity))
161                                                 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
162
163         this.event_damage = func_null;
164         this.takedamage = DAMAGE_NO;
165         RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, this.weaponentity_fld, directhitentity);
166         delete(this);
167 }
168
169 void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
170 {
171         W_RocketMinsta_Laser_Explode(this, trigger); // we probably don't want trigger used here, but this matches closest to old behaviour
172 }
173
174 void W_RocketMinsta_Laser_Touch(entity this, entity toucher)
175 {
176         PROJECTILE_TOUCH(this, toucher);
177         //W_RocketMinsta_Laser_Explode ();
178         RadiusDamage(this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, this.weaponentity_fld, toucher);
179         delete(this);
180 }
181
182 void W_RocketMinsta_Attack2(entity actor, .entity weaponentity)
183 {
184         makevectors(actor.v_angle);
185
186         entity proj;
187         float counter = 0;
188         float total = autocvar_g_rm_laser_count;
189         float spread = autocvar_g_rm_laser_spread;
190         float rndspread = autocvar_g_rm_laser_spread_random;
191
192         Weapon w = actor.(weaponentity).m_weapon;
193         actor.(weaponentity).m_weapon = WEP_ELECTRO;
194         W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_CRYLINK_FIRE, CH_WEAPON_A, autocvar_g_rm_laser_damage);
195         actor.(weaponentity).m_weapon = w;
196
197         Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
198
199     while(counter < total)
200         {
201         proj = new(plasma_prim);
202         proj.owner = proj.realowner = actor;
203         proj.bot_dodge = true;
204         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
205         proj.use = W_RocketMinsta_Laser_Explode_use;
206         setthink(proj, adaptor_think2use_hittype_splash);
207         proj.nextthink = time + autocvar_g_rm_laser_lifetime;
208         PROJECTILE_MAKETRIGGER(proj);
209         proj.projectiledeathtype = WEP_ELECTRO.m_id;
210         proj.weaponentity_fld = weaponentity;
211         setorigin(proj, w_shotorg);
212
213                 proj.rm_force = autocvar_g_rm_laser_force / total;
214                 proj.rm_damage = autocvar_g_rm_laser_damage / total;
215                 proj.rm_edmg = proj.rm_damage;
216
217         //W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed);
218
219         set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
220         //W_SETUPPROJECTILEVELOCITY(proj, g_balance_minstanex_laser);
221                 proj.velocity = (w_shotdir + (((counter + 0.5) / total) * 2 - 1) * v_right * (spread * (rndspread ? random() : 1))) * cvar("g_rm_laser_speed");
222                 proj.velocity_z = proj.velocity_z + cvar("g_rm_laser_zspread") * (random() - 0.5);
223                 proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true);
224         proj.angles = vectoangles(proj.velocity);
225         settouch(proj, W_RocketMinsta_Laser_Touch);
226         setsize(proj, '0 0 -3', '0 0 -3');
227         proj.flags = FL_PROJECTILE;
228         IL_PUSH(g_projectiles, proj);
229         IL_PUSH(g_bot_dodge, proj);
230         proj.missile_flags = MIF_SPLASH;
231
232         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
233
234         MUTATOR_CALLHOOK(EditProjectile, actor, proj);
235         counter++;
236     }
237 }
238
239 void W_RocketMinsta_Attack3 (entity actor, .entity weaponentity)
240 {
241         makevectors(actor.v_angle);
242
243         entity proj;
244         float counter = 0;
245         float total = 1;
246
247         Weapon w = actor.(weaponentity).m_weapon;
248         actor.(weaponentity).m_weapon = WEP_ELECTRO;
249         W_SetupShot_ProjectileSize (actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, SND_ELECTRO_FIRE2, CH_WEAPON_A, autocvar_g_rm_laser_damage);
250         actor.(weaponentity).m_weapon = w;
251
252         Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
253
254     while(counter < total)
255         {
256         proj = new(plasma_prim);
257         proj.owner = proj.realowner = actor;
258         proj.bot_dodge = true;
259         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
260         proj.use = W_RocketMinsta_Laser_Explode_use;
261         setthink(proj, adaptor_think2use_hittype_splash);
262         proj.nextthink = time + autocvar_g_rm_laser_lifetime;
263         PROJECTILE_MAKETRIGGER(proj);
264         proj.projectiledeathtype = WEP_ELECTRO.m_id;
265         proj.weaponentity_fld = weaponentity;
266         setorigin(proj, w_shotorg);
267
268                 proj.rm_force = autocvar_g_rm_laser_force / total;
269                 proj.rm_damage = autocvar_g_rm_laser_damage / total;
270                 proj.rm_edmg = proj.rm_damage;
271
272         //W_SetupProjectileVelocity(proj, autocvar_g_rm_laser_speed, spread * (rndspread ? random() : 1) * autocvar_g_rm_laser_speed);
273
274         set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
275                 proj.velocity = w_shotdir * autocvar_g_rm_laser_speed;
276                 proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true);
277         proj.angles = vectoangles(proj.velocity);
278         settouch(proj, W_RocketMinsta_Laser_Touch);
279         setsize(proj, '0 0 -3', '0 0 -3');
280         proj.flags = FL_PROJECTILE;
281         IL_PUSH(g_projectiles, proj);
282         IL_PUSH(g_bot_dodge, proj);
283         proj.missile_flags = MIF_SPLASH;
284
285         CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true);
286
287         MUTATOR_CALLHOOK(EditProjectile, actor, proj);
288         counter++;
289     }
290 }
291
292 METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
293 {
294     if(GetResourceAmount(actor, thiswep.ammo_type) > 0)
295         PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 1, false);
296     else
297         PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
298 }
299 METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
300 {
301     float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
302     // if the laser uses load, we also consider its ammo for reloading
303     if(WEP_CVAR(vaporizer, reload_ammo) && WEP_CVAR_SEC(vaporizer, ammo) && actor.(weaponentity).clip_load < min(vaporizer_ammo, WEP_CVAR_SEC(vaporizer, ammo))) { // forced reload
304         thiswep.wr_reload(thiswep, actor, weaponentity);
305     } else if(WEP_CVAR(vaporizer, reload_ammo) && actor.(weaponentity).clip_load < vaporizer_ammo) { // forced reload
306         thiswep.wr_reload(thiswep, actor, weaponentity);
307     }
308     if((fire & 1) && (actor.ammo_cells || !autocvar_g_rm) && !forbidWeaponUse(actor))
309     {
310         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(vaporizer, refire)))
311         {
312             W_Vaporizer_Attack(thiswep, actor, weaponentity);
313             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
314         }
315     }
316     if((fire & 2) || ((fire & 1) && !actor.ammo_cells && autocvar_g_rm))
317     {
318         if((autocvar_g_rm && autocvar_g_rm_laser) || autocvar_g_rm_laser == 2)
319         {
320             bool rapid = autocvar_g_rm_laser_rapid;
321             if(actor.(weaponentity).jump_interval <= time && !actor.(weaponentity).held_down)
322             {
323                 if(rapid)
324                     actor.(weaponentity).held_down = true;
325                 actor.(weaponentity).jump_interval = time + autocvar_g_rm_laser_refire;
326                 actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_delay;
327                 damage_goodhits = 0;
328                 W_RocketMinsta_Attack2(actor, weaponentity);
329             }
330             else if(rapid && actor.(weaponentity).jump_interval2 <= time && actor.(weaponentity).held_down)
331             {
332                 actor.(weaponentity).jump_interval2 = time + autocvar_g_rm_laser_rapid_refire;
333                 damage_goodhits = 0;
334                 W_RocketMinsta_Attack3(actor, weaponentity);
335                 //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_rm_laser_rapid_animtime, w_ready);
336             }
337         }
338         else if (actor.(weaponentity).jump_interval <= time)
339         {
340             // handle refire manually, so that primary and secondary can be fired without conflictions (important for instagib)
341             actor.(weaponentity).jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor(actor);
342
343             // decrease ammo for the laser?
344             if(WEP_CVAR_SEC(vaporizer, ammo))
345                 W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo), weaponentity);
346
347             // ugly instagib hack to reuse the fire mode of the laser
348             makevectors(actor.v_angle);
349             Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
350             actor.(weaponentity).m_weapon = WEP_BLASTER;
351             W_Blaster_Attack(
352                 actor,
353                 weaponentity,
354                 WEP_BLASTER.m_id | HITTYPE_SECONDARY,
355                 WEP_CVAR_SEC(vaporizer, shotangle),
356                 WEP_CVAR_SEC(vaporizer, damage),
357                 WEP_CVAR_SEC(vaporizer, edgedamage),
358                 WEP_CVAR_SEC(vaporizer, radius),
359                 WEP_CVAR_SEC(vaporizer, force),
360                 WEP_CVAR_SEC(vaporizer, speed),
361                 WEP_CVAR_SEC(vaporizer, spread),
362                 WEP_CVAR_SEC(vaporizer, delay),
363                 WEP_CVAR_SEC(vaporizer, lifetime)
364             );
365             actor.(weaponentity).m_weapon = oldwep;
366
367             // now do normal refire
368             weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
369         }
370     }
371     else
372         actor.(weaponentity).held_down = false;
373 }
374 METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
375 {
376     actor.vaporizer_lasthit = 0;
377 }
378 METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
379 {
380     float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
381     float ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= vaporizer_ammo;
382     ammo_amount += actor.(weaponentity).(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
383     return ammo_amount;
384 }
385 METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
386 {
387     if(!WEP_CVAR_SEC(vaporizer, ammo))
388         return true;
389     float ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(vaporizer, ammo);
390     ammo_amount += actor.(weaponentity).(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
391     return ammo_amount;
392 }
393 METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor))
394 {
395     actor.vaporizer_lasthit = 0;
396 }
397 METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
398 {
399     float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
400     float used_ammo;
401     if(WEP_CVAR_SEC(vaporizer, ammo))
402         used_ammo = min(vaporizer_ammo, WEP_CVAR_SEC(vaporizer, ammo));
403     else
404         used_ammo = vaporizer_ammo;
405
406     W_Reload(actor, weaponentity, used_ammo, SND_RELOAD);
407 }
408 METHOD(Vaporizer, wr_suicidemessage, Notification(entity thiswep))
409 {
410     return WEAPON_THINKING_WITH_PORTALS;
411 }
412 METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep))
413 {
414     return WEAPON_VAPORIZER_MURDER;
415 }
416
417 #endif
418 #ifdef CSQC
419
420 METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
421 {
422     vector org2 = w_org + w_backoff * 6;
423     if(w_deathtype & HITTYPE_SECONDARY)
424     {
425         pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
426         if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
427     }
428     else
429     {
430         pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
431         if(!w_issilent) { sound(actor, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); }
432     }
433 }
434 METHOD(Vaporizer, wr_init, void(entity thiswep))
435 {
436     if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
437     {
438         precache_pic("gfx/reticle_nex");
439     }
440 }
441 METHOD(Vaporizer, wr_zoom, bool(entity thiswep, entity actor))
442 {
443     if(button_zoom || zoomscript_caught)
444     {
445         return true;
446     }
447     else
448     {
449         // no weapon specific image for this weapon
450         return false;
451     }
452 }
453
454 #endif