Skip to content

Commit

Permalink
Merge pull request #8 from Street-WE/main
Browse files Browse the repository at this point in the history
Crowd sign randomiser and force arena barriers to none
  • Loading branch information
IngoHHacks authored May 28, 2023
2 parents c9da63e + 6b26565 commit 84b8d10
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions Patches/ArenaPatch.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Text.RegularExpressions;
using WECCL.Content;
using Debug = UnityEngine.Debug;

namespace WECCL.Patches;

Expand Down Expand Up @@ -104,6 +105,10 @@ public static void JACOFMPNHGHPatch()
public static void DMGJOHGEOKFPatch()
{
SetCustomArenaShape();
if (World.location > VanillaCounts.NoLocations)
{
World.JCDNJODBBMF();
}
}

[HarmonyPostfix]
Expand Down Expand Up @@ -303,6 +308,74 @@ public static void OGAHGABKJFOPatch(ref int JIBNLDBGFLN)
SetCustomArenaShape();
}
}

//Get signs to randomise on custom arenas
[HarmonyPostfix]
[HarmonyPatch("JCDNJODBBMF")]
public static void JCDNJODBBMFPatch(int CLMNJCOMHJG = 0)
{
if (World.location > VanillaCounts.NoLocations)
{
int num4 = GFEDPBPDALB.GLHCKJPAOPG(1, 6);
int num5;
Transform[] signTransforms = World.gArena.transform.GetComponentsInChildren<Transform>(true);
int count = 0;
for (int i = 0; i < signTransforms.Length; i++)
{
if (signTransforms[i].name.StartsWith("Sign"))
{
count++;
}
}

num5 = count;

for (int i = 1; i <= num5; i++)
{
Transform transform4 = World.gArena.transform.Find("arena/Signs/Sign" + i.ToString("00"));
if (!(transform4 != null))
{
continue;
}
int num6 = 0;
if (GFEDPBPDALB.KFGGEOKGFDL > 0 && World.crowdSize > 0f && World.crowdSize <= 1f)
{
if ((i <= 18 && World.crowdSize >= 0.25f) || World.crowdSize >= 0.6f)
{
num6 = 1;
}
if (World.crowdSize < 0.7f && (i == 21 || i == 31 || i == 35))
{
num6 = 0;
}
if (LAHGBLEJCEO.GLDIFJOEOIO == 50 && GFEDPBPDALB.KFGGEOKGFDL == 1 && GFEDPBPDALB.GLHCKJPAOPG(0, 1) == 0)
{
num6 = 0;
}
}
if (num6 > 0)
{
transform4.gameObject.SetActive(value: true);
if (LAHGBLEJCEO.GLDIFJOEOIO == 50 && CLMNJCOMHJG == 0)
{
if (GFEDPBPDALB.KFGGEOKGFDL >= 2)
{
num4 = GFEDPBPDALB.GLHCKJPAOPG(1, 6);
}
transform4.gameObject.GetComponent<Renderer>().sharedMaterial = JBAFDOKGDIJ.DEFAPOLNFOO[num4];
}
}
else if (LAHGBLEJCEO.GLDIFJOEOIO == 50)
{
UnityEngine.Object.Destroy(transform4.gameObject);
}
else
{
transform4.gameObject.SetActive(value: false);
}
}
}
}
}

[HarmonyPatch(typeof(KCEBMOOKIPH))]
Expand Down Expand Up @@ -515,4 +588,20 @@ public static void OGAIPIGBDODPostPatch(float AOFCMJDNFGD, float DKIDHBJMKFF, fl
}
}
}

[HarmonyPatch(typeof(Scene_Match_Setup))]
public static class Scene_Match_SetupPatch
{
[HarmonyPostfix]
[HarmonyPatch("Update")]
public static void UpdatePostPatch()
{
if (World.location > VanillaCounts.NoLocations)
{
//Force barriers to 0, can't work out how to disable option since its controlled by arena shape
//So just forcing it to always be none does the job well enough
World.arenaBarriers = 0;
}
}
}
}

0 comments on commit 84b8d10

Please sign in to comment.