]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/gamemode_ctf.qh
fix a few syntax errors
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_ctf.qh
1 // these are needed since mutators are compiled last
2
3 // used in cheats.qc
4 void ctf_RespawnFlag(entity flag);
5
6 // score rule declarations
7 #define ST_CTF_CAPS 1
8 #define SP_CTF_CAPS 4
9 #define SP_CTF_CAPTIME 5
10 #define SP_CTF_PICKUPS 6
11 #define SP_CTF_DROPS 7
12 #define SP_CTF_FCKILLS 8
13 #define SP_CTF_RETURNS 9
14
15 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
16 #define FLAG_MIN (PL_MIN + '0 0 -13')
17 #define FLAG_MAX (PL_MAX + '0 0 -13')
18
19 #define FLAG_SCALE 0.6
20
21 #define FLAG_THINKRATE 0.2
22 #define FLAG_TOUCHRATE 0.5
23 #define WPFE_THINKRATE 0.5
24
25 #define FLAG_DROP_OFFSET ('0 0 32')
26 #define FLAG_CARRY_OFFSET ('-16 0 8')
27 #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_z - 13))
28 #define FLAG_WAYPOINT_OFFSET ('0 0 64')
29 #define FLAG_FLOAT_OFFSET ('0 0 32')
30 #define FLAG_PASS_ARC_OFFSET ('0 0 -10')
31
32 #define VEHICLE_FLAG_OFFSET ('0 0 96')
33 #define VEHICLE_FLAG_SCALE 1.0
34
35 // waypoint colors
36 #define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
37 #define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
38 #define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
39
40 // sounds 
41 #define snd_flag_taken noise
42 #define snd_flag_returned noise1
43 #define snd_flag_capture noise2
44 #define snd_flag_respawn noise3
45 .string snd_flag_dropped;
46 .string snd_flag_touch;
47 .string snd_flag_pass;
48
49 // effects
50 .string toucheffect;
51 .string passeffect;
52 .string capeffect;
53
54 // list of flags on the map
55 entity ctf_worldflaglist;
56 .entity ctf_worldflagnext;
57 .entity ctf_staleflagnext;
58
59 // waypoint sprites
60 .entity bot_basewaypoint; // flag waypointsprite
61 .entity wps_helpme;
62 .entity wps_flagbase; 
63 .entity wps_flagcarrier;
64 .entity wps_flagdropped;
65 .entity wps_enemyflagcarrier;
66 .float wps_helpme_time;
67 float wpforenemy_announced;
68 float wpforenemy_nextthink;
69
70 // statuses
71 #define FLAG_BASE 1
72 #define FLAG_DROPPED 2
73 #define FLAG_CARRY 3
74 #define FLAG_PASSING 4
75
76 #define DROP_NORMAL 1
77 #define DROP_THROW 2
78 #define DROP_PASS 3
79 #define DROP_RESET 4
80
81 #define PICKUP_BASE 1
82 #define PICKUP_DROPPED 2
83
84 #define CAPTURE_NORMAL 1
85 #define CAPTURE_DROPPED 2
86
87 #define RETURN_TIMEOUT 1
88 #define RETURN_DROPPED 2
89 #define RETURN_DAMAGE 3
90 #define RETURN_SPEEDRUN 4
91 #define RETURN_NEEDKILL 5
92
93 // flag properties
94 #define ctf_spawnorigin dropped_origin
95 float ctf_stalemate; // indicates that a stalemate is active
96 float ctf_captimerecord; // record time for capturing the flag
97 .float ctf_pickuptime;
98 .float ctf_droptime;
99 .float ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
100 .entity ctf_dropper; // don't allow spam of dropping the flag
101 .float max_flag_health;
102 .float next_take_time;
103
104 // passing/throwing properties
105 .float pass_distance;
106 .entity pass_sender;
107 .entity pass_target;
108 .float throw_antispam;
109 .float throw_prevtime;
110 .float throw_count;
111
112 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
113 .float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
114 float ctf_captureshield_min_negscore; // punish at -20 points
115 float ctf_captureshield_max_ratio; // punish at most 30% of each team
116 float ctf_captureshield_force; // push force of the shield
117
118 // bot player logic
119 #define HAVOCBOT_CTF_ROLE_NONE 0
120 #define HAVOCBOT_CTF_ROLE_DEFENSE 2
121 #define HAVOCBOT_CTF_ROLE_MIDDLE 4
122 #define HAVOCBOT_CTF_ROLE_OFFENSE 8
123 #define HAVOCBOT_CTF_ROLE_CARRIER 16
124 #define HAVOCBOT_CTF_ROLE_RETRIEVER 32
125 #define HAVOCBOT_CTF_ROLE_ESCORT 64
126
127 .float havocbot_cantfindflag;
128
129 vector havocbot_ctf_middlepoint;
130 float havocbot_ctf_middlepoint_radius;
131
132 void havocbot_role_ctf_setrole(entity bot, float role);