void ForcePush2() { // the main routine local entity pushed; pushed = findradius(self.origin, 500); while(pushed) { if(pushed.RocketID == self.netname) pushed = pushed.chain; if(pushed.classname == "rocket" || pushed.classname == "grenade" || pushed.classname == "telegrenade") { if(self.force <= 10 || !infront(pushed)) { // do nothing } else { if(pushed.classname == "telegrenade") { pushed.RocketID = self.netname; } else { pushed.owner = self; pushed.RocketID = self.netname; } pushed.velocity_x = (pushed.velocity_x * -1); pushed.velocity_y = (pushed.velocity_y * -1); pushed.velocity_z = (pushed.velocity_z * -1); pushed.angles_x = (pushed.angles_x * -1); pushed.angles_y = (pushed.angles_y * -1); pushed.angles_z = (pushed.angles_z * -1); sound(pushed, CHAN_ITEM, "force/push.wav", 1, ATTN_NORM); self.force = self.force - 10; } } pushed = pushed.chain; } // end main routine } // Jedi Mind Trick void MindTrickTurn() { if(time >= self.Tricked) { // self.angles_y = 0; self.angles = self.StartAngle; self.fixangle = true; // self.walkframe = 1; // self.weaponframe = 0; self.attack_finished = time; // self.button2 = self.b2state; // adjust player's direction accordingly just in case their compass is corrupted BotSetDirection(); // this takes care of a problem with the agrip footsteps not playing for some reason if(self.classname == "player" || self.classname == "bot") W_SetCurrentAmmo(); self.Tricked = 0; return; } // self.walkframe = 1; makevectors(self.v_angle); self.velocity = self.velocity + (v_forward * 300); if(self.velocity_x != 0) self.velocity_x = (rint(self.velocity_x * 0.6)); if(self.velocity_y != 0) self.velocity_y = (rint(self.velocity_y * 0.6)); // if(self.velocity_z > 0) // self.velocity_z = (rint(self.velocity_z * 0.6)); if(time >= self.NextTurn) { self.angles_y = (rint(random()*359) - 180); self.fixangle = true; self.walkframe = 1; self.NextTurn = time + 0.5; } } void MindTrick() { if(self.force < 150) return; float TrickTime; makevectors(self.v_angle); tracebox(self.origin, VEC_HULL_MIN, VEC_HULL_MAX, (self.origin + (v_forward*500)), false, self); if(trace_fraction == 1.0) return; if(trace_ent.classname != "player" && trace_ent.classname != "bot" && trace_ent.classname != "monster") return; if(trace_ent.Tricked != 0) return; /* if(!(trace_ent.freezed)) { trace_ent.think = SaberOff; trace_ent.nextthink = time; } */ if(self.force < trace_ent.force && random()*5 != 3) return; if(self.force >= 200) { if(trace_ent.force >= 200) TrickTime = 3; else if(trace_ent.force >= 100) TrickTime = 6; else TrickTime = 9; } else if(self.force >= 100) { if(trace_ent.force >= 200) TrickTime = 2; else if(trace_ent.force >= 100) TrickTime = 4; else TrickTime = 6; } else { if(trace_ent.force >= 200) TrickTime = 1; else if(trace_ent.force >= 100) TrickTime = 2; else TrickTime = 3; } self.force = self.force - 30; sound(self, CHAN_BODY, "force/mindtrick.wav", 1, ATTN_NORM); sound(trace_ent, CHAN_ITEM, "force/mindtrick.wav", 1, ATTN_NORM); trace_ent.StartAngle = trace_ent.angles; // trace_ent.b2state = trace_ent.button2; trace_ent.attack_state = 0; // trace_ent.button2 = 0; trace_ent.attack_finished = time + TrickTime; trace_ent.Tricked = time + TrickTime; } // Force Lightning void FLightStop() { // entity PlaceHolder; self.FLightOn = 0; sound(self, CHAN_WEAPON, "force/flightoff.wav", 1, ATTN_NORM); muzzleflash(); self.show_hostile = time + 0.5; self.movetype = MOVETYPE_WALK; W_SetCurrentAmmo(); if(self.FLightRecip.classname == "player" || self.FLightRecip.classname == "bot") { if(self.FLightRecip.health > 0) { self.FLightRecip.movetype = MOVETYPE_WALK; self.FLightRecip.attack_finished = time; self.FLightRecip.think = W_SetCurrentAmmo; self.FLightRecip.nextthink = time; self.FLightRecip.show_hostile = time + 0.5; } } if(self.FLightRecip.classname == "monster") self.FLightRecip.movetype = MOVETYPE_STEP; // self.FLightRecip = PlaceHolder; } void FLightning() { if(self.freezed) return; if(self.FLightOn) return; if(self.force < 100) return; if(self.health < 100) return; makevectors(self.v_angle); tracebox(self.origin, VEC_HULL_MIN, VEC_HULL_MAX, self.origin + (v_forward * 500), false, self); if(trace_fraction == 1.0) return; if(trace_ent.classname != "player" && trace_ent.classname != "bot" && trace_ent.classname != "monster") return; self.FLightSndTime = time + 2; sound(self, CHAN_WEAPON, "force/flighton.wav", 1, ATTN_NORM); muzzleflash(); trace_ent.pain_finished = time + 0.5; if (random() > 0.5) sound (trace_ent, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); else sound (trace_ent, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); self.show_hostile = time + 0.5; trace_ent.show_hostile = time + 0.5; trace_ent.touch = SUB_Null; trace_ent.button0 = 0; trace_ent.attack_state = 0; trace_ent.velocity = '0 0 0'; trace_ent.attack_finished = time + 0.5; trace_ent.movetype = MOVETYPE_NONE; trace_ent.takedamage = 2; trace_ent.force = trace_ent.force - 30; trace_ent.deathtype = "flightning"; T_Damage(trace_ent, self, self, 30); self.force = self.force - 10; self.touch = SUB_Null; self.button0 = 0; self.attack_state = 0; self.velocity = '0 0 0'; self.attack_finished = time + 0.5; self.movetype = MOVETYPE_NONE; self.takedamage = 2; self.FLightRecip = trace_ent; self.FLightOn = 1; } void FLightThink() { local vector org; local vector dir; dir = normalize(self.FLightRecip.origin - self.origin); org = self.origin + (dir * 16); if(random() > 0.5) muzzleflash(); if(self.FLightRecip.pain_finished <= time) { if (random() > 0.5) sound (self.FLightRecip, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM); else sound (self.FLightRecip, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM); self.FLightRecip.pain_finished = time + 0.5; } if(time >= self.FLightSndTime) { sound(self, CHAN_AUTO, "force/flightloop.wav", 1, ATTN_NORM); self.FLightSndTime = time + 1; } WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); WriteByte (MSG_BROADCAST, TE_LIGHTNING1); WriteEntity (MSG_BROADCAST, self); WriteCoord (MSG_BROADCAST, org_x); WriteCoord (MSG_BROADCAST, org_y); WriteCoord (MSG_BROADCAST, org_z); WriteCoord (MSG_BROADCAST, (self.FLightRecip.origin_x + (random()*40) - 20)); WriteCoord (MSG_BROADCAST, (self.FLightRecip.origin_y + (random()*40) - 20)); WriteCoord (MSG_BROADCAST, (self.FLightRecip.origin_z + (random()*60) - 30)); self.show_hostile = time + 0.5; self.FLightRecip.show_hostile = time + 0.5; if(self.force <= 0) self.force = 0; if(self.FLightRecip.health <= 0) { FLightStop(); return; } self.FLightRecip.movetype = MOVETYPE_NONE; self.FLightRecip.attack_finished = time + 0.5; self.movetype = MOVETYPE_NONE; self.attack_finished = time + 0.5; if(self.force > 0) { self.force = self.force - 1; if(self.force <= 0) self.force = 0; } else { if(self.health <= 10) { FLightStop(); return; } T_Damage(self, self, self, 1); } if(self.FLightRecip.force >= 0) { self.FLightRecip.force = self.FLightRecip.force - 2; if(self.FLightRecip.force <= 0) self.FLightRecip.force = 0; self.FLightRecip.deathtype = "flightning"; T_Damage(self.FLightRecip, self, self, 2); } else { self.FLightRecip.deathtype = "flightning"; T_Damage(self.FLightRecip, self, self, 2); } if(self.FLightRecip.health <= 0) { FLightStop(); return; } if(self.freezed) { FLightStop(); return; } if(self.impulse == 69) { FLightStop(); return; } if(self.impulse == 67) { FLightStop(); ForcePush(); return; } if(self.FLightRecip.impulse == 69) { self.FLightRecip.think = FLightning; self.FLightRecip.nextthink = time; } if(self.FLightRecip.impulse == 67) { // FLightStop(); self.FLightRecip.think = ForcePush; self.FLightRecip.nextthink = time; return; } } // Force Jump void FJump() { // check to see if we have enough force if(self.force <= 10) return; sound(self, CHAN_AUTO, "force/forcejump.wav", 1, ATTN_NORM); // make angle for jump makevectors(self.v_angle); // check to see if we're suspended from the grappling hook and if we are, then disengage it if(self.hooking) BreakHook(); // set velocity thereby initiating the jump self.velocity_z = (self.velocity_z + 1000); self.velocity = (self.velocity + (v_forward * 10000)); // establish that we're jumping self.jump_flag = self.velocity_z; self.ForceJump = 1; self.force = self.force - 10; sound(self, CHAN_AUTO, "force/forcejump.wav", 1, ATTN_NORM); }