Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from eternalUnion/dev
Browse files Browse the repository at this point in the history
Merged 1.0.3
Fixes #44, #11, #38 and #37
  • Loading branch information
eternalUnion committed May 31, 2023
2 parents d6a269c + ba2062d commit 251b422
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 38 deletions.
4 changes: 3 additions & 1 deletion Ultrapain/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public static void Initialize()

eidStatEditorSelector = new EnumField<EnemyType>(eidStatEditorPanel, "Enemy", "eidStatEditorSelector", EnemyType.Filth);
eidStatEditorSelector.SetEnumDisplayName(EnemyType.V2Second, "V2 Second");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Sisyphus, "Sisyphean Insurrectionist");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Sisyphus, "Sisyphean Ins.");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.SisyphusPrime, "Sisyphus Prime");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.CancerousRodent, "Cancerous Rodent");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.FleshPanopticon, "Flesh Panopticon");
Expand All @@ -772,9 +772,11 @@ public static void Initialize()
eidStatEditorSelector.SetEnumDisplayName(EnemyType.HideousMass, "Hideous Mass");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.MaliciousFace, "Malicious Face");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Mandalore, "Druid Knight");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Minos, "Minos Corpse");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.MinosPrime, "Minos Prime");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.VeryCancerousRodent, "Very Cancerous Rodent");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Wicked, "Something Wicked");
eidStatEditorSelector.SetEnumDisplayName(EnemyType.Turret, "Sentry");
foreach(EnemyType eid in Enum.GetValues(typeof(EnemyType)))
{
EidStatContainer container = new EidStatContainer();
Expand Down
Binary file modified Ultrapain/Libs/PluginConfigurator.dll
Binary file not shown.
15 changes: 14 additions & 1 deletion Ultrapain/Patches/DiscordController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Discord;
using HarmonyLib;
using System.Text.RegularExpressions;


namespace Ultrapain.Patches
{
Expand All @@ -8,7 +10,18 @@ class DiscordController_SendActivity_Patch
static bool Prefix(DiscordController __instance, ref Activity ___cachedActivity)
{
if (___cachedActivity.State != null && ___cachedActivity.State == "DIFFICULTY: UKMD")
___cachedActivity.State = $"DIFFICULTY: {ConfigManager.pluginName.value}";
{
Regex rich = new Regex(@"<[^>]*>");
string text = $"DIFFICULTY: {ConfigManager.pluginName.value}";
if (rich.IsMatch(text))
{
___cachedActivity.State = rich.Replace(text, string.Empty);
}
else
{
___cachedActivity.State = text;
}
}
return true;
}
}
Expand Down
15 changes: 13 additions & 2 deletions Ultrapain/Patches/SteamFriends.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using HarmonyLib;
using HarmonyLib;
using Steamworks;
using System.Text.RegularExpressions;

namespace Ultrapain.Patches
{
Expand All @@ -10,7 +11,17 @@ static bool Prefix(string __0, ref string __1)
if (__1.ToLower() != "ukmd")
return true;

__1 = ConfigManager.pluginName.value;
Regex rich = new Regex(@"<[^>]*>");
string text = ConfigManager.pluginName.value;
if (rich.IsMatch(text))
{
__1 = rich.Replace(text, string.Empty);
}
else
{
__1 = text;
}

return true;
}
}
Expand Down
39 changes: 7 additions & 32 deletions Ultrapain/Patches/SwordsMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ private void Awake()
private void Update()
{
if (speedingUp)
{
if (anim == null)
anim = sm.GetComponent<Animator>();
anim.speed = speed;
}
}
}

Expand All @@ -51,40 +55,11 @@ class SwordsMachine_Knockdown_Patch
{
static bool Prefix(SwordsMachine __instance, bool __0)
{
if (__0 == true)
{
__instance.Enrage();
return false;
}
else
{
if (ConfigManager.swordsMachineSecondPhaseMode.value == ConfigManager.SwordsMachineSecondPhase.Skip && __instance.secondPhasePosTarget == null && __instance.secondPhasePosTarget == null)
return false;
}

return true;
}

static void Postfix(SwordsMachine __instance, EnemyIdentifier ___eid, bool __0, Animator ___anim)
{
__instance.Enrage();
if (!__0)
{
if (ConfigManager.swordsMachineSecondPhaseMode.value != ConfigManager.SwordsMachineSecondPhase.SpeedUp || __instance.secondPhasePosTarget != null)
return;
__instance.SwordCatch();

SwordsMachineFlag flag = __instance.GetComponent<SwordsMachineFlag>();
if (flag == null)
{
flag = __instance.gameObject.AddComponent<SwordsMachineFlag>();
flag.sm = __instance;
}
flag.speedingUp = true;
flag.speed = (1f * ___eid.totalSpeedModifier) * ConfigManager.swordsMachineSecondPhaseSpeed.value;
___anim.speed = flag.speed;

AnimatorClipInfo clipInfo = ___anim.GetCurrentAnimatorClipInfo(0)[0];
flag.Invoke("ResetAnimSpeed", clipInfo.clip.length / flag.speed);
}
return false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Ultrapain/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Plugin : BaseUnityPlugin
{
public const string PLUGIN_GUID = "com.eternalUnion.ultraPain";
public const string PLUGIN_NAME = "Ultra Pain";
public const string PLUGIN_VERSION = "1.0.2";
public const string PLUGIN_VERSION = "1.0.3";

public static Plugin instance;

Expand Down Expand Up @@ -497,7 +497,7 @@ private static void PatchAllEnemies()
harmonyTweaks.Patch(GetMethod<SwordsMachine>("Start"), postfix: GetHarmonyMethod(GetMethod<SwordsMachine_Start>("Postfix")));
if (ConfigManager.swordsMachineNoLightKnockbackToggle.value || ConfigManager.swordsMachineSecondPhaseMode.value != ConfigManager.SwordsMachineSecondPhase.None)
{
harmonyTweaks.Patch(GetMethod<SwordsMachine>("Knockdown"), prefix: GetHarmonyMethod(GetMethod<SwordsMachine_Knockdown_Patch>("Prefix")), postfix: GetHarmonyMethod(GetMethod<SwordsMachine_Knockdown_Patch>("Postfix")));
harmonyTweaks.Patch(GetMethod<SwordsMachine>("Knockdown"), prefix: GetHarmonyMethod(GetMethod<SwordsMachine_Knockdown_Patch>("Prefix")));
harmonyTweaks.Patch(GetMethod<SwordsMachine>("Down"), postfix: GetHarmonyMethod(GetMethod<SwordsMachine_Down_Patch>("Postfix")), prefix: GetHarmonyMethod(GetMethod<SwordsMachine_Down_Patch>("Prefix")));
//harmonyTweaks.Patch(GetMethod<SwordsMachine>("SetSpeed"), prefix: GetHarmonyMethod(GetMethod<SwordsMachine_SetSpeed_Patch>("Prefix")));
harmonyTweaks.Patch(GetMethod<SwordsMachine>("EndFirstPhase"), postfix: GetHarmonyMethod(GetMethod<SwordsMachine_EndFirstPhase_Patch>("Postfix")), prefix: GetHarmonyMethod(GetMethod<SwordsMachine_EndFirstPhase_Patch>("Prefix")));
Expand Down

0 comments on commit 251b422

Please sign in to comment.