21 float head_dist2, closest_dist2 = 0;
22 for (; head; head = head.chain)
24 head_dist2 =
vlen2(head.WarpZone_findradius_dist);
25 if (!closest || head_dist2 < closest_dist2)
27 closest_dist2 = head_dist2;
34 vector my_org = player.origin;
36 vector my_vel = player.velocity;
37 vector my_ang = player.angles;
38 vector their_org = closest.origin;
40 vector their_vel = closest.velocity;
41 vector their_ang = closest.angles;
47 setorigin(player, their_org);
48 setorigin(closest, my_org);
50 closest.velocity = my_vel;
51 closest.angles = my_ang;
54 closest.v_angle = closest.angles;
57 closest.fixangle =
true;
58 closest.oldorigin = my_org;
59 closest.oldvelocity = my_vel;
60 player.velocity = their_vel;
61 player.angles = their_ang;
64 player.v_angle = player.angles;
67 player.fixangle =
true;
68 player.oldorigin = their_org;
69 player.oldvelocity = their_vel;
72 closest.pusher = player;
76 Send_Effect(EFFECT_SWAPPER, their_center,
'0 0 0', 1);
92 PAR(_(
"The %s buff allows you to press %s to switch places with a nearby enemy once."),
COLORED_NAME(
this),
strcat(
"^3", _(
"drop weapon"),
"^7"));
93 PAR(_(
"A common usage of this buff is to jump over the map's void, then swap with an enemy, to cause them to fall into the void."));
94 PAR(_(
"The range that the buff works over is limited, so sometimes it may do nothing if there are no enemies nearby."));
void bot_aim_reset(entity this)
#define MUTATOR_CALLHOOK(id,...)
#define MUTATOR_HOOKFUNCTION(...)
#define MUTATOR_RETURNVALUE
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
#define PHYS_INPUT_BUTTON_CHAT(s)
#define CENTER_OF_ENT(ent)
float autocvar_g_maxpushtime
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define METHOD(cname, name, prototype)
void Drop_Special_Items(entity player)
#define sound(e, c, s, v, a)
bool StatusEffects_active(StatusEffect this, entity actor)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
void buff_RemoveAll(entity actor, int removal_type)
bool buff_Swapper_cond(entity e)
float autocvar_g_buffs_swapper_range
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))