Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
fusionreactor.qc File Reference
#include "fusionreactor.qh"
Include dependency graph for fusionreactor.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 spawnfunc (turret_fusionreactor)
bool turret_fusionreactor_firecheck (entity this)

Function Documentation

◆ spawnfunc()

spawnfunc ( turret_fusionreactor )

Definition at line 26 of file fusionreactor.qc.

27{
28 if (!turret_initialize(this, TUR_FUSIONREACTOR))
29 delete(this);
30}
bool turret_initialize(entity this, Turret tur)

References turret_initialize().

◆ turret_fusionreactor_firecheck()

bool turret_fusionreactor_firecheck ( entity this)

Definition at line 5 of file fusionreactor.qc.

6{
7 entity targ = this.enemy;
8
9 switch (MUTATOR_CALLHOOK(FusionReactor_ValidTarget, this, targ))
10 {
11 case MUT_FUSREAC_TARG_VALID: return true;
12 case MUT_FUSREAC_TARG_INVALID: return false;
13 }
14
15 if (this.attack_finished_single[0] > time
16 || !targ || this.team != targ.team
17 || IS_DEAD(targ)
18 || this.ammo < this.shot_dmg || targ.ammo >= targ.ammo_max
19 || vdist(targ.origin - this.origin, >, this.target_range)
20 || !(targ.ammo_flags & TFL_AMMO_ENERGY))
21 return false;
22
23 return true;
24}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int team
Definition main.qh:188
#define IS_DEAD(s)
Definition player.qh:244
float time
@ MUT_FUSREAC_TARG_VALID
Definition events.qh:1201
@ MUT_FUSREAC_TARG_INVALID
Definition events.qh:1202
entity enemy
Definition sv_ctf.qh:153
float ammo
Definition sv_turrets.qh:43
const int TFL_AMMO_ENERGY
uses power
Definition turret.qh:158
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
float attack_finished_single[MAX_WEAPONSLOTS]

References ammo, attack_finished_single, enemy, entity(), IS_DEAD, MUT_FUSREAC_TARG_INVALID, MUT_FUSREAC_TARG_VALID, MUTATOR_CALLHOOK, team, TFL_AMMO_ENERGY, time, and vdist.