using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LCRollTheDice")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCRollTheDice")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("63eaab89-f233-4ac9-88a6-2fe19ac0c71e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LCRollTheDice;
[BepInPlugin("Mechanicus.LCRollTheDice", "Roll The Dice", "1.0.0.0")]
public class RollTheDiceBase : BaseUnityPlugin
{
internal enum SpawnLocation
{
Inside,
Outside,
Both
}
public enum EventEnum
{
None,
FixBurstValves,
SpawnRandomEnemy,
SpawnHighThreatEnemy,
SpawnLowThreatEnemy,
SpawnHoarders,
SpawnBrackens,
SpawnMimic,
SpawnHyperJester,
SpawnHyperThumper,
LandmineTrail,
KillAllMobs,
KillRandomMob,
EMP,
LightningStorm,
SpawnGirlPerDeadCrew,
FireSale,
Add1Credit,
Add700Credits,
AddRandomCredits,
LoseRandomCredits,
AddRerollTokens,
AddRandomTokens,
SpawnBoombox,
SpawnDrugs,
SpawnDrugsForAll,
RandomItemsDelivery,
TakeRandomDamage,
SetToCriticalHP,
SetAllToCriticalHP,
HealSelf,
HealAll,
InstantExplode,
Oppenheimer,
SixMinutesToLive,
Bounty,
BroadcastAllWords,
SpawnAirhorn,
SpawnRandomScrap,
SpawnMask,
SpawnGun,
SpawnAmmo,
SpawnGoldBar
}
private const string modGUID = "Mechanicus.LCRollTheDice";
private const string modName = "Roll The Dice";
private const string modVer = "1.0.0.0";
private readonly Harmony harmony = new Harmony("Mechanicus.LCRollTheDice");
private static RollTheDiceBase Instance;
public static ManualLogSource manualLog;
internal static ConfigurationController configController;
internal static bool isHost;
internal static Dictionary<ulong, int> playersWhoRolled;
internal static List<int> feedbackDuplicates;
internal static Dictionary<ulong, int> rtdBalances;
internal static PlayerControllerB hostController;
internal static string rollCommand = "/rtd";
internal static string balanceCommand = "/balance";
internal static string helpCommand = "/help";
internal static string forceEventCommand = "/forceevent";
internal static int tokensForSurvival = 3;
internal static int tokensForSurvivingCompany = 1;
internal static int tokensForDeath = 1;
internal static int tokensToRoll = 5;
internal static bool tokensEnabled = true;
internal static int rollsPerRound = 1;
internal static bool clearTokensOnNewSave = false;
internal const float landmineTrailFreq = 8f;
internal const float SixMinsExactTime = 360f;
internal const float lightningIntervalMin = 9f;
internal const float lightningIntervalMax = 25f;
internal static Dictionary<ulong, float> playersLandmineTrailed;
internal static Dictionary<ulong, float> playersWithSixMins;
internal static Dictionary<ulong, int> playersWithBounty;
internal static List<ulong> playersWithBroadcaster;
internal static bool staticStormEnabled = false;
internal static bool fireSale = false;
internal static int[] previousTerminalPercents;
internal static bool jestersAreHyper = false;
internal static bool thumpersAreHyper = false;
internal static float currLightningInterval = 0f;
internal static GameObject tempTranslator = null;
internal static List<GameObject> oppenMinesToExplode;
internal static BoomboxItem boomboxToEnable = null;
internal static List<GameObject> landmineTrailMines;
internal static bool AtCompany = false;
public static Dictionary<EventEnum, int> EventWeights;
public static List<EventEnum> EventSelectionList;
private static void SetUpEventWeights()
{
EventWeights = new Dictionary<EventEnum, int>();
EventSelectionList = new List<EventEnum>();
EventWeights.Add(EventEnum.None, configController.NoneWeight.Value);
EventWeights.Add(EventEnum.FixBurstValves, configController.FixBurstValvesWeight.Value);
EventWeights.Add(EventEnum.SpawnRandomEnemy, configController.SpawnRandomEnemyWeight.Value);
EventWeights.Add(EventEnum.SpawnHighThreatEnemy, configController.SpawnHighThreatEnemyWeight.Value);
EventWeights.Add(EventEnum.SpawnLowThreatEnemy, configController.SpawnLowThreatEnemyWeight.Value);
EventWeights.Add(EventEnum.SpawnHoarders, configController.SpawnHoardersWeight.Value);
EventWeights.Add(EventEnum.SpawnBrackens, configController.SpawnBrackensWeight.Value);
EventWeights.Add(EventEnum.SpawnMimic, configController.SpawnMimicWeight.Value);
EventWeights.Add(EventEnum.SpawnHyperJester, configController.SpawnHyperJesterWeight.Value);
EventWeights.Add(EventEnum.SpawnHyperThumper, configController.SpawnHyperThumperWeight.Value);
EventWeights.Add(EventEnum.LandmineTrail, configController.LandmineTrailWeight.Value);
EventWeights.Add(EventEnum.KillAllMobs, configController.KillAllMobsWeight.Value);
EventWeights.Add(EventEnum.KillRandomMob, configController.KillRandomMobWeight.Value);
EventWeights.Add(EventEnum.EMP, configController.EMPWeight.Value);
EventWeights.Add(EventEnum.SpawnGirlPerDeadCrew, configController.SpawnGirlPerDeadCrewWeight.Value);
EventWeights.Add(EventEnum.FireSale, configController.FireSaleWeight.Value);
EventWeights.Add(EventEnum.Add1Credit, configController.Add1CreditWeight.Value);
EventWeights.Add(EventEnum.Add700Credits, configController.Add700CreditsWeight.Value);
EventWeights.Add(EventEnum.AddRandomCredits, configController.AddRandomCreditsWeight.Value);
EventWeights.Add(EventEnum.LoseRandomCredits, configController.LoseRandomCreditsWeight.Value);
if (tokensEnabled)
{
EventWeights.Add(EventEnum.AddRerollTokens, configController.AddRerollTokensWeight.Value);
EventWeights.Add(EventEnum.AddRandomTokens, configController.AddRandomTokensWeight.Value);
}
EventWeights.Add(EventEnum.SpawnBoombox, configController.SpawnBoomboxWeight.Value);
EventWeights.Add(EventEnum.SpawnDrugs, configController.SpawnDrugsWeight.Value);
EventWeights.Add(EventEnum.SpawnDrugsForAll, configController.SpawnDrugsForAllWeight.Value);
EventWeights.Add(EventEnum.RandomItemsDelivery, configController.RandomItemsDeliveryWeight.Value);
EventWeights.Add(EventEnum.TakeRandomDamage, configController.TakeRandomDamageWeight.Value);
EventWeights.Add(EventEnum.SetToCriticalHP, configController.SetToCriticalHPWeight.Value);
EventWeights.Add(EventEnum.SetAllToCriticalHP, configController.SetAllToCriticalHPWeight.Value);
EventWeights.Add(EventEnum.HealSelf, configController.HealSelfWeight.Value);
EventWeights.Add(EventEnum.HealAll, configController.HealAllWeight.Value);
EventWeights.Add(EventEnum.InstantExplode, configController.InstantExplodeWeight.Value);
EventWeights.Add(EventEnum.Oppenheimer, configController.OppenheimerWeight.Value);
EventWeights.Add(EventEnum.SixMinutesToLive, configController.SixMinutesToLiveWeight.Value);
EventWeights.Add(EventEnum.Bounty, configController.BountyWeight.Value);
EventWeights.Add(EventEnum.BroadcastAllWords, configController.BroadcastAllWordsWeight.Value);
EventWeights.Add(EventEnum.SpawnAirhorn, configController.SpawnAirhornWeight.Value);
EventWeights.Add(EventEnum.SpawnRandomScrap, configController.SpawnRandomScrapWeight.Value);
EventWeights.Add(EventEnum.SpawnMask, configController.SpawnMaskWeight.Value);
EventWeights.Add(EventEnum.SpawnGun, configController.SpawnGunWeight.Value);
EventWeights.Add(EventEnum.SpawnAmmo, configController.SpawnAmmoWeight.Value);
EventWeights.Add(EventEnum.SpawnGoldBar, configController.SpawnGoldBarWeight.Value);
foreach (KeyValuePair<EventEnum, int> eventWeight in EventWeights)
{
for (int i = 0; i < eventWeight.Value; i++)
{
EventSelectionList.Add(eventWeight.Key);
}
}
}
private static EventEnum ParseStringToEvent(string input)
{
switch (input)
{
case "SpawnRandomEnemy":
return EventEnum.SpawnRandomEnemy;
case "SpawnHighThreatEnemy":
return EventEnum.SpawnHighThreatEnemy;
case "SpawnLowThreatEnemy":
return EventEnum.SpawnLowThreatEnemy;
case "SpawnHoarders":
return EventEnum.SpawnHoarders;
case "SpawnBrackens":
return EventEnum.SpawnBrackens;
case "SpawnMimic":
return EventEnum.SpawnMimic;
case "SpawnHyperJester":
return EventEnum.SpawnHyperJester;
case "SpawnHyperThumper":
return EventEnum.SpawnHyperThumper;
case "LandmineTrail":
return EventEnum.LandmineTrail;
case "KillAllMobs":
return EventEnum.KillAllMobs;
case "KillRandomMob":
return EventEnum.KillRandomMob;
case "EMP":
return EventEnum.EMP;
case "LightningStorm":
return EventEnum.LightningStorm;
case "SpawnGirlPerDeadCrew":
return EventEnum.SpawnGirlPerDeadCrew;
case "FireSale":
return EventEnum.FireSale;
case "Add1Credit":
return EventEnum.Add1Credit;
case "Add700Credits":
return EventEnum.Add700Credits;
case "AddRandomCredits":
return EventEnum.AddRandomCredits;
case "LoseRandomCredits":
return EventEnum.LoseRandomCredits;
case "AddRerollTokens":
return EventEnum.AddRerollTokens;
case "AddRandomTokens":
return EventEnum.AddRandomTokens;
case "SpawnBoombox":
return EventEnum.SpawnBoombox;
case "SpawnDrugs":
return EventEnum.SpawnDrugs;
case "SpawnDrugsForAll":
return EventEnum.SpawnDrugsForAll;
case "RandomItemsDelivery":
return EventEnum.RandomItemsDelivery;
case "TakeRandomDamage":
return EventEnum.TakeRandomDamage;
case "SetToCriticalHP":
return EventEnum.SetToCriticalHP;
case "SetAllToCriticalHP":
return EventEnum.SetAllToCriticalHP;
case "HealSelf":
return EventEnum.HealSelf;
case "HealAll":
return EventEnum.HealAll;
case "InstantExplode":
return EventEnum.InstantExplode;
case "Oppenheimer":
return EventEnum.Oppenheimer;
case "SixMinutesToLive":
return EventEnum.SixMinutesToLive;
case "Bounty":
return EventEnum.Bounty;
case "BroadcastAllWords":
return EventEnum.BroadcastAllWords;
case "SpawnAirhorn":
return EventEnum.SpawnAirhorn;
case "SpawnRandomScrap":
return EventEnum.SpawnRandomScrap;
case "SpawnMask":
return EventEnum.SpawnMask;
case "SpawnGun":
return EventEnum.SpawnGun;
case "SpawnAmmo":
return EventEnum.SpawnAmmo;
case "SpawnGoldBar":
return EventEnum.SpawnGoldBar;
default:
manualLog.LogWarning((object)("Could not parse string to an event, got: " + input));
return EventEnum.None;
}
}
public static GameObject SpawnPropObject(int index, Vector3 p)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(RoundManager.Instance.spawnableMapObjects[index].prefabToSpawn, p, Quaternion.identity, StartOfRound.Instance.propsContainer);
NetworkObject component = val.GetComponent<NetworkObject>();
if ((Object)(object)component != (Object)null)
{
component.Spawn(true);
}
return val;
}
private static GameObject SpawnItemByItemName(string itemName, Vector3 p)
{
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
Item val = null;
foreach (Item items in StartOfRound.Instance.allItemsList.itemsList)
{
if (items.itemName.Equals(itemName))
{
val = items;
break;
}
}
if (!Object.op_Implicit((Object)(object)val))
{
manualLog.LogError((object)("Could not spawn item with itemName: " + itemName));
return null;
}
GameObject val2 = Object.Instantiate<GameObject>(val.spawnPrefab, p, Quaternion.identity, StartOfRound.Instance.propsContainer);
val2.GetComponent<GrabbableObject>().fallTime = 0f;
int scrapValue = (int)((float)Random.Range(val2.GetComponent<GrabbableObject>().itemProperties.minValue + 25, val2.GetComponent<GrabbableObject>().itemProperties.maxValue + 35) * RoundManager.Instance.scrapValueMultiplier);
val2.GetComponent<GrabbableObject>().SetScrapValue(scrapValue);
val2.GetComponent<NetworkObject>().Spawn(false);
return val2;
}
private static GameObject GetEnemyPrefabByAI(Type AIType)
{
SelectableLevel currentLevel = RoundManager.Instance.currentLevel;
foreach (SpawnableEnemyWithRarity enemy in currentLevel.Enemies)
{
if (Object.op_Implicit((Object)(object)enemy.enemyType.enemyPrefab.GetComponent(AIType)))
{
return enemy.enemyType.enemyPrefab;
}
}
foreach (SpawnableEnemyWithRarity outsideEnemy in currentLevel.OutsideEnemies)
{
if (Object.op_Implicit((Object)(object)outsideEnemy.enemyType.enemyPrefab.GetComponent(AIType)))
{
return outsideEnemy.enemyType.enemyPrefab;
}
}
foreach (SpawnableEnemyWithRarity daytimeEnemy in currentLevel.DaytimeEnemies)
{
if (Object.op_Implicit((Object)(object)daytimeEnemy.enemyType.enemyPrefab.GetComponent(AIType)))
{
return daytimeEnemy.enemyType.enemyPrefab;
}
}
manualLog.LogInfo((object)"Tried to spawn an enemy that was not included for this level. Attempting to add enemy to level...");
SelectableLevel[] levels = StartOfRound.Instance.levels;
SelectableLevel[] array = levels;
foreach (SelectableLevel val in array)
{
foreach (SpawnableEnemyWithRarity enemy2 in val.Enemies)
{
if (Object.op_Implicit((Object)(object)enemy2.enemyType.enemyPrefab.GetComponent(AIType)))
{
return enemy2.enemyType.enemyPrefab;
}
}
}
manualLog.LogError((object)("Could not find a prefab in any level that uses AI: " + AIType));
return null;
}
private static EnemyAI SpawnEnemyInside(Type enemyAI, bool ForceInside = true)
{
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
GameObject enemyPrefabByAI = GetEnemyPrefabByAI(enemyAI);
if (!Object.op_Implicit((Object)(object)enemyPrefabByAI))
{
manualLog.LogError((object)"Error when spawning enemy.");
return null;
}
int num = Random.Range(0, RoundManager.Instance.allEnemyVents.Length);
Vector3 position = RoundManager.Instance.allEnemyVents[num].floorNode.position;
Quaternion val = Quaternion.Euler(0f, RoundManager.Instance.allEnemyVents[num].floorNode.eulerAngles.y, 0f);
GameObject val2 = Object.Instantiate<GameObject>(enemyPrefabByAI, position, val);
val2.GetComponentInChildren<NetworkObject>().Spawn(true);
EnemyAI component = val2.GetComponent<EnemyAI>();
if (ForceInside)
{
component.enemyType.isOutsideEnemy = false;
component.allAINodes = GameObject.FindGameObjectsWithTag("AINode");
component.SyncPositionToClients();
}
RoundManager.Instance.SpawnedEnemies.Add(component);
return component;
}
private static EnemyAI SpawnEnemyOutside(Type enemyAI, bool ForceOutside = true)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
GameObject enemyPrefabByAI = GetEnemyPrefabByAI(enemyAI);
if (!Object.op_Implicit((Object)(object)enemyPrefabByAI))
{
manualLog.LogError((object)"Error when spawning enemy.");
return null;
}
GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode");
int num = Random.Range(0, array.Length);
Vector3 position = RoundManager.Instance.outsideAINodes[num].transform.position;
Quaternion identity = Quaternion.identity;
GameObject val = Object.Instantiate<GameObject>(enemyPrefabByAI, position, identity);
val.GetComponentInChildren<NetworkObject>().Spawn(true);
EnemyAI component = val.GetComponent<EnemyAI>();
if (ForceOutside)
{
component.enemyType.isOutsideEnemy = true;
component.allAINodes = array;
component.SyncPositionToClients();
}
RoundManager.Instance.SpawnedEnemies.Add(component);
return component;
}
private static EnemyAI SpawnEnemyOnPlayer(Type enemyAI, PlayerControllerB player)
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
GameObject enemyPrefabByAI = GetEnemyPrefabByAI(enemyAI);
if (!Object.op_Implicit((Object)(object)enemyPrefabByAI))
{
manualLog.LogError((object)"Error when spawning enemy.");
return null;
}
Vector3 position = ((Component)player).transform.position;
Quaternion val = Quaternion.Euler(0f, ((Component)player).transform.eulerAngles.y, 0f);
GameObject val2 = Object.Instantiate<GameObject>(enemyPrefabByAI, position, val);
val2.GetComponentInChildren<NetworkObject>().Spawn(true);
EnemyAI component = val2.GetComponent<EnemyAI>();
if (player.isInsideFactory)
{
component.enemyType.isOutsideEnemy = !player.isInsideFactory;
component.allAINodes = GameObject.FindGameObjectsWithTag("AINode");
component.SyncPositionToClients();
}
RoundManager.Instance.SpawnedEnemies.Add(component);
return component;
}
private static PlayerControllerB GetPlayerBySteamID(ulong steamId)
{
PlayerControllerB[] realPlayerScripts = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val in realPlayerScripts)
{
if (val.playerSteamId == steamId)
{
return val;
}
}
manualLog.LogInfo((object)("Could not find player with steamId: " + steamId));
return null;
}
private static string PerformEvent(EventEnum eventEnum, PlayerControllerB player)
{
//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0a52: Unknown result type (might be due to invalid IL or missing references)
//IL_0cd4: Unknown result type (might be due to invalid IL or missing references)
//IL_0d69: Unknown result type (might be due to invalid IL or missing references)
//IL_0d85: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8a: Unknown result type (might be due to invalid IL or missing references)
//IL_0fc1: Unknown result type (might be due to invalid IL or missing references)
//IL_119b: Unknown result type (might be due to invalid IL or missing references)
//IL_11bd: Unknown result type (might be due to invalid IL or missing references)
//IL_11df: Unknown result type (might be due to invalid IL or missing references)
//IL_1273: Unknown result type (might be due to invalid IL or missing references)
//IL_0b45: Unknown result type (might be due to invalid IL or missing references)
//IL_123a: Unknown result type (might be due to invalid IL or missing references)
//IL_123f: Unknown result type (might be due to invalid IL or missing references)
//IL_1241: Unknown result type (might be due to invalid IL or missing references)
//IL_0a9f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d2d: Unknown result type (might be due to invalid IL or missing references)
//IL_0dbf: Unknown result type (might be due to invalid IL or missing references)
//IL_0dca: Unknown result type (might be due to invalid IL or missing references)
//IL_0dcf: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd4: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd6: Unknown result type (might be due to invalid IL or missing references)
//IL_0ddd: Unknown result type (might be due to invalid IL or missing references)
//IL_0de2: Unknown result type (might be due to invalid IL or missing references)
//IL_0e10: Unknown result type (might be due to invalid IL or missing references)
//IL_0bdc: Unknown result type (might be due to invalid IL or missing references)
//IL_0f23: Unknown result type (might be due to invalid IL or missing references)
//IL_0f37: Unknown result type (might be due to invalid IL or missing references)
//IL_0f3c: Unknown result type (might be due to invalid IL or missing references)
//IL_0f41: Unknown result type (might be due to invalid IL or missing references)
//IL_0c94: Unknown result type (might be due to invalid IL or missing references)
if (!rtdBalances.TryGetValue(player.playerSteamId, out var _))
{
rtdBalances.Add(player.playerSteamId, 0);
}
switch (eventEnum)
{
case EventEnum.None:
return "<color=purple>Nothing.</color>";
case EventEnum.FixBurstValves:
{
SteamValveHazard[] array4 = Object.FindObjectsOfType<SteamValveHazard>();
SteamValveHazard[] array5 = array4;
foreach (SteamValveHazard val10 in array5)
{
val10.FixValveServerRpc();
}
return "<color=blue>Fixed all broken steam valves!</color>";
}
case EventEnum.SpawnRandomEnemy:
{
Dictionary<Type, SpawnLocation> dictionary = new Dictionary<Type, SpawnLocation>();
dictionary.Add(typeof(ForestGiantAI), SpawnLocation.Outside);
dictionary.Add(typeof(MouthDogAI), SpawnLocation.Outside);
dictionary.Add(typeof(RedLocustBees), SpawnLocation.Both);
dictionary.Add(typeof(SandWormAI), SpawnLocation.Outside);
dictionary.Add(typeof(SandSpiderAI), SpawnLocation.Both);
dictionary.Add(typeof(SpringManAI), SpawnLocation.Both);
dictionary.Add(typeof(PufferAI), SpawnLocation.Both);
dictionary.Add(typeof(NutcrackerEnemyAI), SpawnLocation.Both);
dictionary.Add(typeof(JesterAI), SpawnLocation.Both);
dictionary.Add(typeof(DressGirlAI), SpawnLocation.Both);
dictionary.Add(typeof(FlowermanAI), SpawnLocation.Both);
dictionary.Add(typeof(BlobAI), SpawnLocation.Both);
dictionary.Add(typeof(CentipedeAI), SpawnLocation.Inside);
dictionary.Add(typeof(CrawlerAI), SpawnLocation.Both);
dictionary.Add(typeof(MaskedPlayerEnemy), SpawnLocation.Both);
int index = Random.Range(0, dictionary.Keys.Count);
Type type = dictionary.Keys.ElementAt(index);
SpawnLocation spawnLocation = dictionary[type];
string text = "";
switch (spawnLocation)
{
case SpawnLocation.Outside:
text = "outside!";
SpawnEnemyOutside(type);
break;
case SpawnLocation.Inside:
text = "inside!";
SpawnEnemyInside(type);
break;
default:
if (Random.Range(0, 100) > 50)
{
text = "inside!";
SpawnEnemyInside(type);
}
else
{
text = "outside!";
SpawnEnemyOutside(type);
}
break;
}
return "A <color=red>random enemy</color> has been spawned " + text;
}
case EventEnum.SpawnHighThreatEnemy:
{
Dictionary<Type, SpawnLocation> dictionary = new Dictionary<Type, SpawnLocation>();
dictionary.Add(typeof(ForestGiantAI), SpawnLocation.Outside);
dictionary.Add(typeof(SandWormAI), SpawnLocation.Outside);
dictionary.Add(typeof(SpringManAI), SpawnLocation.Both);
dictionary.Add(typeof(NutcrackerEnemyAI), SpawnLocation.Both);
dictionary.Add(typeof(JesterAI), SpawnLocation.Both);
dictionary.Add(typeof(DressGirlAI), SpawnLocation.Both);
dictionary.Add(typeof(FlowermanAI), SpawnLocation.Both);
int index = Random.Range(0, dictionary.Keys.Count);
Type type = dictionary.Keys.ElementAt(index);
SpawnLocation spawnLocation = dictionary[type];
string text = "";
switch (spawnLocation)
{
case SpawnLocation.Outside:
text = "outside!";
SpawnEnemyOutside(type);
break;
case SpawnLocation.Inside:
text = "inside!";
SpawnEnemyInside(type);
break;
default:
if (Random.Range(0, 2) == 1)
{
text = "inside!";
SpawnEnemyInside(type);
}
else
{
text = "outside!";
SpawnEnemyOutside(type);
}
break;
}
return "A <color=red>HIGH-THREAT</color> enemy has been spawned " + text;
}
case EventEnum.SpawnLowThreatEnemy:
{
Dictionary<Type, SpawnLocation> dictionary = new Dictionary<Type, SpawnLocation>();
dictionary.Add(typeof(RedLocustBees), SpawnLocation.Both);
dictionary.Add(typeof(PufferAI), SpawnLocation.Both);
dictionary.Add(typeof(BlobAI), SpawnLocation.Both);
dictionary.Add(typeof(CentipedeAI), SpawnLocation.Inside);
dictionary.Add(typeof(MaskedPlayerEnemy), SpawnLocation.Both);
int index = Random.Range(0, dictionary.Keys.Count);
Type type = dictionary.Keys.ElementAt(index);
SpawnLocation spawnLocation = dictionary[type];
string text = "";
switch (spawnLocation)
{
case SpawnLocation.Outside:
text = "outside!";
SpawnEnemyOutside(type);
break;
case SpawnLocation.Inside:
text = "inside!";
SpawnEnemyInside(type);
break;
default:
if (Random.Range(0, 2) == 1)
{
text = "inside!";
SpawnEnemyInside(type);
}
else
{
text = "outside!";
SpawnEnemyOutside(type);
}
break;
}
return "A <color=blue>low-threat</color> enemy has been spawned " + text;
}
case EventEnum.SpawnHoarders:
{
int num11 = Random.Range(4, 15);
for (int num12 = 0; num12 < num11; num12++)
{
SpawnEnemyInside(typeof(HoarderBugAI));
}
return "<color=yellow>A hoard of hoarders!</color>";
}
case EventEnum.SpawnBrackens:
{
int num9 = Random.Range(4, 8);
for (int num10 = 0; num10 < num9; num10++)
{
EnemyAI val8 = SpawnEnemyInside(typeof(FlowermanAI));
}
return "<color=red>BIG <size=150%>♂ <size=100%>HOT <size=150%>♂ <size=100%>BRACKENS</color>";
}
case EventEnum.SpawnMimic:
SpawnEnemyInside(typeof(MaskedPlayerEnemy));
return "A <color=red>masked man</color> has appeared...";
case EventEnum.SpawnHyperJester:
jestersAreHyper = true;
SpawnEnemyInside(typeof(JesterAI));
return "A <color=red>VERY DANGEROUS</color> Jester has spawned...";
case EventEnum.SpawnHyperThumper:
thumpersAreHyper = true;
SpawnEnemyInside(typeof(CrawlerAI));
return "A <color=red>COKED-OUT</color> Thumper has spawned...";
case EventEnum.LandmineTrail:
playersLandmineTrailed.Add(player.playerSteamId, 8f);
return "<color=yellow>A trail of landmines!</color>";
case EventEnum.KillAllMobs:
{
EnemyAI[] array6 = Object.FindObjectsOfType<EnemyAI>();
EnemyAI[] array7 = array6;
foreach (EnemyAI val12 in array7)
{
val12.HitEnemyServerRpc(10000, 0, true, -1);
val12.KillEnemyServerRpc(true);
}
return "<color=green>The facility has been cleared of monsters!</color>";
}
case EventEnum.KillRandomMob:
{
EnemyAI val11 = RoundManager.Instance.SpawnedEnemies[Random.Range(0, RoundManager.Instance.SpawnedEnemies.Count)];
manualLog.LogInfo((object)("Randomly killed: " + val11.enemyType.enemyName));
val11.HitEnemyServerRpc(10000, 0, true, -1);
val11.KillEnemyServerRpc(true);
return "<color=green>A random monster has been killed!</color>";
}
case EventEnum.EMP:
{
Turret[] array2 = Object.FindObjectsOfType<Turret>();
if (array2.Length != 0)
{
Turret[] array3 = array2;
foreach (Turret val9 in array3)
{
val9.ToggleTurretServerRpc(false);
}
}
RoundManager.Instance.SwitchPower(false);
RoundManager.Instance.powerOffPermanently = true;
return "<color=blue>Power failure!</color>";
}
case EventEnum.LightningStorm:
staticStormEnabled = true;
return "<color=yellow>Static Storm!</color>";
case EventEnum.SpawnGirlPerDeadCrew:
{
PlayerControllerB[] realPlayerScripts3 = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val7 in realPlayerScripts3)
{
if (val7.isPlayerDead)
{
SpawnEnemyInside(typeof(DressGirlAI));
}
}
return "<color=red>An unholy ritual has been performed!</color>";
}
case EventEnum.FireSale:
{
Terminal val6 = Object.FindObjectOfType<Terminal>();
previousTerminalPercents = (int[])val6.itemSalesPercentages.Clone();
for (int m = 0; m < val6.buyableItemsList.Length; m++)
{
val6.itemSalesPercentages[m] = 50;
}
fireSale = true;
return "<color=green>FIRE SALE! Items are half off!</color>";
}
case EventEnum.Add1Credit:
{
Terminal val3 = Object.FindObjectOfType<Terminal>();
val3.SyncGroupCreditsServerRpc(val3.groupCredits + 1, val3.numberOfItemsInDropship);
return player.playerUsername + " is <color=green>Employee Of The Day!</color> +1 credit!";
}
case EventEnum.Add700Credits:
{
Terminal val3 = Object.FindObjectOfType<Terminal>();
val3.SyncGroupCreditsServerRpc(val3.groupCredits + 700, val3.numberOfItemsInDropship);
return "<color=green>700 CREDIT JACKPOT!!! KEEP!!! GAMBLING!!!</color>";
}
case EventEnum.AddRandomCredits:
{
Terminal val3 = Object.FindObjectOfType<Terminal>();
int num7 = Random.Range(2, 25);
val3.SyncGroupCreditsServerRpc(val3.groupCredits + num7, val3.numberOfItemsInDropship);
return "<color=green>Small win at the slots! Keep gambling!! (+" + num7 + " creds)</color>";
}
case EventEnum.LoseRandomCredits:
{
Terminal val3 = Object.FindObjectOfType<Terminal>();
int num5 = Math.Max(val3.groupCredits - Random.Range(10, 45), 0);
int num6 = Math.Abs(num5 - val3.groupCredits);
val3.SyncGroupCreditsServerRpc(num6, val3.numberOfItemsInDropship);
return "<color=red>90% of gamblers quit right before they hit it big! KEEP! GAMBLING! (-" + num6 + " creds)</color>";
}
case EventEnum.AddRerollTokens:
rtdBalances[player.playerSteamId] = rtdBalances[player.playerSteamId] + tokensToRoll;
playersWhoRolled[player.playerSteamId] = playersWhoRolled[player.playerSteamId] - 1;
return "<color=blue>Reroll! Refunded tokens.</color>";
case EventEnum.AddRandomTokens:
{
int num4 = Random.Range(tokensToRoll, tokensToRoll + 3);
rtdBalances[player.playerSteamId] = rtdBalances[player.playerSteamId] + num4;
return "<color=blue>Extra RTD tokens! (+" + num4 + ")</color>";
}
case EventEnum.SpawnBoombox:
{
GameObject val2 = SpawnItemByItemName("Boombox", ((Component)player).transform.position);
if ((Object)(object)val2 != (Object)null)
{
BoomboxItem componentInChildren = val2.GetComponentInChildren<BoomboxItem>();
boomboxToEnable = componentInChildren;
}
return "<color=yellow>I can hear the music!</color>";
}
case EventEnum.SpawnDrugs:
SpawnItemByItemName("TZP-Inhalant", ((Component)player).transform.position);
return "<color=blue>Fentanyl!</color>";
case EventEnum.SpawnDrugsForAll:
{
PlayerControllerB[] realPlayerScripts4 = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val13 in realPlayerScripts4)
{
if (!val13.isPlayerDead)
{
SpawnItemByItemName("TZP-Inhalant", ((Component)val13).transform.position);
}
}
return "<color=blue>Fent-for-all!</color>";
}
case EventEnum.RandomItemsDelivery:
{
int num16 = Random.Range(2, 9);
for (int num17 = 0; num17 < num16; num17++)
{
int item = Random.Range(0, 12);
Object.FindObjectOfType<Terminal>().orderedItemsFromTerminal.Add(item);
}
return "A delivery of <color=green>random items</color>!";
}
case EventEnum.TakeRandomDamage:
{
int num14 = Random.Range(5, 100);
if ((Object)(object)player == (Object)(object)hostController)
{
num14 /= 2;
}
player.DamagePlayerFromOtherClientServerRpc(num14, new Vector3(1f, 1f, 1f), 0);
manualLog.LogInfo((object)("Random Damage applied: " + num14));
return "<color=red>OUCH!</color> Took random damage (" + num14 + ")";
}
case EventEnum.SetToCriticalHP:
{
int num8 = ((player.health > 5) ? (player.health - 5) : 0);
if ((Object)(object)player == (Object)(object)hostController)
{
num8 /= 2;
}
if (player.criticallyInjured)
{
num8 = 0;
}
player.DamagePlayerFromOtherClientServerRpc(num8, new Vector3(1f, 1f, 1f), 0);
manualLog.LogInfo((object)("Random Damage applied: " + num8));
return "<color=red>Tummyache! Critical HP!</color>";
}
case EventEnum.SetAllToCriticalHP:
{
PlayerControllerB[] realPlayerScripts2 = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val5 in realPlayerScripts2)
{
if (!val5.isPlayerDead)
{
int num8 = ((val5.health > 5) ? (val5.health - 5) : 0);
if ((Object)(object)val5 == (Object)(object)hostController)
{
num8 /= 2;
}
if (val5.criticallyInjured)
{
num8 = 0;
}
val5.DamagePlayerFromOtherClientServerRpc(num8, new Vector3(1f, 1f, 1f), 0);
}
}
return "<color=red>5G Waves sweep over the planet! Everyone to Critical HP!</color>";
}
case EventEnum.HealSelf:
{
int num8 = -100;
player.DamagePlayerFromOtherClientServerRpc(num8, new Vector3(1f, 1f, 1f), 0);
return "<color=green>Healed to full HP!</color>";
}
case EventEnum.HealAll:
{
PlayerControllerB[] realPlayerScripts = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val4 in realPlayerScripts)
{
if (!val4.isPlayerDead)
{
int num8 = -100;
val4.DamagePlayerFromOtherClientServerRpc(num8, new Vector3(1f, 1f, 1f), 0);
}
}
return "<color=green>Everyone healed to full HP!</color>";
}
case EventEnum.InstantExplode:
player.DamagePlayerFromOtherClientServerRpc(9999, new Vector3(1f, 1f, 1f), 0);
return "<color=red>256TB of anime reaction images were uploaded directly to their brain!</color>";
case EventEnum.Oppenheimer:
{
int num2 = 60;
Vector3 forward = Vector3.forward;
float num3 = 5f;
if (oppenMinesToExplode == null)
{
oppenMinesToExplode = new List<GameObject>();
}
for (int j = 0; j < 7; j++)
{
oppenMinesToExplode.Add(SpawnPropObject(0, ((Component)player).transform.position + Quaternion.AngleAxis((float)(num2 * j), Vector3.up) * forward * num3));
}
oppenMinesToExplode.Add(SpawnPropObject(0, ((Component)player).transform.position));
return "<color=red>Oppenheimer</color>";
}
case EventEnum.SixMinutesToLive:
playersWithSixMins.Add(player.playerSteamId, 360f);
return "<color=red>You only have <i>mere minutes</i> to live!</color>";
case EventEnum.Bounty:
{
int value2 = Random.Range(50, 100);
playersWithBounty.Add(player.playerSteamId, value2);
return "<color=white>Your life is as valuable as a summer ant! Your crew gets " + value2 + " credits if you kill yourself, <color=red><size=11>NOW!</color>";
}
case EventEnum.BroadcastAllWords:
playersWithBroadcaster.Add(player.playerSteamId);
if ((Object)(object)Object.FindObjectOfType<SignalTranslator>() == (Object)null)
{
manualLog.LogInfo((object)"No translator found, getting new");
foreach (UnlockableItem unlockable in StartOfRound.Instance.unlockablesList.unlockables)
{
if (unlockable.unlockableName.ToLower().Equals("signal translator"))
{
manualLog.LogInfo((object)"got translator prefab");
tempTranslator = Object.Instantiate<GameObject>(unlockable.prefabObject, StartOfRound.Instance.elevatorTransform.position + new Vector3(0f, -999f, 0f), Quaternion.identity, (Transform)null);
tempTranslator.GetComponent<NetworkObject>().Spawn(true);
}
}
}
manualLog.LogInfo((object)("Added player to broadcaster list. Length now: " + playersWithBroadcaster.Count));
return "<color=white>Pocket broadcaster. All words you type are signal translated.</color>";
case EventEnum.SpawnAirhorn:
SpawnItemByItemName("Airhorn", ((Component)player).transform.position);
return "<color=blue>Got an airhorn!</color>";
case EventEnum.SpawnRandomScrap:
{
string[] array = new string[48]
{
"Whoopie cushion", "Comedy", "Tragedy", "Gift", "Flask", "Homemade flashbang", "Yield sign", "Toy cube", "Toothpaste", "Tea kettle",
"Stop sign", "Steering wheel", "Red soda", "Rubber Ducky", "Toy robot", "Ring", "Remote", "Pill bottle", "Jar of pickles", "Old phone",
"Perfume bottle", "Mug", "Cookie mold pan", "Metal sheet", "Magnifying glass", "Hairdryer", "Gold bar", "Laser pointer", "Plastic fish", "Painting",
"Fancy lamp", "Golden cup", "V-type engine", "Egg beater", "Dust pan", "Teeth", "Large axle", "Clown horn", "Chemical jug", "Cash register",
"Candy", "Brush", "Bottles", "Big bolt", "Bell", "Airhorn", "Magic 7 ball", "Apparatus"
};
SpawnItemByItemName(array[Random.Range(0, array.Length)], ((Component)player).transform.position);
return "<color=green>Received random scrap piece!</color>";
}
case EventEnum.SpawnMask:
SpawnItemByItemName("Tragedy", ((Component)player).transform.position);
return "<color=blue>Received a mask!</color>";
case EventEnum.SpawnGun:
SpawnItemByItemName("Shotgun", ((Component)player).transform.position);
return "<color=green>A fucking gun!</color>";
case EventEnum.SpawnAmmo:
{
int num = Random.Range(2, 4);
Vector3 val = default(Vector3);
for (int i = 0; i < num; i++)
{
((Vector3)(ref val))..ctor(Random.Range(-0.5f, 0.5f), 0f, Random.Range(-0.5f, 0.5f));
SpawnItemByItemName("Ammo", ((Component)player).transform.position + val);
}
return "<color=green>A handful of 12/70 6.5mm Express rounds!</color>";
}
case EventEnum.SpawnGoldBar:
SpawnItemByItemName("Gold bar", ((Component)player).transform.position);
return "<color=green>WE'RE RICH.</color>";
default:
manualLog.LogError((object)("Got bad EventEnum when performing an event. Was: " + eventEnum));
return "";
}
}
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
manualLog = Logger.CreateLogSource("Mechanicus.LCRollTheDice");
manualLog.LogInfo((object)"Mod awake");
configController = new ConfigurationController(((BaseUnityPlugin)this).Config);
rollCommand = configController.RollCommand;
helpCommand = configController.HelpCommand;
balanceCommand = configController.BalanceCommand;
forceEventCommand = configController.ForceEventCommand;
tokensEnabled = configController.TokensEnabled;
tokensForSurvival = configController.SurvivalTokens;
tokensForSurvivingCompany = configController.CompanySurvivalTokens;
tokensForDeath = configController.DeathTokens;
tokensToRoll = configController.RollCost;
rollsPerRound = configController.RollsPerRound;
clearTokensOnNewSave = configController.ClearTokensOnNewSave;
SetUpEventWeights();
harmony.PatchAll(typeof(RollTheDiceBase));
}
private void Update()
{
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)StartOfRound.Instance == (Object)null || !StartOfRound.Instance.shipHasLanded || AtCompany)
{
return;
}
Dictionary<ulong, float> dictionary = playersLandmineTrailed.ToDictionary((KeyValuePair<ulong, float> entry) => entry.Key, (KeyValuePair<ulong, float> entry) => entry.Value);
foreach (KeyValuePair<ulong, float> item2 in playersLandmineTrailed)
{
PlayerControllerB playerBySteamID = GetPlayerBySteamID(item2.Key);
if ((Object)(object)playerBySteamID == (Object)null || playerBySteamID.isPlayerDead)
{
playersLandmineTrailed.Remove(item2.Key);
continue;
}
float num = item2.Value - Time.deltaTime;
if (num < 0f)
{
GameObject item = SpawnPropObject(0, ((Component)playerBySteamID).transform.position + ((Component)playerBySteamID).transform.forward * -2f);
landmineTrailMines.Add(item);
playersLandmineTrailed[item2.Key] = 8f;
}
else
{
playersLandmineTrailed[item2.Key] = num;
}
}
dictionary = playersWithSixMins.ToDictionary((KeyValuePair<ulong, float> entry) => entry.Key, (KeyValuePair<ulong, float> entry) => entry.Value);
foreach (KeyValuePair<ulong, float> item3 in dictionary)
{
PlayerControllerB playerBySteamID2 = GetPlayerBySteamID(item3.Key);
if ((Object)(object)playerBySteamID2 == (Object)null || playerBySteamID2.isPlayerDead)
{
manualLog.LogInfo((object)"Removing player from SixMin list...");
playersWithSixMins.Remove(item3.Key);
continue;
}
float num2 = item3.Value - Time.deltaTime;
if (num2 <= 0f)
{
playerBySteamID2.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 1);
}
playersWithSixMins[item3.Key] = num2;
}
if (oppenMinesToExplode == null || oppenMinesToExplode.Count <= 0)
{
return;
}
List<GameObject> list = oppenMinesToExplode.ToList();
foreach (GameObject item4 in list)
{
Landmine componentInChildren = item4.GetComponentInChildren<Landmine>();
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.ExplodeMineServerRpc();
manualLog.LogInfo((object)"EXPLODED A MINE!");
oppenMinesToExplode.Remove(item4);
}
}
}
[HarmonyPatch(typeof(RoundManager), "Start")]
[HarmonyPostfix]
private static void InitializeHost()
{
manualLog.LogInfo((object)("Host Status: " + ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost));
isHost = ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;
hostController = RoundManager.Instance.playersManager.allPlayerScripts[0];
playersWhoRolled = new Dictionary<ulong, int>();
feedbackDuplicates = new List<int>();
rtdBalances = new Dictionary<ulong, int>();
playersLandmineTrailed = new Dictionary<ulong, float>();
playersWithSixMins = new Dictionary<ulong, float>();
playersWithBounty = new Dictionary<ulong, int>();
playersWithBroadcaster = new List<ulong>();
}
[HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageServerRpc")]
[HarmonyPostfix]
private static void RTDChatCommand(HUDManager __instance, string chatMessage, int playerId)
{
if (!isHost || playerId == 99)
{
return;
}
if (!feedbackDuplicates.Contains(playerId) && playerId == 0)
{
feedbackDuplicates.Add(playerId);
return;
}
feedbackDuplicates.Remove(playerId);
manualLog.LogInfo((object)(playerId + " chatted " + chatMessage));
PlayerControllerB val = __instance.playersManager.allPlayerScripts[playerId];
string playerUsername = val.playerUsername;
manualLog.LogInfo((object)("That ID corresponded to: " + playerUsername));
bool isPlayerDead = val.isPlayerDead;
if (!rtdBalances.TryGetValue(val.playerSteamId, out var value))
{
manualLog.LogInfo((object)(playerUsername + " didn't have an initialized balance. Returning 0..."));
value = 0;
}
if (playersWithBroadcaster.Contains(val.playerSteamId) && !val.isPlayerDead)
{
HUDManager.Instance.UseSignalTranslatorServerRpc(chatMessage);
}
if (chatMessage.ToLower().Equals(rollCommand))
{
if (!StartOfRound.Instance.shipHasLanded)
{
manualLog.LogInfo((object)(playerUsername + " tried to roll the dice, but the ship hasn't landed."));
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Cannot roll dice until ship has landed.", -1);
return;
}
if (AtCompany)
{
manualLog.LogInfo((object)(playerUsername + " tried to roll the dice, but the ship was at the company."));
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Cannot roll dice at the Company.", -1);
return;
}
int value2 = 0;
bool flag = playersWhoRolled.TryGetValue(val.playerSteamId, out value2);
if (value2 >= rollsPerRound)
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Failed. " + playerUsername + " already rolled the dice this round.", -1);
}
else if (isPlayerDead)
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Failed. " + playerUsername + " is dead.", -1);
}
else if (value < tokensToRoll && tokensEnabled)
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Failed. " + playerUsername + " did not have enough credits (<color=green>" + value + "</color>).", -1);
}
else
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> " + playerUsername + " rolled the dice!", -1);
if (flag)
{
playersWhoRolled[val.playerSteamId] = value2 + 1;
}
else
{
playersWhoRolled.Add(val.playerSteamId, 1);
}
rtdBalances[val.playerSteamId] = value - tokensToRoll * (tokensEnabled ? 1 : 0);
RollDiceForPlayer(val);
}
}
else if (chatMessage.ToLower().Equals(balanceCommand) && tokensEnabled)
{
manualLog.LogInfo((object)(playerUsername + " requested their balance: " + value));
__instance.AddTextToChatOnServer("<color=orange>Server:</color> <color=purple>" + playerUsername + "'s</color> balance is <color=green>" + value + "</color>. You need " + tokensToRoll + " to roll.", -1);
}
else if (chatMessage.ToLower().Equals(helpCommand))
{
if (tokensEnabled)
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Use \"<color=white>" + rollCommand + "</color>\" to roll the dice (costs <color=green>" + tokensToRoll + "</color> tokens, can roll <color=white>" + rollsPerRound + "</color> times per round). Tokens are awarded at the end of a round. Use \"<color=white>" + balanceCommand + "</color>\" to check your tokens.", -1);
}
else
{
__instance.AddTextToChatOnServer("<color=orange>Server:</color> Use \"<color=white>" + rollCommand + "</color>\" to roll the dice. Can roll <color=white>" + rollsPerRound + "</color> times per round.", -1);
}
}
else
{
if (!((Object)(object)val == (Object)(object)hostController) || !chatMessage.ToLower().StartsWith(forceEventCommand))
{
return;
}
string[] array = chatMessage.Split(new char[1] { ' ' });
if (array.Length != 3)
{
__instance.AddTextToChatOnServer("<color=orange>Malformed command.</color>", -1);
return;
}
EventEnum eventEnum = ParseStringToEvent(array[1]);
PlayerControllerB val2 = null;
PlayerControllerB[] realPlayerScripts = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val3 in realPlayerScripts)
{
if (val3.playerUsername.Equals(array[2]))
{
val2 = val3;
}
}
if ((Object)(object)val2 == (Object)null)
{
manualLog.LogWarning((object)("Could not find a player with that username! Got: " + array[2]));
return;
}
if (eventEnum == EventEnum.None)
{
manualLog.LogWarning((object)"Got no event.");
return;
}
string text = PerformEvent(eventEnum, val2);
__instance.AddTextToChatOnServer("<color=orange>Host Forced Event On " + array[2] + ":</color> " + text, -1);
}
}
private static void RollDiceForPlayer(PlayerControllerB player)
{
int index = Random.Range(0, EventSelectionList.Count);
EventEnum eventEnum = EventSelectionList[index];
manualLog.LogInfo((object)("Rolled: " + index));
string text = PerformEvent(eventEnum, player);
HUDManager.Instance.AddTextToChatOnServer(player.playerUsername + " got: <color=green>(" + index + ")</color> " + text, -1);
}
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
[HarmonyPostfix]
private static void OnRoundStarted(ref SelectableLevel newLevel)
{
if (!isHost)
{
return;
}
StartOfRound instance = StartOfRound.Instance;
string planetName = instance.levels[instance.currentLevelID].PlanetName;
if (planetName == "71 Gordion")
{
AtCompany = true;
}
else
{
AtCompany = false;
}
manualLog.LogInfo((object)("Starting round on: " + planetName));
manualLog.LogInfo((object)"Clearing list of players who rolled.");
playersWhoRolled.Clear();
manualLog.LogInfo((object)"Clearing EventVars...");
ResetEventVars();
manualLog.LogInfo((object)"Setting up balances for uninitialized players.");
PlayerControllerB[] realPlayerScripts = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val in realPlayerScripts)
{
if (!rtdBalances.ContainsKey(val.playerSteamId))
{
rtdBalances.Add(val.playerSteamId, 0);
manualLog.LogInfo((object)(val.playerUsername + "'s balance was initialized."));
}
}
HUDManager.Instance.AddTextToChatOnServer("<color=orange>Server:</color> This server is running Resheph's RTD plugin. Use \"<color=white>" + helpCommand + "</color>\" for more info.", -1);
}
public static PlayerControllerB[] GetRealPlayerScripts(StartOfRound startOfRound)
{
if (!((Object)(object)startOfRound == (Object)null) && startOfRound.allPlayerScripts != null)
{
return startOfRound.allPlayerScripts.Where((PlayerControllerB x) => x.isPlayerDead || x.isPlayerControlled).ToArray();
}
return (PlayerControllerB[])(object)new PlayerControllerB[0];
}
private static void ResetEventVars()
{
playersLandmineTrailed.Clear();
playersWithBounty.Clear();
playersWithBroadcaster.Clear();
playersWithSixMins.Clear();
jestersAreHyper = false;
thumpersAreHyper = false;
staticStormEnabled = false;
currLightningInterval = 0f;
if (fireSale)
{
fireSale = false;
Terminal val = Object.FindObjectOfType<Terminal>();
val.itemSalesPercentages = (int[])previousTerminalPercents.Clone();
}
if ((Object)(object)tempTranslator != (Object)null)
{
Object.Destroy((Object)(object)tempTranslator);
}
if (landmineTrailMines == null)
{
landmineTrailMines = new List<GameObject>();
}
foreach (GameObject landmineTrailMine in landmineTrailMines)
{
Object.Destroy((Object)(object)landmineTrailMine);
}
landmineTrailMines.Clear();
}
[HarmonyPatch(typeof(StartOfRound), "ReviveDeadPlayers")]
[HarmonyPrefix]
private static void OnRoundEnded()
{
if (!isHost)
{
return;
}
manualLog.LogInfo((object)"Adding tokens to players...");
PlayerControllerB[] realPlayerScripts = GetRealPlayerScripts(StartOfRound.Instance);
foreach (PlayerControllerB val in realPlayerScripts)
{
int value = 0;
playersWithBounty.TryGetValue(val.playerSteamId, out value);
if (value > 0)
{
HUDManager.Instance.AddTextToChatOnServer("<color=orange>Server:</color> Confirming the death of " + val.playerUsername + ", " + value + " credits recieved!", -1);
Terminal val2 = Object.FindObjectOfType<Terminal>();
val2.SyncGroupCreditsServerRpc(val2.groupCredits + value, val2.numberOfItemsInDropship);
}
if (tokensEnabled)
{
if (!rtdBalances.TryGetValue(val.playerSteamId, out var value2))
{
manualLog.LogInfo((object)(val.playerUsername + " was uninitialized when trying to add tokens, rectifying."));
rtdBalances.Add(val.playerSteamId, 0);
}
if (!val.isPlayerDead)
{
int value3 = value2 + (AtCompany ? tokensForSurvivingCompany : tokensForSurvival);
manualLog.LogInfo((object)(val.playerUsername + " survived and got " + tokensForSurvival + " tokens. Old balance: " + value2 + ". New Balance: " + value3));
rtdBalances[val.playerSteamId] = value3;
}
else
{
int value4 = value2 + tokensForDeath;
manualLog.LogInfo((object)(val.playerUsername + " died and got " + tokensForDeath + " tokens. Old balance: " + value2 + ". New Balance: " + value4));
rtdBalances[val.playerSteamId] = value4;
}
}
}
manualLog.LogInfo((object)"Resetting EventVars...");
ResetEventVars();
}
[HarmonyPatch(typeof(StartOfRound), "EndOfGame")]
[HarmonyPostfix]
private static void ShowtokensUpdate()
{
if (isHost && tokensEnabled)
{
HUDManager.Instance.AddTextToChatOnServer("<color=orange>Server:</color> RTD tokens have been updated --- <color=green>+" + tokensForSurvival + "</color> for surviving (<color=green>+" + tokensForSurvivingCompany + "</color> at Company), <color=green>+" + tokensForDeath + "</color> for dying.", -1);
}
}
[HarmonyPatch(typeof(JesterAI), "SetJesterInitialValues")]
[HarmonyPostfix]
private static void HyperJester(ref float ___popUpTimer, ref float ___beginCrankingTimer, ref float ___noPlayersToChaseTimer, ref float ___maxAnimSpeed)
{
if (jestersAreHyper && isHost)
{
___popUpTimer = 2f;
___beginCrankingTimer = 2f;
___noPlayersToChaseTimer = 5f;
___maxAnimSpeed = 20f;
jestersAreHyper = false;
}
}
[HarmonyPatch(typeof(CrawlerAI), "Start")]
[HarmonyPrefix]
private static void HyperThumper(ref float ___BaseAcceleration, ref float ___maxSearchAndRoamRadius, ref int ___enemyHP)
{
if (thumpersAreHyper && isHost)
{
___enemyHP = 6;
___maxSearchAndRoamRadius = 300f;
___BaseAcceleration = 100f;
thumpersAreHyper = false;
}
else
{
___enemyHP = 4;
___maxSearchAndRoamRadius = 100f;
___BaseAcceleration = 2f;
}
}
[HarmonyPatch(typeof(StartOfRound), "PlayFirstDayShipAnimation")]
[HarmonyPostfix]
private static void PointsChangeOnNewSave()
{
if (clearTokensOnNewSave)
{
rtdBalances.Clear();
}
}
}
internal class ConfigurationController
{
private ConfigEntry<string> RollCmdCfg;
private ConfigEntry<string> BalanceCmdCfg;
private ConfigEntry<string> HelpCmdCfg;
private ConfigEntry<string> ForceEventCmdCfg;
private ConfigEntry<bool> TokensEnabledCfg;
private ConfigEntry<int> SurvivalTokensCfg;
private ConfigEntry<int> CompanySurvivalTokensCfg;
private ConfigEntry<int> DeathTokensCfg;
private ConfigEntry<int> RollCostCfg;
private ConfigEntry<int> RollsPerRoundCfg;
private ConfigEntry<bool> ClearTokensOnNewSaveCfg;
internal ConfigEntry<int> NoneWeight;
internal ConfigEntry<int> SpawnRandomEnemyWeight;
internal ConfigEntry<int> SpawnHighThreatEnemyWeight;
internal ConfigEntry<int> SpawnLowThreatEnemyWeight;
internal ConfigEntry<int> SpawnHoardersWeight;
internal ConfigEntry<int> SpawnBrackensWeight;
internal ConfigEntry<int> SpawnMimicWeight;
internal ConfigEntry<int> SpawnHyperJesterWeight;
internal ConfigEntry<int> SpawnHyperThumperWeight;
internal ConfigEntry<int> LandmineTrailWeight;
internal ConfigEntry<int> KillAllMobsWeight;
internal ConfigEntry<int> KillRandomMobWeight;
internal ConfigEntry<int> EMPWeight;
internal ConfigEntry<int> FixBurstValvesWeight;
internal ConfigEntry<int> SpawnGirlPerDeadCrewWeight;
internal ConfigEntry<int> FireSaleWeight;
internal ConfigEntry<int> Add1CreditWeight;
internal ConfigEntry<int> Add700CreditsWeight;
internal ConfigEntry<int> AddRandomCreditsWeight;
internal ConfigEntry<int> LoseRandomCreditsWeight;
internal ConfigEntry<int> AddRerollTokensWeight;
internal ConfigEntry<int> AddRandomTokensWeight;
internal ConfigEntry<int> SpawnBoomboxWeight;
internal ConfigEntry<int> SpawnDrugsWeight;
internal ConfigEntry<int> SpawnDrugsForAllWeight;
internal ConfigEntry<int> RandomItemsDeliveryWeight;
internal ConfigEntry<int> TakeRandomDamageWeight;
internal ConfigEntry<int> SetToCriticalHPWeight;
internal ConfigEntry<int> SetAllToCriticalHPWeight;
internal ConfigEntry<int> HealSelfWeight;
internal ConfigEntry<int> HealAllWeight;
internal ConfigEntry<int> InstantExplodeWeight;
internal ConfigEntry<int> OppenheimerWeight;
internal ConfigEntry<int> SixMinutesToLiveWeight;
internal ConfigEntry<int> BountyWeight;
internal ConfigEntry<int> BroadcastAllWordsWeight;
internal ConfigEntry<int> SpawnAirhornWeight;
internal ConfigEntry<int> SpawnRandomScrapWeight;
internal ConfigEntry<int> SpawnMaskWeight;
internal ConfigEntry<int> SpawnGunWeight;
internal ConfigEntry<int> SpawnAmmoWeight;
internal ConfigEntry<int> SpawnGoldBarWeight;
internal string RollCommand
{
get
{
if (RollCmdCfg.Value == "")
{
return (string)((ConfigEntryBase)RollCmdCfg).DefaultValue;
}
return RollCmdCfg.Value;
}
set
{
RollCmdCfg.Value = value;
}
}
internal string BalanceCommand
{
get
{
if (BalanceCmdCfg.Value == "")
{
return (string)((ConfigEntryBase)BalanceCmdCfg).DefaultValue;
}
return BalanceCmdCfg.Value;
}
set
{
BalanceCmdCfg.Value = value;
}
}
internal string HelpCommand
{
get
{
if (HelpCmdCfg.Value == "")
{
return (string)((ConfigEntryBase)HelpCmdCfg).DefaultValue;
}
return HelpCmdCfg.Value;
}
set
{
HelpCmdCfg.Value = value;
}
}
internal string ForceEventCommand
{
get
{
if (ForceEventCmdCfg.Value == "")
{
return (string)((ConfigEntryBase)ForceEventCmdCfg).DefaultValue;
}
return ForceEventCmdCfg.Value;
}
set
{
ForceEventCmdCfg.Value = value;
}
}
internal int SurvivalTokens
{
get
{
if (SurvivalTokensCfg.Value < 0)
{
return (int)((ConfigEntryBase)SurvivalTokensCfg).DefaultValue;
}
return SurvivalTokensCfg.Value;
}
set
{
SurvivalTokensCfg.Value = value;
}
}
internal int DeathTokens
{
get
{
if (DeathTokensCfg.Value < 0)
{
return (int)((ConfigEntryBase)DeathTokensCfg).DefaultValue;
}
return DeathTokensCfg.Value;
}
set
{
DeathTokensCfg.Value = value;
}
}
internal int CompanySurvivalTokens
{
get
{
if (CompanySurvivalTokensCfg.Value < 0)
{
return (int)((ConfigEntryBase)CompanySurvivalTokensCfg).DefaultValue;
}
return CompanySurvivalTokensCfg.Value;
}
set
{
CompanySurvivalTokensCfg.Value = value;
}
}
internal int RollCost
{
get
{
if (RollCostCfg.Value < 0)
{
return (int)((ConfigEntryBase)RollCostCfg).DefaultValue;
}
return RollCostCfg.Value;
}
set
{
RollCostCfg.Value = value;
}
}
internal int RollsPerRound
{
get
{
if (RollsPerRoundCfg.Value < 0)
{
return (int)((ConfigEntryBase)RollsPerRoundCfg).DefaultValue;
}
return RollsPerRoundCfg.Value;
}
set
{
RollsPerRoundCfg.Value = value;
}
}
internal bool ClearTokensOnNewSave => ClearTokensOnNewSaveCfg.Value;
internal bool TokensEnabled => TokensEnabledCfg.Value;
public ConfigurationController(ConfigFile Config)
{
RollCmdCfg = Config.Bind<string>("Chat Commands", "Roll command", "/rtd", "Chat command to roll the dice.");
BalanceCmdCfg = Config.Bind<string>("Chat Commands", "Balance command", "/balance", "Chat command for players to see their balance.");
HelpCmdCfg = Config.Bind<string>("Chat Commands", "Help command", "/help", "Chat command for players to view info about the plugin.");
ForceEventCmdCfg = Config.Bind<string>("Chat Commands", "Force Event command", "/forceevent", "Chat command for the Host to force an event. Utilization is [command] [eventname] [player username]. Player target is always required.");
TokensEnabledCfg = Config.Bind<bool>("Economy Settings", "Enable Tokens", true, "Enable or disable the token system + messages");
SurvivalTokensCfg = Config.Bind<int>("Economy Settings", "Tokens For Survival", 4, "Amount of tokens to receive if the player survives to the end of a round.");
DeathTokensCfg = Config.Bind<int>("Economy Settings", "Tokens For Death", 1, "Amount of tokens to receive if the player dies during the round.");
CompanySurvivalTokensCfg = Config.Bind<int>("Economy Settings", "Tokens For Company", 1, "Amount of tokens to receive if the player survived a round at the Company building.");
RollCostCfg = Config.Bind<int>("Economy Settings", "Cost To Roll", 5, "Token cost for rolling the dice during a round.");
ClearTokensOnNewSaveCfg = Config.Bind<bool>("Economy Settings", "Clear Tokens On Fresh Start", false, "When starting a new game (tutorial announcement plays), all balances are reset to zero.");
RollsPerRoundCfg = Config.Bind<int>("Economy Settings", "Rolls Per Round Restriction", 1, "How many times can a player roll the dice during a round?");
NoneWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "None", 1, "Nothing happens.");
SpawnRandomEnemyWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnRandomEnemy", 1, "Spawns a random enemy, either inside or outside.");
SpawnHighThreatEnemyWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnHighThreatEnemy", 1, "Spawns a more dangerous enemy, either inside or outside.");
SpawnLowThreatEnemyWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnLowThreatEnemy", 1, "Spawns a less dangerous enemy, either inside or outside.");
SpawnHoardersWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnHoarders", 1, "Spawns a pack of hoarder bugs.");
SpawnBrackensWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnBrackens", 1, "Spawns a pack of Brackens.");
SpawnMimicWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnMimic", 1, "Spawns a mimic (masked enemy).");
SpawnHyperJesterWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnHyperJester", 1, "Spawns a Jester with more punishing AI.");
SpawnHyperThumperWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnHyperThumper", 1, "Spawns a Thumper with more health and a wider roam territory.");
LandmineTrailWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "LandmineTrail", 1, "Spawns a landmine behind the afflicted player(s) every few seconds.");
KillAllMobsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "KillAllMobs", 1, "Removes all monsters from the current level.");
KillRandomMobWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "KillRandomMob", 1, "Removes a random monster from the current level.");
EMPWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "EMP", 1, "Disables power to the lights and turrets in the current level.");
FixBurstValvesWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "FixBurstValves", 1, "Fixes all broken steam valves in current level.");
SpawnGirlPerDeadCrewWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnGirlPerDeadCrew", 1, "Spawns ghost girls equal to the number of currently dead crewmates.");
FireSaleWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "FireSale", 1, "Sets all items to 50% off in the terminal.");
Add1CreditWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "Add1Credit", 1, "Adds a single credit to the terminal.");
Add700CreditsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "Add700Credits", 1, "Adds 700 credits, enough for a Titan trip, to the terminal.");
AddRandomCreditsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "AddRandomCredits", 1, "Adds a random handful of credits to the terminal.");
LoseRandomCreditsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "LoseRandomCredits", 1, "Removes some credits from the terminal (won't cause credits to go negative).");
AddRerollTokensWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "AddRerollTokens", 1, "Refunds tokens equal to Roll Cost and allows this player to roll again.");
AddRandomTokensWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "AddRandomTokens", 1, "Refunds a handful of tokens back to this player.");
SpawnBoomboxWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnBoombox", 1, "Spawns a boombox.");
SpawnDrugsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnDrugs", 1, "Spawns a TZP-Inhalant.");
SpawnDrugsForAllWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnDrugsForAll", 1, "Spawns a TZP-Inhalant for all alive players.");
RandomItemsDeliveryWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "RandomItemsDelivery", 1, "Calls a delivery capsule with a random assortment of items.");
TakeRandomDamageWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "TakeRandomDamage", 1, "Take a random amount of damage. Can kill you.");
SetToCriticalHPWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SetToCriticalHP", 1, "Sets player to critical HP status.");
SetAllToCriticalHPWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SetAllToCriticalHP", 1, "Sets all alive players to critical HP status.");
HealSelfWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "HealSelf", 1, "Heals player to full HP.");
HealAllWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "HealAll", 1, "Heals all players to full HP.");
InstantExplodeWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "InstantExplode", 1, "Instantly kills the player who rolled.");
OppenheimerWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "Oppenheimer", 1, "Creates a circle of landmines that detonate around the player.");
SixMinutesToLiveWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SixMinutesToLive", 1, "Afflicted player will die after a ~6 minute timer elapses.");
BountyWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "Bounty", 1, "Afflicted player has a price put on their head. If they die, receive a random credit bonus.");
BroadcastAllWordsWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "BroadcastAllWords", 1, "All of the afflicted player's chat messages are signal translated.");
SpawnAirhornWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnAirhorn", 1, "Spawns an airhorn.");
SpawnRandomScrapWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnRandomScrap", 1, "Spawns a random scrap piece.");
SpawnMaskWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnMask", 1, "Spawns a mask.");
SpawnGunWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnGun", 1, "Spawns a shotgun.");
SpawnAmmoWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnAmmo", 1, "Spawns some shotgun shells.");
SpawnGoldBarWeight = Config.Bind<int>("Event Weights - Set to 0 to disable event, or an integer greater than 1 to increase event frequency", "SpawnGoldBar", 1, "Spawns a gold bar.");
}
}