Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
phaser.qc
Go to the documentation of this file.
1#include "phaser.qh"
2
3#ifdef SVQC
4
5spawnfunc(turret_phaser)
6{
7 if (!turret_initialize(this, TUR_PHASER))
8 delete(this);
9}
10
12
13METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
14{
15 if (it.tur_head.frame != 0)
16 {
17 if (it.fireflag == 1)
18 {
19 if (it.tur_head.frame == 10)
20 it.tur_head.frame = 1;
21 else
22 ++it.tur_head.frame;
23 }
24 else if (it.fireflag == 2)
25 {
26 ++it.tur_head.frame;
27 if (it.tur_head.frame == 15)
28 {
29 it.tur_head.frame = 0;
30 it.fireflag = 0;
31 }
32 }
33 }
34}
36METHOD(PhaserTurret, tr_setup, void(PhaserTurret this, entity it))
37{
39 it.aim_flags = TFL_AIM_LEAD;
40
41 it.turret_firecheckfunc = turret_phaser_firecheck;
42}
44{
45 if (this.fireflag != 0)
46 return false;
47 return turret_firecheck(this);
48}
49
50#endif // SVQC
51#ifdef MENUQC
52
53METHOD(PhaserTurret, describe, string(PhaserTurret this))
54{
55 TC(PhaserTurret, this);
57 PAR(_("The %s is a turret that fires an invisible beam of energy towards its targets."), COLORED_NAME(this));
58 PAR(_("Looks are deceiving with the %s, since although the beam of energy can't be seen, it constantly deals damage to and slows down players who intercept its path."), COLORED_NAME(this));
59 return PAGE_TEXT;
60}
61
62#endif // MENUQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:195
#define TC(T, sym)
Definition _all.inc:82
#define METHOD(cname, name, prototype)
Definition oo.qh:269
bool turret_phaser_firecheck(entity this)
Definition phaser.qc:43
int fireflag
Definition phaser.qc:11
#define spawnfunc(id)
Definition spawnfunc.qh:96
#define PAGE_TEXT
Definition string.qh:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
bool turret_firecheck(entity this)
Preforms pre-fire checks based on the uints firecheck_flags.
bool turret_initialize(entity this, Turret tur)
const int TFL_AIM_LEAD
try to predict target movement
Definition turret.qh:100
const int TFL_AMMO_ENERGY
uses power
Definition turret.qh:158
const int TFL_AMMO_RECHARGE
regenerates ammo
Definition turret.qh:161
const int TFL_AMMO_RECIEVE
can recieve ammo from support units
Definition turret.qh:162