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