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 #define IMPULSE_ALIAS(alias, id) localcmd("\nalias " #alias " \"", id ,"\"\n")
19 #define IMPULSE_ALIAS(alias, id)
22 #define REGISTER_IMPULSE(id, n) _REGISTER_IMPULSE(IMP_##id, id, n)
23 #define _REGISTER_IMPULSE(id, alias, n) \
24 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
27 IMPULSE_ALIAS(alias, "impulse " #n); \
30 #define LEGACY_IMPULSE_ID(alias, id) LEGACY_IMPULSE(alias, id, sprintf("impulse %d", IMP_##alias.impulse))
32 void _impCheck(string s, string alias)
34 // this is inside a function to avoid expanding it on compilation everytime
36 LOG_FATALF("LEGACY_IMPULSE: would define a recursive alias for '%s', use LEGACY_IMPULSE_ID instead", s);
39 #define LEGACY_IMPULSE(alias, id, new) \
40 STATIC_INIT(legacy_##alias) { \
42 _impCheck(s, #alias); \
43 IMPULSE_ALIAS(alias, s); \
45 SHUTDOWN(legacy_##alias) { IMPULSE_ALIAS(alias, "impulse " #id); }
47 #define X(slot, imp) \
48 REGISTER_IMPULSE(weapon_group_##slot, imp) \
49 LEGACY_IMPULSE(weapon_group_##slot, imp, "impulse " #imp)
62 #define X(slot, dir, imp) \
63 REGISTER_IMPULSE(weapon_priority_##slot##_##dir, imp) \
64 LEGACY_IMPULSE(weapon_priority_##slot##_##dir, imp, "impulse " #imp)
102 REGISTER_IMPULSE(weapon_byid_##i, imp)
129 REGISTER_IMPULSE(weapon_next_byid, 10)
130 LEGACY_IMPULSE(_weapnext_2, 10, "weapon_next_byid")
132 REGISTER_IMPULSE(weapon_prev_byid, 12)
133 LEGACY_IMPULSE(_weapprev_2, 12, "weapon_prev_byid")
135 REGISTER_IMPULSE(weapon_next_bygroup, 18)
136 LEGACY_IMPULSE(_weapnext_0, 18, "weapon_next_bygroup")
138 REGISTER_IMPULSE(weapon_prev_bygroup, 19)
139 LEGACY_IMPULSE(_weapprev_0, 19, "weapon_prev_bygroup")
141 REGISTER_IMPULSE(weapon_next_bypriority, 15)
142 LEGACY_IMPULSE(_weapnext_1, 15, "weapon_next_bypriority")
144 REGISTER_IMPULSE(weapon_prev_bypriority, 16)
145 LEGACY_IMPULSE(_weapprev_1, 16, "weapon_prev_bypriority")
147 REGISTER_IMPULSE(weapon_last, 11)
148 LEGACY_IMPULSE(weaplast, 11, "weapon_last")
150 REGISTER_IMPULSE(weapon_best, 13)
151 LEGACY_IMPULSE(weapbest, 13, "weapon_best")
153 REGISTER_IMPULSE(weapon_drop, 17)
154 LEGACY_IMPULSE(dropweapon, 17, "weapon_drop")
156 REGISTER_IMPULSE(weapon_reload, 20)
157 LEGACY_IMPULSE(reload, 20, "weapon_reload")
159 REGISTER_IMPULSE(use, 21)
160 LEGACY_IMPULSE_ID(use, 21)
162 REGISTER_IMPULSE(waypoint_personal_here, 30)
163 LEGACY_IMPULSE(g_waypointsprite_personal, 30, "waypoint_personal_here")
165 REGISTER_IMPULSE(waypoint_personal_crosshair, 31)
166 LEGACY_IMPULSE(g_waypointsprite_personal_p, 31, "waypoint_personal_crosshair")
168 REGISTER_IMPULSE(waypoint_personal_death, 32)
169 LEGACY_IMPULSE(g_waypointsprite_personal_d, 32, "waypoint_personal_death")
171 REGISTER_IMPULSE(waypoint_here_follow, 33)
172 LEGACY_IMPULSE(g_waypointsprite_team_helpme, 33, "waypoint_here_follow")
174 REGISTER_IMPULSE(waypoint_here_here, 34)
175 LEGACY_IMPULSE(g_waypointsprite_team_here, 34, "waypoint_here_here")
177 REGISTER_IMPULSE(waypoint_here_crosshair, 35)
178 LEGACY_IMPULSE(g_waypointsprite_team_here_p, 35, "waypoint_here_crosshair")
180 REGISTER_IMPULSE(waypoint_here_death, 36)
181 LEGACY_IMPULSE(g_waypointsprite_team_here_d, 36, "waypoint_here_death")
183 REGISTER_IMPULSE(waypoint_danger_here, 37)
184 LEGACY_IMPULSE(g_waypointsprite_team_danger, 37, "waypoint_danger_here")
186 REGISTER_IMPULSE(waypoint_danger_crosshair, 38)
187 LEGACY_IMPULSE(g_waypointsprite_team_danger_p, 38, "waypoint_danger_crosshair")
189 REGISTER_IMPULSE(waypoint_danger_death, 39)
190 LEGACY_IMPULSE(g_waypointsprite_team_danger_d, 39, "waypoint_danger_death")
192 REGISTER_IMPULSE(waypoint_clear_personal, 47)
193 LEGACY_IMPULSE(g_waypointsprite_clear_personal, 47, "waypoint_clear_personal")
195 REGISTER_IMPULSE(waypoint_clear, 48)
196 LEGACY_IMPULSE(g_waypointsprite_clear, 48, "waypoint_clear")
199 #define CHIMPULSE(id, n) _CHIMPULSE(CHIMPULSE_##id, n)
200 #define _CHIMPULSE(id, n) \
201 REGISTER(IMPULSES, id, m_id, new_pure(Impulse)) \
206 CHIMPULSE(SPEEDRUN_INIT, 30)
207 CHIMPULSE(GIVE_ALL, 99)
208 CHIMPULSE(CLONE_MOVING, 140)
209 CHIMPULSE(SPEEDRUN, 141)
210 CHIMPULSE(CLONE_STANDING, 142)
211 CHIMPULSE(TELEPORT, 143)