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