4 CLASS(PlasmaTurret, Turret)
5 /* spawnflags */ ATTRIB(PlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
6 /* mins */ ATTRIB(PlasmaTurret, mins, vector, '-32 -32 0');
7 /* maxs */ ATTRIB(PlasmaTurret, maxs, vector, '32 32 64');
8 /* modelname */ ATTRIB(PlasmaTurret, mdl, string, "base.md3");
9 /* model */ ATTRIB(PlasmaTurret, model, string, strzone(strcat("models/turrets/", this.mdl)));
10 /* head_model */ ATTRIB(PlasmaTurret, head_model, string, strzone(strcat("models/turrets/", "plasma.md3")));
11 /* netname */ ATTRIB(PlasmaTurret, netname, string, "plasma");
12 /* fullname */ ATTRIB(PlasmaTurret, turret_name, string, _("Plasma Cannon"));
13 ENDCLASS(PlasmaTurret)
15 REGISTER_TURRET(PLASMA, NEW(PlasmaTurret));
21 CLASS(PlasmaAttack, PortoLaunch)
22 /* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER);
23 /* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5);
24 /* refname */ ATTRIB(PlasmaAttack, netname, string, "plasma");
25 /* wepname */ ATTRIB(PlasmaAttack, message, string, _("Plasma"));
26 ENDCLASS(PlasmaAttack)
27 REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
31 void turret_initparams(entity tur);
32 METHOD(PlasmaAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
34 bool isPlayer = IS_PLAYER(self);
36 if (!isPlayer || weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire))) {
38 turret_initparams(self);
39 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
40 self.tur_shotdir_updated = w_shotdir;
41 self.tur_shotorg = w_shotorg;
43 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
45 entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
46 missile.missile_flags = MIF_SPLASH;
47 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
52 void spawnfunc_turret_plasma() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA.m_id)) remove(self); }
54 METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret thistur))
58 FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
59 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
61 Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
63 // teamcolor / hit beam effect
64 vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
65 WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
69 Weapon wep = WEP_PLASMA;
70 wep.wr_think(wep, true, false);
72 if (self.tur_head.frame == 0)
73 self.tur_head.frame = 1;
75 METHOD(PlasmaTurret, tr_think, bool(PlasmaTurret thistur))
77 if (self.tur_head.frame != 0)
78 self.tur_head.frame = self.tur_head.frame + 1;
80 if (self.tur_head.frame > 5)
81 self.tur_head.frame = 0;
85 METHOD(PlasmaTurret, tr_death, bool(PlasmaTurret thistur))
89 METHOD(PlasmaTurret, tr_setup, bool(PlasmaTurret thistur))
91 self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
92 self.damage_flags |= TFL_DMG_HEADSHAKE;
93 self.firecheck_flags |= TFL_FIRECHECK_AFF;
94 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_SPLASH;
96 turret_do_updates(self);
100 METHOD(PlasmaTurret, tr_precache, bool(PlasmaTurret thistur))
107 METHOD(PlasmaTurret, tr_setup, bool(PlasmaTurret thistur))
111 METHOD(PlasmaTurret, tr_precache, bool(PlasmaTurret thistur))
117 #endif // REGISTER_TURRET