diff --git a/TheOtherRoles/CustomOptionHolder.cs b/TheOtherRoles/CustomOptionHolder.cs index a6f3bd03b..4fc21a720 100644 --- a/TheOtherRoles/CustomOptionHolder.cs +++ b/TheOtherRoles/CustomOptionHolder.cs @@ -312,6 +312,8 @@ public class CustomOptionHolder { public static CustomOption modifierTorch; public static CustomOption modifierTorchQuantity; + public static CustomOption modifierTorchLightsOnVision; + public static CustomOption modifierTorchLightsOffVision; public static CustomOption modifierMini; public static CustomOption modifierMiniGrowingUpDuration; @@ -675,6 +677,8 @@ public static void Load() { modifierTorch = CustomOption.Create(1053, Types.Modifier, cs(Color.yellow, "Torch"), rates, null, true); modifierTorchQuantity = CustomOption.Create(1054, Types.Modifier, cs(Color.yellow, "Torch Quantity"), ratesModifier, modifierTorch); + modifierTorchLightsOnVision = CustomOption.Create(1055, Types.Modifier, cs(Color.yellow, "Vision When Lights On"), 2f, 0.25f, 5f, 0.25f, modifierTorch); + modifierTorchLightsOffVision = CustomOption.Create(1056, Types.Modifier, cs(Color.yellow, "Vision When Lights Off"), 0.75f, 0.25f, 5f, 0.25f, modifierTorch); modifierMini = CustomOption.Create(1061, Types.Modifier, cs(Color.yellow, "Mini"), rates, null, true); modifierMiniGrowingUpDuration = CustomOption.Create(1062, Types.Modifier, "Mini Growing Up Duration", 400f, 100f, 1500f, 100f, modifierMini); diff --git a/TheOtherRoles/Patches/ShipStatusPatch.cs b/TheOtherRoles/Patches/ShipStatusPatch.cs index 12172d42a..e3a1d308c 100644 --- a/TheOtherRoles/Patches/ShipStatusPatch.cs +++ b/TheOtherRoles/Patches/ShipStatusPatch.cs @@ -60,7 +60,10 @@ public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArg if (Sunglasses.sunglasses.FindAll(x => x.PlayerId == player.PlayerId).Count > 0) // Sunglasses __result *= 1f - Sunglasses.vision * 0.1f; if (Torch.torch.FindAll(x => x.PlayerId == player.PlayerId).Count > 0) // Torchtest - __result *= 1f + Torch.vision * 0.1f; + __result *= 1f + Torch.modifierTorchLightsOnVision * 1f; + __result *= 1f + Torch.modifierTorchLightsOffVision * 1f; + //float unlerped = Mathf.InverseLerp(__instance.MinLightRadius, __instance.MaxLightRadius, GetNeutralLightRadius(__instance, false)); + //__result = Mathf.Lerp(__instance.MaxLightRadius * Torch.modifierTorchLightsOffVision, __instance.MaxLightRadius * Torch.modifierTorchLightsOnVision, unlerped); return false; } diff --git a/TheOtherRoles/TheOtherRoles.cs b/TheOtherRoles/TheOtherRoles.cs index affb46b65..f1389daf5 100644 --- a/TheOtherRoles/TheOtherRoles.cs +++ b/TheOtherRoles/TheOtherRoles.cs @@ -1986,11 +1986,13 @@ public static void clearAndReload() { public static class Torch { public static List torch = new List(); - public static int vision = 1; + public static float modifierTorchLightsOnVision = 2f; + public static float modifierTorchLightsOffVision = 0.75f; public static void clearAndReload() { torch = new List(); - vision = CustomOptionHolder.modifierSunglassesVision.getSelection() + 1; //leave it here because there shouldnt be any conflict torchtest + modifierTorchLightsOnVision = CustomOptionHolder.modifierTorchLightsOnVision.getFloat(); + modifierTorchLightsOffVision = CustomOptionHolder.modifierTorchLightsOffVision.getFloat(); } } public static class Mini {