Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a76b3d27e7
|
|||
|
|
f8ce7336f6 | ||
| e720da278b | |||
|
|
e01dd26d6f | ||
|
|
ccffaf352f | ||
|
|
3c0d57e308 | ||
|
|
a5aed348fd | ||
|
|
b450fa1cbf | ||
|
|
7a2815681c | ||
|
|
9f93c16dc3 | ||
|
|
e52f29f702 | ||
|
|
2ce4fea684 | ||
|
|
83ffed3c86 | ||
|
|
d7597b055f | ||
|
|
360aa1061c | ||
|
|
aa0eb090ba | ||
|
|
64e6fd785d | ||
|
|
cfb3235a97 | ||
|
|
84fc72ab59 | ||
|
|
a9c2611427 | ||
|
|
8280ed6362 | ||
|
|
b8ad6a1625 | ||
|
47538a7483
|
|||
|
15d1a91806
|
|||
|
|
f32e3b0eb7 | ||
|
283eee124c
|
|||
|
2308b63699
|
|||
|
|
42ccb45e23 | ||
|
|
26dfb5fa23 | ||
|
|
49a5b7f3ab | ||
|
|
b22b56393a | ||
|
|
9a9cb7a6f5 | ||
|
55ff1074fb
|
|||
|
ebfb23588e
|
|||
|
ce6ed66275
|
|||
|
fd79fb2b19
|
|||
|
|
9ea683f29a | ||
|
|
788ffdac9f | ||
|
|
e1c529f0ed | ||
|
|
9d12c57588 | ||
|
|
620828d4a0 | ||
|
|
0e461120eb | ||
|
17569ee1ed
|
1776
DevourClient/ClientMain.cs
Normal file
1776
DevourClient/ClientMain.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -99,6 +99,23 @@ namespace DevourClient.Hacks
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "Manor":
|
||||||
|
Il2Cpp.MapController mapc = UnityEngine.Object.FindObjectOfType<Il2Cpp.MapController>();
|
||||||
|
if (!mapc)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (burnAll)
|
||||||
|
{
|
||||||
|
mapc.SetProgressTo(10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mapc.SetProgressTo(mapc.GetMapProgress() + 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType<Il2Cpp.SurvivalObjectBurnController>();
|
Il2Cpp.SurvivalObjectBurnController _altar = UnityEngine.Object.FindObjectOfType<Il2Cpp.SurvivalObjectBurnController>();
|
||||||
if (!_altar) {
|
if (!_altar) {
|
||||||
@@ -121,17 +138,38 @@ namespace DevourClient.Hacks
|
|||||||
{
|
{
|
||||||
if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer)
|
if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer)
|
||||||
{
|
{
|
||||||
MelonLogger.Msg("You need to be host to spawn stuff !");
|
Hacks.Misc.ShowMessageBox("You need to be host to spawn stuff !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameObject _localPlayer = Helpers.Entities.LocalPlayer_.p_GameObject;
|
||||||
|
|
||||||
|
if (_localPlayer != null)
|
||||||
|
{
|
||||||
|
Vector3 pos = _localPlayer.transform.position;
|
||||||
|
|
||||||
GameObject _azazel;
|
GameObject _azazel;
|
||||||
Vector3 pos = Player.GetPlayer().transform.position;
|
|
||||||
|
|
||||||
_azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity);
|
_azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity);
|
||||||
|
Il2Cpp.SurvivalAzazelBehaviour? azazelBehaviour = _azazel?.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>();
|
||||||
|
|
||||||
|
if (_azazel != null)
|
||||||
|
{
|
||||||
|
if (azazelBehaviour != null)
|
||||||
|
{
|
||||||
_azazel.gameObject.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>().Spawn();
|
_azazel.gameObject.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>().Spawn();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("azazelBehaviour is null!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("azazel is null!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void CarryObject(string name)
|
public static void CarryObject(string name)
|
||||||
{
|
{
|
||||||
@@ -187,31 +225,11 @@ namespace DevourClient.Hacks
|
|||||||
|
|
||||||
BoltLauncher.StartServer(__config, null);
|
BoltLauncher.StartServer(__config, null);
|
||||||
|
|
||||||
Il2CppHorror.Menu.ShowCanvasGroup(_menu.loadingCanvasGroup, true);
|
_menu.ShowCanvasGroup(_menu.loadingCanvasGroup, true);
|
||||||
Il2CppHorror.Menu.ShowCanvasGroup(_menu.hostCanvasGroup, false);
|
_menu.ShowCanvasGroup(_menu.hostCanvasGroup, false);
|
||||||
Il2CppHorror.Menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false);
|
_menu.ShowCanvasGroup(_menu.mainMenuCanvasGroup, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetSteamName(string name)
|
|
||||||
{
|
|
||||||
Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType<Il2CppHorror.Menu>();
|
|
||||||
if (Menu_ == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu_.steamName = name;
|
|
||||||
}
|
|
||||||
public static void SetServerName(string name)
|
|
||||||
{
|
|
||||||
Il2CppHorror.Menu Menu_ = UnityEngine.Object.FindObjectOfType<Il2CppHorror.Menu>();
|
|
||||||
if (Menu_ == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu_.serverNameText.text = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void BigFlashlight(bool reset)
|
public static void BigFlashlight(bool reset)
|
||||||
{
|
{
|
||||||
@@ -338,23 +356,6 @@ namespace DevourClient.Hacks
|
|||||||
NolanRank.SetRank(rank);
|
NolanRank.SetRank(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MessageSpam(string message)
|
|
||||||
{
|
|
||||||
//TOFIX : not spamming anymore :/
|
|
||||||
if (Helpers.Player.IsInGame())
|
|
||||||
{
|
|
||||||
Il2Cpp.GameUI game_ui_class = UnityEngine.Object.FindObjectOfType<Il2Cpp.GameUI>();
|
|
||||||
|
|
||||||
game_ui_class.textChatInput.text = message;
|
|
||||||
game_ui_class.OnChatMessageSubmit();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Il2CppHorror.Menu menu_class = UnityEngine.Object.FindObjectOfType<Il2CppHorror.Menu>();
|
|
||||||
menu_class.textChatInput.text = message;
|
|
||||||
menu_class.OnChatMessageSubmit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DespawnDemons()
|
public static void DespawnDemons()
|
||||||
{
|
{
|
||||||
@@ -411,11 +412,47 @@ namespace DevourClient.Hacks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowMessageBox(string message)
|
public static void DespawnCrows()
|
||||||
|
{
|
||||||
|
foreach (Il2Cpp.CrowBehaviour crow in Helpers.Entities.Crows)
|
||||||
|
{
|
||||||
|
if (crow != null)
|
||||||
|
{
|
||||||
|
crow.Despawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DespawnLumps()
|
||||||
|
{
|
||||||
|
foreach (Il2Cpp.ManorLumpController lump in Helpers.Entities.Lumps)
|
||||||
|
{
|
||||||
|
if (lump != null)
|
||||||
|
{
|
||||||
|
lump.Dissolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DespawnMonkeys()
|
||||||
|
{
|
||||||
|
foreach (Il2Cpp.MonkeyBehaviour monkey in Helpers.Entities.Monkeys)
|
||||||
|
{
|
||||||
|
if (monkey != null)
|
||||||
|
{
|
||||||
|
monkey.Despawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int ShowMessageBox(string message)
|
||||||
{
|
{
|
||||||
//not used, might be useful, some day
|
//not used, might be useful, some day
|
||||||
Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType<Il2CppHorror.Menu>();
|
Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType<Il2CppHorror.Menu>();
|
||||||
|
if (menu == null)
|
||||||
|
return 1;
|
||||||
menu.ShowMessageModal(message);
|
menu.ShowMessageModal(message);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void PlaySound()
|
public static void PlaySound()
|
||||||
|
|||||||
@@ -1,17 +1,30 @@
|
|||||||
namespace DevourClient.Hacks
|
using Il2CppSteamworks;
|
||||||
|
|
||||||
|
namespace DevourClient.Hacks
|
||||||
{
|
{
|
||||||
public class Unlock
|
public class Unlock
|
||||||
{
|
{
|
||||||
public static void Achievements()
|
public static void Achievements()
|
||||||
{
|
{
|
||||||
Il2Cpp.AchievementHelpers ah = UnityEngine.Object.FindObjectOfType<Il2Cpp.AchievementHelpers>();
|
//Il2Cpp.AchievementHelpers ah = UnityEngine.Object.FindObjectOfType<Il2Cpp.AchievementHelpers>();
|
||||||
|
string[] achievements = { "ACH_666_DOLL_HEADS_DESTROYED", "ACH_1000_HEADS_BURIED", "ACH_1000_PIGS_DESTROYED", "ACH_1000_BOOKS_DESTROYED", "ACH_100_EGGS_DESTROYED", "ACH_100_FUSES_USED", "ACH_100_GASOLINE_USED", "ACH_WON_Manor_NIGHTMARE_SP", "ACH_WON_NIGHTMARE_", "ACH_WON_TOWN_HARD", "ACH_WON_MANOR_NIGHTMARE_SP", "ACH_WON_INN_HARD_SP", "ACH_WON_SLAUGHTERHOUSE_COOP", "ACH_ALL_FEATHERS", "ACH_WON_INN_HARD", "ACH_ALL_BARBED_WIRES", "ACH_WON_CARNIVAL_NIGHTMARE_SP", "ACH_WON_MOLLY_HARD", "ACH_WON_MOLLY_HARD_SP", "ACH_ALL_HORSESHOES", "ACH_WON_INN_SP", "ACH_WON_TOWN_NIGHTMARE_SP", "ACH_WON_MANOR_HARD_SP", "ACH_WON_MOLLY_SP", "ACH_WON_CARNIVAL_HARD_SP", "ACH_WON_SLAUGHTERHOUSE_HARD_SP", "ACH_WON_TOWN_COOP", "ACH_WON_MOLLY_COOP", "ACH_ALL_PATCHES", "ACH_WON_MOLLY_NIGHTMARE_SP", "ACH_WON_TOWN_NIGHTMARE", "ACH_WON_SLAUGHTERHOUSE_SP", "ACH_WON_INN_COOP", "ACH_WON_CARNIVAL_HARD", "ACH_ALL_CHERRY_BLOSSOM", "ACH_WON_MOLLY_NIGHTMARE", "ACH_WON_TOWN_HARD_SP", "ACH_WON_CARNIVAL_NIGHTMARE", "ACH_WON_CARNIVAL_SP", "ACH_ALL_ROSES", "ACH_WON_INN_NIGHTMARE_SP", "ACH_ALL_TICKETS", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE_SP", "ACH_WON_TOWN_SP", "ACH_WON_INN_NIGHTMARE", "ACH_WON_CARNIVAL_COOP", "ACH_WON_MANOR_COOP", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE", "ACH_WON_SLAUGHTERHOUSE_HARD", "ACH_WON_MANOR_NIGHTMARE", "ACH_WON_MANOR_HARD", "ACH_WON_MANOR_SP", "ACH_ALL_CLIPBOARDS_READ", "ACH_ALL_NOTES_READ", "ACH_UNLOCKED_CAGE", "ACH_UNLOCKED_ATTIC_CAGE", "ACH_CALMED_ANNA", "ACH_FRIED_RAT", "ACH_BURNT_GOAT", "ACH_KNOCKED_OUT_BY_ANNA", "ACH_KNOCKOUT_OUT_BY_DEMON", "ACH_KNOCKED_OUT_IN_HIDING", "STAT_NUM_BLEACH_USED", "ACH_WON_SP", "ACH_WIN_NIGHTMARE", "ACH_WON_HARD_SP", "ACH_WON_COOP", "ACH_WON_HARD", "ACH_WIN_NIGHTMARE_SP", "ACH_LOST", "ACH_NEVER_KNOCKED_OUT", "ACH_ONLY_ONE_KNOCKED_OUT", "ACH_WON_HARD_NO_MEDKITS", "ACH_WON_NO_MEDKITS", "ACH_WON_NO_BATTERIES", "ACH_WON_NIGHTMARE_NO_MEDKITS", "ACH_WON_NO_KNOCKOUT_COOP", "ACH_WON_HARD_NO_BATTERIES", "ACH_WON_HARD_{0}", "ACH_WON_NIGHTMARE_{0}", "ACH_WON_NIGHTMARE_NO_BATTERIES", "ACH_SURVIVED_TO_7_GOATS", "ACH_SURVIVED_TO_5_GOATS", "ACH_SURVIVED_TO_3_GOATS", };
|
||||||
string[] achievements = { "STAT_NUM_BLEACH_USED", "ACH_WON_TOWN_COOP", "ACH_WON_TOWN_HARD", "ACH_WON_SLAUGHTERHOUSE_SP", "ACH_WON_SP", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE_SP", "ACH_WON_SLAUGHTERHOUSE_HARD", "ACH_WON_SLAUGHTERHOUSE_HARD_SP", "ACH_WON_NO_MEDKITS", "ACH_WON_SLAUGHTERHOUSE_COOP", "ACH_WON_NO_BATTERIES", "ACH_WON_NO_KNOCKOUT_COOP", "ACH_WON_NIGHTMARE_NO_BATTERIES", "ACH_WON_NIGHTMARE_NO_MEDKITS", "ACH_WON_MOLLY_NIGHTMARE_SP", "ACH_WON_MOLLY_SP", "ACH_WON_TOWN_NIGHTMARE_SP", "ACH_WON_TOWN_SP", "ACH_WON_TOWN_HARD_SP", "ACH_WON_TOWN_NIGHTMARE", "ACH_UNLOCKED_CAGE", "ACH_WIN_NIGHTMARE", "ACH_SURVIVED_TO_7_GOATS", "ACH_UNLOCKED_ATTIC_CAGE", "ACH_SURVIVED_TO_3_GOATS", "ACH_SURVIVED_TO_5_GOATS", "ACH_STAGGERED_SAM_20_TIMES", "ACH_STAGGERED_ZARA_20_TIMES", "ACH_STAGGERED_MOLLY_20_TIMES", "ACH_STAGGERED_NATHAN_20_TIMES", "ACH_REVIVED_20_PLAYERS", "ACH_STAGGERED_ANNA_20_TIMES", "ACH_NEVER_KNOCKED_OUT", "ACH_ONLY_ONE_KNOCKED_OUT", "ACH_LOST", "ACH_LURED_20_GOATS", "ACH_WON_MOLLY_HARD_SP", "ACH_WON_MOLLY_NIGHTMARE", "ACH_WON_MOLLY_COOP", "ACH_WON_MOLLY_HARD", "ACH_WON_INN_NIGHTMARE_SP", "ACH_WON_INN_SP", "ACH_WON_INN_HARD_SP", "ACH_WON_INN_NIGHTMARE", "ACH_WON_INN_COOP", "ACH_WON_INN_HARD", "ACH_WON_HARD_NO_MEDKITS", "ACH_WON_HARD_SP", "ACH_WON_HARD", "ACH_WON_HARD_NO_BATTERIES", "ACH_WIN_NIGHTMARE_SP", "ACH_WON_COOP", "ACH_ALL_ROSES", "ACH_BEAT_GAME_5_TIMES", "ACH_ALL_NOTES_READ", "ACH_ALL_PATCHES", "ACH_ALL_CLIPBOARDS_READ", "ACH_ALL_HORSESHOES", "ACH_ALL_BARBED_WIRES", "ACH_ALL_CHERRY_BLOSSOM", "ACH_20_POOPS_SEARCHED", "ACH_20_TRASH_CANS_KICKED", "ACH_100_GASOLINE_USED", "ACH_20_BLEACH_USED", "ACH_100_EGGS_DESTROYED", "ACH_100_FUSES_USED", "ACH_1000_PIGS_DESTROYED", "ACH_100_BOOKS_CURSED", "ACH_KNOCKED_OUT_IN_HIDING", "ACH_KNOCKOUT_OUT_BY_DEMON", "ACH_KNOCKED_OUT_20_TIMES", "ACH_KNOCKED_OUT_BY_ANNA", "ACH_FRIED_20_DEMONS", "ACH_FRIED_RAT", "ACH_FRIED_100_CORPSES", "ACH_FRIED_100_INMATES", "ACH_FRIED_1000_GHOSTS", "ACH_FRIED_1000_SPIDERS", "ACH_CALM_MOLLY_10_TIMES", "ACH_FRIED_1000_BOARS", "ACH_CALMED_ANNA", "ACH_CALMED_ANNA_10_TIMES", "ACH_BEAT_GAME_5_TIMES_IN_NIGHTMARE_MODE", "ACH_BURNT_GOAT", "ACH_1000_BOOKS_DESTROYED" };
|
string[] stats = { "STAT_TRASH_CANS_KICKED", "STAT_NUM_BOOKS_DESTROYED", "STAT_NUM_ANNA_STAGGERS", "STAT_KNOCKOUTS_BY_GHOST", "STAT_KNOCKOUTS_BY_NATHAN", "STAT_NUM_REVIVES", "STAT_INMATES", "STAT_GHOSTS", "STAT_PRESENTS_COLLECTED", "STAT_ROSES_COLLECTED", "STAT_HEADS", "STAT_KNOCKOUTS_BY_MONKEY", "STAT_GOATS_LURED", "STAT_NUM_NATHAN_STAGGERS", "STAT_DOLLS", "STAT_HORSESHOES_COLLECTED", "STAT_KNOCKOUTS_BY_BOAR", "STAT_KNOCKOUTS_BY_MOLLY", "STAT_KNOCKOUTS_BY_SPIDER", "STAT_DEMONS", "STAT_BARBED_WIRES_COLLECTED", "STAT_CATEGORY_MISC", "STAT_BOOKS", "STAT_CATEGORY_COLLECTABLES", "STAT_HEADS_CLEANSED", "STAT_KNOCKOUTS_BY_SAM", "STAT_NUM_APRIL_STAGGERS", "STAT_BOARS", "STAT_RATS", "STAT_KNOCKOUTS_BY_APRIL", "STAT_CATEGORY_MINIONS_BANISHED", "STAT_HEADS_LURED", "STAT_PIGS", "STAT_CROWS", "STAT_NUM_ZARA_STAGGERS", "STAT_PIGS_LURED", "STAT_NUM_SAM_STAGGERS", "STAT_CATEGORY_AZAZEL_STAGGERS", "STAT_NUM_MOLLY_STAGGERS", "STAT_CHERRY_BLOSSOM_COLLECTED", "STAT_GOATS", "STAT_PUMPKINS_COLLECTED", "STAT_KNOCKOUTS_BY_ZARA", "STAT_PATCHES_COLLECTED", "STAT_KNOCKOUTS_BY_DEMON", "STAT_NUM_KAI_STAGGERS", "STAT_FEATHERS_COLLECTED", "STAT_EGGS", "STAT_KNOCKOUTS_BY_ANNA", "STAT_CATEGORY_ANIMALS_LURED", "STAT_DOLLS_LURED", "STAT_CORPSES_FREED", "STAT_DOLL_HEADS", "STAT_KNOCKOUTS_BY_INMATE", "STAT_RATS_LURED", "STAT_SPIDERS", "STAT_COINS_USED", "STAT_MONKEYS", "STAT_CATEGORY_ITEMS_USED", "STAT_CATEGORY_RITUAL_ITEMS_DESTROYED", "STAT_KNOCKOUTS_BY_CROW", "STAT_DOLL_HEADS_DESTROYED", "STAT_CATEGORY_KNOCKOUTS", "STAT_TICKETS_COLLECTED", "STAT_KNOCKOUTS_BY_KAI", "STAT_CATEGORY_WINS", "STAT_NUM_WON_NORMAL", "STAT_DOLLS_EXPLODED", "STAT_NUM_EGGS_DESTROYED", "STAT_NUM_HEADS_BURIED", "STAT_NUM_CORPSES_FRIED", "STAT_NUM_GHOSTS_FRIED", "STAT_NUM_MOLLY_CALMED_DOWN", "STAT_NUM_ANNA_CALMED_DOWN", "STAT_NUM_", "STAT_MONKEYS_FRIED", "STAT_NUM_CROWS_FRIED", "STAT_NUM_BOARS_FRIED", "STAT_NUM_SPIDERS_FRIED", "STAT_NUM_INMATES_FRIED", "STAT_NUM_DEMONS_FRIED", "STAT_NUM_KNOCKOUTS", "STAT_KNOCKOUTS_BY_", "STAT_NUM_BOOKS_CURSED", "STAT_NUM_ALCOHOL_USED", "STAT_NUM_BLEACH_USED", "STAT_EXP", "STAT_POOPS_SEARCHED", "STAT_NUM_PIGS_DESTROYED", "STAT_NUM_WON_HARD", "STAT_NUM_WON_NIGHTMARE", "STAT_NUM_WON_EASY", "STAT_NUM_WON", "STAT_NUM_GASOLINE_USED", "STAT_NUM_GOATS_DESTROYED", "STAT_NUM_RATS_DESTROYED", "STAT_NUM_FUSES_USED", };
|
||||||
|
|
||||||
for (int i = 0; i < achievements.Length; i++)
|
for (int i = 0; i < achievements.Length; i++)
|
||||||
{
|
{
|
||||||
ah.Unlock(achievements[i]);
|
Il2CppSteamworks.SteamUserStats.SetAchievement(achievements[i]);
|
||||||
|
//ah.Unlock(achievements[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < stats.Length; j++)
|
||||||
|
{
|
||||||
|
Il2CppSteamworks.SteamUserStats.SetStat(stats[j], 666);
|
||||||
|
}
|
||||||
|
|
||||||
|
MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!");
|
||||||
|
MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!");
|
||||||
|
MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!");
|
||||||
|
MelonLoader.MelonLogger.Warning("You need to restart your game for the achievements to be unlocked !!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Doors()
|
public static void Doors()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace DevourClient.Helpers
|
namespace DevourClient.Helpers
|
||||||
{
|
{
|
||||||
@@ -8,6 +9,13 @@ namespace DevourClient.Helpers
|
|||||||
private static float G;
|
private static float G;
|
||||||
private static float B;
|
private static float B;
|
||||||
|
|
||||||
|
private static Texture2D previewTexture = null;
|
||||||
|
private static Dictionary<Color, Texture2D> colorTextureCache = new Dictionary<Color, Texture2D>();
|
||||||
|
private static Dictionary<int, Texture2D> circularTextureCache = new Dictionary<int, Texture2D>();
|
||||||
|
|
||||||
|
private static Color lastPreviewColor = Color.clear;
|
||||||
|
private static GUIStyle cachedBoxStyle = null;
|
||||||
|
|
||||||
public static Color ColorPick(string title, Color color)
|
public static Color ColorPick(string title, Color color)
|
||||||
{
|
{
|
||||||
GUI.Label(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 30), title);
|
GUI.Label(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 70, 250, 30), title);
|
||||||
@@ -24,12 +32,24 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
void DrawPreview(Rect position, Color color_to_draw)
|
void DrawPreview(Rect position, Color color_to_draw)
|
||||||
{
|
{
|
||||||
Texture2D texture = new Texture2D(1, 1);
|
if (previewTexture == null || lastPreviewColor != color_to_draw)
|
||||||
texture.SetPixel(0, 0, color_to_draw);
|
{
|
||||||
texture.Apply();
|
if (previewTexture == null)
|
||||||
GUIStyle boxStyle = new GUIStyle(GUI.skin.box);
|
{
|
||||||
boxStyle.normal.background = texture;
|
previewTexture = new Texture2D(1, 1);
|
||||||
GUI.Box(position, GUIContent.none, boxStyle);
|
}
|
||||||
|
|
||||||
|
previewTexture.SetPixel(0, 0, color_to_draw);
|
||||||
|
previewTexture.Apply();
|
||||||
|
lastPreviewColor = color_to_draw;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cachedBoxStyle == null)
|
||||||
|
{
|
||||||
|
cachedBoxStyle = new GUIStyle(GUI.skin.box);
|
||||||
|
}
|
||||||
|
cachedBoxStyle.normal.background = previewTexture;
|
||||||
|
GUI.Box(position, GUIContent.none, cachedBoxStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color);
|
DrawPreview(new Rect(Settings.Settings.x + 195, Settings.Settings.y + 100, 20, 90), color);
|
||||||
@@ -39,6 +59,14 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static Texture2D MakeTex(int width, int height, Color col)
|
public static Texture2D MakeTex(int width, int height, Color col)
|
||||||
{
|
{
|
||||||
|
if (colorTextureCache.TryGetValue(col, out Texture2D cachedTexture))
|
||||||
|
{
|
||||||
|
if (cachedTexture != null)
|
||||||
|
{
|
||||||
|
return cachedTexture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Color[] pix = new Color[width * height];
|
Color[] pix = new Color[width * height];
|
||||||
for (int i = 0; i < pix.Length; ++i)
|
for (int i = 0; i < pix.Length; ++i)
|
||||||
{
|
{
|
||||||
@@ -47,11 +75,24 @@ namespace DevourClient.Helpers
|
|||||||
Texture2D result = new Texture2D(width, height);
|
Texture2D result = new Texture2D(width, height);
|
||||||
result.SetPixels(pix);
|
result.SetPixels(pix);
|
||||||
result.Apply();
|
result.Apply();
|
||||||
|
|
||||||
|
colorTextureCache[col] = result;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Texture2D GetCircularTexture(int width, int height)
|
public static Texture2D GetCircularTexture(int width, int height)
|
||||||
{
|
{
|
||||||
|
int cacheKey = width;
|
||||||
|
|
||||||
|
if (circularTextureCache.TryGetValue(cacheKey, out Texture2D cachedTexture))
|
||||||
|
{
|
||||||
|
if (cachedTexture != null)
|
||||||
|
{
|
||||||
|
return cachedTexture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Texture2D texture = new Texture2D(width, height);
|
Texture2D texture = new Texture2D(width, height);
|
||||||
for (int x = 0; x < texture.width; x++)
|
for (int x = 0; x < texture.width; x++)
|
||||||
{
|
{
|
||||||
@@ -70,7 +111,36 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
texture.Apply();
|
texture.Apply();
|
||||||
|
|
||||||
|
circularTextureCache[cacheKey] = texture;
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Cleanup()
|
||||||
|
{
|
||||||
|
if (previewTexture != null)
|
||||||
|
{
|
||||||
|
UnityEngine.Object.Destroy(previewTexture);
|
||||||
|
previewTexture = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var texture in colorTextureCache.Values)
|
||||||
|
{
|
||||||
|
if (texture != null)
|
||||||
|
{
|
||||||
|
UnityEngine.Object.Destroy(texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
colorTextureCache.Clear();
|
||||||
|
|
||||||
|
foreach (var texture in circularTextureCache.Values)
|
||||||
|
{
|
||||||
|
if (texture != null)
|
||||||
|
{
|
||||||
|
UnityEngine.Object.Destroy(texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
circularTextureCache.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
{
|
{
|
||||||
switch (sceneName)
|
switch (sceneName)
|
||||||
{
|
{
|
||||||
case "Devour":
|
case "Anna":
|
||||||
return "Farmhouse";
|
return "Farmhouse";
|
||||||
case "Molly":
|
case "Molly":
|
||||||
return "Asylum";
|
return "Asylum";
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
return "Town";
|
return "Town";
|
||||||
case "Slaughterhouse":
|
case "Slaughterhouse":
|
||||||
return "Slaughterhouse";
|
return "Slaughterhouse";
|
||||||
|
case "Manor":
|
||||||
|
return "Manor";
|
||||||
|
case "Carnival":
|
||||||
|
return "Carnival";
|
||||||
default:
|
default:
|
||||||
return "Menu";
|
return "Menu";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,14 +12,32 @@ namespace DevourClient.Render
|
|||||||
{
|
{
|
||||||
public static GUIStyle StringStyle { get; set; } = new GUIStyle(GUI.skin.label);
|
public static GUIStyle StringStyle { get; set; } = new GUIStyle(GUI.skin.label);
|
||||||
|
|
||||||
|
private static GUIContent cachedContent = new GUIContent();
|
||||||
|
private static Dictionary<string, Vector2> sizeCache = new Dictionary<string, Vector2>();
|
||||||
|
private static int frameCacheClearCounter = 0;
|
||||||
|
private const int CACHE_CLEAR_INTERVAL = 1800;
|
||||||
|
|
||||||
public static void DrawString(Vector2 position, Color color, string label, bool centered = true)
|
public static void DrawString(Vector2 position, Color color, string label, bool centered = true)
|
||||||
{
|
{
|
||||||
var content = new GUIContent(label);
|
cachedContent.text = label;
|
||||||
var size = StringStyle.CalcSize(content);
|
|
||||||
|
if (!sizeCache.TryGetValue(label, out Vector2 size))
|
||||||
|
{
|
||||||
|
size = StringStyle.CalcSize(cachedContent);
|
||||||
|
sizeCache[label] = size;
|
||||||
|
|
||||||
|
frameCacheClearCounter++;
|
||||||
|
if (frameCacheClearCounter >= CACHE_CLEAR_INTERVAL)
|
||||||
|
{
|
||||||
|
sizeCache.Clear();
|
||||||
|
frameCacheClearCounter = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var upperLeft = centered ? position - size / 2f : position;
|
var upperLeft = centered ? position - size / 2f : position;
|
||||||
Color color2 = GUI.color;
|
Color color2 = GUI.color;
|
||||||
GUI.color = color;
|
GUI.color = color;
|
||||||
GUI.Label(new Rect(upperLeft, size), content);
|
GUI.Label(new Rect(upperLeft, size), cachedContent);
|
||||||
GUI.color = color2;
|
GUI.color = color2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +81,7 @@ namespace DevourClient.Render
|
|||||||
}
|
}
|
||||||
public static void DrawBones(Transform bone1, Transform bone2, Color c)
|
public static void DrawBones(Transform bone1, Transform bone2, Color c)
|
||||||
{
|
{
|
||||||
if (!Camera.main) //fix the crash maybe
|
if (!Camera.main)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,11 @@ namespace DevourClient.Helpers
|
|||||||
Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent<Il2Cpp.NolanBehaviour>();
|
Il2Cpp.NolanBehaviour nb = p_GameObject.GetComponent<Il2Cpp.NolanBehaviour>();
|
||||||
Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType<Il2Cpp.SurvivalReviveInteractable>();
|
Il2Cpp.SurvivalReviveInteractable _reviveInteractable = UnityEngine.Object.FindObjectOfType<Il2Cpp.SurvivalReviveInteractable>();
|
||||||
|
|
||||||
_reviveInteractable.Interact(nb.gameObject);
|
if (_reviveInteractable.CanInteract(nb.gameObject) == true) { _reviveInteractable.Interact(nb.gameObject); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Jumpscare()
|
public void Jumpscare() //TOFIX doesn't seem to be working
|
||||||
{
|
{
|
||||||
if (!BoltNetwork.IsServer)
|
if (!BoltNetwork.IsServer)
|
||||||
{
|
{
|
||||||
@@ -81,7 +82,6 @@ namespace DevourClient.Helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity);
|
BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TP()
|
public void TP()
|
||||||
@@ -104,11 +104,36 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent<UltimateCharacterLocomotion>();
|
UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent<UltimateCharacterLocomotion>();
|
||||||
|
|
||||||
try
|
if (ucl)
|
||||||
{
|
{
|
||||||
ucl.SetPosition(p_GameObject.transform.position);
|
ucl.SetPosition(p_GameObject.transform.position);
|
||||||
}
|
}
|
||||||
catch { return; }
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("Azazel not found!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShootPlayer()
|
||||||
|
{
|
||||||
|
if (!BoltNetwork.IsServer)
|
||||||
|
{
|
||||||
|
MelonLogger.Msg("You need to be server !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p_GameObject == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType<Il2Cpp.AzazelSamBehaviour>();
|
||||||
|
|
||||||
|
if (_azazelSam)
|
||||||
|
{
|
||||||
|
_azazelSam.OnShootPlayer(p_GameObject, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class Player
|
public class Player
|
||||||
@@ -163,10 +188,17 @@ namespace DevourClient.Helpers
|
|||||||
public static Il2Cpp.SurvivalAzazelBehaviour[] Azazels = default!;
|
public static Il2Cpp.SurvivalAzazelBehaviour[] Azazels = default!;
|
||||||
public static Il2Cpp.BoarBehaviour[] Boars = default!;
|
public static Il2Cpp.BoarBehaviour[] Boars = default!;
|
||||||
public static Il2Cpp.CorpseBehaviour[] Corpses = default!;
|
public static Il2Cpp.CorpseBehaviour[] Corpses = default!;
|
||||||
|
public static Il2Cpp.CrowBehaviour[] Crows = default!;
|
||||||
|
public static Il2Cpp.ManorLumpController[] Lumps = default!;
|
||||||
|
public static Il2Cpp.MonkeyBehaviour[] Monkeys = default!;
|
||||||
|
|
||||||
|
// 协程生命周期管理
|
||||||
|
private static List<object> activeCoroutines = new List<object>();
|
||||||
|
private static bool isRunning = false;
|
||||||
|
|
||||||
public static IEnumerator GetLocalPlayer()
|
public static IEnumerator GetLocalPlayer()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player");
|
GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player");
|
||||||
|
|
||||||
@@ -186,7 +218,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetAllPlayers()
|
public static IEnumerator GetAllPlayers()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
|
GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
|
||||||
Players = new BasePlayer[players.Length];
|
Players = new BasePlayer[players.Length];
|
||||||
@@ -223,7 +255,7 @@ namespace DevourClient.Helpers
|
|||||||
}
|
}
|
||||||
public static IEnumerator GetGoatsAndRats()
|
public static IEnumerator GetGoatsAndRats()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType<Il2Cpp.GoatBehaviour>();
|
GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType<Il2Cpp.GoatBehaviour>();
|
||||||
|
|
||||||
@@ -234,7 +266,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetSurvivalInteractables()
|
public static IEnumerator GetSurvivalInteractables()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType<Il2Cpp.SurvivalInteractable>();
|
SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType<Il2Cpp.SurvivalInteractable>();
|
||||||
|
|
||||||
@@ -245,7 +277,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetKeys()
|
public static IEnumerator GetKeys()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType<Il2Cpp.KeyBehaviour>();
|
Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType<Il2Cpp.KeyBehaviour>();
|
||||||
|
|
||||||
@@ -256,7 +288,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetDemons()
|
public static IEnumerator GetDemons()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType<Il2Cpp.SurvivalDemonBehaviour>();
|
Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType<Il2Cpp.SurvivalDemonBehaviour>();
|
||||||
|
|
||||||
@@ -267,7 +299,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetSpiders()
|
public static IEnumerator GetSpiders()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType<Il2Cpp.SpiderBehaviour>();
|
Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType<Il2Cpp.SpiderBehaviour>();
|
||||||
|
|
||||||
@@ -278,7 +310,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetGhosts()
|
public static IEnumerator GetGhosts()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType<Il2Cpp.GhostBehaviour>();
|
Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType<Il2Cpp.GhostBehaviour>();
|
||||||
|
|
||||||
@@ -289,7 +321,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetBoars()
|
public static IEnumerator GetBoars()
|
||||||
{
|
{
|
||||||
for (; ; )
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType<Il2Cpp.BoarBehaviour>();
|
Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType<Il2Cpp.BoarBehaviour>();
|
||||||
|
|
||||||
@@ -300,7 +332,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetCorpses()
|
public static IEnumerator GetCorpses()
|
||||||
{
|
{
|
||||||
for (; ; )
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType<Il2Cpp.CorpseBehaviour>();
|
Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType<Il2Cpp.CorpseBehaviour>();
|
||||||
|
|
||||||
@@ -309,12 +341,45 @@ namespace DevourClient.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerator GetCrows()
|
||||||
|
{
|
||||||
|
while (isRunning)
|
||||||
|
{
|
||||||
|
Crows = Il2Cpp.CrowBehaviour.FindObjectsOfType<Il2Cpp.CrowBehaviour>();
|
||||||
|
|
||||||
|
// Wait 5 seconds before caching objects again.
|
||||||
|
yield return new WaitForSeconds(5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerator GetLumps()
|
||||||
|
{
|
||||||
|
while (isRunning)
|
||||||
|
{
|
||||||
|
Lumps = Il2Cpp.ManorLumpController.FindObjectsOfType<Il2Cpp.ManorLumpController>();
|
||||||
|
|
||||||
|
// Wait 5 seconds before caching objects again.
|
||||||
|
yield return new WaitForSeconds(5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerator GetMonkeys()
|
||||||
|
{
|
||||||
|
while (isRunning)
|
||||||
|
{
|
||||||
|
Monkeys = Il2Cpp.MonkeyBehaviour.FindObjectsOfType<Il2Cpp.MonkeyBehaviour>();
|
||||||
|
|
||||||
|
// Wait 5 seconds before caching objects again.
|
||||||
|
yield return new WaitForSeconds(5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerator GetAzazels()
|
public static IEnumerator GetAzazels()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* ikr AzazelS, because in case we spawn multiple we want the esp to render all of them
|
* ikr AzazelS, because in case we spawn multiple we want the esp to render all of them
|
||||||
*/
|
*/
|
||||||
for (;;)
|
while (isRunning)
|
||||||
{
|
{
|
||||||
Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType<Il2Cpp.SurvivalAzazelBehaviour>();
|
Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType<Il2Cpp.SurvivalAzazelBehaviour>();
|
||||||
|
|
||||||
@@ -322,5 +387,105 @@ namespace DevourClient.Helpers
|
|||||||
yield return new WaitForSeconds(5f);
|
yield return new WaitForSeconds(5f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 启动所有协程
|
||||||
|
/// </summary>
|
||||||
|
public static void StartAllCoroutines()
|
||||||
|
{
|
||||||
|
isRunning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 停止所有协程并清理协程引用
|
||||||
|
/// </summary>
|
||||||
|
public static void StopAllCoroutines()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 设置标志,让所有协程循环自然退出
|
||||||
|
isRunning = false;
|
||||||
|
|
||||||
|
// 停止所有记录的协程
|
||||||
|
foreach (var coroutine in activeCoroutines)
|
||||||
|
{
|
||||||
|
if (coroutine != null)
|
||||||
|
{
|
||||||
|
MelonCoroutines.Stop(coroutine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空协程引用列表
|
||||||
|
activeCoroutines.Clear();
|
||||||
|
|
||||||
|
// 清理缓存对象
|
||||||
|
CleanupCachedObjects();
|
||||||
|
|
||||||
|
MelonLogger.Msg("All coroutines stopped and cleaned up successfully.");
|
||||||
|
}
|
||||||
|
catch (System.Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Error($"Error stopping coroutines: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存的游戏对象引用
|
||||||
|
/// </summary>
|
||||||
|
public static void CleanupCachedObjects()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 清理玩家对象引用
|
||||||
|
if (Players != null)
|
||||||
|
{
|
||||||
|
foreach (var player in Players)
|
||||||
|
{
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
player.p_GameObject = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将所有实体数组设为null,释放对游戏对象的引用
|
||||||
|
Players = null;
|
||||||
|
GoatsAndRats = null;
|
||||||
|
SurvivalInteractables = null;
|
||||||
|
Keys = null;
|
||||||
|
Demons = null;
|
||||||
|
Spiders = null;
|
||||||
|
Ghosts = null;
|
||||||
|
Azazels = null;
|
||||||
|
Boars = null;
|
||||||
|
Corpses = null;
|
||||||
|
Crows = null;
|
||||||
|
Lumps = null;
|
||||||
|
Monkeys = null;
|
||||||
|
|
||||||
|
// 清理本地玩家引用
|
||||||
|
if (LocalPlayer_ != null)
|
||||||
|
{
|
||||||
|
LocalPlayer_.p_GameObject = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
MelonLogger.Msg("Cached objects cleaned up successfully.");
|
||||||
|
}
|
||||||
|
catch (System.Exception ex)
|
||||||
|
{
|
||||||
|
MelonLogger.Error($"Error cleaning up cached objects: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 注册协程引用用于后续管理
|
||||||
|
/// </summary>
|
||||||
|
public static void RegisterCoroutine(object coroutine)
|
||||||
|
{
|
||||||
|
if (coroutine != null && !activeCoroutines.Contains(coroutine))
|
||||||
|
{
|
||||||
|
activeCoroutines.Add(coroutine);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using DevourClient;
|
using Il2Cpp;
|
||||||
|
|
||||||
namespace DevourClient.Hooks
|
namespace DevourClient.Hooks
|
||||||
{
|
{
|
||||||
@@ -11,7 +11,7 @@ namespace DevourClient.Hooks
|
|||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
static void Prefix(ref Il2CppOpsive.UltimateCharacterController.Traits.Attribute attribute)
|
static void Prefix(ref Il2CppOpsive.UltimateCharacterController.Traits.Attribute attribute)
|
||||||
{
|
{
|
||||||
if (Load.unlimitedUV && attribute.m_Name == "Battery")
|
if (ClientMain.unlimitedUV && attribute.m_Name == "Battery")
|
||||||
{
|
{
|
||||||
attribute.m_Value = 100.0f;
|
attribute.m_Value = 100.0f;
|
||||||
return;
|
return;
|
||||||
@@ -25,9 +25,9 @@ namespace DevourClient.Hooks
|
|||||||
{
|
{
|
||||||
static void Postfix(ref Il2Cpp.RankHelpers.ExpGainInfo __result)
|
static void Postfix(ref Il2Cpp.RankHelpers.ExpGainInfo __result)
|
||||||
{
|
{
|
||||||
if (Load.exp_modifier)
|
if (ClientMain.exp_modifier)
|
||||||
{
|
{
|
||||||
__result.totalExp = (int)Load.exp;
|
__result.totalExp = (int)ClientMain.exp;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,8 +73,6 @@ namespace DevourClient.Hooks
|
|||||||
//MelonLoader.MelonLogger.Msg("currentPrice : " + outfit.currentPrice);
|
//MelonLoader.MelonLogger.Msg("currentPrice : " + outfit.currentPrice);
|
||||||
//MelonLoader.MelonLogger.Msg("isOwned : " + outfit.isOwned);
|
//MelonLoader.MelonLogger.Msg("isOwned : " + outfit.isOwned);
|
||||||
//MelonLoader.MelonLogger.Msg("isHidden : " + outfit.isHidden);
|
//MelonLoader.MelonLogger.Msg("isHidden : " + outfit.isHidden);
|
||||||
outfit.basePrice = 0;
|
|
||||||
outfit.currentPrice = 0;
|
|
||||||
outfit.isOwned = true;
|
outfit.isOwned = true;
|
||||||
outfit.isHidden = false;
|
outfit.isHidden = false;
|
||||||
return;
|
return;
|
||||||
@@ -119,5 +117,16 @@ namespace DevourClient.Hooks
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(ManorMirrorController))]
|
||||||
|
[HarmonyPatch(nameof(ManorMirrorController.IsBroken))] //annotation boiler plate to tell Harmony what to patch. Refer to docs.
|
||||||
|
static class ManorMirrorController_IsBroken
|
||||||
|
{
|
||||||
|
static void Postfix(ref bool __result)
|
||||||
|
{
|
||||||
|
if (ClientMain.infinite_mirrors)
|
||||||
|
__result = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
56
README.md
56
README.md
@@ -25,8 +25,6 @@ Everything about spoofing ehre (steam name, server name, level...) will persist
|
|||||||
* Doors unlocker (should work fine, though it doesn't seem to work sometimes)
|
* Doors unlocker (should work fine, though it doesn't seem to work sometimes)
|
||||||
* Keys teleporter
|
* Keys teleporter
|
||||||
* LV spoofer
|
* LV spoofer
|
||||||
* Steam name spoofer (sets it to "patate", again no input text :/)
|
|
||||||
* Server name spoofer (sets it to "patate on top !", again no input text :/)
|
|
||||||
* Fly
|
* Fly
|
||||||
* Unlock all, including flashlights, perks, outfits. Active by default, can't be turned off, no persistance.
|
* Unlock all, including flashlights, perks, outfits. Active by default, can't be turned off, no persistance.
|
||||||
* Instant Win (allows you to win instantaniously on any map, works in singleplayer, but not as a client. May be working as host)
|
* Instant Win (allows you to win instantaniously on any map, works in singleplayer, but not as a client. May be working as host)
|
||||||
@@ -47,18 +45,46 @@ Everything about spoofing ehre (steam name, server name, level...) will persist
|
|||||||
* Walk in the lobby
|
* Walk in the lobby
|
||||||
* Change the player's speed
|
* Change the player's speed
|
||||||
* Fullbright
|
* Fullbright
|
||||||
* Create a lobby with no player limit
|
* Infinite mirrors (Manor update)
|
||||||
|
* Switch between realms (Manor update)
|
||||||
|
* Due to the game update, I deleted "Steam name spoofer", "Server name spoofer" and "Create a lobby with no player limit" these three functions.For "steam name spoofer", even changed your name by this function, your teamates can still see your name by steam profile, escape button, and your message in game. For "create a lobby with no player limit", if create a lobby with more than four players, the ghost will be stuck or some of the players will not be able to move. So I have to delete this function.(by manafeng)
|
||||||
|
|
||||||
|
## English Installation Tutorial
|
||||||
|
|
||||||
|
Raz did a great job at writing a guide on how to install the mod, link here : [link](https://docs.google.com/presentation/d/1YdIE5wwGWiJZ2RVughFYrlXUnFrxol-HI7QyLY_m0zc)<br>
|
||||||
|
|
||||||
|
## French Installation Tutorial
|
||||||
|
|
||||||
## Installation
|
|
||||||
For my French fellas out there, 1tap2times made a French video tutorial for the installation of the Mod : [link](https://vimeo.com/789315436)<br>
|
For my French fellas out there, 1tap2times made a French video tutorial for the installation of the Mod : [link](https://vimeo.com/789315436)<br>
|
||||||
|
|
||||||
|
## German Video Installation Tutorial
|
||||||
|
|
||||||
For my German friends, KiwiJuice02 made a german video tutorial right here : [link](https://www.youtube.com/watch?v=Ntablvo6y-I)<br>
|
For my German friends, KiwiJuice02 made a german video tutorial right here : [link](https://www.youtube.com/watch?v=Ntablvo6y-I)<br>
|
||||||
In order to get all of this working you need to generate the DevourClient.dll file by building the source code.
|
|
||||||
|
In order to get all of this working you need to generate the DevourClient.dll file by building the source code.<br>
|
||||||
|
|
||||||
0. Install [.NET 6 SDK and runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).
|
0. Install [.NET 6 SDK and runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).
|
||||||
1. [Build the cheat from source](https://github.com/ALittlePatate/DevourClient#building-from-source).
|
1. [Build the cheat from source](https://github.com/ALittlePatate/DevourClient#building-from-source).
|
||||||
2. Put the DevourClient.dll file located in `DevourClient\bin\Release\net6.0` inside `C:\Program Files (x86)\Steam\steamapps\common\Devour\Mods` folder.
|
2. Put the DevourClient.dll file located in `DevourClient\bin\Release\net6.0` inside `C:\Program Files (x86)\Steam\steamapps\common\Devour\Mods` folder.
|
||||||
3. Start the game, now you have successfully installed DevourClient. Use INSERT to open the menu
|
3. Start the game, now you have successfully installed DevourClient. Use INSERT to open the menu
|
||||||
|
|
||||||
|
## 中文安装指南
|
||||||
|
如果你只是想要安装这个插件,直接在游戏里使用的话
|
||||||
|
|
||||||
|
1、安装 .net 6 的运行环境 → (https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
|
||||||
|
|
||||||
|
2、安装melonloader → (https://github.com/LavaGang/MelonLoader/releases)
|
||||||
|
版本无限制,尽量选择新版即可。打开melonloader页面后,点击devour进入安装界面,全部默认即可,无需勾选或修改其他选项,点击install进行安装(安装过程中可能需要vpn支持)
|
||||||
|
|
||||||
|
3、安装dll文件 → 从本项目的release中下载最新的dll文件,然后将此文件添加到你的devour的安装目录中的mods文件夹里(不知道目录的情况下,可以在steam中右键devour,选择“管理”-“浏览本地文件”即可)
|
||||||
|
|
||||||
|
4、运行devour → 如果安装成功,你会看到一个windows窗口进行各类安装提示后,自动进入游戏。点击insert键即可打开和关闭devourclient窗口
|
||||||
|
|
||||||
|
ps:有些电脑在安装melonloader之后,会出现fatal error的提示,这个我目前并没有碰到过。但是出现这个提示的主要原因,基本是melonloader安装过程中,提取到devour根目录的melonloader文件夹里的文件出现了问题,比较简单的解决办法就是(1)在别人的同系统同位宽(x86,x32)的电脑里拷贝出来他的melonloader文件夹,然后直接粘贴到自己的电脑里。(2)将melonloader文件夹完全删除,然后重装。
|
||||||
|
|
||||||
|
如果你想要对代码进行修改和开发,请按照下面的”building from source“的步骤,逐步进行
|
||||||
|
|
||||||
|
|
||||||
## Uninstallation
|
## Uninstallation
|
||||||
|
|
||||||
0. Delete the folders `MelonLoader`, `Mods`, `Plugins`, `UserData`, and the file `version.dll` from `C:\Program Files (x86)\Steam\steamapps\common\Devour`
|
0. Delete the folders `MelonLoader`, `Mods`, `Plugins`, `UserData`, and the file `version.dll` from `C:\Program Files (x86)\Steam\steamapps\common\Devour`
|
||||||
@@ -66,12 +92,13 @@ In order to get all of this working you need to generate the DevourClient.dll fi
|
|||||||
## Building from source
|
## Building from source
|
||||||
|
|
||||||
0. Clone the repository (or Code -> Download Zip)
|
0. Clone the repository (or Code -> Download Zip)
|
||||||
1. Install [MelonLoader](https://github.com/LavaGang/MelonLoader/releases) V0.6.0 (go to Settings -> tick "Show ALPHA Pre-Releases") to Devour.
|
1. Install [.NET 6 SDK and runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).
|
||||||
2. Start your game. A cmd should appear, don't close it, MelonLoader is installing and decompiling Devour's game assemblies.
|
2. Install [MelonLoader](https://github.com/LavaGang/MelonLoader/releases) V0.7.1 (go to Settings -> tick "Show ALPHA Pre-Releases") to Devour.
|
||||||
3. Wait for the process to finish, once it's done close the game.
|
3. Start your game. A cmd should appear, don't close it, MelonLoader is installing and decompiling Devour's game assemblies.
|
||||||
4. Open the solution file (DevourClient.sln) in Visual Studio
|
4. Wait for the process to finish, once it's done close the game.
|
||||||
5. Go to : Project --> Add a reference --> Browse --> Click on the browse button in the down right corner of the window.
|
5. Open the solution file (DevourClient.sln) in Visual Studio
|
||||||
6. Add those files :
|
6. Go to : Project --> Add a reference --> Browse --> Click on the browse button in the down right corner of the window.
|
||||||
|
7. Add those files :
|
||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\MelonLoader.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\MelonLoader.dll`
|
||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\0Harmony.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\0Harmony.dll`
|
||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\Il2CppInterop.Runtime.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\net6\Il2CppInterop.Runtime.dll`
|
||||||
@@ -94,11 +121,13 @@ In order to get all of this working you need to generate the DevourClient.dll fi
|
|||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.platform.photon.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppudpkit.platform.photon.dll`
|
||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll`
|
||||||
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll`
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll`
|
||||||
7. Build the solutions in Release | Any CPU
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\Il2Cppcom.rlabrecque.steamworks.net.dll`
|
||||||
|
* `C:\Program Files (x86)\Steam\steamapps\common\Devour\MelonLoader\Il2CppAssemblies\unity.TextMeshPro.dll`
|
||||||
|
8. Build the solutions in Release | Any CPU
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
You can add me on discord at patate#1252 or on the [discord server](https://discord.gg/2amMFvqjYd)
|
You can add me on discord at _.patate or on the [discord server](https://discord.gg/2amMFvqjYd)
|
||||||
|
|
||||||
## Code used
|
## Code used
|
||||||
|
|
||||||
@@ -128,3 +157,4 @@ Open an [issue](https://github.com/ALittlePatate/DevourClient/issues/new) or mak
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
[GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.md)
|
[GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.md)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 544 KiB After Width: | Height: | Size: 611 KiB |
@@ -11,17 +11,26 @@ import json
|
|||||||
f = open('script.json')
|
f = open('script.json')
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
o = open('out.cs', 'a')
|
o = open('out.cs', 'w')
|
||||||
o.write("string[] achievements = {")
|
o.write("string[] achievements = {")
|
||||||
tot = 0
|
tot_ach = 0
|
||||||
for i in data['ScriptString']:
|
for i in data['ScriptString']:
|
||||||
v = i["Value"]
|
v = i["Value"]
|
||||||
if "ACH_" in v :
|
if "ACH_" in v :
|
||||||
o.write('"'+v+'", ')
|
o.write('"'+v+'", ')
|
||||||
tot+=1
|
tot_ach+=1
|
||||||
|
o.write("};\n")
|
||||||
|
|
||||||
o.write("};")
|
tot_stat = 0
|
||||||
print(f"{tot} achievements")
|
o.write("string[] stats = {")
|
||||||
|
for j in data['ScriptString']:
|
||||||
|
v = j["Value"]
|
||||||
|
if "STAT_" in v :
|
||||||
|
o.write('"'+v+'", ')
|
||||||
|
tot_stat+=1
|
||||||
|
o.write("};\n")
|
||||||
|
|
||||||
|
print(f"{tot_ach} achievements, {tot_stat} stats")
|
||||||
|
|
||||||
# Closing files
|
# Closing files
|
||||||
o.close()
|
o.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user