diff --git a/SCHIZO/Events/Ermcon/ErmconAttendee.cs b/SCHIZO/Events/Ermcon/ErmconAttendee.cs index 88e1edf7..ec1abc97 100644 --- a/SCHIZO/Events/Ermcon/ErmconAttendee.cs +++ b/SCHIZO/Events/Ermcon/ErmconAttendee.cs @@ -230,6 +230,7 @@ public bool SwitchTarget(ErmconPanelist forceTarget = null) private ErmconPanelist PickAnotherBooth() { return Ermcon.instance.targets + .Where(t => t.gameObject != gameObject) // except self (where applicable) .GroupBy(t => (timeFactor: _visited.GetOrDefault(t, 0f) / t.entertainmentFactor, t.entertainmentFactor)) .OrderBy(group => group.Key.timeFactor) .ThenByDescending(group => group.Key.entertainmentFactor) diff --git a/SCHIZO/SwarmControl/Redeems/Annoying/ScanTotallyRandomFragment.cs b/SCHIZO/SwarmControl/Redeems/Annoying/ScanTotallyRandomFragment.cs new file mode 100644 index 00000000..cb828671 --- /dev/null +++ b/SCHIZO/SwarmControl/Redeems/Annoying/ScanTotallyRandomFragment.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using SCHIZO.Commands.Base; +using SCHIZO.Commands.Context; +using SCHIZO.Commands.Output; +using UnityEngine; +using UWE; + +namespace SCHIZO.SwarmControl.Redeems.Annoying; + +[Redeem( + Name = "redeem_scanrandomfragment", + DisplayName = "Scan Random Fragment", + Description = "Auto-scans a random fragment, chosen by fair dice roll." +)] +internal class ScanTotallyRandomFragment : Command, IParameters +{ + public IReadOnlyList Parameters => []; + + protected override object ExecuteCore(CommandExecutionContext ctx) + { + CoroutineHost.StartCoroutine(Coro()); + return CommonResults.OK(); + } + + private IEnumerator Coro() + { + yield return new WaitForSeconds(0.5f); + ErrorMessage.AddMessage("Unlocking random fragment..."); + yield return new WaitForSeconds(Random.Range(1f, 3f)); + ErrorMessage.AddMessage("Result: Thermal Plant Fragment"); + yield return InventoryConsoleCommands.ItemCmdSpawnAsync(2, TechType.Titanium); + } +} diff --git a/SCHIZO/SwarmControl/Redeems/Annoying/SpinHimAround.BelowZero.cs b/SCHIZO/SwarmControl/Redeems/Annoying/SpinHimAround.BelowZero.cs new file mode 100644 index 00000000..c1814b3e --- /dev/null +++ b/SCHIZO/SwarmControl/Redeems/Annoying/SpinHimAround.BelowZero.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using SCHIZO.Commands.Base; +using SCHIZO.Commands.Context; +using SCHIZO.Commands.Output; + +namespace SCHIZO.SwarmControl.Redeems.Annoying; +[Redeem( + Name = "redeem_spin", + DisplayName = "Spin him around and make him dizzy" +)] +internal class SpinHimAround : Command, IParameters +{ + public IReadOnlyList Parameters => []; + + protected override object ExecuteCore(CommandExecutionContext ctx) + { + if (!Player.main) return CommonResults.Error("Requires a loaded game."); + + Player.main.lilyPaddlerHypnosis.StartHypnosis(DayNightCycle.main.timePassed); + + return CommonResults.OK(); + } +} diff --git a/SCHIZO/SwarmControl/Redeems/Helpful/SaveGame.cs b/SCHIZO/SwarmControl/Redeems/Helpful/SaveGame.cs new file mode 100644 index 00000000..142d9c45 --- /dev/null +++ b/SCHIZO/SwarmControl/Redeems/Helpful/SaveGame.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using Nautilus.Utility; +using SCHIZO.Commands.Base; +using SCHIZO.Commands.Context; +using SCHIZO.Commands.Output; +using UWE; + +namespace SCHIZO.SwarmControl.Redeems.Helpful; + +[Redeem( + Name = "redeem_save", + DisplayName = "Save Game", + Description = "Please don't spam this one or we will disable it" +)] +internal class SaveGame : Command, IParameters +{ + public IReadOnlyList Parameters => []; + + private float _lastSave; + public SaveGame() + { + SaveUtils.RegisterOnFinishLoadingEvent(() => _lastSave = PDA.time); + SaveUtils.RegisterOnSaveEvent(() => _lastSave = PDA.time); + } + + protected override object ExecuteCore(CommandExecutionContext ctx) + { + if (!Player.main) + return CommonResults.Error("Requires a loaded game"); + if (PDA.time - _lastSave >= 60f) // yoink money from spammers + { + CoroutineHost.StartCoroutine(IngameMenu.main.SaveGameAsync()); + _lastSave = PDA.time; + } + return CommonResults.OK(); + } +} diff --git a/SCHIZO/SwarmControl/Redeems/Misc/BigErm.cs b/SCHIZO/SwarmControl/Redeems/Misc/BigErm.cs index 48485894..625d370f 100644 --- a/SCHIZO/SwarmControl/Redeems/Misc/BigErm.cs +++ b/SCHIZO/SwarmControl/Redeems/Misc/BigErm.cs @@ -82,15 +82,17 @@ private IEnumerator SpawnCoro() private void GetBigAndWinWildPrizes(GameObject bigErm) { - bigErm.transform.localScale = new(Scale, Scale, Scale); bigErm.GetComponent().isPickupable = false; bigErm.GetComponent().enabled = false; bigErm.GetComponent().enabled = false; bigErm.GetComponent().enabled = false; + // if you put this higher the whole stack gets embiggened + // the viewer only paid for one big erm so we clearly can't have this happen + bigErm.transform.localScale = new(Scale, Scale, Scale); - ErmconAttendee ermconVisitor = bigErm.GetComponent(); - if (ermconVisitor) - UnityEngine.Object.Destroy(ermconVisitor); + //ErmconAttendee ermconVisitor = bigErm.GetComponent(); + //if (ermconVisitor) + // UnityEngine.Object.Destroy(ermconVisitor); ErmconPanelist ermconHost = bigErm.EnsureComponent(); ermconHost.entertainmentFactor = 5f;