4 * 0 reserved (no input)
5 * 1 to 9, 14: weapon shortcuts
6 * 10: next weapon according to linear list
7 * 11: most recently used weapon
8 * 12: previous weapon according to linear list
9 * 13: best weapon according to priority list
10 * 15: next weapon according to priority list
11 * 16: previous weapon according to priority list
13 * 18: next weapon according to sbar_hudselector 1 list
14 * 19: previous weapon according to sbar_hudselector 1 list
15 * 20: reload if needed
17 * 30 to 39: create waypoints
18 * 47: clear personal waypoints
19 * 48: clear team waypoints
26 * 143: emergency teleport
27 * 148: unfairly eliminate
30 * 200 to 209: prev weapon shortcuts
31 * 210 to 219: best weapon shortcuts
32 * 220 to 229: next weapon shortcuts
33 * 230 to 253: individual weapons (up to 24)
36 void ImpulseCommands (void)
49 if (timeout_status == TIMEOUT_ACTIVE) //don't allow any impulses while the game is paused
55 else if (imp >= 1 && imp <= 9)
57 // weapon switching impulses
58 if(self.deadflag == DEAD_NO)
59 W_NextWeaponOnImpulse(imp);
61 self.impulse = imp; // retry in next frame
63 else if(imp >= 10 && imp <= 20)
65 if(self.deadflag == DEAD_NO)
79 W_SwitchWeapon (w_getbestweapon(self));
82 W_NextWeaponOnImpulse(0);
92 W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
106 self.impulse = imp; // retry in next frame
112 else if(imp >= 200 && imp <= 229)
114 if(self.deadflag == DEAD_NO)
116 // custom order weapon cycling
118 m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
119 W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
122 self.impulse = imp; // retry in next frame
124 else if(imp >= 230 && imp <= 253)
126 if(self.deadflag == DEAD_NO)
127 W_SwitchWeapon (imp - 230 + WEP_FIRST);
129 self.impulse = imp; // retry in next frame
132 else if (imp >= 30 && imp <= 49)
138 wp = WaypointSprite_DeployPersonal("waypoint", self.origin, RADARICON_WAYPOINT, '0 1 1');
140 WaypointSprite_Ping(wp);
141 sprint(self, "personal waypoint spawned at location\n");
144 WarpZone_crosshair_trace(self);
145 wp = WaypointSprite_DeployPersonal("waypoint", trace_endpos, RADARICON_WAYPOINT, '0 1 1');
147 WaypointSprite_Ping(wp);
148 sprint(self, "personal waypoint spawned at crosshair\n");
151 if(vlen(self.death_origin))
153 wp = WaypointSprite_DeployPersonal("waypoint", self.death_origin, RADARICON_WAYPOINT, '0 1 1');
155 WaypointSprite_Ping(wp);
156 sprint(self, "personal waypoint spawned at death location\n");
160 if(self.deadflag == DEAD_NO && teamplay)
162 if not(MUTATOR_CALLHOOK(HelpMePing))
164 wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
166 WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
168 WaypointSprite_Ping(wp);
170 sprint(self, "HELP ME attached\n");
174 wp = WaypointSprite_DeployFixed("here", FALSE, self.origin, RADARICON_HERE, '0 1 0');
176 WaypointSprite_Ping(wp);
177 sprint(self, "HERE spawned at location\n");
180 WarpZone_crosshair_trace(self);
181 wp = WaypointSprite_DeployFixed("here", FALSE, trace_endpos, RADARICON_HERE, '0 1 0');
183 WaypointSprite_Ping(wp);
184 sprint(self, "HERE spawned at crosshair\n");
187 if(vlen(self.death_origin))
189 wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin, RADARICON_HERE, '0 1 0');
191 WaypointSprite_Ping(wp);
192 sprint(self, "HERE spawned at death location\n");
196 wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin, RADARICON_DANGER, '1 0.5 0');
198 WaypointSprite_Ping(wp);
199 sprint(self, "DANGER spawned at location\n");
202 WarpZone_crosshair_trace(self);
203 wp = WaypointSprite_DeployFixed("danger", FALSE, trace_endpos, RADARICON_DANGER, '1 0.5 0');
205 WaypointSprite_Ping(wp);
206 sprint(self, "DANGER spawned at crosshair\n");
209 if(vlen(self.death_origin))
211 wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin, RADARICON_DANGER, '1 0.5 0');
213 WaypointSprite_Ping(wp);
214 sprint(self, "DANGER spawned at death location\n");
218 WaypointSprite_ClearPersonal();
221 remove(self.personal);
222 self.personal = world;
224 sprint(self, "personal waypoint cleared\n");
227 WaypointSprite_ClearOwned();
230 remove(self.personal);
231 self.personal = world;
233 sprint(self, "all waypoints cleared\n");
237 else if(imp >= 103 && imp <= 107)
239 if(autocvar_g_waypointeditor)
244 waypoint_schedulerelink(waypoint_spawn(self.origin, self.origin, 0));
245 bprint(strcat("Waypoint spawned at ",vtos(self.origin),"\n"));
248 e = navigation_findnearestwaypoint(self, FALSE);
250 if not(e.wpflags & WAYPOINTFLAG_GENERATED)
252 bprint(strcat("Waypoint removed at ",vtos(e.origin),"\n"));
257 waypoint_schedulerelinkall();
263 for(e = findchain(classname, "waypoint"); e; e = e.chain)
265 e.colormod = '0.5 0.5 0.5';
266 e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
268 e2 = navigation_findnearestwaypoint(self, FALSE);
269 navigation_markroutes(e2);
272 for(e = findchain(classname, "waypoint"); e; e = e.chain)
274 if(e.wpcost >= 10000000)
276 print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
278 e.effects |= EF_NODEPTHTEST | EF_BLUE;
284 print(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
285 navigation_markroutes_inverted(e2);
287 for(e = findchain(classname, "waypoint"); e; e = e.chain)
289 if(e.wpcost >= 10000000)
291 print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
293 if not(e.effects & EF_NODEPTHTEST) // not already reported before
295 e.effects |= EF_NODEPTHTEST | EF_RED;
300 print(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
302 print(ftos(m), " waypoints have been marked total\n");
304 for(e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
307 tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world);
308 setorigin(e, trace_endpos);
309 if(navigation_findnearestwaypoint(e, FALSE))
312 e.effects &~= EF_NODEPTHTEST;
318 print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
319 e.effects |= EF_NODEPTHTEST;
320 setmodel(e, self.model);
321 e.frame = self.frame;
323 e.colormod = '8 0.5 8';
324 setsize(e, '0 0 0', '0 0 0');
329 print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
332 start = findchainflags(flags, FL_ITEM);
333 for(e = start; e; e = e.chain)
335 e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
336 e.colormod = '0.5 0.5 0.5';
338 for(e = start; e; e = e.chain)
340 if(navigation_findnearestwaypoint(e, FALSE))
345 print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
346 e.effects |= EF_NODEPTHTEST | EF_RED;
352 print(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
354 for(e = start; e; e = e.chain)
357 if(navigation_findnearestwaypoint(e, TRUE))
362 print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
363 e.effects |= EF_NODEPTHTEST | EF_BLUE;
369 print(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");