Skip to content

Commit

Permalink
even more redeems you won't believe it
Browse files Browse the repository at this point in the history
fix big erm funny 😔
re-add a different funny to compensate
  • Loading branch information
Govorunb committed Jun 14, 2024
1 parent 8370b4f commit 5084354
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 4 deletions.
1 change: 1 addition & 0 deletions SCHIZO/Events/Ermcon/ErmconAttendee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
34 changes: 34 additions & 0 deletions SCHIZO/SwarmControl/Redeems/Annoying/ScanTotallyRandomFragment.cs
Original file line number Diff line number Diff line change
@@ -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<Parameter> 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);
}
}
23 changes: 23 additions & 0 deletions SCHIZO/SwarmControl/Redeems/Annoying/SpinHimAround.BelowZero.cs
Original file line number Diff line number Diff line change
@@ -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<Parameter> 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();
}
}
37 changes: 37 additions & 0 deletions SCHIZO/SwarmControl/Redeems/Helpful/SaveGame.cs
Original file line number Diff line number Diff line change
@@ -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<Parameter> 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();
}
}
10 changes: 6 additions & 4 deletions SCHIZO/SwarmControl/Redeems/Misc/BigErm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ private IEnumerator SpawnCoro()

private void GetBigAndWinWildPrizes(GameObject bigErm)
{
bigErm.transform.localScale = new(Scale, Scale, Scale);
bigErm.GetComponent<Pickupable>().isPickupable = false;
bigErm.GetComponent<Carryable>().enabled = false;
bigErm.GetComponent<CarryCreature>().enabled = false;
bigErm.GetComponent<ErmStack>().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<ErmconAttendee>();
if (ermconVisitor)
UnityEngine.Object.Destroy(ermconVisitor);
//ErmconAttendee ermconVisitor = bigErm.GetComponent<ErmconAttendee>();
//if (ermconVisitor)
// UnityEngine.Object.Destroy(ermconVisitor);
ErmconPanelist ermconHost = bigErm.EnsureComponent<ErmconPanelist>();
ermconHost.entertainmentFactor = 5f;

Expand Down

0 comments on commit 5084354

Please sign in to comment.