61 if(!ignoredead &&
IS_DEAD(
this))
66 if(
imp == CHIMPULSE_CLONE_MOVING.impulse ||
imp == CHIMPULSE_CLONE_STANDING.impulse)
92#define BEGIN_CHEAT_FUNCTION() \
93 float cheating = 0, attempting = 0
96#define ADD_CHEATS(e,n) \
97 cheatcount_total += n; \
99#define END_CHEAT_FUNCTION() \
100 ADD_CHEATS(this, cheating); \
102#define IS_CHEAT(ent,i,argc,fr) \
103 if((++attempting, !CheatsAllowed(ent,i,argc,fr,true,false))) \
113 objerror(
this,
"Missing target. FAIL!");
127 objerror(
this,
"Too many info_autoscreenshot entitites. FAIL!");
145 case CHIMPULSE_SPEEDRUN_INIT.impulse:
170 case CHIMPULSE_CLONE_MOVING.impulse:
179 case CHIMPULSE_CLONE_STANDING.impulse:
185 case CHIMPULSE_GIVE_ALL.impulse:
189 case CHIMPULSE_SPEEDRUN.impulse:
198 sprint(
this,
"Cannot move there, cheater - only waypoints set using g_waypointsprite_personal work\n");
203 setorigin(
this, this.
personal.origin);
232 sprint(
this,
"UR DEAD AHAHAH))\n");
234 sprint(
this,
"No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
236 case CHIMPULSE_TELEPORT.impulse:
243 sprint(
this,
"Emergency teleport used info_autoscreenshot location\n");
244 setorigin(
this, e.origin);
256 sprint(
this,
"Emergency teleport used random location\n");
257 this.angles_x = -this.
angles.x;
263 sprint(
this,
"Emergency teleport could not find a good location, forget it!\n");
265 case CHIMPULSE_R00T.impulse:
274 Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin,
'0 0 0', 1);
278 setorigin(e2, e.origin);
279 RadiusDamage(e2,
this, 1000, 0, 128,
NULL,
NULL, 500, DEATH_CHEAT.m_id,
DMG_NOWEP, e);
282 LOG_INFO(
"404 Sportsmanship not found.");
301 case "pointparticles":
314 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd pointparticles <effectname> <position> <velocity> <countmultiplier>\n");
315 sprint(
this,
" Where <position> is a number from 0 to 1 representing distance on the crosshair line,\n");
316 sprint(
this,
" and <velocity> is a vector \"x y z\"\n");
318 case "trailparticles":
324 effectnum = _particleeffectnum(
argv(1));
331 sprint(
this,
"Usage: sv_cheats 1; restart; cmd trailparticles <effectname>\n");
342 sprint(
this,
"cannot make stuff there (bad surface)\n");
346 entity e =
new(func_breakable);
348 e.mdl =
"rocket_explode";
361 tracebox(e.origin, e.mins, e.maxs, e.origin,
MOVE_NORMAL, e);
365 sprint(
this,
"cannot make stuff there (no space)\n");
376 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd make <modelname> <mode>\n");
377 sprint(
this,
" where <mode> can be 0, 1 or 2\n");
388 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd penalty <duration> <reason>))\n");
390 case "dragbox_spawn": {
392 entity e =
new(dragbox_box);
402 e.aiment =
new(dragbox_corner_1);
406 setsize(e.aiment,
'0 0 0',
'0 0 0');
415 e.enemy =
new(dragbox_corner_2);
419 setsize(e.enemy,
'0 0 0',
'0 0 0');
421 end.x = (end.x > 0) * 2 - 1;
422 end.y = (end.y > 0) * 2 - 1;
423 end.z = (end.z > 0) * 2 - 1;
427 setorigin(e.enemy, e.aiment.origin + 32 * end);
429 e.killindicator =
new(drag_digit);
430 e.killindicator.owner = e;
431 setattachment(e.killindicator, e,
"");
432 setorigin(e.killindicator,
'0 0 -8');
433 e.killindicator.killindicator =
new(drag_digit);
434 e.killindicator.killindicator.owner = e;
435 setattachment(e.killindicator.killindicator, e,
"");
436 setorigin(e.killindicator.killindicator,
'0 0 8');
440 case "dragpoint_spawn": {
442 entity e =
new(dragpoint);
447 setsize(e,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
462 e.killindicator =
new(drag_digit);
463 e.killindicator.owner = e;
464 setattachment(e.killindicator, e,
"");
465 setorigin(e.killindicator,
'0 0 40');
466 e.killindicator.killindicator =
new(drag_digit);
467 e.killindicator.killindicator.owner = e;
468 setattachment(e.killindicator.killindicator, e,
"");
469 setorigin(e.killindicator.killindicator,
'0 0 56');
513 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_setcnt <cnt>\n");
520 fputs(f,
"cmd drag_clear\n");
523 fputs(f,
strcat(
"cmd dragbox_spawn ",
ftos(e.cnt),
" \"",
vtos(e.aiment.origin),
"\" \"",
vtos(e.enemy.origin),
"\"\n"));
533 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
535 case "drag_saveraceent":
543 fputs(f,
"\"classname\" \"trigger_race_checkpoint\"\n");
545 fputs(f,
strcat(
"\"maxs\" \"",
ftos(e.absmax.x - e.absmin.x),
" ",
ftos(e.absmax.y - e.absmin.y),
" ",
ftos(e.absmax.z - e.absmin.z),
"\"\n"));
556 if((e.cnt <= 0 && ent.cnt == 0) || e.cnt == ent.cnt)
558 start = start + ent.origin;
562 start *= 1 / effectnum;
564 fputs(f,
"\"classname\" \"info_player_race\"\n");
569 fputs(f,
"\"target\" \"checkpoint0\"\n");
570 fputs(f,
"\"race_place\" \"0\"\n");
574 fputs(f,
"\"target\" \"checkpoint0\"\n");
575 fputs(f,
"\"race_place\" \"-1\"\n");
588 if(
vlen2(ent.origin - start) <
vlen2(e.origin - start))
602 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
623 sprint(
this,
"godmode ON\n");
627 sprint(
this,
"godmode OFF\n");
634 sprint(
this,
"notarget ON\n");
638 sprint(
this,
"notarget OFF\n");
645 sprint(
this,
"noclip ON\n");
651 sprint(
this,
"noclip OFF\n");
659 sprint(
this,
"flymode ON\n");
665 sprint(
this,
"flymode OFF\n");
684 e2.killtarget =
argv(1);
689 case "teleporttotarget":
691 entity ent =
new(cheattriggerteleport);
692 setorigin(ent, ent.origin);
693 ent.target =
argv(1);
726 Drag(
this,
true,
true);
730 Drag(
this,
false,
false);
754float Drag(
entity this,
float force_allow_pick,
float ischeat)
772 CS(
this).impulse = 0;
777 CS(
this).impulse = 0;
800 float pick = force_allow_pick;
813 if(e.owner ==
this || e.realowner ==
this)
851 draggee.dragmovetype = draggee.move_movetype;
852 draggee.draggravity = draggee.gravity;
854 draggee.gravity = 0.00001;
856 draggee.draggedby = dragger;
858 dragger.dragentity = draggee;
860 dragger.dragdistance =
vlen(touchpoint - dragger.origin - dragger.view_ofs);
861 dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
862 touchpoint = touchpoint -
gettaginfo(draggee, 0);
864 dragger.draglocalvector_x = touchpoint *
v_forward * tagscale;
865 dragger.draglocalvector_y = touchpoint *
v_right * tagscale;
866 dragger.draglocalvector_z = touchpoint *
v_up * tagscale;
868 dragger.dragspeed = 64;
874 draggee = dragger.dragentity;
876 dragger.dragentity =
NULL;
877 draggee.draggedby =
NULL;
879 draggee.gravity = draggee.draggravity;
881 switch(draggee.move_movetype)
892 draggee.velocity =
'0 0 0';
896 if((draggee.flags &
FL_ITEM) && (
vdist(draggee.velocity, <, 32)))
898 draggee.velocity =
'0 0 0';
915 if(draggee.classname ==
"door")
920 return ((draggee.draggable) ? draggee.draggable(draggee, dragger) :
true);
926 if(
substring(draggee.model, 0, 1) ==
"*")
933 dragger.dragdistance += dragger.dragspeed;
938 dragger.dragspeed = (2 ** s);
943 dragger.dragdistance =
max(0, dragger.dragdistance - dragger.dragspeed);
948 vector curorigin, neworigin, goodvelocity;
952 draggee = dragger.dragentity;
956 curorigin = curorigin +
v_forward * dragger.draglocalvector.x +
v_right * dragger.draglocalvector.y +
v_up * dragger.draglocalvector.z;
958 neworigin = dragger.origin + dragger.view_ofs +
v_forward * dragger.dragdistance;
959 goodvelocity = (neworigin - curorigin) * (1 /
frametime);
961 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle > 180)
962 dragger.draglocalangle += 360;
963 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle <= -180)
964 dragger.draglocalangle -= 360;
967 draggee.velocity = draggee.velocity * (1 - f) + goodvelocity * f;
970 draggee.angles_y = draggee.angles.y * (1 - f) + (dragger.v_angle.y + dragger.draglocalangle) * f;
976 if(dragger.(weaponentity).movedir.x > 0)
977 vecs = dragger.(weaponentity).
movedir;
981 te_lightning1(draggee, dragger.origin + dragger.view_ofs + dv, curorigin);
991 if(!dragger.dragentity)
993 if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
995 dragger.dragentity =
NULL;
1010 to.draggedby = from.draggedby;
1011 to.draggedby.dragentity = to;
1012 from.draggedby =
NULL;
1020 this.origin_x = (this.
aiment.origin.x + this.
enemy.origin.x) * 0.5;
1021 this.origin_y = (this.
aiment.origin.y + this.
enemy.origin.y) * 0.5;
1022 this.origin_z = (this.
aiment.origin.z + this.
enemy.origin.z) * 0.5;
1023 this.maxs_x =
fabs(this.
aiment.origin.x -
this.enemy.origin.x) * 0.5;
1024 this.maxs_y =
fabs(this.
aiment.origin.y -
this.enemy.origin.y) * 0.5;
1025 this.maxs_z =
fabs(this.
aiment.origin.z -
this.enemy.origin.z) * 0.5;
1027 setorigin(
this, this.
origin);
1028 setsize(
this, this.
mins, this.
maxs);
1037 else if(this.
cnt == -2)
#define MUTATOR_CALLHOOK(id,...)
void func_breakable_setup(entity this)
#define END_CHEAT_FUNCTION()
float Drag_CanDrag(entity dragger)
void Drag_MoveBackward(entity dragger)
float CheatCommand(entity this, int argc)
void DragBox_Think(entity this)
void Drag_MoveDrag(entity from, entity to)
#define IS_CHEAT(ent, i, argc, fr)
#define BEGIN_CHEAT_FUNCTION()
float Drag(entity this, float force_allow_pick, float ischeat)
void info_autoscreenshot_findtarget(entity this)
void Drag_Finish(entity dragger)
float Drag_MayChangeAngles(entity draggee)
float CheatImpulse(entity this, int imp)
void Drag_Update(entity dragger)
void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
float Drag_IsDraggable(entity draggee, entity dragger)
void Drag_SetSpeed(entity dragger, float s)
void Drag_MoveForward(entity dragger)
float CheatFrame(entity this)
bool drag_undraggable(entity draggee, entity dragger)
float CheatsAllowed(entity this, float imp, int argc, float cheatframe, bool logattempt, bool ignoredead)
float gamestart_sv_cheats
float Drag_IsDragging(entity dragger)
int autocvar_g_max_info_autoscreenshot
float autocvar_g_grab_range
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_DRAG(s)
string playername(string thename, int teamid, bool team_colorize)
void detach_sameorigin(entity e)
const int INITPRIO_FINDTARGET
const vector PL_CROUCH_MIN_CONST
const vector PL_CROUCH_MAX_CONST
float DPCONTENTS_DONOTENTER
float DPCONTENTS_PLAYERCLIP
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
vector trace_plane_normal
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
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.
void SUB_UseTargets(entity this, entity actor, entity trigger)
#define move_out_of_solid(e)
#define BITXOR_ASSIGN(a, b)
void set_movetype(entity this, int mt)
const int MOVETYPE_FLYMISSILE
const int MOVETYPE_BOUNCEMISSILE
#define UNSET_ONGROUND(s)
const int MOVETYPE_PHYSICS
const int MOVETYPE_NOCLIP
const int MOVETYPE_BOUNCE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
IntrusiveList g_observepoints
float pauserotfuel_finished
float pauseregen_finished
float pauserothealth_finished
float pauserotarmor_finished
float GiveItems(entity e, float beginarg, float endarg)
void CopyBody(entity this, float keepvelocity)
void race_ImposePenaltyTime(entity pl, float penalty, string reason)
bool autocvar_g_allow_checkpoints
#define sound(e, c, s, v, a)
ClientState CS(Client this)
void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
StatusEffect statuseffects
Entity statuseffects.
void StatusEffects_update(entity e)
Header file that describes the resource system.
void teleport_findtarget(entity this)
entity Simple_TeleportPlayer(entity teleporter, entity player)
void crosshair_trace(entity pl)
void crosshair_trace_plusvisibletriggers(entity pl)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity weaponentities[MAX_WEAPONSLOTS]
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
void InitializeEntity(entity e, void(entity this) func, int order)