4 void() trigger_push_touch =
6 local float flighttime, dist, grav;
9 if (other.classname != "player" && other.classname != "corpse" && other.classname != "body" && other.classname != "gib" && other.classname != "missile" && other.classname != "casing" && other.classname != "grenade" && other.classname != "plasma")
14 other.velocity = self.movedir;
15 other.flags = other.flags - (other.flags & FL_ONGROUND);
21 if (other.classname == "player")
22 sound (other, CHAN_ITEM, "misc/jumppad.wav", 1, ATTN_NORM);
24 // figure out how long it will take to hit the point considering gravity
25 grav = cvar("sv_gravity");
26 flighttime = sqrt((self.enemy.origin_z - org_z) / (0.5 * grav));
30 // how far in X and Y to move
31 self.movedir = (self.enemy.origin - org);
33 dist = vlen(self.movedir);
35 // finally calculate the velocity
36 self.movedir = normalize(self.movedir) * (dist / flighttime);
37 self.movedir_z = flighttime * grav;
39 other.velocity = self.movedir;
40 other.flags = other.flags - (other.flags & FL_ONGROUND);
42 if (other.classname == "missile")
43 other.angles = vectoangles (other.velocity);
45 if (self.spawnflags & PUSH_ONCE)
47 self.touch = SUB_Null;
48 self.think = SUB_Remove;
49 self.nextthink = time;
53 void() trigger_push_findtarget =
56 self.enemy = find(world, targetname, self.target);
59 objerror("trigger_push: target not found\n");
66 if (self.angles != '0 0 0')
69 self.solid = SOLID_TRIGGER;
70 setmodel (self, self.model);
71 self.movetype = MOVETYPE_NONE;
75 self.touch = trigger_push_touch;
77 // check if this is a jump pad
80 self.think = trigger_push_findtarget;
81 self.nextthink = time + 0.2;
88 self.movedir = self.movedir * self.speed * 10;
92 void() target_push = {};
93 void() info_notnull = {};
94 void() target_position = {};