-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c1cb62
commit 6337a8c
Showing
347 changed files
with
473 additions
and
1,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.