]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / assault / sv_assault.qh
1 #pragma once
2
3 #include <common/mutators/base.qh>
4 #include <common/scores.qh>
5
6 const int ASSAULT_VALUE_INACTIVE = 1000;
7
8 const int ST_ASSAULT_OBJECTIVES = 1;
9
10 IntrusiveList g_assault_destructibles;
11 IntrusiveList g_assault_objectivedecreasers;
12 IntrusiveList g_assault_objectives;
13
14 REGISTER_MUTATOR(as, false)
15 {
16     MUTATOR_STATIC();
17         MUTATOR_ONADD
18         {
19                 g_assault_destructibles = IL_NEW();
20                 g_assault_objectivedecreasers = IL_NEW();
21                 g_assault_objectives = IL_NEW();
22         GameRules_teams(true);
23         int teams = BITS(2); // always red vs blue
24         GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
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 }
31
32 // sprites
33 .entity assault_decreaser;
34 .entity assault_sprite;
35
36 // legacy bot defs
37 const int HAVOCBOT_AST_ROLE_NONE = 0;
38 const int HAVOCBOT_AST_ROLE_DEFENSE = 2;
39 const int HAVOCBOT_AST_ROLE_OFFENSE = 4;
40
41 .float havocbot_attack_time;
42
43 void(entity this) havocbot_role_ast_defense;
44 void(entity this) havocbot_role_ast_offense;
45
46 void(entity bot) havocbot_ast_reset_role;
47
48 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
49 void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
50
51 // assault game mode: Which team is attacking in this round?
52 float assault_attacker_team;
53
54 // predefined spawnfuncs
55 void target_objective_decrease_activate(entity this);