Xonotic
sv_assault.qh File Reference
+ Include dependency graph for sv_assault.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 REGISTER_MUTATOR (as, false)
 
void target_objective_decrease_activate (entity this)
 
 void (entity this) havocbot_role_ast_defense
 
 void (entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items
 

Variables

float assault_attacker_team
 
entity assault_decreaser
 
entity assault_sprite
 
const int ASSAULT_VALUE_INACTIVE = 1000
 
IntrusiveList g_assault_destructibles
 
IntrusiveList g_assault_objectivedecreasers
 
IntrusiveList g_assault_objectives
 
const int HAVOCBOT_AST_ROLE_DEFENSE = 2
 
const int HAVOCBOT_AST_ROLE_NONE = 0
 
const int HAVOCBOT_AST_ROLE_OFFENSE = 4
 
float havocbot_attack_time
 
const int ST_ASSAULT_OBJECTIVES = 1
 

Function Documentation

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( as  ,
false   
)

Definition at line 14 of file sv_assault.qh.

References BITS, GameRules_scoring, GameRules_teams(), IL_NEW, MUTATOR_ONADD, MUTATOR_STATIC, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_SECONDARY, ST_ASSAULT_OBJECTIVES, and teams.

15 {
18  {
22  GameRules_teams(true);
23  int teams = BITS(2); // always red vs blue
25  field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
26  field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
27  });
28  }
29  return 0;
30 }
#define GameRules_scoring(teams, spprio, stprio, fields)
Definition: sv_rules.qh:53
#define MUTATOR_STATIC()
Definition: base.qh:288
#define IL_NEW()
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit)
Definition: scores.qh:126
const int ST_ASSAULT_OBJECTIVES
Definition: sv_assault.qh:8
const int SFL_SORT_PRIO_PRIMARY
Definition: scores.qh:127
IntrusiveList g_assault_objectives
Definition: sv_assault.qh:12
entity teams
Definition: main.qh:44
void GameRules_teams(bool value)
Definition: sv_rules.qc:6
IntrusiveList g_assault_destructibles
Definition: sv_assault.qh:10
#define MUTATOR_ONADD
Definition: base.qh:284
#define BITS(n)
Definition: bits.qh:9
IntrusiveList g_assault_objectivedecreasers
Definition: sv_assault.qh:11
+ Here is the call graph for this function:

◆ target_objective_decrease_activate()

void target_objective_decrease_activate ( entity  this)

Definition at line 106 of file sv_assault.qc.

References assault_attacker_team, assault_decreaser_sprite_visible(), assault_sprite, entity(), FOREACH_ENTITY_STRING, NULL, owner, SPRITERULE_TEAMPLAY, target, and targetname.

107 {
108  entity spr;
109  this.owner = NULL;
111  {
112  if(it.assault_sprite != NULL)
113  {
114  WaypointSprite_Disown(it.assault_sprite, waypointsprite_deadlifetime);
115  if(it.classname == "func_assault_destructible")
116  it.sprite = NULL; // TODO: just unsetting it?!
117  }
118 
119  spr = WaypointSprite_SpawnFixed(WP_AssaultDefend, 0.5 * (it.absmin + it.absmax), it, assault_sprite, RADARICON_OBJECTIVE);
120  spr.assault_decreaser = this;
121  spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible;
122  WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY);
123  if(it.classname == "func_assault_destructible")
124  {
125  WaypointSprite_UpdateSprites(spr, WP_AssaultDefend, WP_AssaultDestroy, WP_AssaultDestroy);
126  WaypointSprite_UpdateMaxHealth(spr, it.max_health);
127  WaypointSprite_UpdateHealth(spr, GetResource(it, RES_HEALTH));
128  it.sprite = spr;
129  }
130  else
131  WaypointSprite_UpdateSprites(spr, WP_AssaultDefend, WP_AssaultPush, WP_AssaultPush);
132  });
133 }
entity() spawn
bool assault_decreaser_sprite_visible(entity this, entity player, entity view)
Definition: sv_assault.qc:98
entity owner
Definition: main.qh:73
#define FOREACH_ENTITY_STRING(fld, match, body)
Definition: iter.qh:184
const int SPRITERULE_TEAMPLAY
#define NULL
Definition: post.qh:17
entity assault_sprite
Definition: sv_assault.qh:34
string targetname
Definition: progsdefs.qc:194
string target
Definition: progsdefs.qc:193
float assault_attacker_team
Definition: sv_assault.qh:52
+ Here is the call graph for this function:

◆ void() [1/2]

void ( entity  this)

◆ void() [2/2]

void ( entity  this,
float  ratingscale,
vector  org,
float  sradius 
)

Variable Documentation

◆ assault_attacker_team

◆ assault_decreaser

entity assault_decreaser

Definition at line 33 of file sv_assault.qh.

Referenced by assault_decreaser_sprite_visible().

◆ assault_sprite

entity assault_sprite

Definition at line 34 of file sv_assault.qh.

Referenced by target_objective_decrease_activate().

◆ ASSAULT_VALUE_INACTIVE

◆ g_assault_destructibles

IntrusiveList g_assault_destructibles

Definition at line 10 of file sv_assault.qh.

Referenced by havocbot_goalrating_ast_targets(), and spawnfunc().

◆ g_assault_objectivedecreasers

IntrusiveList g_assault_objectivedecreasers

Definition at line 11 of file sv_assault.qh.

Referenced by assault_objective_use(), and spawnfunc().

◆ g_assault_objectives

IntrusiveList g_assault_objectives

Definition at line 12 of file sv_assault.qh.

Referenced by assault_setenemytoobjective(), and spawnfunc().

◆ HAVOCBOT_AST_ROLE_DEFENSE

const int HAVOCBOT_AST_ROLE_DEFENSE = 2

Definition at line 38 of file sv_assault.qh.

Referenced by havocbot_ast_reset_role(), and havocbot_role_ast_setrole().

◆ HAVOCBOT_AST_ROLE_NONE

const int HAVOCBOT_AST_ROLE_NONE = 0

Definition at line 37 of file sv_assault.qh.

◆ HAVOCBOT_AST_ROLE_OFFENSE

const int HAVOCBOT_AST_ROLE_OFFENSE = 4

Definition at line 39 of file sv_assault.qh.

Referenced by havocbot_ast_reset_role(), and havocbot_role_ast_setrole().

◆ havocbot_attack_time

◆ ST_ASSAULT_OBJECTIVES

const int ST_ASSAULT_OBJECTIVES = 1

Definition at line 8 of file sv_assault.qh.

Referenced by REGISTER_MUTATOR(), and WinningCondition_Assault().