]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator/gamemode_assault.qh
GameRules: make `GameRules_teams(true)` imply `have_team_spawns = -1`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_assault.qh
1 #pragma once
2
3 #include "../gamemode.qh"
4
5 void assault_ScoreRules();
6
7 REGISTER_MUTATOR(as, false)
8 {
9         GameRules_teams(true);
10
11         MUTATOR_ONADD
12         {
13                 if (time > 1) // game loads at time 1
14                         error("This is a game type and it cannot be added at runtime.");
15                 assault_ScoreRules();
16         }
17
18         MUTATOR_ONROLLBACK_OR_REMOVE
19         {
20                 // we actually cannot roll back assault_Initialize here
21                 // BUT: we don't need to! If this gets called, adding always
22                 // succeeds.
23         }
24
25         MUTATOR_ONREMOVE
26         {
27                 LOG_INFO("This is a game type and it cannot be removed at runtime.");
28                 return -1;
29         }
30
31         return 0;
32 }
33
34 // sprites
35 .entity assault_decreaser;
36 .entity assault_sprite;
37
38 // legacy bot defs
39 const int HAVOCBOT_AST_ROLE_NONE = 0;
40 const int HAVOCBOT_AST_ROLE_DEFENSE = 2;
41 const int HAVOCBOT_AST_ROLE_OFFENSE = 4;
42
43 .int havocbot_role_flags;
44 .float havocbot_attack_time;
45
46 .void(entity this) havocbot_role;
47 .void(entity this) havocbot_previous_role;
48
49 void(entity this) havocbot_role_ast_defense;
50 void(entity this) havocbot_role_ast_offense;
51
52 void(entity bot) havocbot_ast_reset_role;
53
54 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
55 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
56
57 // scoreboard stuff
58 const float ST_ASSAULT_OBJECTIVES = 1;
59
60 // predefined spawnfuncs
61 void target_objective_decrease_activate(entity this);