]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/plasma_dual.qc
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / plasma_dual.qc
1 #ifndef TURRET_PLASMA_DUAL_H
2 #define TURRET_PLASMA_DUAL_H
3
4 CLASS(PlasmaDualAttack, PlasmaAttack)
5 /* refname   */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual");
6 /* wepname   */ ATTRIB(PlasmaDualAttack, m_name, string, _("Dual plasma"));
7 ENDCLASS(PlasmaDualAttack)
8 REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack));
9
10 CLASS(DualPlasmaTurret, PlasmaTurret)
11 /* spawnflags */ ATTRIB(DualPlasmaTurret, spawnflags, int, TUR_FLAG_SPLASH | TUR_FLAG_MEDPROJ | TUR_FLAG_PLAYER);
12 /* mins       */ ATTRIB(DualPlasmaTurret, mins, vector, '-32 -32 0');
13 /* maxs       */ ATTRIB(DualPlasmaTurret, maxs, vector, '32 32 64');
14 /* modelname  */ ATTRIB(DualPlasmaTurret, mdl, string, "base.md3");
15 /* model      */ ATTRIB_STRZONE(DualPlasmaTurret, model, string, strcat("models/turrets/", this.mdl));
16 /* head_model */ ATTRIB_STRZONE(DualPlasmaTurret, head_model, string, strcat("models/turrets/", "plasmad.md3"));
17 /* netname    */ ATTRIB(DualPlasmaTurret, netname, string, "plasma_dual");
18 /* fullname   */ ATTRIB(DualPlasmaTurret, turret_name, string, _("Dual Plasma Cannon"));
19     ATTRIB(DualPlasmaTurret, m_weapon, Weapon, WEP_PLASMA_DUAL);
20 ENDCLASS(DualPlasmaTurret)
21 REGISTER_TURRET(PLASMA_DUAL, NEW(DualPlasmaTurret));
22
23 #endif
24
25 #ifdef IMPLEMENTATION
26
27 #ifdef SVQC
28
29 spawnfunc(turret_plasma_dual) { if (!turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
30
31 METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
32 {
33     SELFPARAM();
34     if (g_instagib) {
35         FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
36                            800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
37
38
39         Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
40
41         // teamcolor / hit beam effect
42         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
43         WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
44     } else {
45         SUPER(PlasmaTurret).tr_attack(thistur, it);
46     }
47     self.tur_head.frame += 1;
48 }
49 METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
50 {
51     SELFPARAM();
52     if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
53         self.tur_head.frame = self.tur_head.frame + 1;
54
55     if (self.tur_head.frame > 6)
56         self.tur_head.frame = 0;
57 }
58
59 #endif
60 #endif