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