]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/gamemode_ctf.qh
These spawnfuncs belong in the CTF code file, not elsewhere
[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
31 #define VEHICLE_FLAG_OFFSET ('0 0 96')
32 #define VEHICLE_FLAG_SCALE 1.0
33
34 // waypoint colors
35 #define WPCOLOR_ENEMYFC(t) (colormapPaletteColor(t - 1, FALSE) * 0.75)
36 #define WPCOLOR_FLAGCARRIER(t) ('0.8 0.8 0')
37 #define WPCOLOR_DROPPEDFLAG(t) (('0.25 0.25 0.25' + colormapPaletteColor(t - 1, FALSE)) * 0.5)
38
39 // sounds 
40 #define snd_flag_taken noise
41 #define snd_flag_returned noise1
42 #define snd_flag_capture noise2
43 #define snd_flag_respawn noise3
44 .string snd_flag_dropped;
45 .string snd_flag_touch;
46 .string snd_flag_pass;
47
48 // effects
49 .string toucheffect;
50 .string passeffect;
51 .string capeffect;
52
53 // list of flags on the map
54 entity ctf_worldflaglist;
55 .entity ctf_worldflagnext;
56 .entity ctf_staleflagnext;
57
58 // waypoint sprites
59 .entity bot_basewaypoint; // flag waypointsprite
60 .entity wps_helpme;
61 .entity wps_flagbase; 
62 .entity wps_flagcarrier;
63 .entity wps_flagdropped;
64 .entity wps_enemyflagcarrier;
65 float wpforenemy_announced;
66 float wpforenemy_nextthink;
67
68 // statuses
69 #define FLAG_BASE 1
70 #define FLAG_DROPPED 2
71 #define FLAG_CARRY 3
72 #define FLAG_PASSING 4
73
74 #define DROP_NORMAL 1
75 #define DROP_THROW 2
76 #define DROP_PASS 3
77 #define DROP_RESET 4
78
79 #define PICKUP_BASE 1
80 #define PICKUP_DROPPED 2
81
82 #define CAPTURE_NORMAL 1
83 #define CAPTURE_DROPPED 2
84
85 #define RETURN_TIMEOUT 1
86 #define RETURN_DROPPED 2
87 #define RETURN_DAMAGE 3
88 #define RETURN_SPEEDRUN 4
89 #define RETURN_NEEDKILL 5
90
91 // flag properties
92 #define ctf_spawnorigin dropped_origin
93 float ctf_stalemate; // indicates that a stalemate is active
94 float ctf_captimerecord; // record time for capturing the flag
95 .float ctf_pickuptime;
96 .float ctf_droptime;
97 .float ctf_status; // status of the flag (FLAG_BASE, FLAG_DROPPED, FLAG_CARRY declared globally)
98 .entity ctf_dropper; // don't allow spam of dropping the flag
99 .float max_flag_health;
100 .float next_take_time;
101
102 // passing properties
103 .entity pass_sender;
104 .entity pass_target;
105 .float throw_antispam;
106
107 // CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
108 .float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
109 float ctf_captureshield_min_negscore; // punish at -20 points
110 float ctf_captureshield_max_ratio; // punish at most 30% of each team
111 float ctf_captureshield_force; // push force of the shield