Xonotic
plasma.qc
Go to the documentation of this file.
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
19  Send_Effect(EFFECT_VAPORIZER(it.team), it.tur_shotorg, v, 1);
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 {
39  it.damage_flags |= TFL_DMG_HEADSHAKE;
40  it.firecheck_flags |= TFL_FIRECHECK_AFF;
42 
44 }
45 
46 #endif
const int TFL_DMG_HEADSHAKE
Definition: turret.qh:155
const int TFL_FIRECHECK_AFF
Definition: turret.qh:102
entity() spawn
bool turret_initialize(entity this, Turret tur)
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
void turret_do_updates(entity e_turret)
updates aim org, shot org, shot dir and enemy org for selected turret
const int TFL_AMMO_RECHARGE
Definition: turret.qh:143
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition: common.qc:535
#define SUPER(cname)
Definition: oo.qh:219
#define MUTATOR_IS_ENABLED(this)
Definition: base.qh:176
const int TFL_AIM_LEAD
Definition: turret.qh:82
vector trace_endpos
Definition: csprogsdefs.qc:37
const int TFL_AMMO_RECIEVE
Definition: turret.qh:144
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity WarpZone_trace_transform
Definition: common.qh:37
vector v
Definition: ent_cs.qc:116
const int TFL_AIM_SPLASH
Definition: turret.qh:81
const int TFL_AMMO_ENERGY
Definition: turret.qh:140
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
void FireRailgunBullet(entity this,.entity weaponentity, vector start, vector end, float bdamage, bool headshot_notify, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype)
Definition: tracing.qc:231
const int TFL_AIM_SHOTTIMECOMPENSATE
Definition: turret.qh:83
entity EFFECT_VAPORIZER(int teamid)
Definition: all.inc:67