Xonotic
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 
9 spawnfunc(turret_hk) { if(!turret_initialize(this, TUR_HK)) delete(this); }
10 
11 METHOD(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 
20 bool turret_hk_addtarget(entity this, entity e_target,entity e_sender);
21 METHOD(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 
33 bool 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
float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
const int TFL_FIRECHECK_AFF
Definition: turret.qh:102
const int TFL_AMMO_ROCKETS
Definition: turret.qh:142
entity() spawn
int target_validate_flags
Definition: turret.qh:62
bool turret_initialize(entity this, Turret tur)
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
const int TFL_AMMO_RECHARGE
Definition: turret.qh:143
const int TFL_TARGETSELECT_LOS
Definition: turret.qh:64
entity enemy
Definition: sv_ctf.qh:143
const int TFL_FIRECHECK_REFIRE
Definition: turret.qh:105
const int TFL_TARGETSELECT_TEAMCHECK
Definition: turret.qh:70
const int TFL_FIRECHECK_DEAD
Definition: turret.qh:95
const int TFL_TARGETSELECT_VEHICLES
Definition: turret.qh:76
const int TFL_FIRECHECK_TEAMCHECK
Definition: turret.qh:101
const int TFL_AIM_SIMPLE
Definition: turret.qh:85
const int TFL_TARGETSELECT_RANGELIMITS
Definition: turret.qh:69
const int TFL_SHOOT_CLEARTARGET
Definition: turret.qh:114
const int TFL_TARGETSELECT_TRIGGERTARGET
Definition: turret.qh:67