]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
Create the g_race_targets, g_racecheckpoints and g_kaballs intrusive lists only when...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_onslaught.qh
1 #pragma once
2
3 #include <common/mutators/base.qh>
4
5 float autocvar_g_onslaught_point_limit;
6 IntrusiveList g_onsshields;
7 void ons_Initialize();
8
9 REGISTER_MUTATOR(ons, false)
10 {
11     MUTATOR_STATIC();
12         MUTATOR_ONADD
13         {
14                 GameRules_teams(true);
15                 GameRules_limit_score(autocvar_g_onslaught_point_limit);
16
17                 ons_Initialize();
18         }
19         return false;
20 }
21
22 .entity ons_toucher; // player who touched the control point
23
24 // control point / generator constants
25 const float ONS_CP_THINKRATE = 0.2;
26 const float GEN_THINKRATE = 1;
27 #define CPGEN_SPAWN_OFFSET ('0 0 1' * (PL_MAX_CONST.z - 13))
28 const vector CPGEN_WAYPOINT_OFFSET = ('0 0 128');
29 const vector CPICON_OFFSET = ('0 0 96');
30
31 // list of generators on the map
32 entity ons_worldgeneratorlist;
33 .entity ons_worldgeneratornext;
34
35 // list of control points on the map
36 entity ons_worldcplist;
37 .entity ons_worldcpnext;
38
39 // list of links on the map
40 entity ons_worldlinklist;
41 .entity ons_worldlinknext;
42
43 // definitions
44 .entity sprite;
45 .string target2;
46 .int iscaptured;
47 .int islinked;
48 .int isshielded;
49 .float lasthealth;
50 .int lastteam;
51 .int lastshielded;
52 .int lastcaptured;
53
54 .bool waslinked;
55
56 bool ons_stalemate;
57
58 .float teleport_antispam;
59
60 .int aregensneighbor;
61 .int arecpsneighbor;
62 float ons_notification_time[17];
63
64 .float ons_overtime_damagedelay;
65
66 .vector ons_deathloc;
67
68 .entity ons_spawn_by;
69
70 // declarations for functions used outside gamemode_onslaught.qc
71 void ons_Generator_UpdateSprite(entity e);
72 void ons_ControlPoint_UpdateSprite(entity e);
73 bool ons_ControlPoint_Attackable(entity cp, int teamnum);
74
75 // CaptureShield: Prevent capturing or destroying control point/generator if it is not available yet
76 float ons_captureshield_force; // push force of the shield
77
78 // bot player logic
79 const int HAVOCBOT_ONS_ROLE_NONE                = 0;
80 const int HAVOCBOT_ONS_ROLE_DEFENSE     = 2;
81 const int HAVOCBOT_ONS_ROLE_ASSISTANT   = 4;
82 const int HAVOCBOT_ONS_ROLE_OFFENSE     = 8;
83
84 .entity havocbot_ons_target;
85
86 .float havocbot_attack_time;
87
88 void havocbot_role_ons_defense(entity this);
89 void havocbot_role_ons_offense(entity this);
90 void havocbot_role_ons_assistant(entity this);
91
92 void havocbot_ons_reset_role(entity this);
93 void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius);
94 void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius);
95
96 // score rule declarations
97 const int ST_ONS_CAPS = 1;