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
72 else if (imp == 11) // last weapon
73 W_SwitchWeapon (self.cnt);
75 else if (imp >= 13 && imp <= 16)
77 if (cvar("sv_cheats"))
81 makevectors (self.v_angle);
82 self.velocity = self.velocity + v_forward * 300;
84 self.velocity = self.velocity - v_forward * 300;
90 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
91 sprint(self, strcat("angles = ", vtos(self.angles), "\n"));
101 sprint(self, strcat(s, ": ^", s, "color\n"));
104 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
111 if (self.weapon != WEP_LASER
112 && !cvar("g_minstagib") && !cvar("g_instagib")
113 && !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items") && !cvar("g_nixnex"))
114 W_ThrowWeapon(self.velocity * 0.5 + v_forward * 750, '0 0 0', TRUE);
118 if (cvar("sv_cheats"))
122 makevectors(self.v_angle);
123 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, FALSE, self);
124 if (trace_fraction < 1)
125 printsurfaceinfo(trace_ent, trace_endpos);
129 makevectors(self.v_angle);
130 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
131 sprint(self, strcat("distance: ", ftos(fabs(vlen(trace_endpos - (self.origin + self.view_ofs)))), "\n"));
135 CampaignLevelWarp(cvar("_warplevel"));
139 self.items = IT_LASER | IT_UZI | IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER;
140 self.ammo_shells = 999;
141 self.ammo_nails = 999;
142 self.ammo_rockets = 999;
143 self.ammo_cells = 999;
148 if (cvar("g_waypointeditor"))
151 if (imp == 103) waypoint_spawn(self.origin, self.origin, 0);
152 else if (imp == 104) {e = navigation_findnearestwaypoint(self, FALSE);if (e) waypoint_remove(e);}
153 else if (imp == 105) waypoint_schedulerelinkall();
154 else if (imp == 106) waypoint_saveall();