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) { if (!turret_initialize(this, TUR_PHASER)) delete(this); }
6
8
9METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
10{
11 if (it.tur_head.frame != 0)
12 {
13 if (it.fireflag == 1)
14 {
15 if (it.tur_head.frame == 10)
16 it.tur_head.frame = 1;
17 else
18 it.tur_head.frame = it.tur_head.frame +1;
19 }
20 else if (it.fireflag == 2 )
21 {
22 it.tur_head.frame = it.tur_head.frame +1;
23 if (it.tur_head.frame == 15)
24 {
25 it.tur_head.frame = 0;
26 it.fireflag = 0;
27 }
28 }
29 }
30}
32METHOD(PhaserTurret, tr_setup, void(PhaserTurret this, entity it))
33{
35 it.aim_flags = TFL_AIM_LEAD;
36
37 it.turret_firecheckfunc = turret_phaser_firecheck;
38}
40{
41 if (this.fireflag != 0) return false;
42 return turret_firecheck(this);
43}
44
45#endif // SVQC
46#ifdef MENUQC
47
48METHOD(PhaserTurret, describe, string(PhaserTurret this))
49{
50 TC(PhaserTurret, this);
52 PAR(_("The %s is a turret that fires an invisible beam of energy towards its targets."), COLORED_NAME(this));
53 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));
54 return PAGE_TEXT;
55}
56
57#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:39
int fireflag
Definition phaser.qc:7
#define spawnfunc(id)
Definition spawnfunc.qh:96
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642
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
Definition turret.qh:99
const int TFL_AMMO_ENERGY
Definition turret.qh:157
const int TFL_AMMO_RECHARGE
Definition turret.qh:160
const int TFL_AMMO_RECIEVE
Definition turret.qh:161