public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } String what = null; DisabledControl control = DisabledControl.Steering; var id = r.Current; switch (id) { case "steering": control = DisabledControl.Steering; what = "Steering"; break; default: throw new Exception($"bad disable-control id `{id}`"); } var timer = mod.Timer($"Disabled {what}", 10f); mod.AddTicker(new DisableControlTicker(timer, control)); mod.ShowText($"{from} disabled the {what} control!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var timer = mod.Timer("Reduced Gravity", 15); World.GravityLevel = 9.8f / 2; mod.AddUniqueTicker(TickerId.ReducedGravity, new Ticker(timer)); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to make you skyfall :("); return; } // parameters when in vehicle if (player.CurrentVehicle != null) { player.CurrentVehicle.Delete(); } switch (player.ParachuteState) { case ParachuteState.Deploying: case ParachuteState.Gliding: player.Task.UseParachute(); break; default: break; } var timer = mod.Timer("Skyfall", 20f); player.Weapons.Give(WeaponHash.Parachute, 1, true, true); mod.AddUniqueTicker(TickerId.Skyfall, new SkyfallTicker(player, timer)); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to boost you :("); return; } var what = "Boost"; float time = 30f; float factor = 20f; if (super) { factor = 200f; what = "Super Boost"; } var timer = mod.Timer(what, time); mod.AddTicker(new BoostTicker(player, timer, factor)); mod.ShowText($"{from} caused the vehicle to boost!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Exploding Bullets", duration); mod.AddUniqueTicker(TickerId.ExplodingBullets, new ExplodingBulletsTicker(timer)); mod.ShowText($"{from} enabled exploding bullets!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Super Swim", duration); mod.AddUniqueTicker(TickerId.SuperSwim, new SuperSwimTicker(timer, 10f)); mod.ShowText($"{from} gave you with super swim for {duration} seconds"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var timer = mod.Timer("Time Slowdown", 5f); if (mod.AddUniqueTicker(TickerId.SlowDownTime, new SlowDownTimeTicker(timer))) { Function.Call(Hash.SET_TIME_SCALE, 0.25f); } mod.ShowText($"{from} slowed down time!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var r = rest.GetEnumerator(); var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var player = Game.Player; var timer = mod.Timer("Super Jump", duration); mod.AddUniqueTicker(TickerId.SuperJump, new SuperJumpTicker(timer, player)); mod.ShowText($"{from} gave you with super jump for {duration} seconds"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Super Speed", duration); if (mod.AddUniqueTicker(TickerId.SuperSpeed, new SuperSpeedTicker(timer))) { // NB: in spite of its name, it should only be called once. Game.Player.SetRunSpeedMultThisFrame(10f); } mod.ShowText($"{from} gave you super speed for {duration} seconds"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to taze you!"); return; } player.Euphoria.Electrocute.Start(3_000); var timer = mod.Timer("Tazing", 3); mod.AddUniqueTicker(TickerId.Electrocuted, timer); mod.ShowText($"{from} tazed you!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to brake your vehicle!"); return; } var timer = mod.Timer("Handbrake On", 5f); mod.AddTicker(new BrakeTicker(vehicle, timer)); mod.ShowText($"{from} caused the vehicle to brake!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to put you on fire!"); return; } var timer = mod.Timer("On Fire", 5f); if (mod.AddUniqueTicker(TickerId.SetOnFire, new SetOnFireTicker(player, timer))) { player.StartEntityFire(); } mod.ShowText($"{from} put you on fire!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to put EVERYONE on fire!"); return; } var peds = World.GetNearbyPeds(player.Position, 1000f); var scriptFires = new List <ScriptFire>(); foreach (var ped in peds) { if (ped.IsHuman && !ped.IsOnFire && ped.IsAlive && ped != player) { if (ped.CurrentVehicle != null) { ped.Task.ClearAll(); ped.AlwaysKeepTask = true; ped.Task.LeaveVehicle(); } ped.Euphoria.OnFire.Start(10_000); var id = WorldExtension.StartScriptFire(ped.Position, 5, true); scriptFires.Add(new ScriptFire(id, ped)); } } if (scriptFires.Count == 0) { mod.ShowText($"{from} tried to put pedestrians on fire but there are none :("); return; } var timer = mod.Timer("Peds On Fire", 10f); mod.AddTicker(new SetPedsOnFireTicker(scriptFires, timer)); mod.ShowText($"{from} set {scriptFires.Count} pedestrians on fire!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to make you fire proof!"); return; } var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Fireproof", duration); if (mod.AddUniqueTicker(TickerId.MakeFireProof, new FireProofTicker(player, timer))) { player.IsFireProof = true; } mod.ShowText($"{from} made you fire proof for {duration} seconds!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to give you invincibility :("); return; } var timer = mod.Timer("Invincibility", duration); if (mod.AddUniqueTicker(TickerId.Invincibility, new InvincibilityTicker(timer, player))) { Game.Player.IsInvincible = true; } mod.ShowText($"{from} gave you invincibility for {duration} seconds!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; var peds = World.GetNearbyPeds(player.Position, 1000f); foreach (var ped in peds) { if (ped == player || !ped.IsHuman || !ped.IsAlive) { continue; } ped.Euphoria.Electrocute.ResetArguments(); ped.Euphoria.Electrocute.Start(3_000 + (int)(mod.Rnd.NextDouble() * 1_000f)); } var timer = mod.Timer("Tazed Others", 3); mod.AddUniqueTicker(TickerId.ElectrocutedOthers, timer); mod.ShowText($"{from} tazed others!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to enable matrix slam :("); return; } var entities = World.GetNearbyEntities(player.Position, 1000f); foreach (var entity in entities) { if (entity == player) { continue; } if (entity is Ped) { var ped = (Ped)entity; mod.AddTicker(ped.Levitate(mod.Rnd, mod.AnonymousTimer(10f))); continue; } if (entity is Vehicle) { var vehicle = (Vehicle)entity; mod.AddTicker(vehicle.Levitate(mod.Rnd, mod.AnonymousTimer(10f))); continue; } } mod.AddUniqueTicker(TickerId.LevitatingEntities, new TimerTicker(mod.Timer("Levitating things", 10f))); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { return; } float amplitude = 1f; string animationSet = "move_m@drunk@moderatedrunk"; string what = "drunk"; if (veryDrunk) { amplitude = 5f; animationSet = "move_m@drunk@verydrunk"; what = "VERY drunk"; Function.Call(Hash._START_SCREEN_EFFECT, "DrugsDrivingOut", 0, 0); } var timer = mod.Timer(what, 20f); var stumbleTimer = mod.RandomTimer(2f, 5f); if (!WorldExtension.HasAnimationSetLoaded(animationSet)) { WorldExtension.RequestAnimationSet(animationSet); } GameplayCamera.Shake(CameraShake.Drunk, amplitude); player.SetPedIsDrunk(true); player.SetConfigFlag(100, true); player.SetPedMovementClipset(animationSet); mod.AddUniqueTicker(TickerId.Drunk, new DrunkTicker(mod.Rnd, timer, stumbleTimer, player)); mod.ShowText($"{from} made you {what}!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to enable matrix slam :("); return; } var time = 10f; var extraHeight = 4f; var entity = (Entity)player; float?jitter = null; // parameters when in vehicle if (player.CurrentVehicle != null) { entity = player.CurrentVehicle; extraHeight = 10f + (float)(mod.Rnd.NextDouble() * 5f); } else { time = 7f; player.Euphoria.HighFall.Start(10_000); jitter = 0.05f; extraHeight += (float)(mod.Rnd.NextDouble() * 2f); } var height = entity.Position.Z + extraHeight; var timer = mod.Timer("Levitation", time); mod.AddUniqueTicker(TickerId.Levitation, new LevitateController(timer, entity, height, mod.Rnd, jitter)); mod.ShowText($"{from} caused you to levitate!"); }