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