]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/plasma_dual.qc
Turrets: delete 401 lines
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / plasma_dual.qc
1 #ifndef TUR_PLASMA_DUAL_H
2 #define TUR_PLASMA_DUAL_H
3
4 CLASS(PlasmaDualAttack, PlasmaAttack)
5 /* refname   */ ATTRIB(PlasmaDualAttack, netname, string, "turret_plasma_dual");
6 /* wepname   */ ATTRIB(PlasmaDualAttack, message, 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(DualPlasmaTurret, model, string, strzone(strcat("models/turrets/", this.mdl)));
16 /* head_model */ ATTRIB(DualPlasmaTurret, head_model, string, strzone(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 void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
30
31         METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this))
32         {
33             if (g_instagib) {
34                 FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
35                                    800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
36
37
38                 Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
39
40                 // teamcolor / hit beam effect
41                 vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
42                 WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
43             } else {
44                 super.vtblbase.tr_attack(this);
45             }
46             self.tur_head.frame += 1;
47         }
48         METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur))
49         {
50             if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
51                 self.tur_head.frame = self.tur_head.frame + 1;
52
53             if (self.tur_head.frame > 6)
54                 self.tur_head.frame = 0;
55         }
56
57 #endif // SVQC
58 #endif