Skip to content

Commit

Permalink
is it still pr feedback if there's no pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Govorunb committed Jun 15, 2024
1 parent 949272e commit 4f775aa
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 31 deletions.
2 changes: 1 addition & 1 deletion SCHIZO/Resources/AssetBundles/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SCHIZO.Resources;

public static class Assets
{
private const int _rnd = -559146573;
private const int _rnd = 2142497487;

private static readonly UnityEngine.AssetBundle _a = ResourceManager.GetAssetBundle("assets");

Expand Down
Binary file modified SCHIZO/Resources/AssetBundles/assets
Binary file not shown.
8 changes: 7 additions & 1 deletion SCHIZO/SwarmControl/Captcha.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections;
using System.Text.RegularExpressions;
using SCHIZO.DataStructures;
using UnityEngine;
using UnityEngine.UI;
Expand All @@ -8,6 +9,10 @@ namespace SCHIZO.SwarmControl;

partial class Captcha : uGUI_InputGroup
{
partial class CaptchaData
{
public Regex regex;
}
private float _timeLeft;
private bool _open;
private bool _ticking;
Expand All @@ -26,6 +31,7 @@ public override void Awake()
base.Awake();
input.onValueChanged.AddListener(OnValueChanged);
_data = [.. data];
_data.ForEach(d => d.regex = new Regex(d.textRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant));
gameObject.SetActive(false);
// i can't get my own blocker working so i'm just gonna yoink this one
CoroutineHost.StartCoroutine(InitCoro());
Expand Down Expand Up @@ -104,7 +110,7 @@ public void Toggle()

public void OnValueChanged(string value)
{
if (string.Equals(value, _current.text, System.StringComparison.InvariantCultureIgnoreCase))
if (_current.regex?.IsMatch(value) ?? true)
StartCoroutine(CloseSuccess());
}

Expand Down
10 changes: 10 additions & 0 deletions SCHIZO/SwarmControl/Redeems/Annoying/SpinHimAround.BelowZero.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
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(
Expand All @@ -17,7 +20,14 @@ protected override object ExecuteCore(CommandExecutionContext ctx)
if (!Player.main) return CommonResults.Error("Requires a loaded game.");

Player.main.lilyPaddlerHypnosis.StartHypnosis(DayNightCycle.main.timePassed);
CoroutineHost.StartCoroutine(Coro());

return CommonResults.OK();
}

private IEnumerator Coro()
{
yield return new WaitForSeconds(5);
Player.main.lilyPaddlerHypnosis.StopHypnosis();
}
}
1 change: 1 addition & 0 deletions SCHIZO/SwarmControl/Redeems/Audio/PlayTrollNoise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace SCHIZO.SwarmControl.Redeems.Audio;
[Redeem(
Name = "redeem_trollnoise",
DisplayName = "Play Troll Sound",
Description = "IMPORTANT: Leviathan sound will not play if not underwater",
Announce = false
)]
internal class PlayTrollNoise : Command, IParameters
Expand Down
8 changes: 6 additions & 2 deletions SCHIZO/SwarmControl/Redeems/Helpful/SaveGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ 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
if (PDA.time - _lastSave >= 60f)
{
CoroutineHost.StartCoroutine(IngameMenu.main.SaveGameAsync());
_lastSave = PDA.time;
return CommonResults.OK();
}
else // yoink money from spammers
{
return "Last save was less than a minute ago. Rest assured the game is saved.";
}
return CommonResults.OK();
}
}
30 changes: 9 additions & 21 deletions SCHIZO/SwarmControl/Redeems/Spawns/Isekai.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace SCHIZO.SwarmControl.Redeems.Spawns;
[CommandCategory("Spawns")]
[Redeem(
Name = "redeem_isekai",
DisplayName = "Isekai",
Description = "Snap a specific type of entity around the player."
DisplayName = "Remove Entities",
Description = "Snap a specific type of entity around the player. Does not include inventory/containers."
)]
internal class Isekai : ProxyCommand<MethodCommand>
{
Expand All @@ -21,23 +21,19 @@ public enum IsekaiTechType
Tutel,
Ermshark,
Bladderfish,
Cryptosuchus,

Titanium,
Copper,
Silver,
Lead,
Gold,
Diamond,
Ruby,
Gold,
Copper,
}
public enum Range
{
Near,
Far,
}
public Isekai() : base("isekai")
{
Parameters = [
new(new("creature", "Creature", "Creature to isekai."), typeof(IsekaiTechType)),
new(new("range", "Range", null), typeof(Range)),
new(new("creature", "Type", "Which entities to remove."), typeof(IsekaiTechType)),
];
}

Expand All @@ -54,15 +50,7 @@ public Isekai() : base("isekai")
targetArgs["techType"] = proxyThingType.ToString();
}
targetArgs["proportion"] = 1f;
if (args.TryGetValue("range", out Range range))
{
targetArgs["radius"] = range switch
{
Range.Near => 20,
Range.Far => 50,
_ => 0
};
}
targetArgs["radius"] = 50f;

return targetArgs;
}
Expand Down
7 changes: 3 additions & 4 deletions Unity/Assets/Mod/Swarm Control/Captcha/Captcha.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ MonoBehaviour:
image: {fileID: 3156584312642716640}
timerText: {fileID: 1408579787417287750}
input: {fileID: 270100004553668293}
inputBlocker: {fileID: 0}
data:
- image: {fileID: 21300000, guid: 1c9fd624d12320f4d9775f086f677616, type: 3}
text: evil is my favourite
Expand All @@ -503,11 +502,11 @@ MonoBehaviour:
- image: {fileID: 21300000, guid: b99f59bf616050548bb18a4fdab021cd, type: 3}
text: i wear programmer socks
- image: {fileID: 21300000, guid: 93833cf1ce22dd24e81781856a48e346, type: 3}
text: ?w4a?5ix,df nc2.dlnj]x2d6
text: \?w4a\?5ix,df nc2\.dlnj]x2d6
- image: {fileID: 21300000, guid: 9368afe56f79db24d9729424e05ef21f, type: 3}
text: iIll??llI [i]]iIiIl
text: iIll\?\?llI \[i]]iIiIl
- image: {fileID: 21300000, guid: 5a5020aa8d51dfc44a752504e875c46a, type: 3}
text: 21
text: 9\s?\+\s?10\s?=\s?\?
- image: {fileID: 21300000, guid: 01aee213274ad424b957fec89652a7bd, type: 3}
text: bark
--- !u!1 &2241360548984123650
Expand Down
6 changes: 4 additions & 2 deletions Unity/Assets/Scripts/SCHIZO/SwarmControl/Captcha.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using TMPro;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;

namespace SCHIZO.SwarmControl
Expand All @@ -20,10 +21,11 @@ public sealed partial class Captcha
public CaptchaData[] data;

[Serializable]
public struct CaptchaData
public partial class CaptchaData
{
public Sprite image;
public string text;
[FormerlySerializedAs("text")]
public string textRegex;
}

// /ScreenCanvas/Confirmation
Expand Down

0 comments on commit 4f775aa

Please sign in to comment.