3 REGISTRY(IMPULSES, 255)
4 REGISTER_REGISTRY(IMPULSES)
5 REGISTRY_SORT(IMPULSES)
6 STATIC_INIT(IMPULSES_renumber)
8 FOREACH(IMPULSES, true, it.m_id = i);
10 REGISTRY_CHECK(IMPULSES)
12 .void(entity this) impulse_handle;
15 #define IMPULSE_ALIAS(alias, id) localcmd("\nalias " #alias " \"", id ,"\"\n")
17 #define IMPULSE_ALIAS(alias, id)
20 #define REGISTER_IMPULSE(id, n) _REGISTER_IMPULSE(IMP_##id, id, n)
21 #define _REGISTER_IMPULSE(id, alias, n) \
22 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
25 IMPULSE_ALIAS(alias, "impulse " #n); \
28 #define LEGACY_IMPULSE_ID(alias, id) LEGACY_IMPULSE(alias, id, sprintf("impulse %d", IMP_##alias.impulse))
30 #define LEGACY_IMPULSE(alias, id, new) \
31 STATIC_INIT(legacy_##alias) { \
33 if (s == #alias) LOG_FATALF("LEGACY_IMPULSE: would define a recursive alias for '%s', use LEGACY_IMPULSE_ID instead", s); \
34 IMPULSE_ALIAS(alias, s); \
36 SHUTDOWN(legacy_##alias) { IMPULSE_ALIAS(alias, "impulse " #id); }
38 #define X(slot, imp) \
39 REGISTER_IMPULSE(weapon_group_##slot, imp) \
40 LEGACY_IMPULSE(weapon_group_##slot, imp, "impulse " #imp)
53 #define X(slot, dir, imp) \
54 REGISTER_IMPULSE(weapon_priority_##slot##_##dir, imp) \
55 LEGACY_IMPULSE(weapon_priority_##slot##_##dir, imp, "impulse " #imp)
93 REGISTER_IMPULSE(weapon_byid_##i, imp)
120 REGISTER_IMPULSE(weapon_next_byid, 10)
121 LEGACY_IMPULSE(_weapnext_2, 10, "weapon_next_byid")
123 REGISTER_IMPULSE(weapon_prev_byid, 12)
124 LEGACY_IMPULSE(_weapprev_2, 12, "weapon_prev_byid")
126 REGISTER_IMPULSE(weapon_next_bygroup, 18)
127 LEGACY_IMPULSE(_weapnext_0, 18, "weapon_next_bygroup")
129 REGISTER_IMPULSE(weapon_prev_bygroup, 19)
130 LEGACY_IMPULSE(_weapprev_0, 19, "weapon_prev_bygroup")
132 REGISTER_IMPULSE(weapon_next_bypriority, 15)
133 LEGACY_IMPULSE(_weapnext_1, 15, "weapon_next_bypriority")
135 REGISTER_IMPULSE(weapon_prev_bypriority, 16)
136 LEGACY_IMPULSE(_weapprev_1, 16, "weapon_prev_bypriority")
138 REGISTER_IMPULSE(weapon_last, 11)
139 LEGACY_IMPULSE(weaplast, 11, "weapon_last")
141 REGISTER_IMPULSE(weapon_best, 13)
142 LEGACY_IMPULSE(weapbest, 13, "weapon_best")
144 REGISTER_IMPULSE(weapon_drop, 17)
145 LEGACY_IMPULSE(dropweapon, 17, "weapon_drop")
147 REGISTER_IMPULSE(weapon_reload, 20)
148 LEGACY_IMPULSE(reload, 20, "weapon_reload")
150 REGISTER_IMPULSE(use, 21)
151 LEGACY_IMPULSE_ID(use, 21)
153 REGISTER_IMPULSE(waypoint_personal_here, 30)
154 LEGACY_IMPULSE(g_waypointsprite_personal, 30, "waypoint_personal_here")
156 REGISTER_IMPULSE(waypoint_personal_crosshair, 31)
157 LEGACY_IMPULSE(g_waypointsprite_personal_p, 31, "waypoint_personal_crosshair")
159 REGISTER_IMPULSE(waypoint_personal_death, 32)
160 LEGACY_IMPULSE(g_waypointsprite_personal_d, 32, "waypoint_personal_death")
162 REGISTER_IMPULSE(waypoint_here_follow, 33)
163 LEGACY_IMPULSE(g_waypointsprite_team_helpme, 33, "waypoint_here_follow")
165 REGISTER_IMPULSE(waypoint_here_here, 34)
166 LEGACY_IMPULSE(g_waypointsprite_team_here, 34, "waypoint_here_here")
168 REGISTER_IMPULSE(waypoint_here_crosshair, 35)
169 LEGACY_IMPULSE(g_waypointsprite_team_here_p, 35, "waypoint_here_crosshair")
171 REGISTER_IMPULSE(waypoint_here_death, 36)
172 LEGACY_IMPULSE(g_waypointsprite_team_here_d, 36, "waypoint_here_death")
174 REGISTER_IMPULSE(waypoint_danger_here, 37)
175 LEGACY_IMPULSE(g_waypointsprite_team_danger, 37, "waypoint_danger_here")
177 REGISTER_IMPULSE(waypoint_danger_crosshair, 38)
178 LEGACY_IMPULSE(g_waypointsprite_team_danger_p, 38, "waypoint_danger_crosshair")
180 REGISTER_IMPULSE(waypoint_danger_death, 39)
181 LEGACY_IMPULSE(g_waypointsprite_team_danger_d, 39, "waypoint_danger_death")
183 REGISTER_IMPULSE(waypoint_clear_personal, 47)
184 LEGACY_IMPULSE(g_waypointsprite_clear_personal, 47, "waypoint_clear_personal")
186 REGISTER_IMPULSE(waypoint_clear, 48)
187 LEGACY_IMPULSE(g_waypointsprite_clear, 48, "waypoint_clear")
189 REGISTER_IMPULSE(navwaypoint_spawn, 103)
190 LEGACY_IMPULSE(g_waypointeditor_spawn, 103, "navwaypoint_spawn")
192 REGISTER_IMPULSE(navwaypoint_remove, 104)
193 LEGACY_IMPULSE(g_waypointeditor_remove, 104, "navwaypoint_remove")
195 REGISTER_IMPULSE(navwaypoint_relink, 105)
196 LEGACY_IMPULSE(g_waypointeditor_relinkall, 105, "navwaypoint_relink")
198 REGISTER_IMPULSE(navwaypoint_save, 106)
199 LEGACY_IMPULSE(g_waypointeditor_saveall, 106, "navwaypoint_save")
201 REGISTER_IMPULSE(navwaypoint_unreachable, 107)
202 LEGACY_IMPULSE(g_waypointeditor_unreachable, 107, "navwaypoint_unreachable")
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)