-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREPOTweaks.cs
More file actions
140 lines (115 loc) · 7.13 KB
/
Copy pathREPOTweaks.cs
File metadata and controls
140 lines (115 loc) · 7.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
#pragma warning disable CS8618 // ReSharper disable InconsistentNaming
namespace REPOTweaks
{
[BepInPlugin("BLOKBUSTR.REPOTweaks", "REPOTweaks", "1.0.0")]
public class REPOTweaks : BaseUnityPlugin
{
internal static REPOTweaks Instance { get; private set; } = null!;
internal new static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => base.Logger;
internal Harmony? Harmony { get; set; }
#region ConfigEntries
// Valuables
// public static ConfigEntry<float> configCubeBallFragility;
public static ConfigEntry<float> configJackhammerVoiceTrembleAmount;
public static ConfigEntry<float> configJackhammerVoiceTrembleRate;
public static ConfigEntry<float> configJackhammerCameraShakeAmount;
public static ConfigEntry<float> configJackhammerCameraShakeRate;
// Monsters
public static ConfigEntry<bool> configBirthdayBoyRandomizeColors;
// Shop
public static ConfigEntry<float> configShopkeeperVoiceShakeAmount;
public static ConfigEntry<float> configShopkeeperVoiceShakeRate;
// Props
public static ConfigEntry<float> configArcticTVActiveChance;
// public static ConfigEntry<bool> configEnableHingeBreakInvestigate;
public static ConfigEntry<float> configHingeBreakEnemyInvestigate;
// Music
// public static ConfigEntry<bool> configEnemyMusicInterruptsLevelMusic;
// Debug
private static ConfigEntry<bool> configEnableDebug;
// Experimental
internal static ConfigEntry<float> configJackhammerPeerShakeMultiplier;
#endregion
private void Awake()
{
Instance = this;
gameObject.transform.parent = null;
gameObject.hideFlags = HideFlags.HideAndDontSave;
RegisterConfig();
Patch();
Logger.LogInfo($"{Info.Metadata.GUID} v{Info.Metadata.Version} has loaded!");
Debug("Debug logging is enabled.");
Debug($"{Time.time}");
}
private void RegisterConfig()
{
// Valuables
// configCubeBallFragility = Config.Bind("Valuables", "CubeBallFragility", 20f,
// new ConfigDescription("The fragility of the Museum Cube Ball valuable. The vanilla default is 30.",
// new AcceptableValueRange<float>(0f, 30f)));
configJackhammerVoiceTrembleAmount = Config.Bind("Valuables", "JackhammerVoiceTrembleAmount", .035f,
new ConfigDescription("The intensity of the voice tremble caused by holding the McJannek Jackhammer valuable. Set to 0 to disable.",
new AcceptableValueRange<float>(0f, .1f)));
configJackhammerVoiceTrembleRate = Config.Bind("Valuables", "JackhammerVoiceTrembleRate", 70f,
new ConfigDescription("The rate of the voice tremble caused by holding the McJannek Jackhammer valuable.",
new AcceptableValueRange<float>(50f, 100f)));
configJackhammerCameraShakeAmount = Config.Bind("Valuables", "JackhammerCameraShakeAmount", .5f,
new ConfigDescription("The intensity of the camera shake caused by holding the McJannek Jackhammer valuable. Set to 0 to disable.",
new AcceptableValueRange<float>(0f, 1f)));
configJackhammerCameraShakeRate = Config.Bind("Valuables","JackhammerCameraShakeRate", 60f,
new ConfigDescription("The rate of the camera shake caused by holding the McJannek Jackhammer valuable.",
new AcceptableValueRange<float>(50f, 80f)));
// Monsters
configBirthdayBoyRandomizeColors = Config.Bind("Monsters", "BirthdayBoyRandomizeColors", true,
"Whether the colors of Birthday Boy should be randomized instead of defaulting to red for the first instance.");
// Shop
configShopkeeperVoiceShakeAmount = Config.Bind("Shop", "ShopkeeperVoiceShakeAmount", .025f,
new ConfigDescription("The intensity of the voice tremble caused by being shaken by the Shopkeeper. Set to 0 to disable.",
new AcceptableValueRange<float>(0f, .1f)));
configShopkeeperVoiceShakeRate = Config.Bind("Shop", "ShopkeeperVoiceShakeRate", 40f,
new ConfigDescription("The rate of the voice tremble caused by being shaken by the Shopkeeper.",
new AcceptableValueRange<float>(20f, 80f)));
// Props
configArcticTVActiveChance = Config.Bind("Props", "ArcticTVActiveChance", .125f,
new ConfigDescription("The probability of the McJannek Station jumpscare TV spawning in its working state. The vanilla probability is 1 in 8.",
new AcceptableValueRange<float>(0f, 1f)));
configHingeBreakEnemyInvestigate = Config.Bind("Props", "HingeBreakEnemyInvestigate", 8f,
new ConfigDescription("Broken hinge objects (doors, chests, cabinets. etc.) will cause enemies to investigate. Adjust this value to set the radius of the investigation trigger, or set to 0 to disable.",
new AcceptableValueRange<float>(0f, 15f)));
// Music
// configEnemyMusicInterruptsLevelMusic = Config.Bind("Music", "EnemyMusicInterruptsLevelMusic", false,
// "Whether enemy sighting music should interrupt level music. Set to true for vanilla behavior.");
// Debug
configEnableDebug = Config.Bind("Debug", "EnableDebug", false,
"Whether to enable debug logging. Keep this disabled for normal gameplay.");
// Experimental
configJackhammerPeerShakeMultiplier = Config.Bind("Experimental", "JackhammerPeerShakeMultiplier", 50f,
new ConfigDescription("The shake intensity multiplier for peer players affected by the McJannek Jackhammer valuable. This will be hard-coded once I find a good value, unless I decide it's better to make it a normal config entry.",
new AcceptableValueRange<float>(0f, 500f)));
}
private void Patch()
{
Harmony ??= new Harmony(Info.Metadata.GUID);
Harmony.PatchAll();
}
internal static void Debug(string message, Object? obj = null)
{
if (configEnableDebug.Value)
Logger.LogDebug((bool)obj ? $"{obj} ({obj!.GetInstanceID()}): {message}" : message);
}
// internal static void Warn(string message, MonoBehaviour? mono = null)
// {
// Logger.LogWarning((bool)mono ? $"{obj} ({obj!.GetInstanceID()}): {message}" : message);
// }
internal static void Error(string message, Object? obj = null)
{
Logger.LogError((bool)obj ? $"{obj} ({obj!.GetInstanceID()}): {message}" : message);
}
}
}