// dead people cannot cheat
if(self.deadflag != DEAD_NO)
return 0;
- if(self.classname != "player")
+ if(gamestart_sv_cheats < 2 && self.classname != "player")
return 0;
// sv_clones
ADD_CHEATS(self,cheating); \
return attempting
#define IS_CHEAT(i,argc,fr) \
- ++attempting; \
- if(!CheatsAllowed(i,argc,fr)) \
+ if((++attempting, !CheatsAllowed(i,argc,fr))) \
break
+float num_autoscreenshot;
+void info_autoscreenshot_findtarget()
+{
+ entity e;
+ e = find(world, targetname, self.target);
+ if(!e)
+ {
+ objerror("Missing target. FAIL!");
+ return;
+ }
+ vector a = vectoangles(e.origin - self.origin);
+ a_x = -a_x; // don't ask
+ self.angles_x = a_x;
+ self.angles_y = a_y;
+ // we leave Rick Roll alone
+}
+void spawnfunc_info_autoscreenshot()
+{
+ if(++num_autoscreenshot > autocvar_g_max_info_autoscreenshot)
+ {
+ objerror("Too many info_autoscreenshot entitites. FAIL!");
+ return;
+ }
+ if(self.target != "")
+ InitializeEntity(self, info_autoscreenshot_findtarget, INITPRIO_FINDTARGET);
+ // this one just has to exist
+}
+
float CheatImpulse(float i)
{
BEGIN_CHEAT_FUNCTION();
switch(i)
{
entity e, e2;
- vector org;
case CHIMPULSE_SPEEDRUN_INIT: // deploy personal waypoint
// shared with regular waypoint init, so this is not a cheat by itself
self.personal.ammo_fuel = self.ammo_fuel;
self.personal.health = self.health;
self.personal.armorvalue = self.armorvalue;
- self.personal.weapons = self.weapons;
+ WEPSET_COPY_EE(self.personal, self);
self.personal.items = self.items;
self.personal.pauserotarmor_finished = self.pauserotarmor_finished;
self.personal.pauserothealth_finished = self.pauserothealth_finished;
self.oldvelocity = self.velocity = self.personal.velocity;
self.angles = self.personal.v_angle;
self.fixangle = TRUE;
- if(self.flagcarried)
- {
- bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
- ReturnFlag(self.flagcarried);
- }
- }
- if(g_ctf)
- {
- self.ammo_rockets = 999;
- self.ammo_nails = 999;
- self.ammo_cells = 999;
- self.ammo_shells = 999;
- self.ammo_fuel = 999;
- self.health = start_health;
- self.armorvalue = start_armorvalue;
- self.weapons |= weaponsInMap;
- self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
- self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
- self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
- self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
- self.strength_finished = 0;
- self.invincible_finished = 0;
- }
- else
- {
- self.ammo_rockets = self.personal.ammo_rockets;
- self.ammo_nails = self.personal.ammo_nails;
- self.ammo_cells = self.personal.ammo_cells;
- self.ammo_shells = self.personal.ammo_shells;
- self.ammo_fuel = self.personal.ammo_fuel;
- self.health = self.personal.health;
- self.armorvalue = self.personal.armorvalue;
- self.weapons = self.personal.weapons;
- self.items = self.personal.items;
- self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
- self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
- self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time;
- self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time;
- self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time;
- self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time;
+
+ MUTATOR_CALLHOOK(AbortSpeedrun);
}
+
+ self.ammo_rockets = self.personal.ammo_rockets;
+ self.ammo_nails = self.personal.ammo_nails;
+ self.ammo_cells = self.personal.ammo_cells;
+ self.ammo_shells = self.personal.ammo_shells;
+ self.ammo_fuel = self.personal.ammo_fuel;
+ self.health = self.personal.health;
+ self.armorvalue = self.personal.armorvalue;
+ WEPSET_COPY_EE(self, self.personal);
+ self.items = self.personal.items;
+ self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
+ self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
+ self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time;
+ self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time;
+ self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time;
+ self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time;
+
DID_CHEAT();
break;
}
break;
case CHIMPULSE_TELEPORT:
IS_CHEAT(i, 0, 0);
- if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats >= 2) ? 100000 : 100), 1024, 256))
+ if(self.movetype == MOVETYPE_NOCLIP)
+ {
+ e = find(world, classname, "info_autoscreenshot");
+ if(e)
+ {
+ sprint(self, "Emergency teleport used info_autoscreenshot location\n");
+ setorigin(self, e.origin);
+ self.angles = e.angles;
+ remove(e);
+ // should we? self.angles_x = -self.angles_x;
+ self.fixangle = TRUE;
+ self.velocity = '0 0 0';
+ DID_CHEAT();
+ break;
+ }
+ }
+ if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats < 2) ? 100 : 100000), 1024, 256))
{
+ sprint(self, "Emergency teleport used random location\n");
self.angles_x = -self.angles_x;
self.fixangle = TRUE;
self.velocity = '0 0 0';
break;
case CHIMPULSE_R00T:
IS_CHEAT(i, 0, 0);
+ RandomSelection_Init();
FOR_EACH_PLAYER(e)
- {
- get_model_parameters(e.playermodel, e.skinindex);
- if(get_model_parameters_sex == "Female")
- {
- makevectors(e.angles);
- traceline(e.origin, e.origin + v_right * 256, MOVE_NORMAL, e);
- }
- else
- {
- org_x = random();
- org_y = random();
- org_z = 0;
- org = normalize(org);
- traceline(e.origin, e.origin + org * 256, MOVE_NORMAL, e); // random direction
- }
+ if(e.deadflag == DEAD_NO)
+ if(IsDifferentTeam(e, self))
+ RandomSelection_Add(e, 0, string_null, 1, 1);
+ if(RandomSelection_chosen_ent)
+ e = RandomSelection_chosen_ent;
+ else
+ e = self;
- org = findbetterlocation(trace_endpos, 12);
+ pointparticles(particleeffectnum("rocket_explode"), e.origin, '0 0 0', 1);
+ sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+
+ e2 = spawn();
+ setorigin(e2, e.origin);
+ RadiusDamage(e2, self, 1000, 0, 128, world, 500, DEATH_CHEAT, e);
+ remove(e2);
- e2 = spawn();
- setorigin(e2, org);
- pointparticles(particleeffectnum("rocket_explode"), org, '0 0 0', 1);
- sound(e2, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- RadiusDamage(e2, e, 1000, 0, 128, e, 500, DEATH_CHEAT, world);
- remove(e2);
- }
print("404 Sportsmanship not found.\n");
DID_CHEAT();
break;
if(GiveItems(self, 1, argc))
DID_CHEAT();
break;
+ case "usetarget":
+ IS_CHEAT(0, argc, 0);
+ e = self;
+ self = spawn();
+ self.target = argv(1);
+ activator = e;
+ SUB_UseTargets();
+ remove(self);
+ self = e;
+ DID_CHEAT();
+ break;
+ case "killtarget":
+ IS_CHEAT(0, argc, 0);
+ e = self;
+ self = spawn();
+ self.killtarget = argv(1);
+ activator = e;
+ SUB_UseTargets();
+ remove(self);
+ self = e;
+ DID_CHEAT();
+ break;
+ case "teleporttotarget":
+ IS_CHEAT(0, argc, 0);
+ e = self;
+ self = spawn();
+ setorigin(self, self.origin);
+ self.classname = "cheattriggerteleport";
+ self.target = argv(1);
+ teleport_findtarget();
+ if(!wasfreed(self))
+ {
+ Simple_TeleportPlayer(self, e);
+ remove(self);
+ self = e;
+ DID_CHEAT();
+ }
+ else
+ self = e;
+ break;
}
END_CHEAT_FUNCTION();
float drag;
crosshair_trace_plusvisibletriggers(self);
+ drag = FALSE;
if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range)
{
switch(trace_ent.grab)