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 void _impCheck(string s, string alias)
32 // this is inside a function to avoid expanding it on compilation everytime
34 LOG_FATALF("LEGACY_IMPULSE: would define a recursive alias for '%s', use LEGACY_IMPULSE_ID instead", s);
37 #define LEGACY_IMPULSE(alias, id, new) \
38 STATIC_INIT(legacy_##alias) { \
40 _impCheck(s, #alias); \
41 IMPULSE_ALIAS(alias, s); \
43 SHUTDOWN(legacy_##alias) { IMPULSE_ALIAS(alias, "impulse " #id); }
45 #define X(slot, imp) \
46 REGISTER_IMPULSE(weapon_group_##slot, imp) \
47 LEGACY_IMPULSE(weapon_group_##slot, imp, "impulse " #imp)
60 #define X(slot, dir, imp) \
61 REGISTER_IMPULSE(weapon_priority_##slot##_##dir, imp) \
62 LEGACY_IMPULSE(weapon_priority_##slot##_##dir, imp, "impulse " #imp)
100 REGISTER_IMPULSE(weapon_byid_##i, imp)
127 REGISTER_IMPULSE(weapon_next_byid, 10)
128 LEGACY_IMPULSE(_weapnext_2, 10, "weapon_next_byid")
130 REGISTER_IMPULSE(weapon_prev_byid, 12)
131 LEGACY_IMPULSE(_weapprev_2, 12, "weapon_prev_byid")
133 REGISTER_IMPULSE(weapon_next_bygroup, 18)
134 LEGACY_IMPULSE(_weapnext_0, 18, "weapon_next_bygroup")
136 REGISTER_IMPULSE(weapon_prev_bygroup, 19)
137 LEGACY_IMPULSE(_weapprev_0, 19, "weapon_prev_bygroup")
139 REGISTER_IMPULSE(weapon_next_bypriority, 15)
140 LEGACY_IMPULSE(_weapnext_1, 15, "weapon_next_bypriority")
142 REGISTER_IMPULSE(weapon_prev_bypriority, 16)
143 LEGACY_IMPULSE(_weapprev_1, 16, "weapon_prev_bypriority")
145 REGISTER_IMPULSE(weapon_last, 11)
146 LEGACY_IMPULSE(weaplast, 11, "weapon_last")
148 REGISTER_IMPULSE(weapon_best, 13)
149 LEGACY_IMPULSE(weapbest, 13, "weapon_best")
151 REGISTER_IMPULSE(weapon_drop, 17)
152 LEGACY_IMPULSE(dropweapon, 17, "weapon_drop")
154 REGISTER_IMPULSE(weapon_reload, 20)
155 LEGACY_IMPULSE(reload, 20, "weapon_reload")
157 REGISTER_IMPULSE(use, 21)
158 LEGACY_IMPULSE_ID(use, 21)
160 REGISTER_IMPULSE(waypoint_personal_here, 30)
161 LEGACY_IMPULSE(g_waypointsprite_personal, 30, "waypoint_personal_here")
163 REGISTER_IMPULSE(waypoint_personal_crosshair, 31)
164 LEGACY_IMPULSE(g_waypointsprite_personal_p, 31, "waypoint_personal_crosshair")
166 REGISTER_IMPULSE(waypoint_personal_death, 32)
167 LEGACY_IMPULSE(g_waypointsprite_personal_d, 32, "waypoint_personal_death")
169 REGISTER_IMPULSE(waypoint_here_follow, 33)
170 LEGACY_IMPULSE(g_waypointsprite_team_helpme, 33, "waypoint_here_follow")
172 REGISTER_IMPULSE(waypoint_here_here, 34)
173 LEGACY_IMPULSE(g_waypointsprite_team_here, 34, "waypoint_here_here")
175 REGISTER_IMPULSE(waypoint_here_crosshair, 35)
176 LEGACY_IMPULSE(g_waypointsprite_team_here_p, 35, "waypoint_here_crosshair")
178 REGISTER_IMPULSE(waypoint_here_death, 36)
179 LEGACY_IMPULSE(g_waypointsprite_team_here_d, 36, "waypoint_here_death")
181 REGISTER_IMPULSE(waypoint_danger_here, 37)
182 LEGACY_IMPULSE(g_waypointsprite_team_danger, 37, "waypoint_danger_here")
184 REGISTER_IMPULSE(waypoint_danger_crosshair, 38)
185 LEGACY_IMPULSE(g_waypointsprite_team_danger_p, 38, "waypoint_danger_crosshair")
187 REGISTER_IMPULSE(waypoint_danger_death, 39)
188 LEGACY_IMPULSE(g_waypointsprite_team_danger_d, 39, "waypoint_danger_death")
190 REGISTER_IMPULSE(waypoint_clear_personal, 47)
191 LEGACY_IMPULSE(g_waypointsprite_clear_personal, 47, "waypoint_clear_personal")
193 REGISTER_IMPULSE(waypoint_clear, 48)
194 LEGACY_IMPULSE(g_waypointsprite_clear, 48, "waypoint_clear")
197 #define CHIMPULSE(id, n) _CHIMPULSE(CHIMPULSE_##id, n)
198 #define _CHIMPULSE(id, n) \
199 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
204 CHIMPULSE(SPEEDRUN_INIT, 30)
205 CHIMPULSE(GIVE_ALL, 99)
206 CHIMPULSE(CLONE_MOVING, 140)
207 CHIMPULSE(SPEEDRUN, 141)
208 CHIMPULSE(CLONE_STANDING, 142)
209 CHIMPULSE(TELEPORT, 143)