feat: initial commit

This commit is contained in:
ALittlePatate
2022-07-07 19:10:40 +02:00
commit b3b6fb2f77
13 changed files with 1204 additions and 0 deletions

66
Hacks/Misc.cs Normal file
View File

@@ -0,0 +1,66 @@
using SlimeRanger.Helpers;
using UnityEngine;
namespace SlimeRanger.Hacks
{
internal class Misc
{
public static void Fly(float speed) //normal speed 50f
{
TeleportablePlayer tpp = UnityEngine.Object.FindObjectOfType<TeleportablePlayer>();
Vector3 pos = tpp.transform.position;
if (Input.GetKey(KeyCode.Z))
{
pos += tpp.transform.forward * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.S))
{
pos += -tpp.transform.forward * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.D))
{
pos += tpp.transform.right * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.Q))
{
pos += -tpp.transform.right * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.Keypad8))
{
pos += tpp.transform.up * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.Keypad2))
{
pos += -tpp.transform.up * speed * Time.deltaTime;
}
Misc.SetPlayerPosition(pos);
}
public static void AddCurrency(int amount, PlayerState.CoinsType type = PlayerState.CoinsType.NORM)
{
StateHelpers.GetPlayerState().AddCurrency(amount, type);
}
public static void AddKey()
{
StateHelpers.GetPlayerState().AddKey();
}
public static void SetEnergy(int amount)
{
StateHelpers.GetPlayerState().SetEnergy(amount);
}
public static void SetHealth(int amount)
{
StateHelpers.GetPlayerState().SetHealth(amount);
}
public static void SetPlayerPosition(Vector3 position)
{
TeleportablePlayer tpp = UnityEngine.Object.FindObjectOfType<TeleportablePlayer>();
tpp.playerEventHandler.Position.Set(position);
}
}
}

17
Hacks/Unlocks.cs Normal file
View File

@@ -0,0 +1,17 @@
using UnityEngine;
using SlimeRanger.Helpers;
using System;
namespace SlimeRanger.Hacks
{
internal class Unlocks
{
public static void UnlockAllUpgrades()
{
foreach (PlayerState.Upgrade up in Enum.GetValues(typeof(PlayerState.Upgrade)))
{
StateHelpers.GetPlayerState().AddUpgrade(up);
}
}
}
}