using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using Gamemodes;
using HarmonyLib;
using OtherLoader;
using Popcron;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using Sodalite;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.UI;
using Valve.Newtonsoft.Json;
using Valve.VR;
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Gamemodes
{
[CreateAssetMenu(fileName = "New Atlas Object Table", menuName = "MeatKit/Gamemodes/AtlasObjectTable", order = 0)]
public class AtlasObjectTable : ScriptableObject
{
[Header("General Tags")]
public ObjectCategory Category;
public List<OTagEra> Eras = new List<OTagEra>();
public List<OTagSet> Sets = new List<OTagSet>();
public List<OTagFirearmCountryOfOrigin> CountriesOfOrigin = new List<OTagFirearmCountryOfOrigin>();
public int EarliestYear = -1;
public int LatestYear = -1;
[Header("Firearm Tags")]
public List<OTagFirearmSize> Sizes = new List<OTagFirearmSize>();
public List<OTagFirearmAction> Actions = new List<OTagFirearmAction>();
public List<OTagFirearmFiringMode> Modes = new List<OTagFirearmFiringMode>();
public List<OTagFirearmFiringMode> ExcludedModes = new List<OTagFirearmFiringMode>();
public List<OTagFirearmFeedOption> FeedOptions = new List<OTagFirearmFeedOption>();
public List<OTagFirearmMount> MountsAvailable = new List<OTagFirearmMount>();
public List<OTagFirearmRoundPower> RoundPowers = new List<OTagFirearmRoundPower>();
[Header("Attachment Tags")]
public List<OTagAttachmentFeature> Features = new List<OTagAttachmentFeature>();
public List<OTagFirearmMount> MountTypes = new List<OTagFirearmMount>();
[Header("Melee Tags")]
public List<OTagMeleeStyle> MeleeStyles = new List<OTagMeleeStyle>();
public List<OTagMeleeHandedness> MeleeHandedness = new List<OTagMeleeHandedness>();
public List<OTagThrownType> ThrownTypes = new List<OTagThrownType>();
public List<OTagThrownDamageType> ThrownDamageTypes = new List<OTagThrownDamageType>();
[Header("Misc Tags")]
public List<OTagPowerupType> PowerupTypes = new List<OTagPowerupType>();
[Header("Ammo Properties")]
public int MinAmmoCapacity = -1;
public int MaxAmmoCapacity = -1;
public bool OverrideMagType;
public bool OverrideRoundType;
public FireArmMagazineType MagTypeOverride;
public FireArmRoundType RoundTypeOverride;
[Header("Misc Properties")]
public List<string> WhitelistedObjectIDs = new List<string>();
public List<string> BlacklistedObjectIDs = new List<string>();
[NonSerialized]
public List<FVRObject> generatedObjects;
public void GenerateTable()
{
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_0342: Unknown result type (might be due to invalid IL or missing references)
//IL_0373: Unknown result type (might be due to invalid IL or missing references)
//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0406: Unknown result type (might be due to invalid IL or missing references)
//IL_0437: Unknown result type (might be due to invalid IL or missing references)
//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
generatedObjects = new List<FVRObject>();
foreach (FVRObject fvr in IM.OD.Values)
{
if (WhitelistedObjectIDs.Contains(fvr.ItemID))
{
generatedObjects.Add(fvr);
}
else if (!BlacklistedObjectIDs.Contains(fvr.ItemID) && fvr.OSple && fvr.Category == Category && (Eras.Count <= 0 || Eras.Contains(fvr.TagEra)) && (Sets.Count <= 0 || Sets.Contains(fvr.TagSet)) && (CountriesOfOrigin.Count <= 0 || CountriesOfOrigin.Contains(fvr.TagFirearmCountryOfOrigin)) && (EarliestYear <= -1 || fvr.TagFirearmFirstYear >= EarliestYear) && (LatestYear <= -1 || fvr.TagFirearmFirstYear <= LatestYear) && (Sizes.Count <= 0 || Sizes.Contains(fvr.TagFirearmSize)) && (Actions.Count <= 0 || Actions.Contains(fvr.TagFirearmAction)) && (Modes.Count <= 0 || Modes.Any((OTagFirearmFiringMode o) => fvr.TagFirearmFiringModes.Contains(o))) && (ExcludedModes.Count <= 0 || !ExcludedModes.Any((OTagFirearmFiringMode o) => fvr.TagFirearmFiringModes.Contains(o))) && (FeedOptions.Count <= 0 || FeedOptions.Any((OTagFirearmFeedOption o) => fvr.TagFirearmFeedOption.Contains(o))) && (MountsAvailable.Count <= 0 || MountsAvailable.Any((OTagFirearmMount o) => fvr.TagFirearmMounts.Contains(o))) && (RoundPowers.Count <= 0 || RoundPowers.Contains(fvr.TagFirearmRoundPower)) && (Features.Count <= 0 || Features.Contains(fvr.TagAttachmentFeature)) && (MountTypes.Count <= 0 || MountTypes.Contains(fvr.TagAttachmentMount)) && (MeleeStyles.Count <= 0 || MeleeStyles.Contains(fvr.TagMeleeStyle)) && (MeleeHandedness.Count <= 0 || MeleeHandedness.Contains(fvr.TagMeleeHandedness)) && (ThrownTypes.Count <= 0 || ThrownTypes.Contains(fvr.TagThrownType)) && (ThrownDamageTypes.Count <= 0 || ThrownDamageTypes.Contains(fvr.TagThrownDamageType)) && (PowerupTypes.Count <= 0 || PowerupTypes.Contains(fvr.TagPowerupType)) && (MinAmmoCapacity <= -1 || fvr.MaxCapacityRelated >= MinAmmoCapacity) && (MaxAmmoCapacity <= -1 || fvr.MinCapacityRelated <= MaxAmmoCapacity) && (!OverrideMagType || fvr.MagazineType == MagTypeOverride) && (!OverrideRoundType || fvr.RoundType == RoundTypeOverride))
{
generatedObjects.Add(fvr);
}
}
}
}
[CreateAssetMenu(fileName = "New Atlas Outfit Config", menuName = "MeatKit/Gamemodes/AtlasOutfitConfig", order = 0)]
public class AtlasOutfitConfigTemplate : ScriptableObject
{
public List<string> Headwear;
public float Chance_Headwear;
public List<string> Eyewear;
public float Chance_Eyewear;
public List<string> Facewear;
public float Chance_Facewear;
public List<string> Torsowear;
public float Chance_Torsowear;
public List<string> Pantswear;
public float Chance_Pantswear;
public List<string> Pantswear_Lower;
public float Chance_Pantswear_Lower;
public List<string> Backpacks;
public float Chance_Backpacks;
public SosigOutfitConfig GetOutfitConfig()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
SosigOutfitConfig val = (SosigOutfitConfig)ScriptableObject.CreateInstance(typeof(SosigOutfitConfig));
val.Chance_Headwear = Chance_Headwear;
val.Headwear = Headwear.Select((string o) => IM.OD[o]).ToList();
val.Chance_Eyewear = Chance_Eyewear;
val.Eyewear = Eyewear.Select((string o) => IM.OD[o]).ToList();
val.Chance_Facewear = Chance_Facewear;
val.Facewear = Facewear.Select((string o) => IM.OD[o]).ToList();
val.Chance_Torsowear = Chance_Torsowear;
val.Torsowear = Torsowear.Select((string o) => IM.OD[o]).ToList();
val.Chance_Pantswear = Chance_Pantswear;
val.Pantswear = Pantswear.Select((string o) => IM.OD[o]).ToList();
val.Chance_Pantswear_Lower = Chance_Pantswear_Lower;
val.Pantswear_Lower = Pantswear_Lower.Select((string o) => IM.OD[o]).ToList();
val.Chance_Backpacks = Chance_Backpacks;
val.Backpacks = Backpacks.Select((string o) => IM.OD[o]).ToList();
return val;
}
}
[CreateAssetMenu(fileName = "New Atlas Config", menuName = "MeatKit/Gamemodes/AtlasConfigTemplate", order = 0)]
public class AtlasSosigConfigTemplate : ScriptableObject
{
public float ViewDistance;
public float HearingDistance;
public float MaxFOV;
public float SearchExtentsModifier;
public bool DoesAggroOnFriendlyFire;
public bool HasABrain;
public bool DoesDropWeaponsOnBallistic;
public bool CanPickupRanged;
public bool CanPickupMelee;
public bool CanPickupOther;
public int TargetCapacity;
public float TargetTrackingTime;
public float NoFreshTargetTime;
public float AssaultPointOverridesSkirmishPointWhenFurtherThan;
public float RunSpeed;
public float WalkSpeed;
public float SneakSpeed;
public float CrawlSpeed;
public float TurnSpeed;
public float MaxJointLimit;
public float MovementRotMagnitude;
public float TotalMustard;
public float BleedDamageMult;
public float BleedRateMultiplier;
public float BleedVFXIntensity;
public float DamMult_Projectile;
public float DamMult_Explosive;
public float DamMult_Melee;
public float DamMult_Piercing;
public float DamMult_Blunt;
public float DamMult_Cutting;
public float DamMult_Thermal;
public float DamMult_Chilling;
public float DamMult_EMP;
public List<float> LinkDamageMultipliers;
public List<float> LinkStaggerMultipliers;
public List<Vector2> StartingLinkIntegrity;
public List<float> StartingChanceBrokenJoint;
public float ShudderThreshold;
public float ConfusionThreshold;
public float ConfusionMultiplier;
public float ConfusionTimeMax;
public float StunThreshold;
public float StunMultiplier;
public float StunTimeMax;
public bool CanBeGrabbed;
public bool CanBeSevered;
public bool CanBeStabbed;
public bool CanBeSurpressed;
public float SuppressionMult;
public bool DoesJointBreakKill_Head;
public bool DoesJointBreakKill_Upper;
public bool DoesJointBreakKill_Lower;
public bool DoesSeverKill_Head;
public bool DoesSeverKill_Upper;
public bool DoesSeverKill_Lower;
public bool DoesExplodeKill_Head;
public bool DoesExplodeKill_Upper;
public bool DoesExplodeKill_Lower;
public SosigConfigTemplate GetConfigTemplate()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
SosigConfigTemplate val = (SosigConfigTemplate)ScriptableObject.CreateInstance(typeof(SosigConfigTemplate));
val.ViewDistance = ViewDistance;
val.HearingDistance = HearingDistance;
val.MaxFOV = MaxFOV;
val.SearchExtentsModifier = SearchExtentsModifier;
val.DoesAggroOnFriendlyFire = DoesAggroOnFriendlyFire;
val.HasABrain = HasABrain;
val.DoesDropWeaponsOnBallistic = DoesDropWeaponsOnBallistic;
val.CanPickup_Ranged = CanPickupRanged;
val.CanPickup_Melee = CanPickupMelee;
val.CanPickup_Other = CanPickupOther;
val.TargetCapacity = TargetCapacity;
val.TargetTrackingTime = TargetTrackingTime;
val.NoFreshTargetTime = NoFreshTargetTime;
val.AssaultPointOverridesSkirmishPointWhenFurtherThan = AssaultPointOverridesSkirmishPointWhenFurtherThan;
val.RunSpeed = RunSpeed;
val.WalkSpeed = WalkSpeed;
val.SneakSpeed = SneakSpeed;
val.CrawlSpeed = CrawlSpeed;
val.TurnSpeed = TurnSpeed;
val.MaxJointLimit = MaxJointLimit;
val.MovementRotMagnitude = MovementRotMagnitude;
val.TotalMustard = TotalMustard;
val.BleedDamageMult = BleedDamageMult;
val.BleedRateMultiplier = BleedRateMultiplier;
val.BleedVFXIntensity = BleedVFXIntensity;
val.DamMult_Projectile = DamMult_Projectile;
val.DamMult_Explosive = DamMult_Explosive;
val.DamMult_Melee = DamMult_Melee;
val.DamMult_Piercing = DamMult_Piercing;
val.DamMult_Blunt = DamMult_Blunt;
val.DamMult_Cutting = DamMult_Cutting;
val.DamMult_Thermal = DamMult_Thermal;
val.DamMult_Chilling = DamMult_Chilling;
val.DamMult_EMP = DamMult_EMP;
val.LinkDamageMultipliers = LinkDamageMultipliers;
val.LinkStaggerMultipliers = LinkStaggerMultipliers;
val.StartingLinkIntegrity = StartingLinkIntegrity;
val.StartingChanceBrokenJoint = StartingChanceBrokenJoint;
val.ShudderThreshold = ShudderThreshold;
val.ConfusionThreshold = ConfusionThreshold;
val.ConfusionMultiplier = ConfusionMultiplier;
val.ConfusionTimeMax = ConfusionTimeMax;
val.StunThreshold = StunThreshold;
val.StunMultiplier = StunMultiplier;
val.StunTimeMax = StunTimeMax;
val.CanBeGrabbed = CanBeGrabbed;
val.CanBeSevered = CanBeSevered;
val.CanBeStabbed = CanBeStabbed;
val.CanBeSurpressed = CanBeSurpressed;
val.SuppressionMult = SuppressionMult;
val.DoesJointBreakKill_Head = DoesJointBreakKill_Head;
val.DoesJointBreakKill_Upper = DoesJointBreakKill_Upper;
val.DoesJointBreakKill_Lower = DoesJointBreakKill_Lower;
val.DoesSeverKill_Head = DoesSeverKill_Head;
val.DoesSeverKill_Upper = DoesSeverKill_Upper;
val.DoesSeverKill_Lower = DoesSeverKill_Lower;
val.DoesExplodeKill_Head = DoesExplodeKill_Head;
val.DoesExplodeKill_Upper = DoesExplodeKill_Upper;
val.DoesExplodeKill_Lower = DoesExplodeKill_Lower;
val.UsesLinkSpawns = false;
val.LinkSpawns = new List<FVRObject>();
val.LinkSpawnChance = new List<float>();
val.OverrideSpeech = false;
return val;
}
}
[CreateAssetMenu(fileName = "New Atlas Enemy Template", menuName = "MeatKit/Gamemodes/AtlasEnemyTemplate", order = 0)]
public class AtlasSosigEnemyTemplate : ScriptableObject
{
public string DisplayName;
public SosigEnemyCategory SosigEnemyCategory;
public List<string> SosigPrefabs;
public List<AtlasSosigConfigTemplate> Configs;
public List<AtlasSosigConfigTemplate> ConfigsEasy;
public List<AtlasOutfitConfigTemplate> OutfitConfigs;
public List<string> WeaponOptions;
public List<string> WeaponOptionsSecondary;
public List<string> WeaponOptionsTertiary;
public float SecondaryChance;
public float TertiaryChance;
public SosigEnemyTemplate GetSosigEnemyTemplate()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
SosigEnemyTemplate val = (SosigEnemyTemplate)ScriptableObject.CreateInstance(typeof(SosigEnemyTemplate));
val.DisplayName = DisplayName;
val.SosigEnemyCategory = SosigEnemyCategory;
val.SosigPrefabs = SosigPrefabs.Select((string o) => IM.OD[o]).ToList();
val.ConfigTemplates = Configs.Select((AtlasSosigConfigTemplate o) => o.GetConfigTemplate()).ToList();
val.ConfigTemplates_Easy = ConfigsEasy.Select((AtlasSosigConfigTemplate o) => o.GetConfigTemplate()).ToList();
val.OutfitConfig = OutfitConfigs.Select((AtlasOutfitConfigTemplate o) => o.GetOutfitConfig()).ToList();
val.WeaponOptions = WeaponOptions.Select((string o) => IM.OD[o]).ToList();
val.WeaponOptions_Secondary = WeaponOptionsSecondary.Select((string o) => IM.OD[o]).ToList();
val.WeaponOptions_Tertiary = WeaponOptionsTertiary.Select((string o) => IM.OD[o]).ToList();
val.SecondaryChance = SecondaryChance;
val.TertiaryChance = TertiaryChance;
return val;
}
}
public class BuildableCover : MonoBehaviour
{
public GameObject coverGeo;
public MeshRenderer areaMesh;
public SphereCollider areaCollider;
public bool built;
private void OnTriggerEnter(Collider other)
{
if (built)
{
return;
}
Supplies component = ((Component)other).GetComponent<Supplies>();
if ((Object)(object)component != (Object)null)
{
if ((Object)(object)((FVRInteractiveObject)component).m_hand != (Object)null)
{
((FVRInteractiveObject)component).ForceBreakInteraction();
}
Object.Destroy((Object)(object)((Component)component).gameObject);
BuildCover();
}
}
public void BuildCover()
{
built = true;
coverGeo.SetActive(true);
((Collider)areaCollider).enabled = false;
((Renderer)areaMesh).enabled = false;
}
public void ResetCover()
{
built = false;
coverGeo.SetActive(false);
((Collider)areaCollider).enabled = false;
((Renderer)areaMesh).enabled = false;
}
}
public class ButtonList : MonoBehaviour
{
public SelectableButton buttonPrefab;
public Transform buttonOrigin;
public float buttonSpacing;
[HideInInspector]
public List<SelectableButton> buttons = new List<SelectableButton>();
public SelectableButton AddButton(string text, UnityAction onClick, bool selectable)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: 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_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Expected O, but got Unknown
SelectableButton buttonComp = Object.Instantiate<SelectableButton>(buttonPrefab, buttonOrigin.position, buttonOrigin.rotation, buttonOrigin);
Transform transform = ((Component)buttonComp).transform;
transform.localPosition += Vector3.down * (float)buttons.Count * buttonSpacing;
buttonComp.text.text = text;
buttonComp.button.onClick = new ButtonClickedEvent();
((UnityEvent)buttonComp.button.onClick).AddListener(onClick);
if (selectable)
{
((UnityEvent)buttonComp.button.onClick).AddListener((UnityAction)delegate
{
buttonComp.SetSelected();
});
buttonComp.otherButtons.AddRange(buttons);
foreach (SelectableButton button in buttons)
{
button.otherButtons.Add(buttonComp);
}
}
buttons.Add(buttonComp);
return buttonComp;
}
public void ClearButtons()
{
for (int i = 0; i < buttons.Count; i++)
{
Object.Destroy((Object)(object)((Component)buttons[i]).gameObject);
}
buttons.Clear();
}
}
public class KillBox : MonoBehaviour
{
public LayerMask layerMask;
public bool killPlayer;
private void OnTriggerEnter(Collider other)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
if (((1 << ((Component)other).gameObject.layer) & LayerMask.op_Implicit(layerMask)) == 0)
{
return;
}
Sosig componentInParent = ((Component)other).GetComponentInParent<Sosig>();
if ((Object)(object)componentInParent != (Object)null)
{
componentInParent.KillSosig();
}
else if (killPlayer && PlayerTracker.currentPlayerState == PlayerState.playing)
{
FVRPlayerHitbox component = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component != (Object)null)
{
component.Body.HarmPercent(1000f);
}
}
}
}
[CreateAssetMenu(fileName = "New Loadout Pool", menuName = "Loadout/LoadoutPool", order = 0)]
public class LoadoutPool : ScriptableObject
{
public string poolName;
public int poolCost;
public List<AtlasObjectTable> tables;
public List<string> additionalItems;
public int minMagCapacity = -1;
public int maxMagCapacity = -1;
public int itemsToSpawn = 1;
[HideInInspector]
public List<FVRObject> items = new List<FVRObject>();
private int lastSpawnedIndex = 0;
public void InitializeTables()
{
items.Clear();
foreach (AtlasObjectTable table in tables)
{
table.GenerateTable();
items.AddRange(table.generatedObjects);
}
foreach (string additionalItem in additionalItems)
{
if (IM.OD.ContainsKey(additionalItem))
{
items.Add(IM.OD[additionalItem]);
}
}
IListExtensions.Shuffle<FVRObject>((IList<FVRObject>)items);
IListExtensions.Shuffle<FVRObject>((IList<FVRObject>)items);
lastSpawnedIndex = Random.Range(0, items.Count);
}
public FVRObject GetItem()
{
lastSpawnedIndex++;
if (lastSpawnedIndex >= items.Count)
{
lastSpawnedIndex = 0;
}
return items[lastSpawnedIndex];
}
}
[CreateAssetMenu(fileName = "New Player Loadout", menuName = "Loadout/PlayerLoadout", order = 0)]
public class PlayerLoadout : ScriptableObject
{
public string LoadoutName;
public LoadoutPool rightHandTable;
public LoadoutPool leftHandTable;
public List<LoadoutPool> quickbeltTables;
public bool magInOtherHand;
public bool bespokeInOtherHand;
}
public enum PlayerState
{
waitingToRespawn,
spectating,
playing,
enteringSpectator,
spawningIn
}
public static class PlayerTracker
{
public static PlayerState currentPlayerState = PlayerState.spectating;
public static void EquipPlayer(PlayerLoadout loadout)
{
ClearPlayerItems();
EquipHands(loadout);
EquipQuickbelt(loadout);
}
public static void ClearPlayerItems()
{
FVRViveHand component = ((Component)GM.CurrentPlayerBody.RightHand).GetComponent<FVRViveHand>();
FVRInteractiveObject currentInteractable = component.CurrentInteractable;
if ((Object)(object)currentInteractable != (Object)null)
{
currentInteractable.ForceBreakInteraction();
Object.Destroy((Object)(object)((Component)currentInteractable).gameObject);
}
FVRViveHand component2 = ((Component)GM.CurrentPlayerBody.LeftHand).GetComponent<FVRViveHand>();
FVRInteractiveObject currentInteractable2 = component2.CurrentInteractable;
if ((Object)(object)currentInteractable2 != (Object)null)
{
currentInteractable2.ForceBreakInteraction();
Object.Destroy((Object)(object)((Component)currentInteractable2).gameObject);
}
GM.CurrentPlayerBody.WipeQuickbeltContents();
}
public static void EquipHands(PlayerLoadout loadout)
{
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Invalid comparison between Unknown and I4
bool flag = false;
bool flag2 = false;
if ((Object)(object)loadout.rightHandTable != (Object)null)
{
FVRObject item = loadout.rightHandTable.GetItem();
GivePlayerItemRightHand(item.ItemID);
flag2 = true;
FVRObject val = null;
if (item.CompatibleMagazines.Count > 0)
{
if (loadout.rightHandTable.maxMagCapacity < 0 && loadout.rightHandTable.minMagCapacity < 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleMagazines);
}
else
{
List<FVRObject> list = item.CompatibleMagazines.Where((FVRObject o) => (loadout.rightHandTable.maxMagCapacity < 0 || o.MagazineCapacity <= loadout.rightHandTable.maxMagCapacity) && (loadout.rightHandTable.minMagCapacity < 0 || o.MagazineCapacity >= loadout.rightHandTable.minMagCapacity)).ToList();
val = ((list.Count <= 0) ? FirearmAPI.GetSmallestMagazine(item, (Func<FVRObject, bool>)null) : SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)list));
}
}
else if (item.CompatibleClips.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleClips);
}
else if (item.CompatibleSpeedLoaders.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleSpeedLoaders);
}
else if (item.CompatibleSingleRounds.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleSingleRounds);
}
if ((Object)(object)val != (Object)null)
{
if (loadout.magInOtherHand && (int)val.Category == 2)
{
GivePlayerItemLeftHand(val.ItemID);
flag = true;
}
GivePlayerItemQuickbelt(val.ItemID);
}
if (loadout.bespokeInOtherHand && !flag && item.BespokeAttachments.Count > 0)
{
GivePlayerItemLeftHand(SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.BespokeAttachments).ItemID);
flag = true;
}
}
if (!((Object)(object)loadout.leftHandTable != (Object)null) || flag)
{
return;
}
FVRObject item2 = loadout.leftHandTable.GetItem();
GivePlayerItemLeftHand(item2.ItemID);
FVRObject val2 = null;
if (item2.CompatibleMagazines.Count > 0)
{
if (loadout.leftHandTable.maxMagCapacity < 0 && loadout.leftHandTable.minMagCapacity < 0)
{
val2 = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item2.CompatibleMagazines);
}
else
{
List<FVRObject> list2 = item2.CompatibleMagazines.Where((FVRObject o) => (loadout.leftHandTable.maxMagCapacity < 0 || o.MaxCapacityRelated <= loadout.leftHandTable.maxMagCapacity) && (loadout.leftHandTable.minMagCapacity < 0 || o.MinCapacityRelated >= loadout.leftHandTable.minMagCapacity)).ToList();
val2 = ((list2.Count <= 0) ? FirearmAPI.GetSmallestMagazine(item2, (Func<FVRObject, bool>)null) : SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)list2));
}
}
else if (item2.CompatibleClips.Count > 0)
{
val2 = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item2.CompatibleClips);
}
else if (item2.CompatibleSpeedLoaders.Count > 0)
{
val2 = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item2.CompatibleSpeedLoaders);
}
else if (item2.CompatibleSingleRounds.Count > 0)
{
val2 = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item2.CompatibleSingleRounds);
}
if ((Object)(object)val2 != (Object)null)
{
if (loadout.magInOtherHand && !flag2)
{
GivePlayerItemRightHand(val2.ItemID);
flag2 = true;
}
GivePlayerItemQuickbelt(val2.ItemID);
}
if (loadout.bespokeInOtherHand && !flag2 && item2.BespokeAttachments.Count > 0)
{
GivePlayerItemRightHand(SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item2.BespokeAttachments).ItemID);
flag2 = true;
}
}
public static void EquipQuickbelt(PlayerLoadout loadout)
{
foreach (LoadoutPool quickbeltTable in loadout.quickbeltTables)
{
if ((Object)(object)quickbeltTable == (Object)null)
{
continue;
}
for (int i = 0; i < quickbeltTable.itemsToSpawn; i++)
{
FVRObject item = quickbeltTable.GetItem();
GivePlayerItemQuickbelt(item.ItemID);
if (item.RequiredSecondaryPieces.Count > 0)
{
foreach (FVRObject requiredSecondaryPiece in item.RequiredSecondaryPieces)
{
GivePlayerItemQuickbelt(requiredSecondaryPiece.ItemID);
}
}
FVRObject val = null;
if (item.CompatibleMagazines.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleMagazines);
}
else if (item.CompatibleClips.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleClips);
}
else if (item.CompatibleSpeedLoaders.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleSpeedLoaders);
}
else if (item.CompatibleSingleRounds.Count > 0)
{
val = SodaliteUtils.GetRandom<FVRObject>((IList<FVRObject>)item.CompatibleSingleRounds);
}
if ((Object)(object)val != (Object)null)
{
GivePlayerItemQuickbelt(val.ItemID);
}
}
}
}
public static FVRPhysicalObject GivePlayerItemQuickbelt(string itemID)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: 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)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
if (!IM.OD.ContainsKey(itemID))
{
return null;
}
Transform head = GM.CurrentPlayerBody.Head;
GameObject val = Object.Instantiate<GameObject>(((AnvilAsset)IM.OD[itemID]).GetGameObject(), ((Component)head).transform.position + ((Component)head).transform.forward / 2f, ((Component)head).transform.rotation);
if ((Object)(object)val.gameObject.GetComponent<GrappleGun>() != (Object)null)
{
Debug.Log((object)"Grapple spawned!");
}
FVRPhysicalObject[] components = val.GetComponents<FVRPhysicalObject>();
FVRPhysicalObject val2 = ((IEnumerable<FVRPhysicalObject>)components).FirstOrDefault((Func<FVRPhysicalObject, bool>)((FVRPhysicalObject o) => ((Behaviour)o).enabled));
if (components.Length > 1)
{
Debug.Log((object)"hey we have two components!");
}
foreach (FVRQuickBeltSlot item in GM.CurrentPlayerBody.QBSlots_Internal.OrderBy((FVRQuickBeltSlot o) => o.SizeLimit))
{
if ((Object)(object)item.CurObject == (Object)null && item.Type == val2.QBSlotType && item.SizeLimit >= val2.Size)
{
val2.SetQuickBeltSlot(item);
break;
}
}
if ((Object)(object)val.gameObject.GetComponent<GrappleGun>() != (Object)null)
{
Debug.Log((object)("Is it in a quickbelt? " + ((Object)(object)val2.m_quickbeltSlot != (Object)null)));
}
return val2;
}
public static FVRPhysicalObject GivePlayerItemLeftHand(string itemID)
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
if (!IM.OD.ContainsKey(itemID))
{
return null;
}
FVRViveHand component = ((Component)GM.CurrentPlayerBody.LeftHand).GetComponent<FVRViveHand>();
if ((Object)(object)component.CurrentInteractable != (Object)null)
{
Debug.LogError((object)"Player was holding stuff!");
return null;
}
FVRPhysicalObject component2 = Object.Instantiate<GameObject>(((AnvilAsset)IM.OD[itemID]).GetGameObject(), ((Component)component).transform.position, ((Component)component).transform.rotation).GetComponent<FVRPhysicalObject>();
component.RetrieveObject(component2);
return component2;
}
public static FVRPhysicalObject GivePlayerItemRightHand(string itemID)
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
if (!IM.OD.ContainsKey(itemID))
{
return null;
}
FVRViveHand component = ((Component)GM.CurrentPlayerBody.RightHand).GetComponent<FVRViveHand>();
if ((Object)(object)component.CurrentInteractable != (Object)null)
{
Debug.LogError((object)"Player was holding stuff!");
return null;
}
FVRPhysicalObject component2 = Object.Instantiate<GameObject>(((AnvilAsset)IM.OD[itemID]).GetGameObject(), ((Component)component).transform.position, ((Component)component).transform.rotation).GetComponent<FVRPhysicalObject>();
component.RetrieveObject(component2);
return component2;
}
}
public class SelectableButton : MonoBehaviour
{
public Color selectedColor;
public List<SelectableButton> otherButtons;
public Text text;
[HideInInspector]
public FVRPointableButton fvrButton;
[HideInInspector]
public Button button;
[HideInInspector]
public Color normalColor;
private void Awake()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
button = ((Component)this).GetComponent<Button>();
fvrButton = ((Component)this).GetComponent<FVRPointableButton>();
normalColor = fvrButton.ColorUnselected;
}
public void SetSelected()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
fvrButton.ColorUnselected = selectedColor;
((Graphic)fvrButton.Image).color = selectedColor;
foreach (SelectableButton otherButton in otherButtons)
{
otherButton.SetUnselected();
}
}
public void SetUnselected()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
fvrButton.ColorUnselected = normalColor;
((Graphic)fvrButton.Image).color = normalColor;
}
}
public class SpawnArea : MonoBehaviour
{
public float spawnRadius = 1f;
public MeshRenderer areaMesh;
[HideInInspector]
public int IFF;
[HideInInspector]
public bool isPlayerInSpawn;
[HideInInspector]
public Color spawnColor;
public Vector3 GetPositionInArea()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
Vector3 result = ((Component)this).transform.position + Random.insideUnitSphere * spawnRadius;
result.y = ((Component)this).transform.position.y;
return result;
}
public Sosig SpawnSosig(SosigEnemyTemplate template, SpawnOptions spawnOptions)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return SosigAPI.Spawn(template, spawnOptions, GetPositionInArea(), ((Component)this).transform.rotation);
}
public void SetTeam(int team, Color teamColor)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
spawnColor = teamColor;
IFF = team;
if (!isPlayerInSpawn || IFF == 0)
{
((Renderer)areaMesh).material.SetColor("_ScrollColor", teamColor);
}
else
{
((Renderer)areaMesh).material.SetColor("_ScrollColor", Color.grey);
}
}
public bool CanSosigSpawn(int team)
{
return IFF == team && (!isPlayerInSpawn || IFF == 0);
}
private void OnTriggerEnter(Collider other)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
if (PlayerTracker.currentPlayerState != PlayerState.playing)
{
return;
}
FVRPlayerHitbox component = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component != (Object)null)
{
isPlayerInSpawn = true;
if (IFF != 0)
{
((Renderer)areaMesh).material.SetColor("_ScrollColor", Color.grey);
}
}
}
private void OnTriggerExit(Collider other)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
FVRPlayerHitbox component = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component != (Object)null)
{
isPlayerInSpawn = false;
((Renderer)areaMesh).material.SetColor("_ScrollColor", spawnColor);
}
}
private void OnDrawGizmos()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
Handles.color = Color.white;
Handles.DrawWireDisc(((Component)this).transform.position, ((Component)this).transform.up, spawnRadius);
}
}
public delegate void InteractionEvent();
public class Supplies : FVRPhysicalObject
{
public event InteractionEvent ShowBuildableAreas;
public event InteractionEvent HideBuildableAreas;
public override void BeginInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).BeginInteraction(hand);
this.ShowBuildableAreas();
((MonoBehaviour)this).CancelInvoke();
}
public override void EndInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).EndInteraction(hand);
if (!((Object)(object)hand.OtherHand.CurrentInteractable != (Object)null) || !(hand.OtherHand.CurrentInteractable is Supplies))
{
((MonoBehaviour)this).Invoke("DelayedHideBuildableAreas", 2f);
}
}
public void DelayedHideBuildableAreas()
{
this.HideBuildableAreas();
}
public override void OnDestroy()
{
((FVRPhysicalObject)this).OnDestroy();
FVRViveHand component = ((Component)GM.CurrentPlayerBody.LeftHand).GetComponent<FVRViveHand>();
FVRViveHand component2 = ((Component)GM.CurrentPlayerBody.RightHand).GetComponent<FVRViveHand>();
if (!(component.CurrentInteractable is Supplies) && !(component2.CurrentInteractable is Supplies))
{
this.HideBuildableAreas();
}
}
}
public class WristMapController : MonoBehaviour
{
public float mapRadius = 0.05f;
public Color mapColor = Color.white;
public float mapScale = 0.001f;
public WristMapDisplayMode displayMode = WristMapDisplayMode.RightHand;
[HideInInspector]
public List<WristMapTarget> targets = new List<WristMapTarget>();
private Quaternion mapRotation;
private Vector3 drawPosition;
private void Awake()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
mapRotation = Quaternion.LookRotation(Vector3.up);
}
private void Update()
{
if (!((Object)(object)GM.CurrentPlayerBody == (Object)null) && displayMode != WristMapDisplayMode.Disabled)
{
UpdateDrawPosition();
DrawWristMap();
}
}
public void IncrementMapState(bool reverse)
{
if (reverse)
{
displayMode = displayMode.Previous();
}
else
{
displayMode = displayMode.Next();
}
}
private void UpdateDrawPosition()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
if (displayMode == WristMapDisplayMode.LeftHand)
{
drawPosition = GM.CurrentPlayerBody.LeftHand.position + GM.CurrentPlayerBody.LeftHand.forward * -0.2f;
}
else
{
drawPosition = GM.CurrentPlayerBody.RightHand.position + GM.CurrentPlayerBody.RightHand.forward * -0.2f;
}
}
private void DrawWristMap()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
Gizmos.Circle(drawPosition, mapRadius, mapRotation, (Color?)mapColor, false, 16);
foreach (WristMapTarget target in targets)
{
DrawWristTarget(target);
}
}
private void DrawWristTarget(WristMapTarget target)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = (target.transform.position - drawPosition) * mapScale;
val.y = 0f;
if (((Vector3)(ref val)).magnitude > mapRadius - mapRadius * target.scale)
{
val = ((Vector3)(ref val)).normalized * mapRadius - ((Vector3)(ref val)).normalized * (mapRadius * target.scale);
}
Gizmos.Circle(drawPosition + val, mapRadius * target.scale, mapRotation, (Color?)target.color, false, 16);
}
}
public static class Enums
{
public static T Next<T>(this T v) where T : struct
{
return Enum.GetValues(v.GetType()).Cast<T>().Concat(new T[1] { default(T) })
.SkipWhile((T e) => !v.Equals(e))
.Skip(1)
.First();
}
public static T Previous<T>(this T v) where T : struct
{
return Enum.GetValues(v.GetType()).Cast<T>().Concat(new T[1] { default(T) })
.Reverse()
.SkipWhile((T e) => !v.Equals(e))
.Skip(1)
.First();
}
}
public class WristMapTarget
{
public Color color;
public float scale;
public Transform transform;
public WristMapTarget(Transform target, Color color, float radius)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
transform = target;
this.color = color;
scale = radius;
}
}
public enum WristMapDisplayMode
{
RightHand,
LeftHand,
Disabled
}
}
namespace KOTH
{
public class ChildHillTrigger : MonoBehaviour
{
public KOTHHill hill;
[HideInInspector]
public List<KOTHSosig> capturingSosigs = new List<KOTHSosig>();
[HideInInspector]
public bool isPlayerInHill;
private void OnTriggerEnter(Collider other)
{
KOTHSosig component = ((Component)other).GetComponent<KOTHSosig>();
if ((Object)(object)component != (Object)null)
{
if (!capturingSosigs.Contains(component))
{
capturingSosigs.Add(component);
}
hill.OnSosigEnteredHill(component);
return;
}
FVRPlayerHitbox component2 = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component2 != (Object)null)
{
isPlayerInHill = true;
hill.OnPlayerEnteredHill(component2);
}
}
private void OnTriggerExit(Collider other)
{
KOTHSosig component = ((Component)other).GetComponent<KOTHSosig>();
if ((Object)(object)component != (Object)null)
{
capturingSosigs.Remove(component);
hill.OnSosigExitedHill(component);
return;
}
FVRPlayerHitbox component2 = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component2 != (Object)null)
{
isPlayerInHill = false;
hill.OnPlayerExitedHill(component2);
}
}
}
public class KOTHHill : MonoBehaviour
{
public List<KOTHSpawnPointCollection> teamSpawnPoints;
public List<Transform> attackPoints;
public List<Transform> defendPoints;
public List<MeshRenderer> hillRendererList;
public KOTHPurchasePanel purchasePanel;
public List<BuildableCover> coverList;
public float captureRate = 0.1f;
public float timeToCapture = 180f;
public List<Text> progressTextList;
public List<ChildHillTrigger> childHillTriggers = new List<ChildHillTrigger>();
[NonSerialized]
public List<KOTHSosig> capturingSosigs = new List<KOTHSosig>();
[NonSerialized]
public List<int> captureCount = new List<int>();
[NonSerialized]
public int currentTeam = -1;
[NonSerialized]
public bool isPlayerInHill;
[NonSerialized]
public List<AutoMeater> turretList = new List<AutoMeater>();
private float timeTillCaptureUpdate = 0f;
private float captureProgress = 0f;
private float timeOfCapture;
private float timeRemaining;
private void Awake()
{
if ((Object)(object)purchasePanel != (Object)null)
{
purchasePanel.hill = this;
}
}
private void Start()
{
for (int i = 0; i < KOTHManager.instance.teams.Count; i++)
{
captureCount.Add(0);
}
timeOfCapture = Time.time;
}
private void Update()
{
if (KOTHManager.instance.hasInit)
{
timeTillCaptureUpdate -= Time.deltaTime;
if (timeTillCaptureUpdate <= 0f)
{
timeTillCaptureUpdate = KOTHManager.instance.captureUpdateFrequency;
UpdateCaptureProgress();
}
UpdateTime();
}
}
public void ResetHill()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
captureProgress = 0f;
currentTeam = -1;
timeRemaining = timeToCapture;
SetAllSpawnsToNormal();
foreach (Text progressText in progressTextList)
{
progressText.text = GetTimeString();
((Graphic)progressText).color = new Color(1f, 1f, 1f, 0.5f);
}
foreach (MeshRenderer hillRenderer in hillRendererList)
{
((Renderer)hillRenderer).material.SetFloat("_CaptureProgress", captureProgress);
}
}
public void ResetDefenses()
{
if ((Object)(object)purchasePanel != (Object)null)
{
purchasePanel.SetPoints(0);
purchasePanel.ClearSpawnedItems();
}
foreach (BuildableCover cover in coverList)
{
cover.ResetCover();
}
for (int i = 0; i < turretList.Count; i++)
{
if ((Object)(object)turretList[i] != (Object)null)
{
Object.Destroy((Object)(object)((Component)turretList[i]).gameObject);
}
}
turretList.Clear();
}
public void ShowBuildableAreas()
{
foreach (BuildableCover cover in coverList)
{
if (!cover.built)
{
((Collider)cover.areaCollider).enabled = true;
((Renderer)cover.areaMesh).enabled = true;
}
}
}
public void HideBuildableAreas()
{
foreach (BuildableCover cover in coverList)
{
((Collider)cover.areaCollider).enabled = false;
((Renderer)cover.areaMesh).enabled = false;
}
}
private string GetTimeString()
{
return (int)(timeRemaining / 60f) + " : " + $"{(int)(timeRemaining % 60f):00}";
}
private void UpdateTime()
{
if (currentTeam == -1)
{
return;
}
float num = timeRemaining;
timeRemaining = timeToCapture - (Time.time - timeOfCapture);
foreach (Text progressText in progressTextList)
{
progressText.text = GetTimeString();
}
if (timeRemaining <= 0f)
{
capturingSosigs.Clear();
ResetDefenses();
ResetHill();
KOTHManager.instance.SetNextHill();
}
}
private void ResetCaptureCount()
{
for (int i = 0; i < captureCount.Count; i++)
{
captureCount[i] = 0;
}
}
private int UpdateCaptureCount()
{
if (isPlayerInHill && PlayerTracker.currentPlayerState == PlayerState.playing)
{
captureCount[0]++;
}
int num = 0;
for (int i = 0; i < capturingSosigs.Count; i++)
{
KOTHSosig kOTHSosig = capturingSosigs[i];
if ((Object)(object)kOTHSosig == (Object)null)
{
capturingSosigs.RemoveAt(i);
i--;
}
else if (kOTHSosig.sosig.E.IFFCode >= 0 && kOTHSosig.sosig.E.IFFCode < captureCount.Count)
{
captureCount[kOTHSosig.sosig.E.IFFCode]++;
if (captureCount[kOTHSosig.sosig.E.IFFCode] > captureCount[num])
{
num = kOTHSosig.sosig.E.IFFCode;
}
}
}
return num;
}
private void UpdateCaptureProgress()
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
ResetCaptureCount();
int num = UpdateCaptureCount();
if (captureCount[num] <= 0)
{
return;
}
if (currentTeam == -1)
{
currentTeam = num;
captureProgress += captureRate;
foreach (MeshRenderer hillRenderer in hillRendererList)
{
((Renderer)hillRenderer).material.SetColor("_TeamColor", KOTHManager.instance.teams[num].teamColor);
}
timeOfCapture = Time.time;
foreach (Text progressText in progressTextList)
{
((Graphic)progressText).color = KOTHManager.instance.teams[num].teamColor;
}
if ((Object)(object)purchasePanel != (Object)null)
{
purchasePanel.AddPoints(2);
}
foreach (AutoMeater turret in turretList)
{
turret.E.IFFCode = currentTeam;
}
if (num == 0)
{
SetAllSpawnsToTeam(1);
}
else
{
SetAllSpawnsToTeam(0);
}
}
else if (currentTeam != num)
{
captureProgress -= captureRate;
}
else
{
if (captureProgress < 1f && captureProgress + captureRate >= 1f)
{
Captured();
}
captureProgress = Mathf.Min(captureProgress + captureRate, 1f);
}
if (captureProgress <= 0f)
{
Neutralized(currentTeam);
}
foreach (MeshRenderer hillRenderer2 in hillRendererList)
{
((Renderer)hillRenderer2).material.SetFloat("_CaptureProgress", captureProgress);
}
}
private void Captured()
{
foreach (KOTHSosig capturingSosig in capturingSosigs)
{
if (capturingSosig.sosig.E.IFFCode == currentTeam)
{
capturingSosig.OrderToDefend(this);
}
}
}
private void Neutralized(int originalTeam)
{
ResetHill();
KOTHManager.instance.OnHillNeutralized();
foreach (KOTHSosig sosig in KOTHManager.instance.teams[originalTeam].sosigs)
{
sosig.OrderToAssault(this);
}
}
private void SetAllSpawnsToTeam(int team)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
foreach (KOTHSpawnPointCollection teamSpawnPoint in teamSpawnPoints)
{
foreach (SpawnArea spawnPoint in teamSpawnPoint.spawnPoints)
{
spawnPoint.SetTeam(team, KOTHManager.instance.teams[team].teamColor);
}
}
}
private void SetAllSpawnsToNormal()
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < teamSpawnPoints.Count; i++)
{
foreach (SpawnArea spawnPoint in teamSpawnPoints[i].spawnPoints)
{
spawnPoint.SetTeam(i, KOTHManager.instance.teams[i].teamColor);
}
}
}
private void OnTriggerEnter(Collider other)
{
KOTHSosig component = ((Component)other).GetComponent<KOTHSosig>();
if ((Object)(object)component != (Object)null)
{
OnSosigEnteredHill(component);
return;
}
FVRPlayerHitbox component2 = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component2 != (Object)null)
{
OnPlayerEnteredHill(component2);
}
}
private void OnTriggerExit(Collider other)
{
KOTHSosig component = ((Component)other).GetComponent<KOTHSosig>();
if ((Object)(object)component != (Object)null)
{
OnSosigExitedHill(component);
return;
}
FVRPlayerHitbox component2 = ((Component)other).GetComponent<FVRPlayerHitbox>();
if ((Object)(object)component2 != (Object)null)
{
OnPlayerExitedHill(component2);
}
}
public void OnSosigEnteredHill(KOTHSosig sosig)
{
if (!capturingSosigs.Contains(sosig))
{
capturingSosigs.Add(sosig);
}
sosig.currentHill = this;
if (sosig.sosig.E.IFFCode == currentTeam && captureProgress >= 1f)
{
sosig.OrderToDefend(this);
}
}
public void OnSosigExitedHill(KOTHSosig sosig)
{
if (!childHillTriggers.Any((ChildHillTrigger o) => o.capturingSosigs.Contains(sosig)))
{
capturingSosigs.Remove(sosig);
}
sosig.currentHill = null;
}
public void OnPlayerEnteredHill(FVRPlayerHitbox player)
{
isPlayerInHill = true;
}
public void OnPlayerExitedHill(FVRPlayerHitbox player)
{
if (!childHillTriggers.Any((ChildHillTrigger o) => o.isPlayerInHill))
{
isPlayerInHill = false;
}
}
private void OnDrawGizmos()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
Gizmos.color = Color.red;
Gizmos.DrawSphere(((Component)this).transform.position, 0.5f);
if ((Object)(object)KOTHManager.instance == (Object)null)
{
return;
}
for (int i = 0; i < teamSpawnPoints.Count; i++)
{
Gizmos.color = KOTHManager.instance.teams[i].teamColor;
foreach (SpawnArea spawnPoint in teamSpawnPoints[i].spawnPoints)
{
Gizmos.DrawSphere(((Component)spawnPoint).transform.position, 0.25f);
Gizmos.DrawLine(((Component)spawnPoint).transform.position, ((Component)this).transform.position);
}
}
Gizmos.color = Color.magenta;
foreach (Transform defendPoint in defendPoints)
{
Gizmos.DrawSphere(defendPoint.position, 0.25f);
}
Gizmos.color = Color.cyan;
foreach (Transform attackPoint in attackPoints)
{
Gizmos.DrawSphere(attackPoint.position, 0.25f);
}
}
}
public class KOTHLevel : MonoBehaviour
{
public string levelName;
public Transform spectatePoint;
public List<KOTHHill> hills;
public Transform PlayerBackupSpawn;
public void SetActiveLevel()
{
KOTHManager.instance.SetActiveLevel(this);
}
}
public class KOTHLoadoutEditor : MonoBehaviour
{
public int MaxPoints = 20;
public Text pointsText;
public ButtonList firearmsList;
public ButtonList equipmentList;
public ButtonList primaryList;
public ButtonList quickbeltList;
[HideInInspector]
public int selectedLoadoutSlot = -1;
public void InitLoadoutEditor()
{
selectedLoadoutSlot = -1;
InitFirearmButtons();
InitEquipmentButtons();
InitPrimaryButtons();
InitQuickbeltButtons();
LinkEquippedButtons();
pointsText.text = GetAvailablePoints().ToString();
}
public void InitFirearmButtons()
{
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
firearmsList.ClearButtons();
foreach (LoadoutPool pool in KOTHManager.instance.currentTimePeriod.firearmPools)
{
firearmsList.AddButton("[" + pool.poolCost + "] " + pool.poolName, (UnityAction)delegate
{
EquipIntoSlot(pool);
}, selectable: false);
}
}
public void InitEquipmentButtons()
{
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
equipmentList.ClearButtons();
foreach (LoadoutPool pool in KOTHManager.instance.currentTimePeriod.equipmentPools)
{
equipmentList.AddButton("[" + pool.poolCost + "] " + pool.poolName, (UnityAction)delegate
{
EquipIntoSlot(pool);
}, selectable: false);
}
}
public void InitPrimaryButtons()
{
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
primaryList.ClearButtons();
string text = "Empty";
if ((Object)(object)KOTHManager.instance.currentPlayerLoadout.rightHandTable != (Object)null)
{
text = "[" + KOTHManager.instance.currentPlayerLoadout.rightHandTable.poolCost + "] " + KOTHManager.instance.currentPlayerLoadout.rightHandTable.poolName;
}
int slot = 0;
primaryList.AddButton(text, (UnityAction)delegate
{
selectedLoadoutSlot = slot;
}, selectable: true);
}
public void InitQuickbeltButtons()
{
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Expected O, but got Unknown
quickbeltList.ClearButtons();
for (int i = 0; i < KOTHManager.instance.currentPlayerLoadout.quickbeltTables.Count; i++)
{
string text = "Empty";
if ((Object)(object)KOTHManager.instance.currentPlayerLoadout.quickbeltTables[i] != (Object)null)
{
text = "[" + KOTHManager.instance.currentPlayerLoadout.quickbeltTables[i].poolCost + "] " + KOTHManager.instance.currentPlayerLoadout.quickbeltTables[i].poolName;
}
int slot = i + 1;
quickbeltList.AddButton(text, (UnityAction)delegate
{
selectedLoadoutSlot = slot;
}, selectable: true);
}
}
public void LinkEquippedButtons()
{
foreach (SelectableButton button in primaryList.buttons)
{
button.otherButtons.AddRange(quickbeltList.buttons);
}
foreach (SelectableButton button2 in quickbeltList.buttons)
{
button2.otherButtons.AddRange(primaryList.buttons);
}
}
public void EquipIntoSlot(LoadoutPool pool)
{
Debug.Log((object)("Selected slot: " + selectedLoadoutSlot));
if (selectedLoadoutSlot == -1)
{
return;
}
int num = 0;
if (selectedLoadoutSlot == 0 && (Object)(object)KOTHManager.instance.currentPlayerLoadout.rightHandTable != (Object)null)
{
num = KOTHManager.instance.currentPlayerLoadout.rightHandTable.poolCost;
}
else if ((Object)(object)KOTHManager.instance.currentPlayerLoadout.quickbeltTables[selectedLoadoutSlot - 1] != (Object)null)
{
num = KOTHManager.instance.currentPlayerLoadout.quickbeltTables[selectedLoadoutSlot - 1].poolCost;
}
if (pool.poolCost <= GetAvailablePoints() + num)
{
if (selectedLoadoutSlot == 0)
{
KOTHManager.instance.currentPlayerLoadout.rightHandTable = pool;
}
else
{
KOTHManager.instance.currentPlayerLoadout.quickbeltTables[selectedLoadoutSlot - 1] = pool;
}
InitPrimaryButtons();
InitQuickbeltButtons();
LinkEquippedButtons();
if (selectedLoadoutSlot == 0)
{
primaryList.buttons[0].SetSelected();
}
else
{
quickbeltList.buttons[selectedLoadoutSlot - 1].SetSelected();
}
pointsText.text = GetAvailablePoints().ToString();
KOTHSaveManager.SaveData(KOTHManager.instance);
}
}
public int GetAvailablePoints()
{
int num = MaxPoints;
if ((Object)(object)KOTHManager.instance.currentPlayerLoadout.rightHandTable != (Object)null)
{
num -= KOTHManager.instance.currentPlayerLoadout.rightHandTable.poolCost;
}
foreach (LoadoutPool quickbeltTable in KOTHManager.instance.currentPlayerLoadout.quickbeltTables)
{
if (!((Object)(object)quickbeltTable == (Object)null))
{
num -= quickbeltTable.poolCost;
}
}
return num;
}
}
public class KOTHManager : MonoBehaviour
{
public Transform playerSpawn;
public List<KOTHTeam> teams;
public List<KOTHLevel> levels;
public List<KOTHTimePeriodOption> timePeriodOptions;
public WristMapController wristMap;
public float sosigSpawnFrequency = 10f;
public float captureUpdateFrequency = 1f;
public float playerHealth = 1000f;
public string levelName = "GenericKOTH";
private static KOTHManager instanceRef;
[HideInInspector]
public KOTHLevel currentLevel;
[HideInInspector]
public KOTHTimePeriodOption currentTimePeriod;
[HideInInspector]
public PlayerLoadout currentPlayerLoadout;
[HideInInspector]
public int currentHillIndex = 0;
[HideInInspector]
public float timeTillSpawn = 0f;
[HideInInspector]
public bool hasInit = false;
public static KOTHManager instance
{
get
{
if ((Object)(object)instanceRef == (Object)null)
{
instanceRef = Object.FindObjectOfType<KOTHManager>();
}
return instanceRef;
}
set
{
instanceRef = value;
}
}
private void Awake()
{
instance = this;
}
private void Update()
{
if (!hasInit)
{
return;
}
if (timeTillSpawn <= 0f)
{
for (int i = 0; i < teams.Count; i++)
{
if (currentLevel.hills[currentHillIndex].currentTeam != i && teams[i].sosigs.Count < teams[i].maxSosigs)
{
SpawnSosig(i);
}
}
timeTillSpawn = sosigSpawnFrequency;
}
timeTillSpawn -= Time.deltaTime;
}
public void DelayedInit()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
hasInit = true;
Debug.Log((object)"Delayed init of koth manager!");
KOTHSaveManager.InitSaveManager(this);
SetActiveLevel(levels[0]);
timePeriodOptions[0].SetActiveTimePeriod();
GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(OnSosigKill);
GM.CurrentSceneSettings.PlayerDeathEvent += new PlayerDeath(OnPlayerDeath);
GM.CurrentPlayerBody.SetHealthThreshold(playerHealth);
}
public void ResetKOTH()
{
Debug.Log((object)"Resetting KOTH");
foreach (KOTHTeam team in teams)
{
team.KillAllSosigs();
}
currentLevel.hills[currentHillIndex].ResetHill();
currentLevel.hills[currentHillIndex].ResetDefenses();
}
public void SetNextHill()
{
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
foreach (KOTHHill hill in currentLevel.hills)
{
((Component)hill).gameObject.SetActive(false);
}
currentHillIndex++;
if (currentHillIndex >= currentLevel.hills.Count)
{
currentHillIndex = 0;
}
KOTHHill kOTHHill = currentLevel.hills[currentHillIndex];
((Component)kOTHHill).gameObject.SetActive(true);
kOTHHill.capturingSosigs.Clear();
kOTHHill.ResetHill();
kOTHHill.ResetDefenses();
foreach (KOTHTeam team in teams)
{
foreach (KOTHSosig sosig in team.sosigs)
{
sosig.OrderToAssault(kOTHHill);
}
}
if (PlayerTracker.currentPlayerState == PlayerState.waitingToRespawn)
{
KOTHMenuController.instance.SetPlay();
}
wristMap.targets.Clear();
wristMap.targets.Add(new WristMapTarget(((Component)kOTHHill).transform, Color.cyan, 0.1f));
}
public void SetActiveLevel(KOTHLevel level)
{
foreach (KOTHLevel level2 in levels)
{
((Component)level2).gameObject.SetActive(false);
}
((Component)level).gameObject.SetActive(true);
currentLevel = level;
currentHillIndex = Random.Range(0, level.hills.Count);
SetNextHill();
ResetKOTH();
}
public void SetPlayerLoadout(PlayerLoadout loadout)
{
currentPlayerLoadout = loadout;
}
private void OnDestroy()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(OnSosigKill);
GM.CurrentSceneSettings.PlayerDeathEvent -= new PlayerDeath(OnPlayerDeath);
}
private void OnSosigKill(Sosig sosig)
{
sosig.ClearSosig();
}
private void OnPlayerDeath(bool killedSelf)
{
MovePlayerSpawnpoint();
PlayerTracker.currentPlayerState = PlayerState.spawningIn;
((MonoBehaviour)this).Invoke("OnPlayerFadeComplete", GM.CurrentSceneSettings.PlayerDeathFade);
}
private void MoveSpawnToSpectate()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
playerSpawn.position = currentLevel.spectatePoint.position;
playerSpawn.rotation = currentLevel.spectatePoint.rotation;
GM.CurrentSceneSettings.DeathResetPoint = playerSpawn;
}
public void MovePlayerSpawnpoint()
{
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: 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)
bool spawnAnywhere = currentLevel.hills[currentHillIndex].currentTeam != -1 && currentLevel.hills[currentHillIndex].currentTeam != 0;
SpawnArea randomSpawnPoint = GetRandomSpawnPoint(0, spawnAnywhere);
if ((Object)(object)randomSpawnPoint != (Object)null)
{
playerSpawn.position = randomSpawnPoint.GetPositionInArea();
}
else
{
playerSpawn.position = currentLevel.PlayerBackupSpawn.position;
Debug.Log((object)("Spawning player at backup spawn. Position: " + playerSpawn.position));
}
GM.CurrentSceneSettings.DeathResetPoint = playerSpawn;
}
public void OnHillNeutralized()
{
if (PlayerTracker.currentPlayerState == PlayerState.waitingToRespawn)
{
KOTHMenuController.instance.SetPlay();
}
}
public void OnPlayerFadeComplete()
{
KOTHMenuController.instance.CleanupItems();
PlayerTracker.ClearPlayerItems();
PlayerTracker.EquipPlayer(currentPlayerLoadout);
PlayerTracker.currentPlayerState = PlayerState.playing;
}
private void SpawnSosig(int team)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
KOTHHill kOTHHill = currentLevel.hills[currentHillIndex];
SpawnOptions val = new SpawnOptions();
val.SpawnState = (SosigOrder)7;
val.SpawnActivated = true;
val.EquipmentMode = (EquipmentSlots)7;
val.SpawnWithFullAmmo = true;
val.IFF = team;
val.SosigTargetPosition = SodaliteUtils.GetRandom<Transform>((IList<Transform>)kOTHHill.attackPoints).position;
SpawnOptions spawnOptions = val;
bool spawnAnywhere = kOTHHill.currentTeam != team && kOTHHill.currentTeam != -1;
SpawnArea randomSpawnPoint = GetRandomSpawnPoint(team, spawnAnywhere);
if (!((Object)(object)randomSpawnPoint == (Object)null))
{
SosigEnemyTemplate random = SodaliteUtils.GetRandom<SosigEnemyTemplate>((IList<SosigEnemyTemplate>)teams[team].builtSosigTemplates);
Sosig val2 = randomSpawnPoint.SpawnSosig(random, spawnOptions);
KOTHSosig kOTHSosig = ((Component)val2.Links[0]).gameObject.AddComponent<KOTHSosig>();
kOTHSosig.sosig = val2;
kOTHSosig.team = teams[team];
kOTHSosig.EquipSlothingItem(kOTHSosig.team.teamClothingPrefab, 2);
teams[team].sosigs.Add(kOTHSosig);
}
}
public SpawnArea GetRandomSpawnPoint(int team, bool spawnAnywhere)
{
if (spawnAnywhere)
{
SpawnArea random = SodaliteUtils.GetRandom<SpawnArea>((IList<SpawnArea>)SodaliteUtils.GetRandom<KOTHSpawnPointCollection>((IList<KOTHSpawnPointCollection>)currentLevel.hills[currentHillIndex].teamSpawnPoints).spawnPoints);
if (random.CanSosigSpawn(team))
{
return random;
}
foreach (KOTHSpawnPointCollection teamSpawnPoint in currentLevel.hills[currentHillIndex].teamSpawnPoints)
{
foreach (SpawnArea spawnPoint in teamSpawnPoint.spawnPoints)
{
if (spawnPoint.CanSosigSpawn(team))
{
return spawnPoint;
}
}
}
}
else
{
SpawnArea random2 = SodaliteUtils.GetRandom<SpawnArea>((IList<SpawnArea>)SodaliteUtils.GetRandom<KOTHSpawnPointCollection>((IList<KOTHSpawnPointCollection>)currentLevel.hills[currentHillIndex].teamSpawnPoints).spawnPoints);
if (random2.CanSosigSpawn(team))
{
return random2;
}
foreach (SpawnArea spawnPoint2 in currentLevel.hills[currentHillIndex].teamSpawnPoints[team].spawnPoints)
{
if (spawnPoint2.CanSosigSpawn(team))
{
return spawnPoint2;
}
}
}
return null;
}
}
public class KOTHMenuController : MonoBehaviour
{
public GameObject gamePanel;
public KOTHLoadoutEditor loadoutPanel;
public GameObject loadingContainer;
public Slider loadingBar;
public Transform menuPoint;
public ButtonList gamemodeButtons;
public ButtonList levelButtons;
public ButtonList timePeriodButtons;
public ButtonList loadoutButtons;
public List<Text> teamText;
public Text healthText;
public Text rateText;
public Text wristText;
private static KOTHMenuController instanceRef;
[HideInInspector]
public bool hasPlayerInit = false;
[HideInInspector]
public bool hasGameInit = false;
private float basePointDistance;
private WristMenuButton menuButton;
public static KOTHMenuController instance
{
get
{
if ((Object)(object)instanceRef == (Object)null)
{
instanceRef = Object.FindObjectOfType<KOTHMenuController>();
}
return instanceRef;
}
set
{
instanceRef = value;
}
}
private void Awake()
{
instance = this;
loadingContainer.SetActive(true);
((Component)loadingBar).gameObject.SetActive(true);
gamePanel.SetActive(false);
((Component)loadoutPanel).gameObject.SetActive(false);
((Component)KOTHManager.instance).gameObject.SetActive(false);
}
private void Update()
{
if (!hasPlayerInit)
{
DelayedPlayerInit();
}
else if (!hasGameInit)
{
UpdateLoadProgress();
DelayedGameInit();
}
}
private void DelayedPlayerInit()
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)GM.CurrentSceneSettings != (Object)null)
{
Debug.Log((object)"Delayed Init of Player");
hasPlayerInit = true;
basePointDistance = GM.CurrentSceneSettings.MaxPointingDistance;
SetPlayerSpectator(menuPoint);
menuButton = new WristMenuButton("Game Menu", new ButtonClickEvent(StartGoToMenu));
WristMenuAPI.Buttons.Add(menuButton);
}
}
private void DelayedGameInit()
{
if (LoaderStatus.GetLoaderProgress() >= 1f)
{
Debug.Log((object)"Delayed Init of Game");
hasGameInit = true;
loadingContainer.SetActive(false);
gamePanel.SetActive(true);
((Component)KOTHManager.instance).gameObject.SetActive(true);
KOTHManager.instance.DelayedInit();
InitGamemodeButtons();
InitLevelButtons();
InitTimePeriodButtons();
InitLoadoutButtons();
InitSettingsText();
}
}
public void InitGamemodeButtons()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
gamemodeButtons.ClearButtons();
gamemodeButtons.AddButton("KOTH", (UnityAction)delegate
{
}, selectable: true);
gamemodeButtons.buttons[0].SetSelected();
}
public void InitLevelButtons()
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Expected O, but got Unknown
levelButtons.ClearButtons();
foreach (KOTHLevel level in KOTHManager.instance.levels)
{
levelButtons.AddButton(((Object)level).name, new UnityAction(level.SetActiveLevel), selectable: true);
}
levelButtons.buttons[0].SetSelected();
}
public void InitTimePeriodButtons()
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Expected O, but got Unknown
timePeriodButtons.ClearButtons();
foreach (KOTHTimePeriodOption timePeriodOption in KOTHManager.instance.timePeriodOptions)
{
timePeriodButtons.AddButton(timePeriodOption.timePeriodName, new UnityAction(timePeriodOption.SetActiveTimePeriod), selectable: true);
}
timePeriodButtons.buttons[0].SetSelected();
}
public void InitLoadoutButtons()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Expected O, but got Unknown
loadoutButtons.ClearButtons();
foreach (PlayerLoadout loadout in KOTHManager.instance.currentTimePeriod.loadouts)
{
loadoutButtons.AddButton(loadout.LoadoutName, (UnityAction)delegate
{
KOTHManager.instance.SetPlayerLoadout(loadout);
}, selectable: true);
}
loadoutButtons.buttons[0].SetSelected();
}
private void InitSettingsText()
{
for (int i = 0; i < teamText.Count; i++)
{
teamText[i].text = KOTHManager.instance.teams[i].maxSosigs.ToString();
}
healthText.text = KOTHManager.instance.playerHealth.ToString();
rateText.text = KOTHManager.instance.sosigSpawnFrequency.ToString();
wristText.text = KOTHManager.instance.wristMap.displayMode.ToString();
}
private void UpdateLoadProgress()
{
loadingBar.value = LoaderStatus.GetLoaderProgress();
}
private void OnDestroy()
{
WristMenuAPI.Buttons.Remove(menuButton);
}
public void StartGoToMenu(object sender, ButtonClickEventArgs args)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (PlayerTracker.currentPlayerState != PlayerState.enteringSpectator)
{
PlayerTracker.currentPlayerState = PlayerState.enteringSpectator;
GM.CurrentSceneSettings.DoesDamageGetRegistered = false;
SteamVR_Fade.Start(Color.black, GM.CurrentSceneSettings.PlayerDeathFade, false);
((MonoBehaviour)this).Invoke("DelayedGoToMenu", GM.CurrentSceneSettings.PlayerDeathFade);
}
}
public void DelayedGoToMenu()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
SetPlayerSpectator(menuPoint);
CleanupItems();
gamePanel.SetActive(true);
((Component)loadoutPanel).gameObject.SetActive(false);
SteamVR_Fade.Start(Color.clear, 0.5f, false);
}
public void SetPlay()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (PlayerTracker.currentPlayerState != PlayerState.spawningIn)
{
PlayerTracker.currentPlayerState = PlayerState.spawningIn;
SteamVR_Fade.Start(Color.black, GM.CurrentSceneSettings.PlayerDeathFade, false);
((MonoBehaviour)this).Invoke("SpawnPlayer", GM.CurrentSceneSettings.PlayerDeathFade);
}
}
public void SetEditLoadout()
{
gamePanel.SetActive(false);
((Component)loadoutPanel).gameObject.SetActive(true);
loadoutPanel.InitLoadoutEditor();
}
public void SetGameMenu()
{
gamePanel.SetActive(true);
((Component)loadoutPanel).gameObject.SetActive(false);
}
public void SetPlayerSpectator(Transform point)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
PlayerTracker.ClearPlayerItems();
PlayerTracker.currentPlayerState = PlayerState.spectating;
GM.CurrentPlayerRoot.localScale = new Vector3(10f, 10f, 10f);
((Component)WristMenuAPI.Instance2).transform.localScale = GM.CurrentPlayerRoot.localScale;
GM.CurrentMovementManager.TeleportToPoint(point.position, true, point.forward);
GM.CurrentMovementManager.Mode = (MovementMode)10;
GM.CurrentPlayerBody.SetPlayerIFF(-3);
GM.CurrentPlayerBody.DisableHitBoxes();
GM.CurrentSceneSettings.DoesDamageGetRegistered = false;
GM.CurrentPlayerBody.HealthBar.gameObject.SetActive(false);
GM.CurrentSceneSettings.MaxPointingDistance = 100f;
}
public void SpawnPlayer()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
gamePanel.SetActive(false);
((Component)loadoutPanel).gameObject.SetActive(false);
PlayerTracker.currentPlayerState = PlayerState.playing;
GM.CurrentPlayerRoot.localScale = new Vector3(1f, 1f, 1f);
((Component)WristMenuAPI.Instance2).transform.localScale = GM.CurrentPlayerRoot.localScale;
GM.CurrentMovementManager.Mode = GM.Options.MovementOptions.CurrentMovementMode;
GM.CurrentPlayerBody.SetPlayerIFF(0);
GM.CurrentPlayerBody.EnableHitBoxes();
GM.CurrentSceneSettings.DoesDamageGetRegistered = true;
GM.CurrentPlayerBody.HealthBar.gameObject.SetActive(true);
GM.CurrentSceneSettings.MaxPointingDistance = basePointDistance;
if (((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
KOTHManager.instance.MovePlayerSpawnpoint();
KOTHManager.instance.OnPlayerFadeComplete();
GM.CurrentMovementManager.TeleportToPoint(KOTHManager.instance.playerSpawn.position, true, KOTHManager.instance.playerSpawn.forward);
}
SteamVR_Fade.Start(Color.clear, 0.5f, false);
}
public void IncreasePlayerHealth()
{
if (((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
KOTHManager.instance.playerHealth = Math.Max(100f, KOTHManager.instance.playerHealth + 100f);
GM.CurrentPlayerBody.SetHealthThreshold(KOTHManager.instance.playerHealth);
healthText.text = ((int)KOTHManager.instance.playerHealth).ToString();
}
}
public void DecreasePlayerHealth()
{
if (((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
KOTHManager.instance.playerHealth = Math.Max(100f, KOTHManager.instance.playerHealth - 100f);
GM.CurrentPlayerBody.SetHealthThreshold(KOTHManager.instance.playerHealth);
healthText.text = ((int)KOTHManager.instance.playerHealth).ToString();
}
}
public void IncreaseSosigCount(int team)
{
if (!((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
return;
}
KOTHManager.instance.teams[team].maxSosigs = Math.Max(1, KOTHManager.instance.teams[team].maxSosigs + 1);
teamText[team].text = KOTHManager.instance.teams[team].maxSosigs.ToString();
foreach (KOTHTimePeriodOption timePeriodOption in KOTHManager.instance.timePeriodOptions)
{
timePeriodOption.kothTeams[team].maxSosigs = KOTHManager.instance.teams[team].maxSosigs;
}
}
public void DecreaseSosigCount(int team)
{
if (!((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
return;
}
KOTHManager.instance.teams[team].maxSosigs = Math.Max(1, KOTHManager.instance.teams[team].maxSosigs - 1);
teamText[team].text = KOTHManager.instance.teams[team].maxSosigs.ToString();
foreach (KOTHTimePeriodOption timePeriodOption in KOTHManager.instance.timePeriodOptions)
{
timePeriodOption.kothTeams[team].maxSosigs = KOTHManager.instance.teams[team].maxSosigs;
}
}
public void IncreaseSosigDelay()
{
if (((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
KOTHManager.instance.sosigSpawnFrequency = Math.Max(0.1f, KOTHManager.instance.sosigSpawnFrequency + 0.1f);
rateText.text = KOTHManager.instance.sosigSpawnFrequency.ToString("0.0");
}
}
public void DecreaseSosigDelay()
{
if (((Component)KOTHManager.instance).gameObject.activeInHierarchy)
{
KOTHManager.instance.sosigSpawnFrequency = Math.Max(0.1f, KOTHManager.instance.sosigSpawnFrequency - 0.1f);
rateText.text = KOTHManager.instance.sosigSpawnFrequency.ToString("0.0");
}
}
public void IncrementWristMode(bool decrease)
{
KOTHManager.instance.wristMap.IncrementMapState(decrease);
wristText.text = KOTHManager.instance.wristMap.displayMode.ToString();
}
public void CleanupItems()
{
FVRPhysicalObject[] array = Object.FindObjectsOfType<FVRPhysicalObject>();
foreach (FVRPhysicalObject val in array)
{
if (!((FVRInteractiveObject)val).IsHeld && (Object)(object)val.QuickbeltSlot == (Object)null)
{
if (val is FVRFireArm || val is FVRFireArmMagazine || val is FVRFireArmRound || val is FVRFireArmClip || val is Speedloader || val is FVRMeleeWeapon || val is PinnedGrenade || val is FVRFireArmAttachment)
{
Object.Destroy((Object)(object)((Component)val).gameObject);
}
else if (val is GrappleThrowable)
{
((Component)val).gameObject.GetComponent<GrappleThrowable>().ClearRopeLengths();
Object.Destroy((Object)(object)((Component)val).gameObject);
}
}
}
GrappleGunBolt[] array2 = Object.FindObjectsOfType<GrappleGunBolt>();
foreach (GrappleGunBolt val2 in array2)
{
val2.ClearRopeLengths();
Object.Destroy((Object)(object)((Component)val2).gameObject);
}
}
}
public class KOTHPurchasePanel : MonoBehaviour
{
public Transform spawnPos;
public Text pointText;
public Supplies suppliesPrefab;
public ButtonList buttonList;
public int maxShields = 3;
public int costSupplies;
public int costHealth;
public int costShield;
public int costRadio;
public int costTurret;
[HideInInspector]
public int points;
[HideInInspector]
public KOTHHill hill;
private List<Supplies> spawnedSupplies = new List<Supplies>();
private List<GameObject> spawnedShields = new List<GameObject>();
public void Start()
{
ResetButtons();
}
public void ResetButtons()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Expected O, but got Unknown
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Expected O, but got Unknown
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Expected O, but got Unknown
buttonList.ClearButtons();
buttonList.AddButton("[" + costSupplies + "] Spawn Supplies", new UnityAction(SpawnSupplies), selectable: false);
buttonList.AddButton("[" + costHealth + "] Spawn Health", new UnityAction(SpawnHealth), selectable: false);
buttonList.AddButton("[" + costShield + "] Spawn Shield", new UnityAction(SpawnShield), selectable: false);
buttonList.AddButton("[" + costRadio + "] Spawn Radio", new UnityAction(SpawnRadio), selectable: false);
buttonList.AddButton("[" + costTurret + "] Spawn Turret", new UnityAction(SpawnTurret), selectable: false);
}
public void AddPoints(int i)
{
points += i;
UpdateText();
}
public void SetPoints(int i)
{
points = i;
UpdateText();
}
public void SpawnSupplies()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
if (points >= costSupplies)
{
Supplies supplies = Object.Instantiate<Supplies>(suppliesPrefab, spawnPos.position, spawnPos.rotation);
supplies.ShowBuildableAreas += hill.ShowBuildableAreas;
supplies.HideBuildableAreas += hill.HideBuildableAreas;
spawnedSupplies.Add(supplies);
AddPoints(-costSupplies);
}
}
public void SpawnHealth()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (points >= costHealth)
{
Object.Instantiate<GameObject>(((AnvilAsset)IM.OD["PowerUpMeat_Health"]).GetGameObject(), spawnPos.position, spawnPos.rotation);
AddPoints(-costHealth);
}
}
public void SpawnShield()
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
if (points >= costShield && spawnedShields.Count < maxShields)
{
spawnedShields.Add(Object.Instantiate<GameObject>(((AnvilAsset)IM.OD["deployableshield.tt"]).GetGameObject(), spawnPos.position, spawnPos.rotation));
AddPoints(-costShield);
if (spawnedShields.Count >= maxShields)
{
buttonList.buttons[2].text.text = "Out Of Stock";
}
}
}
public void SpawnRadio()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (points >= costRadio)
{
Object.Instantiate<GameObject>(((AnvilAsset)IM.OD["Dev_Radio"]).GetGameObject(), spawnPos.position, spawnPos.rotation);
AddPoints(-costRadio);
}
}
public void SpawnTurret()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (points >= costTurret)
{
GameObject val = Object.Instantiate<GameObject>(((AnvilAsset)IM.OD["Turburgert_Flamethrower"]).GetGameObject(), spawnPos.position, spawnPos.rotation);
AutoMeater component = val.GetComponent<AutoMeater>();
component.E.IFFCode = hill.currentTeam;
hill.turretList.Add(component);
AddPoints(-costTurret);
}
}
public void UpdateText()
{
pointText.text = "Points : " + points;
}
public void ClearSpawnedItems()
{
ResetButtons();
ClearSupplies();
ClearShields();
}
public void ClearSupplies()
{
foreach (Supplies spawnedSupply in spawnedSupplies)
{
if ((Object)(object)spawnedSupply != (Object)null)
{
if (((FVRInteractiveObject)spawnedSupply).IsHeld)
{
((FVRInteractiveObject)spawnedSupply).ForceBreakInteraction();
}
else if ((Object)(object)((FVRPhysicalObject)spawnedSupply).QuickbeltSlot != (Object)null)
{
((FVRPhysicalObject)spawnedSupply).SetQuickBeltSlot((FVRQuickBeltSlot)null);
}
Object.Destroy((Object)(object)((Component)spawnedSupply).gameObject);
}
}
spawnedSupplies.Clear();
}
public void ClearShields()
{
foreach (GameObject spawnedShield in spawnedShields)
{
if ((Object)(object)spawnedShield != (Object)null)
{
FVRPhysicalObject component = spawnedShield.GetComponent<FVRPhysicalObject>();
if (((FVRInteractiveObject)component).IsHeld)
{
((FVRInteractiveObject)component).ForceBreakInteraction();
}
else if ((Object)(object)component.QuickbeltSlot != (Object)null)
{
component.SetQuickBeltSlot((FVRQuickBeltSlot)null);
}
Object.Destroy((Object)(object)spawnedShield);
}
}
spawnedShields.Clear();
}
}
public static class KOTHSaveManager
{
private class KOTHSaveData
{
public KOTHSettingsData settingsData;
public List<TimePeriodData> timePeriodList = new List<TimePeriodData>();
public KOTHSaveData()
{
}
public KOTHSaveData(KOTHManager manager)
{
settingsData = new KOTHSettingsData(manager);
foreach (KOTHTimePeriodOption timePeriodOption in manager.timePeriodOptions)
{
timePeriodList.Add(new TimePeriodData(timePeriodOption));
}
}
}
private class KOTHSettingsData
{
public int numRed;
public int numGreen;
public float respawnDelay;
public int playerHealth;
public WristMapDisplayMode wristMapMode;
public KOTHSettingsData()
{
}
public KOTHSettingsData(KOTHManager manager)
{
playerHealth = (int)manager.playerHealth;
wristMapMode = manager.wristMap.displayMode;
respawnDelay = manager.sosigSpawnFrequency;
numGreen = manager.timePeriodOptions[0].kothTeams[0].maxSosigs;
numRed = manager.timePeriodOptions[0].kothTeams[1].maxSosigs;
}
}
private class TimePeriodData
{
public List<LoadoutData> loadoutData = new List<LoadoutData>();
public TimePeriodData()
{
}
public TimePeriodData(KOTHTimePeriodOption timePeriod)
{
foreach (PlayerLoadout loadout in timePeriod.loadouts)
{
loadoutData.Add(new LoadoutData(loadout));
}
}
}
private class LoadoutData
{
public string primaryPoolName;
public List<string> quickbeltPoolNames = new List<string>();
public LoadoutData()
{
}
public LoadoutData(PlayerLoadout loadout)
{
if ((Object)(object)loadout != (Object)null)
{
primaryPoolName = loadout.rightHandTable.poolName;
}
foreach (LoadoutPool quickbeltTable in loadout.quickbeltTables)
{
if (!((Object)(object)quickbeltTable == (Object)null))
{
quickbeltPoolNames.Add(quickbeltTable.poolName);
}
}
}
}
public static string saveFolderPath;
public static string saveFilePath;
public static void InitSaveManager(KOTHManager manager)
{
saveFolderPath = Application.dataPath.Replace("/h3vr_Data", "/GamemodeSaves");
if (!Directory.Exists(saveFolderPath))
{
Directory.CreateDirectory(saveFolderPath);
}
saveFolderPath = Path.Combine(saveFolderPath, "KOTH");
if (!Directory.Exists(saveFolderPath))
{
Directory.CreateDirectory(saveFolderPath);
}
saveFilePath = Path.Combine(saveFolderPath, manager.levelName + ".json");
if (!File.Exists(saveFilePath))
{
SaveData(manager);
}
else
{
LoadData(manager);
}
}
public static void SaveData(KOTHManager manager)
{
Debug.Log((object)"Saving data to file");
if (File.Exists(saveFilePath))
{
File.Delete(saveFilePath);
}
using StreamWriter streamWriter = File.CreateText(saveFilePath);
string value = JsonConvert.SerializeObject((object)new KOTHSaveData(manager));
streamWriter.WriteLine(value);
streamWriter.Close();
}
public static void LoadData(KOTHManager manager)
{
Debug.Log((object)"Loading save data from file");
string text = File.ReadAllText(saveFilePath);
KOTHSaveData saveData = JsonConvert.DeserializeObject<KOTHSaveData>(text);
try
{
LoadSettings(manager, saveData);
LoadTimePeriods(manager, saveData);
}
catch (Exception)
{
SaveData(manager);
}
}
private static void LoadSettings(KOTHManager manager, KOTHSaveData saveData)
{
manager.sosigSpawnFrequency = saveData.settingsData.respawnDelay;
manager.playerHealth = saveData.settingsData.playerHealth;
manager.wristMap.displayMode = saveData.settingsData.wristMapMode;
foreach (KOTHTimePeriodOption timePeriodOption in manager.timePeriodOptions)
{
timePeriodOption.kothTeams[0].maxSosigs = saveData.settingsData.numGreen;
timePeriodOption.kothTeams[1].maxSosigs = saveData.settingsData.numRed;
}
}
private static void LoadTimePeriods(KOTHManager manager, KOTHSaveData saveData)
{
for (int i = 0; i < saveData.timePeriodList.Count; i++)
{
LoadLoadouts(manager.timePeriodOptions[i], saveData.timePeriodList[i]);
}
}
private static void LoadLoadouts(KOTHTimePeriodOption timePeriod, TimePeriodData timeData)
{
for (int j = 0; j < timeData.loadoutData.Count; j++)
{
PlayerLoadout playerLoadout = timePeriod.loadouts[j];
LoadoutData loadoutData = timeData.loadoutData[j];
LoadoutPool loadoutPool = null;
loadoutPool = timePeriod.firearmPools.FirstOrDefault((LoadoutPool o) => o.poolName == loadoutData.primaryPoolName);
if ((Object)(object)loadoutPool == (Object)null)
{
loadoutPool = timePeriod.equipmentPools.FirstOrDefault((LoadoutPool o) => o.poolName == loadoutData.primaryPoolName);
}
if ((Object)(object)loadoutPool != (Object)null)
{
playerLoadout.rightHandTable = loadoutPool;
}
for (int i = 0; i < loadoutData.quickbeltPoolNames.Count; i++)
{
LoadoutPool loadoutPool2 = null;
loadoutPool2 = timePeriod.firearmPools.FirstOrDefault((LoadoutPool o) => o.poolName == loadoutData.quickbeltPoolNames[i]);
if ((Object)(object)loadoutPool2 == (Object)null)
{
loadoutPool2 = timePeriod.equipmentPools.FirstOrDefault((LoadoutPool o) => o.poolName == loadoutData.quickbeltPoolNames[i]);
}
if ((Object)(object)loadoutPool2 != (Object)null)
{
playerLoadout.quickbeltTables[i] = loadoutPool2;
}
}
}
}
}
public class KOTHSosig : MonoBehaviour
{
public Sosig sosig;
public KOTHTeam team;
public KOTHHill currentHill;
private void OnDestroy()
{
team.sosigs.Remove(this);
if ((Object)(object)currentHill != (Object)null)
{
currentHill.capturingSosigs.Remove(this);
}
}
public void OrderToAssault(KOTHHill hill)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
sosig.CommandAssaultPoint(SodaliteUtils.GetRandom<Transform>((IList<Transform>)hill.attackPoints).position);
}
public void OrderToDefend(KOTHHill hill)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
sosig.CommandAssaultPoint(SodaliteUtils.GetRandom<Transform>((IList<Transform>)hill.defendPoints).position);
sosig.SetDominantGuardDirection(Random.onUnitSphere);
}
public void EquipSlothingItem(SosigWearable item, int sosigLink)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
SosigLink val = sosig.Links[sosigLink];
SosigWearable val2 = Object.Instantiate<SosigWearable>(item, ((Component)val).transform.position + Vector3.up * 0.15f, ((Component)val).transform.rotation, ((Component)val).transform);
val2.RegisterWearable(val);
}
}
public class KOTHSpawnPointCollection : MonoBehaviour
{
public List<SpawnArea> spawnPoints;
}
public class KOTHTeam : MonoBehaviour
{
public List<KOTHSosig> sosigs;
public List<AtlasSosigEnemyTemplate> sosigTemplates;
public Color teamColor = Color.red;
public SosigWearable teamClothingPrefab;
[HideInInspector]
public int maxSosigs = 20;
[HideInInspector]
public List<SosigEnemyTemplate> builtSosigTemplates;
private void Awake()
{
builtSosigTemplates = sosigTemplates.Select((AtlasSosigEnemyTemplate o) => o.GetSosigEnemyTemplate()).ToList();
}
public void KillAllSosigs()
{
foreach (KOTHSosig sosig in sosigs)
{
sosig.sosig.KillSosig();
}
}
}
public class KOTHTimePeriodOption : MonoBehaviour
{
public string timePeriodName;
public List<KOTHTeam> kothTeams;
public List<PlayerLoadout> loadouts;
public List<LoadoutPool> firearmPools;
public List<LoadoutPool> equipmentPools;
public void SetActiveTimePeriod()
{
KOTHManager.instance.ResetKOTH();
InitializeLoadouts();
KOTHManager.instance.currentTimePeriod = this;
KOTHMenuController.instance.InitLoadoutButtons();
SetupTeams();
KOTHManager.instance.SetPlayerLoadout(loadouts[0]);
}
public void InitializeLoadouts()
{
foreach (LoadoutPool firearmPool in firearmPools)
{
firearmPool.InitializeTables();
}
foreach (LoadoutPool equipmentPool in equipmentPools)
{
equipmentPool.InitializeTables();
}
}
public void SetupTeams()
{
Debug.Log((object)"Setting up teams");
KOTHManager.instance.teams.Clear();
KOTHManager.instance.teams.AddRange(kothTeams);
}
}
}
namespace Prometheuz.Wolf_ET_map_pack
{
[BepInPlugin("Prometheuz.Wolf_ET_map_pack", "Wolf_ET_map_pack", "2.0.3")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("nrgill28.Atlas", "1.0.1")]
public class Wolf_ET_map_packPlugin : BaseUnityPlugin
{
private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
internal static ManualLogSource Logger;
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
LoadAssets();
}
private void LoadAssets()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Prometheuz.Wolf_ET_map_pack");
AtlasPlugin.RegisterScene(Path.Combine(BasePath, "fueldump"));
}
}
}
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class MeshCombiner : MonoBehaviour
{
private const int Mesh16BitBufferVertexLimit = 65535;
[SerializeField]
private bool createMultiMaterialMesh = false;
[SerializeField]
private bool combineInactiveChildren = false;
[SerializeField]
private bool deactivateCombinedChildren = true;
[SerializeField]
private bool deactivateCombinedChildrenMeshRenderers = false;
[SerializeField]
private bool generateUVMap = false;
[SerializeField]
private bool destroyCombinedChildren = false;
[SerializeField]
private string folderPath = "Prefabs/CombinedMeshes";
[SerializeField]
[Tooltip("MeshFilters with Meshes which we don't want to combine into one Mesh.")]
private MeshFilter[] meshFiltersToSkip = (MeshFilter[])(object)new MeshFilter[0];
public bool CreateMultiMaterialMesh
{
get
{
return createMultiMaterialMesh;
}
set
{
createMultiMaterialMesh = value;
}
}
public bool CombineInactiveChildren
{
get
{
return combineInactiveChildren;
}
set
{
combineInactiveChildren = value;
}
}
public bool DeactivateCombinedChildren
{
get
{
return deactivateCombinedChildren;
}
set
{
deactivateCombinedChildren = value;
CheckDeactivateCombinedChildren();
}
}
public bool DeactivateCombinedChildrenMeshRenderers
{
get
{
return deactivateCombinedChildrenMeshRenderers;
}
set
{
deactivateCombinedChildrenMeshRenderers = value;
CheckDeactivateCombinedChildren();
}
}
public bool GenerateUVMap
{
get
{
return generateUVMap;
}
set
{
generateUVMap = value;
}
}
public bool DestroyCombinedChildren
{
get
{
return destroyCombinedChildren;
}
set
{
destroyCombinedChildren = value;
CheckDestroyCombinedChildren();
}
}
public string FolderPath
{
get
{
return folderPath;
}
set
{
folderPath = value;
}
}
private void CheckDeactivateCombinedChildren()
{
if (deactivateCombinedChildren || deactivateCombinedChildrenMeshRenderers)
{
destroyCombinedChildren = false;
}
}
private void CheckDestroyCombinedChildren()
{
if (destroyCombinedChildren)
{
deactivateCombinedChildren = false;
deactivateCombinedChildrenMeshRenderers = false;
}
}
public void CombineMeshes(bool showCreatedMeshInfo)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
Vector3 localScale = ((Component)this).transform.localScale;
int siblingIndex = ((Component)this).transform.GetSiblingIndex();
Transform parent = ((Component)this).transform.parent;
((Component)this).transform.parent