]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/plasma.qc
Merge branch 'Mario/headshots' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / plasma.qc
1 #include "plasma.qh"
2
3 #ifdef SVQC
4
5 spawnfunc(turret_plasma) { if (!turret_initialize(this, TUR_PLASMA)) delete(this); }
6
7 METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
8 {
9     if(MUTATOR_IS_ENABLED(mutator_instagib))
10     {
11         .entity weaponentity = weaponentities[0]; // TODO: unhardcode
12         FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000, false,
13                            800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
14
15         Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, it.tur_shotorg, it.tur_shotdir_updated * 1000, 1);
16
17         // teamcolor / hit beam effect
18         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
19         WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
20     }
21     else
22     {
23         SUPER(PlasmaTurret).tr_attack(this, it);
24     }
25     if (it.tur_head.frame == 0)
26         it.tur_head.frame = 1;
27 }
28 METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it))
29 {
30     if (it.tur_head.frame != 0)
31         it.tur_head.frame = it.tur_head.frame + 1;
32
33     if (it.tur_head.frame > 5)
34         it.tur_head.frame = 0;
35 }
36 METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it))
37 {
38     it.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
39     it.damage_flags |= TFL_DMG_HEADSHAKE;
40     it.firecheck_flags |= TFL_FIRECHECK_AFF;
41     it.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_SPLASH;
42
43     turret_do_updates(it);
44 }
45
46 #endif