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