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