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 27 of file fusionreactor.qc.

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

References turret_initialize().

◆ turret_fusionreactor_firecheck()

bool turret_fusionreactor_firecheck ( entity this)

Definition at line 4 of file fusionreactor.qc.

5{
6 entity targ = this.enemy;
7
8 switch(MUTATOR_CALLHOOK(FusionReactor_ValidTarget, this, targ))
9 {
10 case MUT_FUSREAC_TARG_VALID: { return true; }
11 case MUT_FUSREAC_TARG_INVALID: { return false; }
12 }
13
14 if((this.attack_finished_single[0] > time)
15 || (!targ)
16 || (IS_DEAD(targ))
17 || (this.ammo < this.shot_dmg)
18 || (targ.ammo >= targ.ammo_max)
19 || (vdist(targ.origin - this.origin, >, this.target_range))
20 || (this.team != targ.team)
21 || (!(targ.ammo_flags & TFL_AMMO_ENERGY))
22 ) { return false; }
23
24 return true;
25}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define IS_DEAD(s)
Definition player.qh:245
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
Definition turret.qh:157
#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, TFL_AMMO_ENERGY, time, and vdist.