1 void CopyBody(float keepvelocity);
3 // changes by LordHavoc on 03/30/04
4 // cleaned up dummy code
5 // dummies are now removed eventually after being gibbed (norespawn = TRUE)
6 // dummy impulse now checks sv_cheats to prevent players from overwhelming server with dummies
7 // dummies now use player code where possible
9 void player_anim (void);
12 self.think = DummyThink;
13 self.nextthink = time;
21 void(entity e, vector v) printsurfaceinfo =
23 local float surfnum, numpoints, vnum;
26 surfnum = getsurfacenearpoint(e, v);
29 sprint(self, "texture: ");
30 s = getsurfacetexture(e, surfnum);
32 sprint(self, " normal: ");
33 n = getsurfacenormal(e, surfnum);
34 sprint(self, vtos(n));
36 numpoints = getsurfacenumpoints(e, surfnum);
37 sprint(self, ftos(numpoints));
38 sprint(self, " verts:");
40 while (vnum < numpoints)
43 n = getsurfacepoint(e, surfnum, vnum);
44 sprint(self, vtos(n));
47 sprint(self, " point tested: ");
48 sprint(self, vtos(v));
49 sprint(self, " nearest point on surface: ");
50 n = getsurfaceclippedpoint(e, surfnum, v);
51 sprint(self, vtos(n));
56 void ImpulseCommands (void)
63 if (imp >= 1 && imp <= 12)
65 // weapon switching impulses
66 if(self.deadflag == DEAD_NO)
74 else if (imp == 11) // last weapon
75 W_SwitchWeapon (self.cnt);
78 self.impulse = imp; // retry in next frame
80 else if (imp >= 13 && imp <= 16)
82 if (cvar("sv_cheats"))
84 if (imp == 13 && self.deadflag == DEAD_NO)
86 makevectors (self.v_angle);
87 self.velocity = self.velocity + v_forward * 300;
89 self.velocity = self.velocity - v_forward * 300;
91 else if (imp == 14 && self.deadflag == DEAD_NO)
95 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
96 sprint(self, strcat("angles = ", vtos(self.angles), "\n"));
106 sprint(self, strcat(s, ": ^", s, "color\n"));
109 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
116 if(self.deadflag == DEAD_NO)
118 if (self.weapon != WEP_LASER
119 && !cvar("g_minstagib") && !cvar("g_instagib")
120 && !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items") && !cvar("g_nixnex"))
121 W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750), '0 0 0', TRUE);
125 else if (imp >= 30 && imp <= 49)
129 WaypointSprite_DeployPersonal("waypoint", self.origin);
130 sprint(self, "personal waypoint spawned at location\n");
134 WaypointSprite_DeployPersonal("waypoint", self.cursor_trace_endpos);
135 sprint(self, "personal waypoint spawned at crosshair\n");
137 else if(imp == 32 && vlen(self.death_origin))
139 WaypointSprite_DeployPersonal("waypoint", self.death_origin);
140 sprint(self, "personal waypoint spawned at death location\n");
142 else if(imp == 33 && self.deadflag == DEAD_NO && teams_matter)
144 WaypointSprite_Attach("helpme", TRUE);
145 sprint(self, "HELP ME attached\n");
149 WaypointSprite_DeployFixed("here", FALSE, self.origin);
150 sprint(self, "HERE spawned at location\n");
154 WaypointSprite_DeployFixed("here", FALSE, self.cursor_trace_endpos);
155 sprint(self, "HERE spawned at crosshair\n");
157 else if(imp == 36 && vlen(self.death_origin))
159 WaypointSprite_DeployFixed("here", FALSE, self.death_origin);
160 sprint(self, "HERE spawned at death location\n");
164 WaypointSprite_DeployFixed("danger", FALSE, self.origin);
165 sprint(self, "DANGER spawned at location\n");
169 WaypointSprite_DeployFixed("danger", FALSE, self.cursor_trace_endpos);
170 sprint(self, "DANGER spawned at crosshair\n");
172 else if(imp == 39 && vlen(self.death_origin))
174 WaypointSprite_DeployFixed("danger", FALSE, self.death_origin);
175 sprint(self, "DANGER spawned at death location\n");
179 WaypointSprite_ClearPersonal();
180 sprint(self, "personal waypoint cleared\n");
184 WaypointSprite_ClearOwned();
185 sprint(self, "all waypoints cleared\n");
189 self.cvar_cl_hidewaypoints = !(self.cvar_cl_hidewaypoints);
190 sprint(self, "fixed waypoints now ");
191 if(self.cvar_cl_hidewaypoints)
192 sprint(self, "OFF\n");
194 sprint(self, "ON\n");
199 if (cvar("sv_cheats"))
203 makevectors(self.v_angle);
204 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, FALSE, self);
205 if (trace_fraction < 1)
206 printsurfaceinfo(trace_ent, trace_endpos);
210 makevectors(self.v_angle);
211 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
212 sprint(self, strcat("distance: ", ftos(fabs(vlen(trace_endpos - (self.origin + self.view_ofs)))), "\n"));
216 CampaignLevelWarp(cvar("_warplevel"));
218 else if (imp == 99 && self.deadflag == DEAD_NO)
220 self.items = IT_LASER | IT_UZI | IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER;
221 self.ammo_shells = 999;
222 self.ammo_nails = 999;
223 self.ammo_rockets = 999;
224 self.ammo_cells = 999;
229 if (cvar("g_waypointeditor"))
232 if (imp == 103) waypoint_schedulerelink(waypoint_spawn(self.origin, self.origin, 0));
233 else if (imp == 104) {e = navigation_findnearestwaypoint(self, FALSE);if (e) waypoint_remove(e);}
234 else if (imp == 105) waypoint_schedulerelinkall();
235 else if (imp == 106) waypoint_saveall();