Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
hk.qc
Go to the documentation of this file.
1#include "hk.qh"
2
3#ifdef SVQC
4
5#ifdef TURRET_DEBUG_HK
6.float atime;
7#endif
8
9spawnfunc(turret_hk) { if(!turret_initialize(this, TUR_HK)) delete(this); }
10
11METHOD(HunterKiller, tr_think, void(HunterKiller thistur, entity it))
12{
13 if (it.tur_head.frame != 0)
14 it.tur_head.frame = it.tur_head.frame + 1;
15
16 if (it.tur_head.frame > 5)
17 it.tur_head.frame = 0;
18}
19
20bool turret_hk_addtarget(entity this, entity e_target,entity e_sender);
21METHOD(HunterKiller, tr_setup, void(HunterKiller this, entity it))
22{
23 it.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
24 it.aim_flags = TFL_AIM_SIMPLE;
27 it.shoot_flags = TFL_SHOOT_CLEARTARGET;
28 it.target_validate_flags = TFL_TARGETSELECT_VEHICLES | TFL_TARGETSELECT_TEAMCHECK;
29
30 it.turret_addtarget = turret_hk_addtarget;
31}
32
33bool turret_hk_addtarget(entity this, entity e_target,entity e_sender)
34{
35 if (e_target)
36 {
37 if (turret_validate_target(this,e_target,this.target_validate_flags) > 0)
38 {
39 this.enemy = e_target;
40 return true;
41 }
42 }
43
44 return false;
45}
46
47#endif // SVQC
48#ifdef MENUQC
50
51METHOD(HunterKiller, describe, string(HunterKiller this))
52{
53 TC(HunterKiller, this);
55 PAR(_("The %s fires a single powerful homing rocket with the ability to evade obstacles to find its target. "
56 "The rocket it fires is similar to that of the %s."), COLORED_NAME(this), COLORED_NAME(WEP_DEVASTATOR));
57 return PAGE_TEXT;
58}
59
60#endif // MENUQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:195
bool turret_hk_addtarget(entity this, entity e_target, entity e_sender)
Definition hk.qc:33
#define TC(T, sym)
Definition _all.inc:82
#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
entity enemy
Definition sv_ctf.qh:153
float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
Evaluate a entity for target valitity based on validate_flags NOTE: the caller must check takedamage ...
bool turret_initialize(entity this, Turret tur)
const int TFL_TARGETSELECT_TEAMCHECK
Definition turret.qh:87
int target_validate_flags
Definition turret.qh:79
const int TFL_FIRECHECK_DEAD
Definition turret.qh:112
const int TFL_TARGETSELECT_TRIGGERTARGET
Definition turret.qh:84
const int TFL_TARGETSELECT_RANGELIMITS
Definition turret.qh:86
const int TFL_SHOOT_CLEARTARGET
Definition turret.qh:131
const int TFL_AMMO_ROCKETS
Definition turret.qh:159
const int TFL_FIRECHECK_REFIRE
Definition turret.qh:122
const int TFL_TARGETSELECT_VEHICLES
Definition turret.qh:93
const int TFL_TARGETSELECT_LOS
Definition turret.qh:81
const int TFL_AMMO_RECHARGE
Definition turret.qh:160
const int TFL_FIRECHECK_TEAMCHECK
Definition turret.qh:118
const int TFL_AIM_SIMPLE
Definition turret.qh:102
const int TFL_FIRECHECK_AFF
Definition turret.qh:119