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
53 if(self.vehicle.deadflag == DEAD_NO)
54 if(self.vehicle.vehicles_impusle)
55 if(self.vehicle.vehicles_impusle(imp))
61 else if (imp >= 1 && imp <= 9)
63 // weapon switching impulses
64 if(self.deadflag == DEAD_NO)
65 W_NextWeaponOnImpulse(imp);
67 self.impulse = imp; // retry in next frame
69 else if(imp >= 10 && imp <= 20)
71 if(self.deadflag == DEAD_NO)
85 W_SwitchWeapon (w_getbestweapon(self));
88 W_NextWeaponOnImpulse(0);
98 W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
104 W_PreviousWeapon (1);
112 self.impulse = imp; // retry in next frame
118 else if(imp >= 200 && imp <= 229)
120 if(self.deadflag == DEAD_NO)
122 // custom order weapon cycling
124 m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
125 W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
128 self.impulse = imp; // retry in next frame
130 else if(imp >= 230 && imp <= 253)
132 if(self.deadflag == DEAD_NO)
133 W_SwitchWeapon (imp - 230 + WEP_FIRST);
135 self.impulse = imp; // retry in next frame
138 else if (imp >= 30 && imp <= 49)
144 wp = WaypointSprite_DeployPersonal("waypoint", self.origin, RADARICON_WAYPOINT, '0 1 1');
146 WaypointSprite_Ping(wp);
147 sprint(self, "personal waypoint spawned at location\n");
150 WarpZone_crosshair_trace(self);
151 wp = WaypointSprite_DeployPersonal("waypoint", trace_endpos, RADARICON_WAYPOINT, '0 1 1');
153 WaypointSprite_Ping(wp);
154 sprint(self, "personal waypoint spawned at crosshair\n");
157 if(vlen(self.death_origin))
159 wp = WaypointSprite_DeployPersonal("waypoint", self.death_origin, RADARICON_WAYPOINT, '0 1 1');
161 WaypointSprite_Ping(wp);
162 sprint(self, "personal waypoint spawned at death location\n");
166 if(self.deadflag == DEAD_NO && teamplay)
168 if not(MUTATOR_CALLHOOK(HelpMePing))
170 wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
172 WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
174 WaypointSprite_Ping(wp);
176 sprint(self, "HELP ME attached\n");
180 wp = WaypointSprite_DeployFixed("here", FALSE, self.origin, RADARICON_HERE, '0 1 0');
182 WaypointSprite_Ping(wp);
183 sprint(self, "HERE spawned at location\n");
186 WarpZone_crosshair_trace(self);
187 wp = WaypointSprite_DeployFixed("here", FALSE, trace_endpos, RADARICON_HERE, '0 1 0');
189 WaypointSprite_Ping(wp);
190 sprint(self, "HERE spawned at crosshair\n");
193 if(vlen(self.death_origin))
195 wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin, RADARICON_HERE, '0 1 0');
197 WaypointSprite_Ping(wp);
198 sprint(self, "HERE spawned at death location\n");
202 wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin, RADARICON_DANGER, '1 0.5 0');
204 WaypointSprite_Ping(wp);
205 sprint(self, "DANGER spawned at location\n");
208 WarpZone_crosshair_trace(self);
209 wp = WaypointSprite_DeployFixed("danger", FALSE, trace_endpos, RADARICON_DANGER, '1 0.5 0');
211 WaypointSprite_Ping(wp);
212 sprint(self, "DANGER spawned at crosshair\n");
215 if(vlen(self.death_origin))
217 wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin, RADARICON_DANGER, '1 0.5 0');
219 WaypointSprite_Ping(wp);
220 sprint(self, "DANGER spawned at death location\n");
224 WaypointSprite_ClearPersonal();
227 remove(self.personal);
228 self.personal = world;
230 sprint(self, "personal waypoint cleared\n");
233 WaypointSprite_ClearOwned();
236 remove(self.personal);
237 self.personal = world;
239 sprint(self, "all waypoints cleared\n");
243 else if(imp >= 103 && imp <= 107)
245 if(autocvar_g_waypointeditor)
250 waypoint_schedulerelink(waypoint_spawn(self.origin, self.origin, 0));
251 bprint(strcat("Waypoint spawned at ",vtos(self.origin),"\n"));
254 e = navigation_findnearestwaypoint(self, FALSE);
256 if not(e.wpflags & WAYPOINTFLAG_GENERATED)
258 bprint(strcat("Waypoint removed at ",vtos(e.origin),"\n"));
263 waypoint_schedulerelinkall();
269 for(e = findchain(classname, "waypoint"); e; e = e.chain)
271 e.colormod = '0.5 0.5 0.5';
272 e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
274 e2 = navigation_findnearestwaypoint(self, FALSE);
275 navigation_markroutes(e2);
278 for(e = findchain(classname, "waypoint"); e; e = e.chain)
280 if(e.wpcost >= 10000000)
282 print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
284 e.effects |= EF_NODEPTHTEST | EF_BLUE;
290 print(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
291 navigation_markroutes_inverted(e2);
293 for(e = findchain(classname, "waypoint"); e; e = e.chain)
295 if(e.wpcost >= 10000000)
297 print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
299 if not(e.effects & EF_NODEPTHTEST) // not already reported before
301 e.effects |= EF_NODEPTHTEST | EF_RED;
306 print(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
308 print(ftos(m), " waypoints have been marked total\n");
310 for(e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
313 tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world);
314 setorigin(e, trace_endpos);
315 if(navigation_findnearestwaypoint(e, FALSE))
318 e.effects &~= EF_NODEPTHTEST;
324 print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
325 e.effects |= EF_NODEPTHTEST;
326 setmodel(e, self.model);
327 e.frame = self.frame;
329 e.colormod = '8 0.5 8';
330 setsize(e, '0 0 0', '0 0 0');
335 print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
338 start = findchainflags(flags, FL_ITEM);
339 for(e = start; e; e = e.chain)
341 e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
342 e.colormod = '0.5 0.5 0.5';
344 for(e = start; e; e = e.chain)
346 if(navigation_findnearestwaypoint(e, FALSE))
351 print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
352 e.effects |= EF_NODEPTHTEST | EF_RED;
358 print(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
360 for(e = start; e; e = e.chain)
363 if(navigation_findnearestwaypoint(e, TRUE))
368 print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
369 e.effects |= EF_NODEPTHTEST | EF_BLUE;
375 print(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");