Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
giplgwm committed Jun 9, 2024
1 parent 102a5bc commit ddbee3a
Show file tree
Hide file tree
Showing 5 changed files with 531 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Helltakercheat.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34902.65
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helltakercheat", "Helltakercheat\Helltakercheat.csproj", "{3E852543-A5D5-4917-A920-D405CE69DBFB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Debug|x64.ActiveCfg = Debug|x64
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Debug|x64.Build.0 = Debug|x64
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Release|Any CPU.Build.0 = Release|Any CPU
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Release|x64.ActiveCfg = Release|x64
{3E852543-A5D5-4917-A920-D405CE69DBFB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {43DC379B-5094-473E-89F9-CF9ACD9D6ACE}
EndGlobalSection
EndGlobal
5 changes: 5 additions & 0 deletions Helltakercheat/AssemblyInfo1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using MelonLoader;
using Helltakercheat; // The namespace of your mod class
// ...
[assembly: MelonInfo(typeof(HellCheat), "Helltaker Cheats", "0.0.1", "Lurk")]
[assembly: MelonGame()]
140 changes: 140 additions & 0 deletions Helltakercheat/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MelonLoader;
using UnityEngine;
using HarmonyLib;
using Helltakercheat;

namespace Helltakercheat
{
public class HellCheat : MelonMod
{
public Rect windowRect = new Rect(20, 20, 200, 255);
public bool noClipObstacles = false;
public bool noClipWalls = false;
public static bool maxWill = false;
public GameObject border;

public override void OnGUI()
{
windowRect = GUI.Window(420024, windowRect, MakeGuiWork, "Helltaker cheat -");
}

public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
checkBoxCollider2Ds();
}

public void MakeGuiWork(int windowID)
{
if (GUILayout.Button("Kill all enemies"))
{
DestroyAllBreakables();
}
noClipObstacles = GUILayout.Toggle(noClipObstacles, "No Clip Obstacles");
noClipWalls = GUILayout.Toggle(noClipWalls, "No Clip Walls");

if (GUILayout.Button("TP to Goal"))
{
TPtoGoal();
}
if (GUI.changed)
{
checkBoxCollider2Ds();
}

maxWill = GUILayout.Toggle(maxWill, "Max Will");

}

public void checkBoxCollider2Ds()
{
GameObject[] unbreakableObjects = GameObject.FindGameObjectsWithTag("unBreakable");
GameObject[] walls = GameObject.FindGameObjectsWithTag("wall");
GameObject[] spikes = GameObject.FindGameObjectsWithTag("spikes");
if (noClipObstacles)
{
// Iterate through each found object
SetActiveBoxCollider2D(unbreakableObjects, false);
SetActiveBoxCollider2D(walls, false);
SetActiveBoxCollider2D(spikes, false);
}
else
{
// Iterate through each found object
SetActiveBoxCollider2D(unbreakableObjects, true);
SetActiveBoxCollider2D(walls, true);
SetActiveBoxCollider2D(spikes, false);
}

if (noClipWalls)
{
border = GameObject.Find("border");
border.SetActive(false);
}
else
{
if (border != null)
{
border.SetActive(true);
}
}
}

public void SetActiveBoxCollider2D(GameObject[] obj_list, bool active)
{
foreach (GameObject obj in obj_list)
{
if (obj.GetComponent<BoxCollider2D>().enabled != active)
{
obj.GetComponent<BoxCollider2D>().enabled = active;
}
else
{
break;
}
}
}

public void DestroyAllBreakables()
{
GameObject[] breakableObjects = GameObject.FindGameObjectsWithTag("breakable");

// Iterate through each found object
foreach (GameObject breakableObject in breakableObjects)
{
GameObject.Destroy(breakableObject);
}
}

public void TPtoGoal()
{
GameObject player = GameObject.Find("player");
GameObject goal = GameObject.Find("demon_regular");
if (player != null && goal != null)
{
player.transform.position = goal.transform.position - new Vector3(1, 0, 0);
}
}

}

[HarmonyPatch(typeof(Player), "MinusWill")]
static class WillPatch
{
private static void Postfix(Player __instance)
{
if (HellCheat.maxWill)
{
__instance.will = 49;
}

}
}


}

Loading

0 comments on commit ddbee3a

Please sign in to comment.