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
83 if(self.deadflag == DEAD_NO)
85 if (self.weapon != WEP_LASER
86 && !cvar("g_minstagib") && !cvar("g_instagib")
87 && !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items") && !cvar("g_nixnex"))
88 W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750), '0 0 0', TRUE);
92 else if (imp >= 30 && imp <= 49)
96 WaypointSprite_DeployPersonal("waypoint", self.origin);
97 sprint(self, "personal waypoint spawned at location\n");
101 WaypointSprite_DeployPersonal("waypoint", self.cursor_trace_endpos);
102 sprint(self, "personal waypoint spawned at crosshair\n");
104 else if(imp == 32 && vlen(self.death_origin))
106 WaypointSprite_DeployPersonal("waypoint", self.death_origin);
107 sprint(self, "personal waypoint spawned at death location\n");
109 else if(imp == 33 && self.deadflag == DEAD_NO && teams_matter)
111 WaypointSprite_Attach("helpme", TRUE);
112 sprint(self, "HELP ME attached\n");
116 WaypointSprite_DeployFixed("here", FALSE, self.origin);
117 sprint(self, "HERE spawned at location\n");
121 WaypointSprite_DeployFixed("here", FALSE, self.cursor_trace_endpos);
122 sprint(self, "HERE spawned at crosshair\n");
124 else if(imp == 36 && vlen(self.death_origin))
126 WaypointSprite_DeployFixed("here", FALSE, self.death_origin);
127 sprint(self, "HERE spawned at death location\n");
131 WaypointSprite_DeployFixed("danger", FALSE, self.origin);
132 sprint(self, "DANGER spawned at location\n");
136 WaypointSprite_DeployFixed("danger", FALSE, self.cursor_trace_endpos);
137 sprint(self, "DANGER spawned at crosshair\n");
139 else if(imp == 39 && vlen(self.death_origin))
141 WaypointSprite_DeployFixed("danger", FALSE, self.death_origin);
142 sprint(self, "DANGER spawned at death location\n");
146 WaypointSprite_ClearPersonal();
147 sprint(self, "personal waypoint cleared\n");
151 WaypointSprite_ClearOwned();
152 sprint(self, "all waypoints cleared\n");
156 self.cvar_cl_hidewaypoints = !(self.cvar_cl_hidewaypoints);
157 sprint(self, "fixed waypoints now ");
158 if(self.cvar_cl_hidewaypoints)
159 sprint(self, "OFF\n");
161 sprint(self, "ON\n");
170 makevectors(self.v_angle);
171 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, FALSE, self);
172 if (trace_fraction < 1)
173 printsurfaceinfo(trace_ent, trace_endpos);
177 makevectors(self.v_angle);
178 traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 65536, FALSE, self);
179 sprint(self, strcat("distance: ", ftos(fabs(vlen(trace_endpos - (self.origin + self.view_ofs)))), "\n"));
181 else if(self.deadflag == DEAD_NO)
185 self.items |= (IT_LASER | IT_UZI | IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER);
186 self.ammo_shells = cvar("g_pickup_shells_max");
187 self.ammo_nails = cvar("g_pickup_nails_max");
188 self.ammo_rockets = cvar("g_pickup_rockets_max");
189 self.ammo_cells = cvar("g_pickup_cells_max");
190 self.health = cvar("g_pickup_healthshard_max");
191 self.armorvalue = cvar("g_pickup_armorshard_max");
192 self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
193 self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
194 self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
195 // precache weapon models/sounds
198 while (wep <= WEP_LAST)
200 weapon_action(wep, WR_PRECACHE);
206 makevectors (self.v_angle);
207 self.velocity = self.velocity + v_forward * 300;
209 self.velocity = self.velocity - v_forward * 300;
217 if (cvar("g_waypointeditor"))
220 if (imp == 103) waypoint_schedulerelink(waypoint_spawn(self.origin, self.origin, 0));
221 else if (imp == 104) {e = navigation_findnearestwaypoint(self, FALSE);if (e) waypoint_remove(e);}
222 else if (imp == 105) waypoint_schedulerelinkall();
223 else if (imp == 106) waypoint_saveall();