Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
mlrs.qc
Go to the documentation of this file.
1#include "mlrs.qh"
2
3#ifdef SVQC
4
5spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) delete(this); }
6
7METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
8{
9 // 0 = full, 6 = empty
10 it.tur_head.frame = bound(0, 6 - floor(0.1 + it.ammo / it.shot_dmg), 6);
11 if(it.tur_head.frame < 0)
12 {
13 LOG_TRACE("ammo:",ftos(it.ammo));
14 LOG_TRACE("shot_dmg:",ftos(it.shot_dmg));
15 }
16}
17METHOD(MLRSTurret, tr_setup, void(MLRSTurret this, entity it))
18{
19 it.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
21
22 it.damage_flags |= TFL_DMG_HEADSHAKE;
23 it.shoot_flags |= TFL_SHOOT_VOLLYALWAYS;
24 it.volly_counter = it.shot_volly;
25}
26
27#endif // SVQC
28#ifdef MENUQC
30
31METHOD(MLRSTurret, describe, string(MLRSTurret this))
32{
33 TC(MLRSTurret, this);
35 PAR(_("The %s fires a rapid burst of 6 rockets similar to those of the %s towards its targets."), COLORED_NAME(this), COLORED_NAME(WEP_DEVASTATOR));
36 PAR(_("Getting caught in the line of fire of this turret can be very deadly, "
37 "but thankfully it doesn't shoot if you get too close, so as to not damage itself."));
38 return PAGE_TEXT;
39}
40
41#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 LOG_TRACE(...)
Definition log.qh:76
float bound(float min, float value, float max)
string ftos(float f)
float floor(float f)
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#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_initialize(entity this, Turret tur)
const int TFL_DMG_HEADSHAKE
Definition turret.qh:172
const int TFL_SHOOT_VOLLYALWAYS
Definition turret.qh:129
const int TFL_AIM_LEAD
Definition turret.qh:99
const int TFL_AMMO_ROCKETS
Definition turret.qh:159
const int TFL_AIM_SHOTTIMECOMPENSATE
Definition turret.qh:100
const int TFL_AMMO_RECHARGE
Definition turret.qh:160