3 REGISTRY(IMPULSES, 255)
4 REGISTER_REGISTRY(IMPULSES)
5 REGISTRY_SORT(IMPULSES)
7 REGISTRY_DEFINE_GET(IMPULSES, NULL)
8 STATIC_INIT(IMPULSES_renumber)
10 FOREACH(IMPULSES, true, it.m_id = i);
12 REGISTRY_CHECK(IMPULSES)
14 .void(entity this) impulse_handle;
17 void Impulse_Send(entity imp)
19 localcmd(sprintf("\nimpulse %d\n", imp.impulse));
22 #define IMPULSE_ALIAS(alias, id) localcmd("\nalias " #alias " \"", id ,"\"\n")
24 #define IMPULSE_ALIAS(alias, id)
27 #define REGISTER_IMPULSE(id, n) _REGISTER_IMPULSE(IMP_##id, id, n)
28 #define _REGISTER_IMPULSE(id, alias, n) \
29 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
32 IMPULSE_ALIAS(alias, "impulse " #n); \
35 #define LEGACY_IMPULSE_ID(alias, id) LEGACY_IMPULSE(alias, id, sprintf("impulse %d", IMP_##alias.impulse))
37 void _impCheck(string s, string alias)
39 // this is inside a function to avoid expanding it on compilation everytime
41 LOG_FATALF("LEGACY_IMPULSE: would define a recursive alias for '%s', use LEGACY_IMPULSE_ID instead", s);
44 #define LEGACY_IMPULSE(alias, id, new) \
45 STATIC_INIT(legacy_##alias) { \
47 _impCheck(s, #alias); \
48 IMPULSE_ALIAS(alias, s); \
50 SHUTDOWN(legacy_##alias) { IMPULSE_ALIAS(alias, "impulse " #id); }
52 #define X(slot, imp) \
53 REGISTER_IMPULSE(weapon_group_##slot, imp) \
54 LEGACY_IMPULSE(weapon_group_##slot, imp, "impulse " #imp)
67 #define X(slot, dir, imp) \
68 REGISTER_IMPULSE(weapon_priority_##slot##_##dir, imp) \
69 LEGACY_IMPULSE(weapon_priority_##slot##_##dir, imp, "impulse " #imp)
107 REGISTER_IMPULSE(weapon_byid_##i, imp)
134 REGISTER_IMPULSE(weapon_next_byid, 10)
135 LEGACY_IMPULSE(_weapnext_2, 10, "weapon_next_byid")
137 REGISTER_IMPULSE(weapon_prev_byid, 12)
138 LEGACY_IMPULSE(_weapprev_2, 12, "weapon_prev_byid")
140 REGISTER_IMPULSE(weapon_next_bygroup, 18)
141 LEGACY_IMPULSE(_weapnext_0, 18, "weapon_next_bygroup")
143 REGISTER_IMPULSE(weapon_prev_bygroup, 19)
144 LEGACY_IMPULSE(_weapprev_0, 19, "weapon_prev_bygroup")
146 REGISTER_IMPULSE(weapon_next_bypriority, 15)
147 LEGACY_IMPULSE(_weapnext_1, 15, "weapon_next_bypriority")
149 REGISTER_IMPULSE(weapon_prev_bypriority, 16)
150 LEGACY_IMPULSE(_weapprev_1, 16, "weapon_prev_bypriority")
152 REGISTER_IMPULSE(weapon_last, 11)
153 LEGACY_IMPULSE(weaplast, 11, "weapon_last")
155 REGISTER_IMPULSE(weapon_best, 13)
156 LEGACY_IMPULSE(weapbest, 13, "weapon_best")
158 REGISTER_IMPULSE(weapon_drop, 17)
159 LEGACY_IMPULSE(dropweapon, 17, "weapon_drop")
161 REGISTER_IMPULSE(weapon_reload, 20)
162 LEGACY_IMPULSE(reload, 20, "weapon_reload")
164 REGISTER_IMPULSE(use, 21)
165 LEGACY_IMPULSE_ID(use, 21)
167 REGISTER_IMPULSE(waypoint_personal_here, 30)
168 LEGACY_IMPULSE(g_waypointsprite_personal, 30, "waypoint_personal_here")
170 REGISTER_IMPULSE(waypoint_personal_crosshair, 31)
171 LEGACY_IMPULSE(g_waypointsprite_personal_p, 31, "waypoint_personal_crosshair")
173 REGISTER_IMPULSE(waypoint_personal_death, 32)
174 LEGACY_IMPULSE(g_waypointsprite_personal_d, 32, "waypoint_personal_death")
176 REGISTER_IMPULSE(waypoint_here_follow, 33)
177 LEGACY_IMPULSE(g_waypointsprite_team_helpme, 33, "waypoint_here_follow")
179 REGISTER_IMPULSE(waypoint_here_here, 34)
180 LEGACY_IMPULSE(g_waypointsprite_team_here, 34, "waypoint_here_here")
182 REGISTER_IMPULSE(waypoint_here_crosshair, 35)
183 LEGACY_IMPULSE(g_waypointsprite_team_here_p, 35, "waypoint_here_crosshair")
185 REGISTER_IMPULSE(waypoint_here_death, 36)
186 LEGACY_IMPULSE(g_waypointsprite_team_here_d, 36, "waypoint_here_death")
188 REGISTER_IMPULSE(waypoint_danger_here, 37)
189 LEGACY_IMPULSE(g_waypointsprite_team_danger, 37, "waypoint_danger_here")
191 REGISTER_IMPULSE(waypoint_danger_crosshair, 38)
192 LEGACY_IMPULSE(g_waypointsprite_team_danger_p, 38, "waypoint_danger_crosshair")
194 REGISTER_IMPULSE(waypoint_danger_death, 39)
195 LEGACY_IMPULSE(g_waypointsprite_team_danger_d, 39, "waypoint_danger_death")
197 REGISTER_IMPULSE(waypoint_clear_personal, 47)
198 LEGACY_IMPULSE(g_waypointsprite_clear_personal, 47, "waypoint_clear_personal")
200 REGISTER_IMPULSE(waypoint_clear, 48)
201 LEGACY_IMPULSE(g_waypointsprite_clear, 48, "waypoint_clear")
204 #define CHIMPULSE(id, n) _CHIMPULSE(CHIMPULSE_##id, n)
205 #define _CHIMPULSE(id, n) \
206 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
211 CHIMPULSE(SPEEDRUN_INIT, 30)
212 CHIMPULSE(GIVE_ALL, 99)
213 CHIMPULSE(CLONE_MOVING, 140)
214 CHIMPULSE(SPEEDRUN, 141)
215 CHIMPULSE(CLONE_STANDING, 142)
216 CHIMPULSE(TELEPORT, 143)