Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / plasma_dual.qc
1 #include "plasma_dual.qh"
2
3 #ifdef IMPLEMENTATION
4
5 #ifdef SVQC
6
7 spawnfunc(turret_plasma_dual) { if (!turret_initialize(this, TUR_PLASMA_DUAL)) delete(this); }
8
9 METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
10 {
11     if (g_instagib) {
12         .entity weaponentity = weaponentities[0]; // TODO: unhardcode
13         FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
14                            800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
15
16
17         Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1);
18
19         // teamcolor / hit beam effect
20         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
21         WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
22     } else {
23         SUPER(PlasmaTurret).tr_attack(thistur, it);
24     }
25     it.tur_head.frame += 1;
26 }
27 METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
28 {
29     if ((it.tur_head.frame != 0) && (it.tur_head.frame != 3))
30         it.tur_head.frame = it.tur_head.frame + 1;
31
32     if (it.tur_head.frame > 6)
33         it.tur_head.frame = 0;
34 }
35
36 #endif
37 #endif