]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/gamemode_ctf.qh
Fix two bugs (multiple captures at once bug, and issue with flag touching bug)
[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 ('-15 0 7')
31 #define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_z - 13))
32 #define FLAG_WAYPOINT_OFFSET ('0 0 64')
33
34 // sounds 
35 .string noise4;
36 .string noise5;
37
38 #define snd_flag_taken noise
39 #define snd_flag_returned noise1
40 #define snd_flag_capture noise2
41 #define snd_flag_respawn noise3
42 #define snd_flag_dropped noise4
43 #define snd_flag_touch noise5
44
45 // list of flags on the map
46 entity ctf_worldflaglist;
47 .entity ctf_worldflagnext;
48
49 // waypoint sprites
50 .entity bot_basewaypoint; // flag waypointsprite
51 .entity wps_flagbase; 
52 .entity wps_flagcarrier;
53 .entity wps_flagdropped;
54
55 // statuses
56 #define FLAG_BASE 1
57 #define FLAG_DROPPED 2
58 #define FLAG_CARRY 3
59 #define FLAG_PASSING 4
60
61 #define DROPTYPE_DROP 1
62 #define DROPTYPE_THROW 2
63 #define DROPTYPE_PASS 3
64
65 // flag properties
66 #define ctf_spawnorigin dropped_origin
67 float ctf_captimerecord; // record time for capturing the flag
68 .float ctf_pickuptime;
69 .float ctf_droptime;
70 .float ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
71 .entity ctf_carrier;
72 .entity ctf_dropper; // don't allow spam of dropping the flag
73 .float max_flag_health;
74 .float next_take_time;
75
76 // passing properties
77 .entity pass_sender;
78 .entity pass_target;
79 .float throw_antispam;
80
81 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
82 .float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
83 float ctf_captureshield_min_negscore; // punish at -20 points
84 float ctf_captureshield_max_ratio; // punish at most 30% of each team
85 float ctf_captureshield_force; // push force of the shield