Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
plasma.qc
Go to the documentation of this file.
1#include "plasma.qh"
2
3#ifdef SVQC
4
5spawnfunc(turret_plasma)
6{
7 if (!turret_initialize(this, TUR_PLASMA))
8 delete(this);
9}
10
11METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
12{
13 if (!MUTATOR_CALLHOOK(Turret_Plasma_Fire, it, false))
14 SUPER(PlasmaTurret).tr_attack(this, it);
15 if (it.tur_head.frame == 0)
16 it.tur_head.frame = 1;
17}
18METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it))
19{
20 if (it.tur_head.frame != 0)
21 ++it.tur_head.frame;
22 if (it.tur_head.frame > 5)
23 it.tur_head.frame = 0;
24}
25METHOD(PlasmaTurret, tr_setup, void(PlasmaTurret this, entity it))
26{
28 it.damage_flags |= TFL_DMG_HEADSHAKE;
29 it.firecheck_flags |= TFL_FIRECHECK_AFF;
31
33}
34
35#endif // SVQC
36#ifdef MENUQC
38#include "plasma_dual.qh"
39
40METHOD(PlasmaTurret, describe, string(PlasmaTurret this))
41{
42 TC(PlasmaTurret, this);
44 PAR(_("The %s is a turret that fires electric balls forwards, similar to those of the %s."), COLORED_NAME(this), COLORED_NAME(WEP_ELECTRO));
45 PAR(_("It is a weaker version of the %s, which has two electric ball cannons."), COLORED_NAME(TUR_PLASMA_DUAL));
46 return PAGE_TEXT;
47}
48
49#endif // MENUQC
#define MUTATOR_CALLHOOK(name,...)
Definition base.qh:186
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:189
#define TC(T, sym)
Definition _all.inc:82
#define SUPER(cname)
Definition oo.qh:236
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define spawnfunc(id)
Definition spawnfunc.qh:107
#define PAGE_TEXT
Definition string.qh:652
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:658
#define PAGE_TEXT_INIT()
Definition string.qh:651
void turret_do_updates(entity t_turret)
updates enemy distances, predicted impact point/time and updated aim<->predict impact distance.
bool turret_initialize(entity this, Turret tur)
const int TFL_DMG_HEADSHAKE
damage shakes head
Definition turret.qh:176
const int TFL_AIM_LEAD
try to predict target movement
Definition turret.qh:103
const int TFL_AIM_SPLASH
aim for ground around the target's feet
Definition turret.qh:102
const int TFL_AIM_SHOTTIMECOMPENSATE
compensate for shot traveltime when leading
Definition turret.qh:104
const int TFL_AMMO_ENERGY
uses power
Definition turret.qh:161
const int TFL_AMMO_RECHARGE
regenerates ammo
Definition turret.qh:164
const int TFL_AMMO_RECIEVE
can recieve ammo from support units
Definition turret.qh:165
const int TFL_FIRECHECK_AFF
try to avoid any friendly fire
Definition turret.qh:123