1 #ifndef TUR_PLASMA_DUAL_H
2 #define TUR_PLASMA_DUAL_H
4 /* TUR_##id */ PLASMA_DUAL,
5 /* function */ t_plasma_dual,
6 /* spawnflags */ TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER,
7 /* mins,maxs */ '-32 -32 0', '32 32 64',
8 /* model */ "base.md3",
9 /* head_model */ "plasmad.md3",
10 /* netname */ "plasma_dual",
11 /* fullname */ _("Dual Plasma Cannon")
17 #include "../../weapons/all.qh"
19 CLASS(PlasmaDualAttack, PortoLaunch)
20 /* flags */ ATTRIB(PlasmaDualAttack, spawnflags, int, WEP_TYPE_OTHER);
21 /* impulse */ ATTRIB(PlasmaDualAttack, impulse, int, 5);
22 /* refname */ ATTRIB(PlasmaDualAttack, netname, string, "plasmadual");
23 /* wepname */ ATTRIB(PlasmaDualAttack, message, string, _("Dual plasma"));
24 ENDCLASS(PlasmaDualAttack)
25 REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack));
29 float t_plasma_dual(float req);
30 METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep)) {
33 if (weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire))) {
34 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
35 self.tur_shotdir_updated = w_shotdir;
36 self.tur_shotorg = w_shotorg;
38 self.shot_speed = max(1, ((!self.shot_speed) ? 2500 : self.shot_speed));
39 self.shot_spread = bound(0.0001, ((!self.shot_spread) ? 0.0125 : self.shot_spread), 500);
40 t_plasma_dual(TR_ATTACK);
41 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
46 void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL.m_id)) remove(self); }
48 float t_plasma_dual(float req)
57 flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
59 FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
60 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
63 Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
65 // teamcolor / hit beam effect
66 vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
67 WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
68 self.tur_head.frame += 1;
72 entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE);
73 missile.missile_flags = MIF_SPLASH;
74 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
75 self.tur_head.frame += 1;
82 if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
83 self.tur_head.frame = self.tur_head.frame + 1;
85 if (self.tur_head.frame > 6)
86 self.tur_head.frame = 0;
96 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
97 self.damage_flags |= TFL_DMG_HEADSHAKE;
98 self.firecheck_flags |= TFL_FIRECHECK_AFF;
99 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_SPLASH;
101 turret_do_updates(self);
116 float t_plasma_dual(float req)
134 #endif // REGISTER_TURRET