10 this.
team = actor.team;
34 float grav, sdist, zdist, vs, vz, jumpheight;
37 torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
40 if(pushed_entity && pushed_entity.gravity)
41 grav *= pushed_entity.gravity;
51 zdist = torg.z -
org.z;
52 sdist =
vlen(torg -
org - zdist *
'0 0 1');
56 jumpheight =
fabs(ht);
82 vz =
sqrt(
fabs(2 * grav * jumpheight));
92 solution_y = solution.x;
94 solution_x = solution.y;
105 flighttime = solution.y;
112 flighttime = solution.y;
123 flighttime = solution.x;
130 flighttime = solution.y;
133 vs = sdist / flighttime;
136 return sdir * vs +
'0 0 1' * vz;
150 float zdir = pushed_entity.velocity.z;
151 if(zdir != 0) zdir =
copysign(1, zdir);
155 if (!is_playerdir_xy || !is_playerdir_z)
158 vs_tgt =
vec2(vel_tgt);
162 if (is_bidirectional_xy)
170 if (is_bidirectional_z)
210 if (is_clamp_negative_adds)
222 float vz_add = pushed_entity.velocity.z;
231 if (is_clamp_negative_adds)
241 return vs +
'0 0 1' * vz;
250 if(!WarpZoneLib_ExactTrigger_Touch(this, it, false))
251 it.last_pushed = NULL;
273 bool already_pushed =
false;
276 if(
this == targ.last_pushed || (targ.last_pushed && !
STAT(Q3COMPAT, targ)))
278 already_pushed =
true;
282 targ.last_pushed =
this;
331 objerror (
this,
"Jumppad with no target");
343 switch(targ.move_movetype)
361 targ.oldvelocity = targ.velocity;
372 Send_Effect(EFFECT_JUMPPAD, targ.origin, targ.velocity, 1);
382 if(targ.(jumppadsused[i]) ==
this)
397 targ.lastteleporttime =
time;
398 targ.lastteleport_origin = targ.origin;
405 targ.jumppadcount = 1;
412 if(this.
enemy.target)
418 targ.com_phys_gravity_factor = 1;
419 switch(targ.move_movetype)
478 setorigin(tracetest_ent,
org);
479 tracetoss(tracetest_ent, tracetest_ent);
492 tracetest_ent.velocity.z = 0;
493 setorigin(tracetest_ent, targ.origin + ofs);
494 tracetoss(tracetest_ent, tracetest_ent);
497 setorigin(tracetest_ent, targ.origin + ofs * 0.5);
498 tracetoss(tracetest_ent, tracetest_ent);
501 setorigin(tracetest_ent, targ.origin);
502 tracetoss(tracetest_ent, tracetest_ent);
514 setorigin(tracetest_ent,
org);
515 tracetoss(tracetest_ent, tracetest_ent);
543 if(t.classname ==
"target_push")
583 return (v.z + v2.z) / grav;
591 float t = v.z / grav;
592 float jump_height = 1/2 * grav * (t ** 2);
593 float remaining_height =
org.z + jump_height - endpos.z;
594 float v2_z =
sqrt(2 * grav * remaining_height);
596 return (v.z + v2_z) / grav;
638 vector best_target =
'0 0 0';
639 vector best_org =
'0 0 0';
640 vector best_vel =
'0 0 0';
641 bool valid_best_target =
false;
654 if ((e.velocity.x != 0 || e.velocity.y != 0)
659 best_vel = e.velocity;
660 valid_best_target =
true;
666 if (dist.x || dist.y)
695 valid_best_target =
true;
698 if (ofs && new_org !=
org - ofs)
711 if (valid_best_target)
716 float cost =
vlen(
vec2(t.origin - best_org)) / velxy;
719 cost +=
vlen(
vec2(best_target - t.origin)) / velxy;
734 objerror (
this,
"Jumppad with nonexistant target");
762 e.velocity =
pusher.movedir;
861 this.
noise =
"misc/jumppad.wav";
889 this.
noise =
"misc/jumppad.wav";
911 if(trigger.classname ==
"trigger_push" || trigger ==
this)
927 setorigin(
this, this.
origin);
938 for (
entity trigger_ent = findchain(
target, this.
targetname); trigger_ent; trigger_ent = trigger_ent.chain)
960 this.
noise =
"sound/misc/windfly.wav";
962 this.
noise =
"misc/jumppad.wav";
978NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH,
bool isnew)
980 int mytm =
ReadByte();
if(mytm) { this.
team = mytm - 1; }
983 this.
height = ReadCoord();
996NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH_VELOCITY,
bool isnew)
998 int mytm =
ReadByte();
if(mytm) { this.
team = mytm - 1; }
1001 this.
speed = ReadCoord();
1002 this.
count = ReadCoord();
1014void target_push_remove(
entity this)
1020NET_HANDLE(ENT_CLIENT_TARGET_PUSH,
bool isnew)
1030 setorigin(
this, this.
origin);
1033 this.entremove = target_push_remove;
void animdecide_setaction(entity e, float action, float restart)
const int ANIMACTION_JUMP
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float autocvar_sv_maxspeed
const vector PL_MIN_CONST
const int INITPRIO_FINDTARGET
const vector PL_MAX_CONST
const float SOLID_TRIGGER
float DPCONTENTS_PLAYERCLIP
const float EF_NODEPTHTEST
void UpdateCSQCProjectile(entity e)
void defer(entity this, float fdelay, void(entity) func)
Execute func() after time + fdelay.
void SUB_Remove(entity this)
Remove entity.
const int SF_TRIGGER_INIT
const int SF_TRIGGER_UPDATE
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
#define IL_EACH(this, cond, body)
float trigger_push_send(entity this, entity to, float sf)
vector trigger_push_get_start_point(entity this)
void target_push_link(entity this)
bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vector org)
bool trigger_push_testorigin_for_item(entity tracetest_ent, entity item, vector org)
void trigger_push_use(entity this, entity actor, entity trigger)
void target_push_init(entity this)
void trigger_push_findtarget(entity this)
bool trigger_push_test(entity this, entity item)
bool jumppad_push(entity this, entity targ, bool is_velocity_pad)
entity get_pusher_from_trigger(entity this)
float trigger_push_get_push_time(entity this, vector endpos)
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
bool target_push_send(entity this, entity to, float sf)
void trigger_push_link(entity this)
void trigger_push_velocity_think(entity this)
float trigger_push_velocity_send(entity this, entity to, float sf)
void trigger_push_updatelink(entity this)
void trigger_push_velocity_link(entity this)
vector trigger_push_velocity_calculatevelocity(entity this, vector org, entity tgt, float speed, float count, entity pushed_entity, bool already_pushed)
void trigger_push_velocity_touch(entity this, entity toucher)
void target_push_use(entity this, entity actor, entity trigger)
void trigger_push_touch(entity this, entity toucher)
#define PUSH_VELOCITY_PLAYERDIR_Z
#define PUSH_VELOCITY_ADD_Z
void SUB_UseTargets(entity this, entity actor, entity trigger)
#define PUSH_VELOCITY_PLAYERDIR_XY
#define PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS
const int NUM_JUMPPADSUSED
#define Q3_TARGET_PUSH_JUMPPAD
#define PUSH_VELOCITY_BIDIRECTIONAL_XY
#define PUSH_VELOCITY_BIDIRECTIONAL_Z
#define PUSH_VELOCITY_ADD_XY
#define NET_HANDLE(id, param)
#define ReadAngleVector()
#define WriteHeader(to, id)
#define REGISTER_NET_LINKED(id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
#define EXACTTRIGGER_TOUCH(e, t)
#define BITSET_ASSIGN(a, b)
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
float copysign(float e, float f)
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
#define UNSET_ONGROUND(s)
const int MOVETYPE_BOUNCE
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
#define _sound(e, c, s, v, a)
void SetMovedir(entity this)
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc)
bool isPushable(entity e)
void trigger_common_write(entity this, bool withtarget)
void trigger_remove_generic(entity this)
void trigger_common_read(entity this, bool withtarget)
void WarpZoneLib_ExactTrigger_Init(entity this, bool unsetmodel)
#define IS_REAL_CLIENT(v)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
void InitializeEntity(entity e, void(entity this) func, int order)
IntrusiveList g_moveables