Added an exp modifier, exp persists !

This commit is contained in:
ALittlePatate
2022-05-08 19:30:09 +02:00
parent a7e3ee435e
commit e9efd3af9c
3 changed files with 12 additions and 9 deletions

View File

@@ -175,7 +175,6 @@ namespace DevourClient.Hacks
public static void InstantWin() public static void InstantWin()
{ {
Survival survival_class = UnityEngine.Object.FindObjectOfType<Survival>(); Survival survival_class = UnityEngine.Object.FindObjectOfType<Survival>();
survival_class.m_InnMapController.AddEggToWorld();
try try
{ {

View File

@@ -18,23 +18,21 @@ namespace DevourClient.Hooks
} }
} }
*/ */
/*
[HarmonyPatch(typeof(RankHelpers))] [HarmonyPatch(typeof(RankHelpers))]
[HarmonyPatch(nameof(RankHelpers.CalculateExpGain))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. [HarmonyPatch(nameof(RankHelpers.CalculateExpGain))] //annotation boiler plate to tell Harmony what to patch. Refer to docs.
static class RankHelpers_CalculateExpGain static class RankHelpers_CalculateExpGain
{ {
static void Postfix(ref RankHelpers.ExpGainInfo __result) static void Postfix(ref RankHelpers.ExpGainInfo __result)
{ {
__result.baseExp = 200; if (Load.exp_modifier)
__result.winBonus = 200; {
__result.awardsBonus = 200; __result.totalExp = (int)Load.exp;
__result.totalExp = 200; }
__result.gameModeBonus = 200;
MelonLoader.MelonLogger.Msg("called");
return; return;
} }
} }
*/
[HarmonyPatch(typeof(Horror.Menu))] [HarmonyPatch(typeof(Horror.Menu))]
[HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. [HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs.

View File

@@ -16,6 +16,8 @@ namespace DevourClient
bool fly = false; bool fly = false;
float fly_speed = 5; float fly_speed = 5;
public bool _IsCarryingFirstAidOnLocalCharacter = false; public bool _IsCarryingFirstAidOnLocalCharacter = false;
public static bool exp_modifier = false;
public static float exp = 1000f;
bool spam_message = false; bool spam_message = false;
@@ -107,6 +109,10 @@ namespace DevourClient
GUI.Label(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 125, 100, 30), this.fly_speed.ToString()); //Prints the value of the slider; GUI.Label(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 125, 100, 30), this.fly_speed.ToString()); //Prints the value of the slider;
this._IsCarryingFirstAidOnLocalCharacter = GUI.Toggle(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 190, 150, 20), this._IsCarryingFirstAidOnLocalCharacter, "IsCarryingFirstAid"); this._IsCarryingFirstAidOnLocalCharacter = GUI.Toggle(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 190, 150, 20), this._IsCarryingFirstAidOnLocalCharacter, "IsCarryingFirstAid");
Load.exp_modifier = GUI.Toggle(new Rect(Settings.Settings.x + 350, Settings.Settings.y + 40, 150, 20), Load.exp_modifier, "Exp Modifier");
Load.exp = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 350, Settings.Settings.y + 70, 100, 10), Load.exp, 1000f, 50000f); //Slider for the fly speed
GUI.Label(new Rect(Settings.Settings.x + 410, Settings.Settings.y + 75, 100, 30), Load.exp.ToString()); //Prints the value of the slider;
if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 40, 150, 20), "Unlock Achievements")) if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 40, 150, 20), "Unlock Achievements"))
{ {
Thread AchievementsThread = new Thread( Thread AchievementsThread = new Thread(