Skip to content

Commit

Permalink
feat: 新UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiroNeri4u committed Aug 18, 2024
1 parent 9c1cb62 commit 6337a8c
Show file tree
Hide file tree
Showing 347 changed files with 473 additions and 1,369 deletions.
30 changes: 14 additions & 16 deletions Ricca_Uncensor_Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,35 @@

<ItemGroup>
<Reference Include="BepInEx.Unity.IL2CPP">
<HintPath>dlls\BepInEx.Unity.IL2CPP.dll</HintPath>
<HintPath>dlls\core\BepInEx.Unity.IL2CPP.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Core">
<HintPath>dlls\BepInEx.Core.dll</HintPath>
<HintPath>dlls\core\BepInEx.Core.dll</HintPath>
</Reference>
<Reference Include="0Harmony">
<HintPath>dlls\core\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Il2CppInterop.Runtime">
<HintPath>dlls\core\Il2CppInterop.Runtime.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>dlls\UnityEngine.CoreModule.dll</HintPath>
<HintPath>dlls\interop\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="ACTAssemblyDefiniton">
<HintPath>dlls\ACTAssemblyDefiniton.dll</HintPath>
<HintPath>dlls\interop\ACTAssemblyDefiniton.dll</HintPath>
</Reference>
<Reference Include="AppControllerAssemblyDefinition">
<HintPath>dlls\AppControllerAssemblyDefinition.dll</HintPath>
</Reference>
<Reference Include="0Harmony">
<HintPath>dlls\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Il2CppInterop.Runtime">
<HintPath>dlls\Il2CppInterop.Runtime.dll</HintPath>
<HintPath>dlls\interop\AppControllerAssemblyDefinition.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>dlls\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>dlls\interop\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>dlls\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>dlls\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="Il2Cppmscorlib">
<HintPath>dlls\Il2Cppmscorlib.dll</HintPath>
<HintPath>dlls\interop\Il2Cppmscorlib.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
105 changes: 0 additions & 105 deletions Ricca_Uncensor_Plugin/ArmorBreakPatch.cs

This file was deleted.

83 changes: 83 additions & 0 deletions Ricca_Uncensor_Plugin/ArmorCheatPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using ACT;
using System.Collections.Generic;
using HarmonyLib;
using UnityEngine;

namespace Ricca_Uncensor_Plugin;

[HarmonyPatch]
public class ArmorBreakerPatch
{
[HarmonyPatch(typeof(CharacterArmorBreaker), nameof(CharacterArmorBreaker.Initialize))]

[HarmonyPostfix]
public static void InitializePostfix(CharacterArmorBreaker __instance)
{
ArmorBreakerMonitor.instance.AddInstance(__instance);
}
}

public class ArmorBreakerMonitor : MonoBehaviour
{
private static ArmorBreakerMonitor _instance;
public static ArmorBreakerMonitor instance => _instance;
public readonly List<CharacterArmorBreaker> Instance = new();
public void AddInstance(CharacterArmorBreaker __instance)
{
Instance.Add(__instance);
}

public void RemoveInstance(int id)
{
Instance.RemoveAt(id);
}

public string GetName(int id)
{
return Instance[id].parentActor.IsPlayerActor ? Instance[id].parentActor.NickName + CheatMenu.GetLanguageText("Player") : "Instance[id].parentActor.NickName";
}

public int GetCurrenctLevel(int id)
{
return Instance[id].CurrentArmorLevelIndex + 1;
}

public int GetMaxLevel(int id)
{
return Instance[id].LevelList.Count + 1;
}

public void SetCharacterArmorLevel(int id, int level)
{
Instance[id].SetArmorLevel(level - 1, CharacterArmorBreaker.CostumeUpdateMode.Normal);
}

private void EnsureBreakerListNotNull()
{
for (int i = Instance.Count - 1; i >= 0; i--)
{
if (Instance[i] == null || !Instance[i].IsProfileValid)
RemoveInstance(i);
}
}

private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(this);
return;
}
_instance = this;
}

private void OnDestroy()
{
_instance = null;
}

private void Update()
{
EnsureBreakerListNotNull();
}
}
70 changes: 70 additions & 0 deletions Ricca_Uncensor_Plugin/BasicCheatPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using APP;
using HarmonyLib;

namespace Ricca_Uncensor_Plugin;

[HarmonyPatch]
public class BasicCheatPatch
{

[HarmonyPatch(typeof(CharacterActor), "CurrentHitPoint", MethodType.Setter)]

[HarmonyPrefix]
public static void CurrentHitPointPrefix(CharacterActor __instance, ref float value)
{
if (CheatMenu.PlayerHpNotDecrease.Status && __instance.IsPlayerActor)
{
value = __instance.hitPointMax;
}
else if (CheatMenu.EnemyBeInstantlyKilled.Status && !__instance.IsPlayerActor)
{
value = 0;
}
}

[HarmonyPatch(typeof(CharacterActor), "CurrentMagicPoint", MethodType.Setter)]

[HarmonyPrefix]
public static void CurrentMagicPointPrefix(CharacterActor __instance, ref float value)
{
if (CheatMenu.PlayerMpNotDecrease.Status && __instance.IsPlayerActor)
{
value = __instance.magicPointMax;
}
}

[HarmonyPatch(typeof(CharacterActor), "TrySpecialAttackStart")]

[HarmonyPrefix]
public static void TrySpecialAttackStartPrefix(CharacterActor __instance, ref bool isCooling)
{
if (CheatMenu.SkillHasNotCoolTime.Status && __instance.IsPlayerActor)
{
isCooling = false;
}
}

[HarmonyPatch(typeof(App.PlayerParameter), "SubMagicCrystalCount")]

[HarmonyPrefix]
public static void SubMagicCrystalCountPrefix(ref int sub)
{
if (CheatMenu.CrystalNotDecrease.Status)
{
sub = 0;
}
}

[HarmonyPatch(typeof(ACT.CharacterArmorBreaker), "RestoreArmor")]
[HarmonyPatch(typeof(ACT.CharacterArmorBreaker), "BreakArmor")]

[HarmonyPrefix]
public static bool ArmorBreakerLockPrefix(ACT.CharacterArmorBreaker __instance)
{
if (CheatMenu.PlayerArmorBreakLock.Status && __instance.parentActor.IsPlayerActor)
{
return false;
}
else return true;
}
}
Loading

0 comments on commit 6337a8c

Please sign in to comment.