]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/gamemode_ctf.qh
More waypoint_for_enemy flagcarrier stuff, plus some cleanups/tweaks
[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 portals.qc
7 void ctf_Handle_Throw(entity player, entity reciever, float droptype);
8
9 // used in g_damage.qc
10 float ctf_ReadScore(string parameter); // SOON WON'T BE NEEDED. // FIXCTF
11
12 // used in t_quake3.qc
13 void spawnfunc_info_player_team1();
14 void spawnfunc_info_player_team2();
15 void spawnfunc_info_player_team3();
16 void spawnfunc_info_player_team4();
17 void spawnfunc_item_flag_team1();
18 void spawnfunc_item_flag_team2();
19 void spawnfunc_ctf_team();
20
21 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
22 #define FLAG_MIN (PL_MIN + '0 0 -13')
23 #define FLAG_MAX (PL_MAX + '0 0 -13')
24 #define FLAG_SCALE 0.6
25
26 #define FLAG_THINKRATE 0.2
27 #define FLAG_TOUCHRATE 0.5
28
29 #define FLAG_DROP_OFFSET ('0 0 32')
30 #define FLAG_CARRY_OFFSET ('-16 0 8')
31 #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_z - 13))
32 #define FLAG_WAYPOINT_OFFSET ('0 0 64')
33
34 // waypoint colors
35 #define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
36 #define WPCOLOR_FLAGCARRIER(t) (('0 0.75 0' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
37 #define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
38
39 // sounds 
40 .string noise4;
41 .string noise5;
42
43 #define snd_flag_taken noise
44 #define snd_flag_returned noise1
45 #define snd_flag_capture noise2
46 #define snd_flag_respawn noise3
47 #define snd_flag_dropped noise4
48 #define snd_flag_touch noise5
49
50 // list of flags on the map
51 entity ctf_worldflaglist;
52 .entity ctf_worldflagnext;
53
54 // waypoint sprites
55 .entity bot_basewaypoint; // flag waypointsprite
56 .entity wps_flagbase; 
57 .entity wps_flagcarrier;
58 .entity wps_flagdropped;
59 .entity wps_enemyflagcarrier;
60
61 // statuses
62 #define FLAG_BASE 1
63 #define FLAG_DROPPED 2
64 #define FLAG_CARRY 3
65 #define FLAG_PASSING 4
66
67 #define DROP_NORMAL 1
68 #define DROP_THROW 2
69 #define DROP_PASS 3
70 #define DROP_RESET 4
71
72 #define PICKUP_BASE 1
73 #define PICKUP_DROPPED 2
74
75 #define CAPTURE_NORMAL 1
76 #define CAPTURE_DROPPED 2
77
78 // flag properties
79 #define ctf_spawnorigin dropped_origin
80 float ctf_captimerecord; // record time for capturing the flag
81 .float ctf_pickuptime;
82 .float ctf_droptime;
83 .float ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
84 .entity ctf_carrier;
85 .entity ctf_dropper; // don't allow spam of dropping the flag
86 .float max_flag_health;
87 .float next_take_time;
88 .float wpforenemy_announced;
89
90 // passing properties
91 .entity pass_sender;
92 .entity pass_target;
93 .float throw_antispam;
94
95 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
96 .float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
97 float ctf_captureshield_min_negscore; // punish at -20 points
98 float ctf_captureshield_max_ratio; // punish at most 30% of each team
99 float ctf_captureshield_force; // push force of the shield