5 /* spawnflags */ ATTRIB(Flac, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_FASTPROJ | TUR_FLAG_MISSILE);
6 /* mins */ ATTRIB(Flac, mins, vector, '-32 -32 0');
7 /* maxs */ ATTRIB(Flac, maxs, vector, '32 32 64');
8 /* modelname */ ATTRIB(Flac, mdl, string, "base.md3");
9 /* model */ ATTRIB(Flac, model, string, strzone(strcat("models/turrets/", this.mdl)));
10 /* head_model */ ATTRIB(Flac, head_model, string, strzone(strcat("models/turrets/", "flac.md3")));
11 /* netname */ ATTRIB(Flac, netname, string, "flac");
12 /* fullname */ ATTRIB(Flac, turret_name, string, _("FLAC Cannon"));
15 REGISTER_TURRET(FLAC, NEW(Flac));
17 CLASS(FlacAttack, PortoLaunch)
18 /* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER);
19 /* impulse */ ATTRIB(FlacAttack, impulse, int, 5);
20 /* refname */ ATTRIB(FlacAttack, netname, string, "turret_flac");
21 /* wepname */ ATTRIB(FlacAttack, message, string, _("FLAC"));
23 REGISTER_WEAPON(FLAC, NEW(FlacAttack));
29 void turret_initparams(entity);
30 void turret_flac_projectile_think_explode();
31 METHOD(FlacAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
33 bool isPlayer = IS_PLAYER(self);
35 if (!isPlayer || weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire))) {
37 turret_initparams(self);
38 W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
39 self.tur_shotdir_updated = w_shotdir;
40 self.tur_shotorg = w_shotorg;
42 self.tur_impacttime = 10;
43 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
46 turret_tag_fire_update();
48 entity proj = turret_projectile(SND(HAGAR_FIRE), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, true, true);
49 proj.missile_flags = MIF_SPLASH | MIF_PROXY;
50 proj.think = turret_flac_projectile_think_explode;
51 proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01);
52 Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
55 self.tur_head.frame = self.tur_head.frame + 1;
56 if (self.tur_head.frame >= 4)
57 self.tur_head.frame = 0;
63 void turret_flac_projectile_think_explode()
65 if(self.enemy != world)
66 if(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3)
67 setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
71 d = RadiusDamage (self, self.owner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
72 self.owner.tur_dbg_dmg_t_h = self.owner.tur_dbg_dmg_t_h + d;
73 self.owner.tur_dbg_dmg_t_f = self.owner.tur_dbg_dmg_t_f + self.owner.shot_dmg;
75 RadiusDamage (self, self.realowner, self.owner.shot_dmg, self.owner.shot_dmg, self.owner.shot_radius, self, world, self.owner.shot_force, self.totalfrags, world);
80 void spawnfunc_turret_flac() { SELFPARAM(); if(!turret_initialize(TUR_FLAC.m_id)) remove(self); }
82 METHOD(Flac, tr_attack, void(Flac thistur))
84 Weapon wep = WEP_FLAC;
85 wep.wr_think(wep, true, false);
87 METHOD(Flac, tr_think, bool(Flac thistur))
91 METHOD(Flac, tr_death, bool(Flac thistur))
95 METHOD(Flac, tr_setup, bool(Flac thistur))
97 self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
98 self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
99 self.damage_flags |= TFL_DMG_HEADSHAKE;
100 self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY;
104 METHOD(Flac, tr_precache, bool(Flac thistur))
111 METHOD(Flac, tr_setup, bool(Flac thistur))
115 METHOD(Flac, tr_precache, bool(Flac thistur))
121 #endif // REGISTER_TURRET