using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.Json.Serialization; using BoneStrike; using BoneStrike.Audio; using BoneStrike.Audio.Effectors; using BoneStrike.Config; using BoneStrike.Manager; using BoneStrike.Phase; using BoneStrike.Tags; using BoneStrike.Teams; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.Data; using Il2CppSLZ.Marrow.Interaction; using Il2CppSLZ.Marrow.Pool; using Il2CppSLZ.Marrow.Warehouse; using Il2CppSystem; using Il2CppTMPro; using LabFusion.Data; using LabFusion.Entities; using LabFusion.Extensions; using LabFusion.Marrow.Extenders; using LabFusion.Marrow.Pool; using LabFusion.Menu; using LabFusion.Menu.Data; using LabFusion.Network; using LabFusion.Network.Serialization; using LabFusion.Player; using LabFusion.RPC; using LabFusion.SDK.Gamemodes; using LabFusion.SDK.Modules; using LabFusion.Senders; using LabFusion.UI.Popups; using LabFusion.Utilities; using MashGamemodeLibrary; using MashGamemodeLibrary.Audio.Containers; using MashGamemodeLibrary.Audio.Loaders; using MashGamemodeLibrary.Audio.Modifiers; using MashGamemodeLibrary.Audio.Music; using MashGamemodeLibrary.Audio.Players.Background; using MashGamemodeLibrary.Audio.Players.Background.Timed; using MashGamemodeLibrary.Audio.Players.Basic.Providers; using MashGamemodeLibrary.Audio.Players.Extensions; using MashGamemodeLibrary.Audio.Players.Object; using MashGamemodeLibrary.Audio.Registry; using MashGamemodeLibrary.Config; using MashGamemodeLibrary.Config.Menu; using MashGamemodeLibrary.Config.Menu.Attributes; using MashGamemodeLibrary.Context; using MashGamemodeLibrary.Entities; using MashGamemodeLibrary.Entities.Behaviour.Cache; using MashGamemodeLibrary.Entities.CommonComponents; using MashGamemodeLibrary.Entities.ECS; using MashGamemodeLibrary.Entities.ECS.Attributes; using MashGamemodeLibrary.Entities.ECS.BaseComponents; using MashGamemodeLibrary.Entities.ECS.Declerations; using MashGamemodeLibrary.Entities.ECS.Networking; using MashGamemodeLibrary.Entities.Interaction; using MashGamemodeLibrary.Entities.Interaction.Grabbing; using MashGamemodeLibrary.Entities.Queries; using MashGamemodeLibrary.Environment; using MashGamemodeLibrary.Environment.Effector; using MashGamemodeLibrary.Environment.Effector.Weather; using MashGamemodeLibrary.Environment.State; using MashGamemodeLibrary.Execution; using MashGamemodeLibrary.Loadout; using MashGamemodeLibrary.Networking.Remote; using MashGamemodeLibrary.Phase; using MashGamemodeLibrary.Player; using MashGamemodeLibrary.Player.Actions; using MashGamemodeLibrary.Player.Data; using MashGamemodeLibrary.Player.Data.Rules; using MashGamemodeLibrary.Player.Data.Rules.Rules; using MashGamemodeLibrary.Player.Helpers; using MashGamemodeLibrary.Player.Stats; using MashGamemodeLibrary.Player.Team; using MashGamemodeLibrary.Util.Timer; using MashGamemodeLibrary.networking.Control; using MashGamemodeLibrary.networking.Validation; using MashGamemodeLibrary.networking.Variable; using MashGamemodeLibrary.networking.Variable.Encoder; using MashGamemodeLibrary.networking.Variable.Encoder.Impl; using MelonLoader; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(Mod), "Bonestrike", "1.0.0", "Mash", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: NetworkIdentifiable("bonestrike")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BoneStrike")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BoneStrike")] [assembly: AssemblyTitle("BoneStrike")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace BoneStrike { public class BoneStrike : ExtendedGamemode { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static PlayerSpectatePredicate <>9__20_0; public static Func <>9__21_1; public static Func <>9__21_2; public static ModifyRuleDelegate <>9__23_1; public static ModifyRuleDelegate <>9__23_2; public static Runnable <>9__27_0; public static Func <>9__30_1; public static Func <>9__30_0; public static Func <>9__31_1; public static Func <>9__31_0; internal bool b__20_0(NetworkPlayer _) { if (AnyDefusers()) { return true; } ExplodeAllBombs(); WinManager.Win(); return false; } internal bool b__21_1(NetworkPlayer p) { return p.HasRig; } internal PlayerID b__21_2(NetworkPlayer p) { return p.PlayerID; } internal void b__23_1(PlayerCrippledRule playerCrippledRule) { playerCrippledRule.IsEnabled = ExtendedGamemode.Config.RemoveMovementMods; } internal void b__23_2(PlayerAmmunitionLimitRule rule) { rule.AmmunitionLimit = (ExtendedGamemode.Config.LimitMags ? new int?(ExtendedGamemode.Config.MagazineCapacity) : null); } internal void b__27_0() { if (GamePhaseManager.ActivePhase is DefusePhase && !AnyDefusers()) { ExplodeAllBombs(); WinManager.Win(); } } internal bool b__30_0(NetworkPlayer player) { if (player.HasRig && LogicTeamManager.IsTeam(player.PlayerID)) { return PlayerComponentExtender.HasComponent(player, (Func)((LimitedRespawn tag) => !tag.IsEliminated)); } return false; } internal bool b__30_1(LimitedRespawn tag) { return !tag.IsEliminated; } internal bool b__31_0(NetworkPlayer player) { if (player.HasRig && LogicTeamManager.IsTeam(player.PlayerID)) { return PlayerComponentExtender.HasComponent(player, (Func)((LimitedRespawn tag) => !tag.IsEliminated)); } return false; } internal bool b__31_1(LimitedRespawn tag) { return !tag.IsEliminated; } } private bool _hasAssignedTeams; private Vector3 _resetPoint = Vector3.zero; public override string Title => "Bone Strike"; public override string Author => "Mash"; public override string LogoResource => "BoneStrike.Resources.Icon.png"; public override bool AutoHolsterOnDeath => true; public override bool DisableDevTools => ExtendedGamemode.Config.DevToolsDisabled; public override bool DisableSpawnGun => ExtendedGamemode.Config.DevToolsDisabled; public override bool DisableManualUnragdoll => true; public override bool SlowMotionDisabled => false; public override int RoundCount => 5; protected override void OnRegistered() { //IL_0014: 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_001f: Expected O, but got Unknown object obj = <>c.<>9__20_0; if (obj == null) { PlayerSpectatePredicate val = delegate { if (AnyDefusers()) { return true; } ExplodeAllBombs(); WinManager.Win(); return false; }; <>c.<>9__20_0 = val; obj = (object)val; } LimitedRespawn.RegisterSpectatePredicate((PlayerSpectatePredicate)obj); } protected override void OnStart() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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: Expected O, but got Unknown _resetPoint = RigData.RigSpawn; Executor.RunIfHost((Runnable)delegate { PersistentTeams.Clear(); PersistentTeams.AddTeam(); PersistentTeams.AddTeam(); if (ExtendedGamemode.Config.ManualTeamAssignment) { _hasAssignedTeams = false; } else { PersistentTeams.AddPlayers(from p in NetworkPlayer.Players where p.HasRig select p.PlayerID); PersistentTeams.RandomizeShift(); _hasAssignedTeams = true; } }, (string)null); } protected override void OnEnd() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) Executor.RunIfHost(new Runnable(PersistentTeams.SendMessage), (string)null); LeaderboardManager.ShowLeaderboard(_resetPoint); ExtendedGamemode.Context.IntermissionMusicPlayer.Stop(); FusionPlayer.ResetSpawnPoints(); } protected override void OnRoundStart() { //IL_0006: 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_002c: Expected O, but got Unknown Notifier.CancelAll(); SpawnPointHelper.SetSpawnPoint(_resetPoint); LogicTeamManager.Enable(); LogicTeamManager.Enable(); Executor.RunIfHost((Runnable)delegate { PlayerDataManager.ModifyAll((ModifyRuleDelegate)delegate(PlayerCrippledRule playerCrippledRule) { playerCrippledRule.IsEnabled = ExtendedGamemode.Config.RemoveMovementMods; }); PlayerDataManager.ModifyAll((ModifyRuleDelegate)delegate(PlayerAmmunitionLimitRule rule) { rule.AmmunitionLimit = (ExtendedGamemode.Config.LimitMags ? new int?(ExtendedGamemode.Config.MagazineCapacity) : null); }); if (ExtendedGamemode.Config.PalletBarcodes.Count > 0) { PalletLoadoutManager.Load((IEnumerable)ExtendedGamemode.Config.PalletBarcodes); } else { PalletLoadoutManager.Load("SLZ.BONELAB.Content"); } PalletLoadoutManager.LoadUtility((IEnumerable)ExtendedGamemode.Config.UtilityBarcodes); if (_hasAssignedTeams) { GamePhaseManager.Enable(); } else { GamePhaseManager.Enable(); } _hasAssignedTeams = true; }, (string)null); AvatarStatManager.BalanceStats = ExtendedGamemode.Config.BalanceStats; PlayerGunManager.NormalizePlayerDamage = ExtendedGamemode.Config.BalanceDamage; ExtendedGamemode.Context.IntermissionMusicPlayer.Stop(); ExtendedGamemode.Context.EnvironmentPlayer.StartPlaying(new EnvironmentProfile("all", new EnvironmentState[3] { (EnvironmentState)(object)new PlantState(), (EnvironmentState)(object)new DefuseState(), (EnvironmentState)(object)new IntermissionState() }, (Action)LocalWeatherManager.ClearLocalWeather)); } protected override void OnRoundEnd(ulong winnerTeamId) { //IL_0014: 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_004f: Expected O, but got Unknown LocalPlayer.TeleportToPosition(_resetPoint); DelayUtilities.InvokeNextFrame((Action)delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) LeaderboardManager.ShowLeaderboard(_resetPoint); }); ExtendedGamemode.Context.IntermissionMusicPlayer.Start(); Executor.RunIfHost((Runnable)delegate { PersistentTeams.AddScore(winnerTeamId, 1); if (winnerTeamId == LogicTeamManager.GetTeamID()) { ExtendedGamemode.Context.CounterTerroristsWinAudioPlayer.PlayRandom(); } else { ExtendedGamemode.Context.TerroristsWinAudioPlayer.PlayRandom(); } }, (string)null); } protected override void OnCleanup() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) LocalVision.Blind = false; LocalControls.LockedMovement = false; foreach (BombMarker item in BombMarker.Query) { if (item.NetworkEntity != null) { DespawnRequestInfo val = default(DespawnRequestInfo); val.DespawnEffect = true; val.EntityID = item.NetworkEntity.ID; NetworkAssetSpawner.Despawn(val); } } } public override void OnLateJoin(PlayerID playerID) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown PlayerID playerID2 = playerID; Executor.RunIfHost((Runnable)delegate { if (!(GamePhaseManager.ActivePhase is TeamAssignmentPhase)) { SpectatorExtender.SetSpectating(playerID2, true); PersistentTeams.QueueLateJoiner(playerID2); } }, (string)null); } protected override void OnPlayerLeft(PlayerID playerId) { //IL_0014: 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_001f: Expected O, but got Unknown object obj = <>c.<>9__27_0; if (obj == null) { Runnable val = delegate { if (GamePhaseManager.ActivePhase is DefusePhase && !AnyDefusers()) { ExplodeAllBombs(); WinManager.Win(); } }; <>c.<>9__27_0 = val; obj = (object)val; } Executor.RunIfHost((Runnable)obj, (string)null); } public override bool CanAttackPlayer(PlayerID player) { GamePhase activePhase = GamePhaseManager.ActivePhase; if (activePhase != null) { if (!(activePhase is TeamAssignmentPhase)) { if (!(activePhase is PlantPhase)) { if (activePhase is DefusePhase defusePhase && LogicTeamManager.IsTeam(player)) { return ((GamePhase)defusePhase).ElapsedTime > ExtendedGamemode.Config.DefuserSpawnProtection && !LogicTeamManager.IsTeamMember(player); } return !LogicTeamManager.IsTeamMember(player); } return false; } return false; } return true; } internal static void ExplodeAllBombs() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!ExtendedGamemode.Config.BombExplosion) { return; } foreach (BombMarker item in BombMarker.Query) { MarrowEntity? marrowEntity = item.MarrowEntity; Transform val = ((marrowEntity != null) ? ((Component)marrowEntity).transform : null); if (!((Object)(object)val == (Object)null)) { Vector3 position = val.position; GameAssetSpawner.SpawnNetworkAsset("BaBaCorp.MiscExplosiveDevices.Spawnable.ExplosionSmallMedDamage", position, Array.Empty()); } } } internal static bool AnyDefusers() { return NetworkPlayer.Players.Any((NetworkPlayer player) => player.HasRig && LogicTeamManager.IsTeam(player.PlayerID) && PlayerComponentExtender.HasComponent(player, (Func)((LimitedRespawn tag) => !tag.IsEliminated))); } internal static bool AnyDefenders() { return NetworkPlayer.Players.Any((NetworkPlayer player) => player.HasRig && LogicTeamManager.IsTeam(player.PlayerID) && PlayerComponentExtender.HasComponent(player, (Func)((LimitedRespawn tag) => !tag.IsEliminated))); } } public class BoneStrikeContext : GameModeContext { private static readonly AudioBin ClockAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.BombBeep", new string[1] { "Mash.BoneStrike.MonoDisc.ClockBeep" }); private static readonly AudioBin KillAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.Kill", new string[1] { "Mash.BoneStrike.MonoDisc.Kill" }); private static readonly AudioBin PlantPhaseStartAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.PlantPhaseStart", new string[1] { "Mash.BoneStrike.MonoDisc.PlantPhaseStart" }); private static readonly AudioBin DefusePhaseStartAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.DefusePhaseStart", new string[1] { "Mash.BoneStrike.MonoDisc.DefusePhaseStart" }); private static readonly AudioBin TerroristsWinAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.TerroristsWin", new string[1] { "Mash.BoneStrike.MonoDisc.TerroristsWin" }); private static readonly AudioBin CounterTerroristsWinAudioBin = AudioRegistry.CreateBin("MashTags.SFX.Bonestrike.CounterTerroristsWin", new string[1] { "Mash.BoneStrike.MonoDisc.CounterTerroristsWin" }); public readonly TimedComponentPlayer BombAudioPlayer = new TimedComponentPlayer((IRandomAudioPlayer)new ObjectAudioPlayer("BombSound", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(ClockAudioBin))), 1, new AudioModifierFactory().AddModifier((ModifierDelegate)((AudioSettingsModifier settings) => settings.SetVolume(1f).SetMaxDistance(200f)))), 5f, (float?)6f); public readonly PositionalAudioPlayer KillAudioPlayer = new PositionalAudioPlayer("KillSound", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(KillAudioBin))), (AudioSourceProvider)new PooledAudioSourceProvider(5, new AudioModifierFactory().AddModifier((ModifierDelegate)((AudioSettingsModifier settings) => settings.SetVolume(1f).SetMaxDistance(800f).SetSpatialBlend(0.45f) .SetCustomRolloff(AnimationCurve.Constant(0f, 1f, 1f)))))); public readonly AnnouncementAudioPlayer PlantPhaseStartAudioPlayer = new AnnouncementAudioPlayer("PlantPhaseStart", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(PlantPhaseStartAudioBin))), (AudioModifierFactory)null); public readonly AnnouncementAudioPlayer DefusePhaseStartAudioPlayer = new AnnouncementAudioPlayer("DefusePhaseStart", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(DefusePhaseStartAudioBin))), (AudioModifierFactory)null); public readonly AnnouncementAudioPlayer TerroristsWinAudioPlayer = new AnnouncementAudioPlayer("TerroristsWin", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(TerroristsWinAudioBin))), (AudioModifierFactory)null); public readonly AnnouncementAudioPlayer CounterTerroristsWinAudioPlayer = new AnnouncementAudioPlayer("CounterTerroristsWin", (ISyncedAudioContainer)new DesyncedAudioContainer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new AudioBinLoader(CounterTerroristsWinAudioBin))), (AudioModifierFactory)null); public readonly EnvironmentManager EnvironmentPlayer = new EnvironmentManager((Func)EnvironmentContext.GetContext); public readonly MusicPlayer IntermissionMusicPlayer = new MusicPlayer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new MusicPackLoader((MusicPackTags)2))); } public class FusionModule : Module { public override string Name => "BoneStrike"; protected override void OnModuleRegistered() { GamemodeRegistration.RegisterGamemode(); } } public class Mod : MelonMod { public override void OnInitializeMelon() { if (MelonBase.FindMelon("LabFusion", "Lakatrazz") != null) { ModuleManager.RegisterModule(); Mod.Register(); } } } } namespace BoneStrike.Teams { public class CounterTerroristTeam : LogicTeam { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_2; public static Runnable <>9__7_0; internal LimitedRespawn b__5_2() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown return new LimitedRespawn(0); } internal void b__7_0() { LocalControls.LockedMovement = false; } } public override string Name => "LavaGang"; public override Texture Icon { get; } = MenuResources.GetLogoIcon("LavaGang"); public override void OnPhaseChanged(GamePhase phase) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown GamePhase phase2 = phase; Executor.RunIfHost((Runnable)delegate { PlayerComponentExtender.ToggleComponent(((LogicTeam)this).Owner, phase2 is DefusePhase, (Func)(() => new LimitedRespawn(0))); }, (string)null); Executor.RunIfMe(((LogicTeam)this).Owner.PlayerID, (Runnable)delegate { LocalControls.LockedMovement = phase2 is PlantPhase; LocalVision.Blind = phase2 is PlantPhase && ExtendedGamemode.Config.BlindAttackersDuringPlanting; }); } protected override void OnAssigned() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown PlayerComponentExtender.AddComponent(((LogicTeam)this).Owner, (IComponent)(object)new KillEffect()); Executor.RunIfMe(((LogicTeam)this).Owner.PlayerID, (Runnable)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown PlayerComponentExtender.AddComponent(((LogicTeam)this).Owner, (IComponent)(object)new PlayerHandTimerTag()); AvatarStats val = default(AvatarStats); val.Agility = 1.2f; val.LowerStrength = 1.2f; val.UpperStrength = 1.2f; val.Speed = ExtendedGamemode.Config.MovementSpeedMultiplier; val.Vitality = 1f; AvatarStatManager.SetStats(((AvatarStats)(ref val)).MultiplyHealth(ExtendedGamemode.Config.AttackerHealthMultiplier)); Notifier.Send(new Notification { Title = NotificationText.op_Implicit("LavaGang"), Message = NotificationText.op_Implicit("Stop Sabrelake from ending the simulation by disabling the alarm!"), PopupLength = 10f, SaveToMenu = false, ShowPopup = true, Type = (NotificationType)0 }); }); } protected override void OnRemoved() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown PlayerID playerID = ((LogicTeam)this).Owner.PlayerID; object obj = <>c.<>9__7_0; if (obj == null) { Runnable val = delegate { LocalControls.LockedMovement = false; }; <>c.<>9__7_0 = val; obj = (object)val; } Executor.RunIfMe(playerID, (Runnable)obj); } } public class TerroristTeam : LogicTeam { public override string Name => "Sabrelake"; public override Texture Icon { get; } = MenuResources.GetLogoIcon("Sabrelake"); public override void OnPhaseChanged(GamePhase phase) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GamePhase phase2 = phase; Executor.RunIfHost((Runnable)delegate { PlayerComponentExtender.ToggleComponent(((LogicTeam)this).Owner, phase2 is DefusePhase, (Func)(() => new LimitedRespawn(0))); }, (string)null); } protected override void OnAssigned() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown PlayerComponentExtender.AddComponent(((LogicTeam)this).Owner, (IComponent)(object)new KillEffect()); Executor.RunIfMe(((LogicTeam)this).Owner.PlayerID, (Runnable)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown PlayerComponentExtender.AddComponent(((LogicTeam)this).Owner, (IComponent)(object)new PlayerHandTimerTag()); AvatarStats val = default(AvatarStats); val.Agility = 1.2f; val.LowerStrength = 1.2f; val.UpperStrength = 1.2f; val.Speed = ExtendedGamemode.Config.MovementSpeedMultiplier; val.Vitality = 1f; AvatarStatManager.SetStats(((AvatarStats)(ref val)).MultiplyHealth(ExtendedGamemode.Config.DefenderHealthMultiplier)); Notifier.Send(new Notification { Title = NotificationText.op_Implicit("Sabrelake"), Message = NotificationText.op_Implicit("Hide and defend the alarm clock and purge the simulation."), PopupLength = 10f, SaveToMenu = false, ShowPopup = true, Type = (NotificationType)0 }); }); } } } namespace BoneStrike.Tags { public class BombMarker : IComponent, IEntityAttached, IBehaviour, IRemoved, IPhaseChanged, IUpdate, IGrabCallback, IDropCallback { public static readonly CachedQuery Query = CachedQueryManager.Create(); private const float MaxVelocitySquared = 400f; public NetworkEntity? NetworkEntity; public MarrowEntity? MarrowEntity; private Vector3? _returnPosition; private List? _rigidbodies; private bool _isGrabbed; public void OnReady(NetworkEntity networkEntity, MarrowEntity marrowEntity) { NetworkEntity = networkEntity; MarrowEntity = marrowEntity; _rigidbodies = ((IEnumerable)MarrowEntity._bodies).Select((MarrowBody b) => b._rigidbody).ToList(); } public void OnPhaseChange(GamePhase gamePhase) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)MarrowEntity == (Object)null) && gamePhase is DefusePhase) { _returnPosition = ((Component)MarrowEntity).transform.position; } } public void OnRemoved() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Executor.RunIfHost(new Runnable(WinManager.Win), (string)null); } public void Update(float delta) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MarrowEntity == (Object)null || _rigidbodies == null) { return; } if (_isGrabbed) { _returnPosition = ((Component)MarrowEntity).transform.position; } else if (!(_rigidbodies.Average(delegate(Rigidbody r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = r.velocity; return ((Vector3)(ref velocity)).sqrMagnitude; }) < 400f)) { _rigidbodies.ForEach(delegate(Rigidbody r) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) r.velocity = Vector3.zero; }); if (_returnPosition.HasValue) { ((Component)MarrowEntity).transform.position = _returnPosition.Value; } } } public void OnGrabbed(GrabRequest grabRequest) { _isGrabbed = true; } public void OnDropped(GrabRequest grabRequest) { _isGrabbed = false; } } public class DefusableTag : IEntityAttached, IBehaviour, IComponent, IGrabPredicate, IRemoved, IUpdate, IGrabCallback, IDropCallback, INetworkEvents, INetSerializable { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Runnable <>9__10_0; internal void b__10_0() { LocalControls.LockedMovement = true; } } private static readonly RemoteEvent DefuseEvent = new RemoteEvent("DefuseEvent", new EventHandler(OnDefuse), CommonNetworkRoutes.AllToHost); private const int SyncTimeEventIndex = 0; private PlayerID? _grabber; private Transform? _offset; private TextMeshPro? _text; private Poolee? _timerObject; private TextMeshPro? _clockText; private bool _isDefused; private float _timer; public void OnDropped(GrabRequest grabRequest) { _grabber = null; Poolee? timerObject = _timerObject; if (timerObject != null) { ((Component)timerObject).gameObject.SetActive(false); } if (GamePhaseManager.IsPhase()) { LocalControls.LockedMovement = false; } if (grabRequest.NetworkPlayer.PlayerID.IsMe) { NetworkEventsExtender.SendEvent((INetworkEvents)(object)this, (byte)0, 4, (Action)delegate(NetWriter writer) { writer.Write(_timer); }); } } public void OnGrabbed(GrabRequest grabRequest) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown if (GamePhaseManager.IsPhase() || !LogicTeamManager.IsTeam(grabRequest.NetworkPlayer.PlayerID)) { return; } PlayerID playerID = grabRequest.NetworkPlayer.PlayerID; object obj = <>c.<>9__10_0; if (obj == null) { Runnable val = delegate { LocalControls.LockedMovement = true; }; <>c.<>9__10_0 = val; obj = (object)val; } Executor.RunIfMe(playerID, (Runnable)obj); _grabber = grabRequest.NetworkPlayer.PlayerID; Poolee? timerObject = _timerObject; if (timerObject != null) { ((Component)timerObject).gameObject.SetActive(true); } if (grabRequest.NetworkPlayer.PlayerID.IsMe) { NetworkEventsExtender.SendEvent((INetworkEvents)(object)this, (byte)0, 4, (Action)delegate(NetWriter writer) { writer.Write(_timer); }); } } public bool CanGrab(GrabRequest grabRequest) { if (GamePhaseManager.IsPhase()) { return LogicTeamManager.IsLocalTeam(); } return LogicTeamManager.IsLocalTeam(); } public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref _timer); } public void OnReady(NetworkEntity networkEntity, MarrowEntity marrowEntity) { SpawnTimer(((Component)marrowEntity).transform); _clockText = ((Component)marrowEntity).GetComponentInChildren(); } public void OnRemoved() { Poolee? timerObject = _timerObject; if (timerObject != null) { timerObject.Despawn(); } } public void Update(float delta) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) GamePhase activePhase = GamePhaseManager.ActivePhase; if (activePhase != null && (Object)(object)_clockText != (Object)null) { float num = activePhase.Duration - activePhase.ElapsedTime; int value = Math.Max(Mathf.FloorToInt(num / 60f), 0); int value2 = Math.Max(Mathf.FloorToInt(num % 60f), 0); ((TMP_Text)_clockText).text = $"{value:D2}:{value2:D2}"; } if (_grabber == null || GamePhaseManager.IsPhase()) { return; } _timer += delta; float defuseTime = ExtendedGamemode.Config.DefuseTime; if (defuseTime - _timer <= 0f && !_isDefused) { Defuse(); return; } if ((Object)(object)_offset != (Object)null && (Object)(object)_timerObject != (Object)null) { _offset.position = ((Component)_timerObject).transform.position + new Vector3(0f, 0.2f, 0f); } if (!((Object)(object)_text == (Object)null)) { ((TMP_Text)_text).text = (defuseTime - _timer).ToString("F1", CultureInfo.InvariantCulture); } } private void Defuse() { if (_grabber != null && _grabber.IsMe && !_isDefused) { _isDefused = true; if (NetworkInfo.IsHost) { WinManager.Win(); } else { MelonLogger.Msg("Sent defuse request."); DefuseEvent.CallFor(PlayerIDManager.GetHostID()); } _grabber = null; } } private void SpawnTimer(Transform parent) { //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) Transform parent2 = parent; if (!Object.op_Implicit((Object)(object)_timerObject)) { Spawnable obj = LocalAssetSpawner.CreateSpawnable("Mash.BoneStrike.Spawnable.Timer"); LocalAssetSpawner.Register(obj); LocalAssetSpawner.Spawn(obj, Vector3.zero, Quaternion.identity, (Action)delegate(Poolee poolee) { //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) ((Component)poolee).gameObject.SetActive(false); _timerObject = poolee; _offset = ((Component)_timerObject).transform.GetChild(0); _text = ((Component)poolee).GetComponentInChildren(); ((Component)poolee).transform.parent = parent2; ((Component)poolee).transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); }); } } public void OnEvent(byte senderId, byte eventIndex, NetReader reader) { if (eventIndex == 0 && PlayerID.op_Implicit(PlayerIDManager.LocalID) != senderId) { _timer = reader.ReadSingle(); } } private static void OnDefuse(byte senderId) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown if (!GamePhaseManager.IsPhase() && PlayerIDManager.SmallIDLookup.TryGetValue(senderId, out var value) && value.IsValid) { if (!LogicTeamManager.IsTeam(value)) { MelonLogger.Warning($"Player {value} attempted to defuse but is not on the Counter-Terrorist team."); } Executor.RunIfHost(new Runnable(WinManager.Win), (string)null); } } } [LocalOnly] public class KillEffect : IComponent, IPlayerAttached, IPlayerBehaviour, IBehaviour, IPlayerActionCallback { private NetworkPlayer? _owner; public void OnReady(NetworkPlayer networkPlayer) { _owner = networkPlayer; } public void OnAction(PlayerActionType action, PlayerID otherPlayer) { //IL_000d: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Executor.RunIfHost((Runnable)delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //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_0050: Unknown result type (might be due to invalid IL or missing references) if (_owner != null && (int)action == 3 && _owner.HasRig) { Vector3 position = _owner.RigRefs.Head.position; ExtendedGamemode.Context.KillAudioPlayer.PlayRandom(position); } }, (string)null); } } public class OvertimeMarker : IComponent, IEntityAttached, IBehaviour, IRemoved, IUpdate { private const string MarkerBarcode = "Mash.BoneStrike.Spawnable.BombMarker"; private const float BlinkTime = 1f; private const float BlinkInterval = 0.5f; private MarrowEntity? _marrowEntity; private Poolee? _poolee; private MeshRenderer? _renderer; private bool _isVisible; private float _timer; public void OnReady(NetworkEntity networkEntity, MarrowEntity marrowEntity) { //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) _marrowEntity = marrowEntity; Spawnable obj = LocalAssetSpawner.CreateSpawnable("Mash.BoneStrike.Spawnable.BombMarker"); LocalAssetSpawner.Register(obj); LocalAssetSpawner.Spawn(obj, Vector3.zero, Quaternion.identity, (Action)delegate(Poolee poolee) { _poolee = poolee; _renderer = ((Component)poolee).GetComponentInChildren(); if ((Object)(object)_renderer != (Object)null) { ((Renderer)_renderer).enabled = false; } }); } public void OnRemoved() { if (!((Object)(object)_poolee == (Object)null)) { _poolee.Despawn(); _poolee = null; _renderer = null; } } public void Update(float delta) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_marrowEntity == (Object)null) && !((Object)(object)_poolee == (Object)null) && !((Object)(object)_renderer == (Object)null)) { _timer += delta; float num = (_isVisible ? 0.5f : 1f); if (!(_timer < num)) { _timer = 0f; _isVisible = !_isVisible; ((Renderer)_renderer).enabled = _isVisible; ((Component)_poolee).transform.position = ((Component)_marrowEntity).transform.position; } } } } [LocalOnly] public class PlayerHandTimerTag : IPlayerAttached, IPlayerBehaviour, IBehaviour, IUpdate, IComponent, IRemoved { public static readonly CachedQuery Query = CachedQueryManager.Create(); private Transform? _compasPointer; private bool _isSpawning; private NetworkPlayer _owner; private Func>? _getTargetTransform; private TextMeshPro? _text; private Poolee? _timerObject; public void SetTarget(Func> getter) { _getTargetTransform = getter; } public void OnReady(NetworkPlayer networkPlayer) { _owner = networkPlayer; SpawnTimer(); } public void OnRemoved() { Poolee? timerObject = _timerObject; if (timerObject != null) { timerObject.Despawn(); } _timerObject = null; } public void Update(float delta) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_timerObject == (Object)null) { return; } GamePhase activePhase = GamePhaseManager.ActivePhase; if ((!_owner.PlayerID.IsMe && SpectatorExtender.IsSpectating(_owner)) || activePhase == null) { ((Component)_timerObject).gameObject.SetActive(false); return; } ((Component)_timerObject).gameObject.SetActive(true); Transform transform = ((Component)_owner.RigRefs.LeftHand).transform; Vector3 position2 = transform.position; Vector3 position = position2 + transform.forward * 0.05f + transform.right * -0.05f; Quaternion rotation = transform.rotation; ((Component)_timerObject).transform.SetPositionAndRotation(position, rotation); if ((Object)(object)_compasPointer != (Object)null) { Vector3? val = _getTargetTransform?.Invoke().DefaultIfEmpty().MinBy(delegate(Vector3 t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) Vector3 val3 = t - position; return ((Vector3)(ref val3)).sqrMagnitude; }); ((Component)_compasPointer).gameObject.SetActive(val.HasValue); if (val.HasValue) { Vector3 val2 = val.Value - position; val2 = Vector3.ProjectOnPlane(((Vector3)(ref val2)).normalized, Vector3.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = Mathf.Atan2(normalized.x, normalized.z) * 57.29578f; Vector3 right = transform.right; val2 = Vector3.ProjectOnPlane((-right + transform.up) * 2.5f, Vector3.up); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; float num2 = Mathf.Atan2(normalized2.x, normalized2.z) * 57.29578f; float num3 = (((-right).y > 0f) ? 180f : 0f); float num4 = 0f - num + num2 + num3; _compasPointer.localEulerAngles = new Vector3(num4, 0f, 0f); } } if (!((Object)(object)_text == (Object)null)) { float num5 = activePhase.Duration - activePhase.ElapsedTime; int value = Math.Max(Mathf.FloorToInt(num5 / 60f), 0); int value2 = Math.Max(Mathf.FloorToInt(num5 % 60f), 0); ((TMP_Text)_text).text = $"{value:D2}:{value2:D2}"; } } private void SpawnTimer() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_timerObject != (Object)null) && !_isSpawning) { _isSpawning = true; Spawnable obj = LocalAssetSpawner.CreateSpawnable("Mash.BoneStrike.Spawnable.HandTimer"); LocalAssetSpawner.Register(obj); LocalAssetSpawner.Spawn(obj, Vector3.zero, Quaternion.identity, (Action)delegate(Poolee poolee) { _timerObject = poolee; _text = ((Component)poolee).GetComponentInChildren(); _compasPointer = ((Component)poolee).transform.FindChild("Compas"); _isSpawning = false; }); } } } } namespace BoneStrike.Phase { public class DefusePhase : GamePhase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__5_0; public static Func <>9__7_2; public static Func <>9__7_3; public static Func> <>9__7_1; public static ModifyRuleDelegate <>9__7_4; public static Runnable <>9__7_0; internal void b__5_0(float _) { if (!ExtendedGamemode.Config.MarkBombNearEnd) { return; } foreach (BombMarker item in BombMarker.Query) { NetworkEntity? networkEntity = item.NetworkEntity; if (networkEntity != null) { NetworkEntityExtender.AddComponent(networkEntity, (IComponent)(object)new OvertimeMarker()); } } } internal IEnumerable b__7_1() { return from p in (IEnumerable)BombMarker.Query where (Object)(object)p.MarrowEntity != (Object)null select ((Component)p.MarrowEntity).transform.position; } internal bool b__7_2(BombMarker p) { return (Object)(object)p.MarrowEntity != (Object)null; } internal Vector3 b__7_3(BombMarker p) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)p.MarrowEntity).transform.position; } internal void b__7_0() { ExtendedGamemode.Context.BombAudioPlayer.Start(); ExtendedGamemode.Context.DefusePhaseStartAudioPlayer.PlayRandom(); PlayerDataManager.ModifyAll((ModifyRuleDelegate)delegate(HideEnemyNametagsRule rule) { rule.IsEnabled = true; }); } internal void b__7_4(HideEnemyNametagsRule rule) { rule.IsEnabled = true; } } public override string Name => "Defuse Phase"; public override float Duration => ExtendedGamemode.Config.DefuseDuration; protected override TimeMarker[] Markers => (TimeMarker[])(object)new TimeMarker[3] { CommonTimeMarkerEvents.TimeRemaining(10f), new TimeMarker((MarkerType)1, 30f, (Action)delegate { if (!ExtendedGamemode.Config.MarkBombNearEnd) { return; } foreach (BombMarker item in BombMarker.Query) { NetworkEntity? networkEntity = item.NetworkEntity; if (networkEntity != null) { NetworkEntityExtender.AddComponent(networkEntity, (IComponent)(object)new OvertimeMarker()); } } }), CommonTimeMarkerEvents.TimeRemaining(60f) }; public override PhaseIdentifier GetNextPhase() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!((GamePhase)this).HasReachedDuration()) { return PhaseIdentifier.Empty(); } BoneStrike.ExplodeAllBombs(); WinManager.Win(); return PhaseIdentifier.Empty(); } protected override void OnPhaseEnter() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown Notifier.Send(new Notification { Title = NotificationText.op_Implicit("Game Start!"), Message = NotificationText.op_Implicit(LogicTeamManager.IsLocalTeam() ? "Defend the bomb!" : "Defuse the bomb!"), ShowPopup = true, SaveToMenu = false, PopupLength = 4f, Type = (NotificationType)0 }); Executor.RunCheckedInFuture((Action)DropClock, TimeSpan.FromSeconds(5.0)); foreach (PlayerHandTimerTag item in PlayerHandTimerTag.Query) { item.SetTarget(() => from p in (IEnumerable)BombMarker.Query where (Object)(object)p.MarrowEntity != (Object)null select ((Component)p.MarrowEntity).transform.position); } object obj = <>c.<>9__7_0; if (obj == null) { Runnable val = delegate { ExtendedGamemode.Context.BombAudioPlayer.Start(); ExtendedGamemode.Context.DefusePhaseStartAudioPlayer.PlayRandom(); PlayerDataManager.ModifyAll((ModifyRuleDelegate)delegate(HideEnemyNametagsRule rule) { rule.IsEnabled = true; }); }; <>c.<>9__7_0 = val; obj = (object)val; } Executor.RunIfHost((Runnable)obj, (string)null); } private static void DropClock() { if (!LogicTeamManager.IsLocalTeam() || !RigData.HasPlayer) { return; } foreach (Hand item in MarrowInventoryExtender.GetHandsHoldingTag(RigData.Refs)) { HandExtensions.TryDetach(item); } } } internal class FetchClockPacket : INetSerializable, IKnownSenderPacket { public Handedness Hand; public byte SenderSmallId { get; set; } public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref Hand); } } public class PlantPhase : GamePhase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Runnable <>9__10_0; internal void b__10_0() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown PhaseShouldQuit.Value = false; PersistentTeams.AssignAll(); PalletLoadoutManager.AssignAll(); Vector3 position = ((Component)((GameModeContext)(object)ExtendedGamemode.Context).LocalPlayer.RigRefs.RightHand).transform.position; GameAssetSpawner.SpawnNetworkAsset(ClockBarcode, position, (IComponent[])(object)new IComponent[3] { new BombMarker(), new DefusableTag(), (IComponent)new ImportantEntityMarker() }); ExtendedGamemode.Context.PlantPhaseStartAudioPlayer.PlayRandom(); } } private static readonly string ClockBarcode = "SLZ.BONELAB.Content.Spawnable.AlarmClock"; private static readonly SyncedVariable PhaseShouldQuit = new SyncedVariable("SkipPlantPhase", (IEncoder)new BoolEncoder(), false, CommonNetworkRoutes.AllToAll); private static readonly RemoteEvent FetchClockEvent = new RemoteEvent("FetchClockEvent", (PacketHandler)OnFetchClock, CommonNetworkRoutes.AllToHost); public override string Name => "Plant Phase"; public override float Duration => ExtendedGamemode.Config.PlantDuration; protected override TimeMarker[] Markers => (TimeMarker[])(object)new TimeMarker[2] { CommonTimeMarkerEvents.TimeRemaining(10f), CommonTimeMarkerEvents.TimeRemaining(60f) }; public override PhaseIdentifier GetNextPhase() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (((GamePhase)this).HasReachedDuration() || PhaseShouldQuit.Value) { return PhaseIdentifier.Of(); } return PhaseIdentifier.Empty(); } protected override void OnPhaseEnter() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown LocalInventory.SetAmmo(2000); PlayerGrabManager.GrabPredicate = new GrabPredicateHanlder(GrabPredicate); object obj = <>c.<>9__10_0; if (obj == null) { Runnable val = delegate { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown PhaseShouldQuit.Value = false; PersistentTeams.AssignAll(); PalletLoadoutManager.AssignAll(); Vector3 position = ((Component)((GameModeContext)(object)ExtendedGamemode.Context).LocalPlayer.RigRefs.RightHand).transform.position; GameAssetSpawner.SpawnNetworkAsset(ClockBarcode, position, (IComponent[])(object)new IComponent[3] { new BombMarker(), new DefusableTag(), (IComponent)new ImportantEntityMarker() }); ExtendedGamemode.Context.PlantPhaseStartAudioPlayer.PlayRandom(); }; <>c.<>9__10_0 = val; obj = (object)val; } Executor.RunIfHost((Runnable)obj, (string)null); } protected override void OnPhaseExit() { PlayerGrabManager.GrabPredicate = null; } public override void OnPlayerAction(PlayerID playerId, PlayerGameActions action, Handedness handedness) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) NetworkPlayer val = default(NetworkPlayer); if (playerId.IsMe && (int)action == 6 && LogicTeamManager.IsTeam(playerId) && NetworkPlayerManager.TryGetPlayer(PlayerID.op_Implicit(playerId), ref val)) { if (MarrowInventoryExtender.IsHolding(val, handedness)) { PhaseShouldQuit.Value = true; return; } FetchClockEvent.Call(new FetchClockPacket { Hand = handedness }); } } private bool GrabPredicate(GrabRequest request) { NetworkEntity grabbedNetworkEntity = request.GrabbedNetworkEntity; if (grabbedNetworkEntity == null) { return true; } NetworkPlayer extender = grabbedNetworkEntity.GetExtender(); if (extender != null && !LogicTeamManager.IsTeamMember(extender.PlayerID)) { return false; } Transform parent = ((Component)request.GrabbedEntity).transform.parent; if ((Object)(object)parent == (Object)null) { return true; } InventorySlotReceiver component = ((Component)parent).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } NetworkEntity val = default(NetworkEntity); if (!InventorySlotReceiverExtender.Cache.TryGet(component, ref val)) { return true; } if (!val.HasOwner) { return true; } if (LogicTeamManager.IsTeamMember(val.OwnerID)) { return true; } return false; } private static void OnFetchClock(FetchClockPacket packet) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) NetworkPlayer val = default(NetworkPlayer); if (!NetworkPlayerManager.TryGetPlayer(packet.SenderSmallId, ref val) || !val.HasRig) { return; } Hand hand = val.RigRefs.GetHand(packet.Hand); if (hand.HasAttachedObject()) { return; } Vector3 position = hand.palmPositionTransform.position; InteractableHost val2 = default(InteractableHost); foreach (BombMarker item in BombMarker.Query) { NetworkEntity networkEntity = item.NetworkEntity; if (networkEntity == null) { continue; } NetworkProp extender = networkEntity.GetExtender(); if (extender != null) { MarrowEntity marrowEntity = extender.MarrowEntity; if (!((Object)(object)marrowEntity == (Object)null) && (!InteractableHost.Cache.TryGet(((Component)marrowEntity).gameObject, ref val2) || !val2.IsAttached)) { NetworkEntityManager.TakeOwnership(networkEntity); networkEntity.LockOwner(); marrowEntity.EnableColliders(false); marrowEntity._anchorBody._rigidbody.velocity = Vector3.zero; marrowEntity.Teleport(position, Quaternion.identity, true); marrowEntity.EnableColliders(true); networkEntity.UnlockOwner(); } } } } } public record SpawnTeamWallPacket : INetSerializable { public Vector3 Position; public float Yaw; public void Serialize(INetSerializer serializer) { NetSerializerUnityExtensions.SerializeValue(serializer, ref Position); serializer.SerializeValue(ref Yaw); } [CompilerGenerated] protected virtual bool PrintMembers(StringBuilder builder) { RuntimeHelpers.EnsureSufficientExecutionStack(); builder.Append("Position = "); builder.Append(((object)(Vector3)(ref Position)).ToString()); builder.Append(", Yaw = "); builder.Append(Yaw.ToString()); return true; } } internal record struct PlayerWallSide(PlayerID PlayerID, bool IsInFront); public class TeamAssignmentPhase : GamePhase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__12_0; public static Func <>9__14_0; public static Runnable <>9__16_0; public static Action <>9__19_0; internal bool b__12_0(NetworkPlayer player) { return player.HasRig; } internal bool b__14_0(PlayerWallSide p) { return p.IsInFront; } internal void b__16_0() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) NetworkPlayer networkPlayer = LocalPlayer.GetNetworkPlayer(); Transform val = ((networkPlayer != null) ? networkPlayer.RigRefs.Head : null); if (!((Object)(object)val == (Object)null)) { Quaternion rotation = val.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; SpawnTeamWallEvent.Call(new SpawnTeamWallPacket { Position = val.position, Yaw = y }); } } internal void b__19_0(Poolee poolee) { _poolee = poolee; _timerTexts = Il2CppArrayBase.op_Implicit(((Component)poolee).GetComponentsInChildren()); } } private static readonly RemoteEvent SpawnTeamWallEvent = new RemoteEvent((PacketHandler)SpawnTeamWallHandler, CommonNetworkRoutes.HostToAll); private static readonly string TeamWallBarcode = "Mash.BoneStrike.Spawnable.TeamWALL"; private static Poolee? _poolee; private static TextMeshPro[] _timerTexts = (TextMeshPro[])(object)new TextMeshPro[2]; private static Vector3 _wallPosition; private static Quaternion _wallRotation; private static bool _areTeamsFair; public override string Name => "Team Assignment Phase"; public override float Duration => 15f; private bool IsPositionInFrontOfWall(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position - _wallPosition; Vector3 val2 = _wallRotation * Vector3.forward; return Vector3.Dot(val, val2) > 0f; } private IEnumerable GetPlayerWallSides() { return from player in NetworkPlayer.Players where player.HasRig select new PlayerWallSide(player.PlayerID, IsPositionInFrontOfWall(player.RigRefs.Head.position)); } public override PhaseIdentifier GetNextPhase() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!((GamePhase)this).HasReachedDuration()) { return PhaseIdentifier.Empty(); } return PhaseIdentifier.Of(); } private bool AreTeamsFair() { List list = GetPlayerWallSides().ToList(); int num = list.Count((PlayerWallSide p) => p.IsInFront); int num2 = list.Count - num; if (num == 0 || num2 == 0) { return false; } if (ExtendedGamemode.Config.AllowUnbalancedTeams) { return true; } int num3 = (((num + num2) % 2 != 0) ? 1 : 0); if (Mathf.Abs(num - num2) > num3) { return false; } return true; } public override bool CanTimerTick() { _areTeamsFair = AreTeamsFair(); return _areTeamsFair; } protected override void OnPhaseEnter() { //IL_0014: 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_001f: Expected O, but got Unknown object obj = <>c.<>9__16_0; if (obj == null) { Runnable val = delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) NetworkPlayer networkPlayer = LocalPlayer.GetNetworkPlayer(); Transform val2 = ((networkPlayer != null) ? networkPlayer.RigRefs.Head : null); if (!((Object)(object)val2 == (Object)null)) { Quaternion rotation = val2.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; SpawnTeamWallEvent.Call(new SpawnTeamWallPacket { Position = val2.position, Yaw = y }); } }; <>c.<>9__16_0 = val; obj = (object)val; } Executor.RunIfHost((Runnable)obj, (string)null); } protected override void OnPhaseExit() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Executor.RunIfHost((Runnable)delegate { //IL_0040: Unknown result type (might be due to invalid IL or missing references) List[] array = new List[2] { new List(), new List() }; foreach (NetworkPlayer player in NetworkPlayer.Players) { if (player.HasRig) { int num = ((!IsPositionInFrontOfWall(player.RigRefs.Head.position)) ? 1 : 0); array[num].Add(player.PlayerID); } } PersistentTeams.OverwritePlayers((IEnumerable>)array); }, (string)null); if (!((Object)(object)_poolee == (Object)null)) { _poolee.Despawn(); _poolee = null; } } protected override void OnUpdate() { //IL_00c0: 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) if ((Object)(object)_poolee == (Object)null) { return; } TextMeshPro[] timerTexts; if (!_areTeamsFair) { timerTexts = _timerTexts; foreach (TextMeshPro obj in timerTexts) { ((Graphic)obj).color = Color.red; ((TMP_Text)obj).text = "X"; } return; } float num = ((GamePhase)this).Duration - ((GamePhase)this).ElapsedTime; int value = Math.Max(Mathf.FloorToInt(num / 60f), 0); int value2 = Math.Max(Mathf.FloorToInt(num % 60f), 0); string text = $"{value:D1}:{value2:D2}"; timerTexts = _timerTexts; foreach (TextMeshPro obj2 in timerTexts) { ((Graphic)obj2).color = Color.white; ((TMP_Text)obj2).text = text; } } private static void SpawnTeamWall(Vector3 position, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) _wallPosition = position; _wallRotation = rotation; if ((Object)(object)_poolee != (Object)null) { Transform transform = ((Component)_poolee).transform; transform.position = position; transform.rotation = rotation; return; } Spawnable obj = LocalAssetSpawner.CreateSpawnable(TeamWallBarcode); LocalAssetSpawner.Register(obj); LocalAssetSpawner.Spawn(obj, position, rotation, (Action)delegate(Poolee poolee) { _poolee = poolee; _timerTexts = Il2CppArrayBase.op_Implicit(((Component)poolee).GetComponentsInChildren()); }); } private static void SpawnTeamWallHandler(SpawnTeamWallPacket packet) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) Quaternion rotation = Quaternion.Euler(0f, packet.Yaw, 0f); SpawnTeamWall(packet.Position, rotation); } } } namespace BoneStrike.Manager { internal class LeaderboardPlayerEntry { public GameObject Root; public Image Background; public TextMeshPro PositionText; public TextMeshPro NameText; public TextMeshPro KillsText; public TextMeshPro DeathsText; public TextMeshPro AssistsText; public TextMeshPro WinsText; public TextMeshPro ScoreText; public LeaderboardPlayerEntry(GameObject root) { Transform transform = root.transform; Root = ((Component)transform.Find("Content")).gameObject; Background = Root.GetComponent(); PositionText = ((Component)root.transform.Find("Content/Position")).GetComponent(); NameText = ((Component)root.transform.Find("Content/Player")).GetComponent(); KillsText = ((Component)root.transform.Find("Content/Stats/Kills")).GetComponent(); DeathsText = ((Component)root.transform.Find("Content/Stats/Deaths")).GetComponent(); AssistsText = ((Component)root.transform.Find("Content/Stats/Assists")).GetComponent(); WinsText = ((Component)root.transform.Find("Content/Stats/Wins")).GetComponent(); ScoreText = ((Component)root.transform.Find("Content/Stats/Score")).GetComponent(); } } internal class LeaderboardPlayerData { public PlayerID PlayerId { get; init; } public int Kills { get; init; } public int Deaths { get; init; } public int Assists { get; init; } public int Wins { get; init; } public int Score { get; init; } public LeaderboardPlayerData(PlayerStatistics statistics) { PlayerId = PlayerIDManager.GetPlayerID(statistics.PlayerID); Kills = statistics.GetValue((Enum)(object)(PlayerDamageStatistics)0); Deaths = statistics.GetValue((Enum)(object)(PlayerDamageStatistics)2); Assists = statistics.GetValue((Enum)(object)(PlayerDamageStatistics)1); Wins = statistics.GetValue((Enum)(object)(TeamStatisticKeys)0); Score = (Kills + Assists / 2 + Wins * 2 - Deaths) * 125; } } public static class LeaderboardManager { private const string Barcode = "Mash.BoneStrike.Spawnable.Leaderboard"; private static Poolee? _poolee; private static readonly List Entries = new List(); private static void Spawn(Vector3 position) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_poolee != (Object)null) { SetContent(); ((Component)_poolee).gameObject.SetActive(true); return; } GameAssetSpawner.SpawnLocalAsset("Mash.BoneStrike.Spawnable.Leaderboard", position, (Action)delegate(Poolee poolee) { _poolee = poolee; LoadEntries(); SetContent(); }); } private static void SetEntryData(LeaderboardPlayerEntry entry, LeaderboardPlayerData data, int position) { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)entry.PositionText).text = position.ToString(); string valueOrEmpty = data.PlayerId.Metadata.Nickname.GetValueOrEmpty(); string text = (string.IsNullOrEmpty(valueOrEmpty) ? data.PlayerId.Metadata.Username.GetValueOrEmpty() : valueOrEmpty); ((TMP_Text)entry.NameText).text = text; ((TMP_Text)entry.KillsText).text = data.Kills.ToString(); ((TMP_Text)entry.DeathsText).text = data.Deaths.ToString(); ((TMP_Text)entry.AssistsText).text = data.Assists.ToString(); ((TMP_Text)entry.WinsText).text = data.Wins.ToString(); ((TMP_Text)entry.ScoreText).text = data.Score.ToString(); ((Graphic)entry.Background).color = ((PersistentTeams.GetTeamIndex(data.PlayerId) == 0) ? new Color(1f, 0.2f, 0.2f) : new Color(0.2f, 0.2f, 1f)); } public static void SetContent() { if ((Object)(object)_poolee == (Object)null) { return; } List list = (from v in GlobalStatisticsCollector.Statistics select new LeaderboardPlayerData(v) into v where v.PlayerId.IsValid select v).ToList(); list.Sort((LeaderboardPlayerData a, LeaderboardPlayerData b) => b.Score.CompareTo(a.Score)); bool flag = false; for (int i = 0; i < Entries.Count - 1; i++) { LeaderboardPlayerEntry leaderboardPlayerEntry = Entries[i + 1]; bool flag2 = i < list.Count; leaderboardPlayerEntry.Root.SetActive(flag2); if (flag2) { LeaderboardPlayerData data = list[i]; SetEntryData(leaderboardPlayerEntry, data, i + 1); } } if (!flag) { int num = list.FindIndex((LeaderboardPlayerData s) => s.PlayerId.IsMe); if (num != -1) { LeaderboardPlayerData data2 = list[num]; SetEntryData(Entries[num + 1], data2, num + 1); } } } private static void LoadEntries() { if ((Object)(object)_poolee == (Object)null) { return; } Entries.Clear(); Transform val = ((Component)_poolee).transform.Find("Center/Players"); if ((Object)(object)val == (Object)null) { Debug.LogError(Object.op_Implicit("Failed to find player list in leaderboard")); return; } for (int i = 0; i < val.childCount; i++) { Transform child = val.GetChild(i); if (!((Object)(object)child == (Object)null)) { Entries.Add(new LeaderboardPlayerEntry(((Component)child).gameObject)); } } } public static void ShowLeaderboard(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) Spawn(position); } public static void HideLeaderboard() { if (!((Object)(object)_poolee == (Object)null)) { ((Component)_poolee).gameObject.SetActive(false); } } } } namespace BoneStrike.Config { internal class SecondsToMinutesElementProvider : IConfigElementProvider { public ElementData GetElementData(ConfigEntryData entry, Action setter) { //IL_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown Action setter2 = setter; ConfigEntryData entry2 = entry; return (ElementData)new FloatElementData { Title = entry2.Name, Increment = 0.25f, MaxValue = 10f, MinValue = 0.25f, Value = Convert.ToSingle(entry2.Value) / 60f, OnValueChanged = delegate(float f) { setter2(entry2, Convert.ToSingle(f) * 60f); } }; } } internal class PositionElementProvider : IConfigElementProvider { public ElementData GetElementData(ConfigEntryData entry, Action setter) { //IL_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown Action setter2 = setter; ConfigEntryData entry2 = entry; return (ElementData)new FunctionElementData { Title = entry2.Name, OnPressed = delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) NetworkPlayer networkPlayer = LocalPlayer.GetNetworkPlayer(); if (networkPlayer != null && networkPlayer.HasRig) { Vector3 position = ((Component)networkPlayer.RigRefs.RigManager).transform.position; setter2(entry2, position); } } }; } } internal class CrateBarcodeElement : IConfigElementProvider { public ElementData GetElementData(ConfigEntryData entry, Action setter) { //IL_0014: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown Action setter2 = setter; ConfigEntryData entry2 = entry; return (ElementData)new SpawnableElementData { Title = entry2.Name, OnSetSpawnable = delegate(Barcode barcode) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Crate val = default(Crate); if (AssetWarehouse.Instance.TryGetCrate(new Barcode(barcode), ref val)) { setter2(entry2, ((Scannable)val._pallet)._barcode._id); } } }; } } internal class CrateBarcodeListElement : IConfigElementProvider { public ElementData GetElementData(ConfigEntryData entry, Action setter) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_006a: 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_0079: Expected O, but got Unknown ConfigEntryData entry2 = entry; Action setter2 = setter; GroupElementData val = new GroupElementData(entry2.Name); SpawnableElementData val2 = new SpawnableElementData { Title = "Add Held Item Pallet", OnSetSpawnable = delegate(Barcode barcode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Barcode val4 = new Barcode(barcode); Crate val5 = default(Crate); if (AssetWarehouse.Instance.TryGetCrate(val4, ref val5)) { List list = (List)entry2.Value; string id = ((Scannable)val5._pallet)._barcode._id; if (!list.Contains(id)) { list.Add(id); setter2(entry2, list); } } } }; FunctionElementData val3 = new FunctionElementData { Title = "Clear", OnPressed = delegate { setter2(entry2, new List()); } }; val.AddElement(val2); val.AddElement(val3); return (ElementData)val; } } internal class BarcodeListElement : IConfigElementProvider { public ElementData GetElementData(ConfigEntryData entry, Action setter) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_006a: 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_0079: Expected O, but got Unknown ConfigEntryData entry2 = entry; Action setter2 = setter; GroupElementData val = new GroupElementData(entry2.Name); SpawnableElementData val2 = new SpawnableElementData { Title = "Add Held Item", OnSetSpawnable = delegate(Barcode barcode) { List list = (List)entry2.Value; string id = barcode._id; if (!list.Contains(id)) { list.Add(id); setter2(entry2, list); } } }; FunctionElementData val3 = new FunctionElementData { Title = "Clear", OnPressed = delegate { setter2(entry2, new List()); } }; val.AddElement(val2); val.AddElement(val3); return (ElementData)val; } } public class BoneStrikeConfig : IConfig, INetSerializable, ICloneable { [ConfigMenuEntry("Plant Phase Duration", "Time")] [ConfigElementProvider(typeof(SecondsToMinutesElementProvider))] [JsonInclude] public float PlantDuration = 90f; [ConfigMenuEntry("Defuse Phase Duration", "Time")] [ConfigElementProvider(typeof(SecondsToMinutesElementProvider))] [JsonInclude] public float DefuseDuration = 150f; [ConfigMenuEntry("Defuse timer", "Time")] [ConfigRangeConstraint(2f, 20f)] [JsonInclude] public float DefuseTime = 7f; [ConfigMenuEntry("Mark Bomb in last 30 seconds", "Time")] [JsonInclude] public bool MarkBombNearEnd = true; [ConfigMenuEntry("Balance Weapon Damage (EXPERIMENTAL)", "Balancing")] [JsonInclude] public bool BalanceDamage; [ConfigMenuEntry("Balance Avatar Health", "Balancing")] [JsonInclude] public bool BalanceStats = true; [ConfigMenuEntry("Defuser Spawn Protection", "Balancing")] [ConfigRangeConstraint(0f, 15f)] [ConfigStepSize(1f)] [JsonInclude] public float DefuserSpawnProtection = 5f; [ConfigMenuEntry("Limit Player Magazines", "Balancing")] [JsonInclude] public bool LimitMags = true; [ConfigMenuEntry("Max ammunition", "Balancing")] [ConfigRangeConstraint(50, 300)] [ConfigStepSize(50)] [JsonInclude] public int MagazineCapacity = 150; [ConfigMenuEntry("Movement Speed", "Balancing")] [ConfigRangeConstraint(1f, 2f)] [ConfigStepSize(0.05f)] [JsonInclude] public float MovementSpeedMultiplier = 1.35f; [ConfigMenuEntry("Blind Attackers During Planting", "Health")] [JsonInclude] public bool BlindAttackersDuringPlanting; [ConfigMenuEntry("Defender Health Multiplier", "Health")] [ConfigRangeConstraint(0.25f, 4f)] [ConfigStepSize(0.25f)] [JsonInclude] public float DefenderHealthMultiplier = 1f; [ConfigMenuEntry("Attacker Health Multiplier", "Health")] [ConfigRangeConstraint(0.25f, 4f)] [ConfigStepSize(0.25f)] [JsonInclude] public float AttackerHealthMultiplier = 1.5f; [ConfigMenuEntry("Weapons", null)] [ConfigElementProvider(typeof(CrateBarcodeListElement))] [JsonInclude] public List PalletBarcodes = new List(); [ConfigMenuEntry("Uility Items", null)] [ConfigElementProvider(typeof(BarcodeListElement))] [JsonInclude] public List UtilityBarcodes = new List(); [ConfigMenuEntry("Bomb Explosion Enabled", "Utility")] [JsonInclude] public bool BombExplosion = true; [ConfigMenuEntry("Dev Tools Disabled", "Utility")] [JsonInclude] public bool DevToolsDisabled = true; [ConfigMenuEntry("Mitigate Movement Mods", "Utility")] [JsonInclude] public bool RemoveMovementMods = true; [ConfigMenuEntry("Manual Team Assignment", "Teams")] [JsonInclude] public bool ManualTeamAssignment = true; [ConfigMenuEntry("Allow Unbalanced Teams", "Teams")] [JsonInclude] public bool AllowUnbalancedTeams; public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref PlantDuration); serializer.SerializeValue(ref DefuseDuration); serializer.SerializeValue(ref DefuseTime); serializer.SerializeValue(ref BlindAttackersDuringPlanting); serializer.SerializeValue(ref DefenderHealthMultiplier); serializer.SerializeValue(ref AttackerHealthMultiplier); serializer.SerializeValue(ref LimitMags); serializer.SerializeValue(ref MagazineCapacity); serializer.SerializeValue(ref BalanceStats); serializer.SerializeValue(ref BalanceDamage); serializer.SerializeValue(ref DefuserSpawnProtection); serializer.SerializeValue(ref MovementSpeedMultiplier); serializer.SerializeValue(ref DevToolsDisabled); serializer.SerializeValue(ref ManualTeamAssignment); serializer.SerializeValue(ref AllowUnbalancedTeams); serializer.SerializeValue(ref MarkBombNearEnd); serializer.SerializeValue(ref RemoveMovementMods); } public object Clone() { return new BoneStrikeConfig { PlantDuration = PlantDuration, DefuseDuration = DefuseDuration, DefuseTime = DefuseTime, BlindAttackersDuringPlanting = BlindAttackersDuringPlanting, BalanceStats = BalanceStats, BalanceDamage = BalanceDamage, DefuserSpawnProtection = DefuserSpawnProtection, MovementSpeedMultiplier = MovementSpeedMultiplier, DefenderHealthMultiplier = DefenderHealthMultiplier, AttackerHealthMultiplier = AttackerHealthMultiplier, LimitMags = LimitMags, MagazineCapacity = MagazineCapacity, PalletBarcodes = new List(PalletBarcodes), UtilityBarcodes = new List(UtilityBarcodes), BombExplosion = BombExplosion, DevToolsDisabled = DevToolsDisabled, ManualTeamAssignment = ManualTeamAssignment, AllowUnbalancedTeams = AllowUnbalancedTeams, MarkBombNearEnd = MarkBombNearEnd, RemoveMovementMods = RemoveMovementMods }; } } } namespace BoneStrike.Audio { public class DefuseState : EnvironmentState { public override int Priority => 5; public DefuseState() : base(new EnvironmentEffector[1] { (EnvironmentEffector)(object)new DefuseMusicEffector() }) { } public override bool CanPlay(EnvironmentContext context) { return GamePhaseManager.IsPhase(); } } public class EnvironmentContext { public static EnvironmentContext GetContext(BoneStrikeContext context) { return new EnvironmentContext(); } } public class IntermissionState : EnvironmentState { public override int Priority => 15; public IntermissionState() : base(new EnvironmentEffector[1] { (EnvironmentEffector)(object)new IntermissionMusicEffector() }) { } public override bool CanPlay(EnvironmentContext context) { return GamePhaseManager.IsPhase(); } } public class PlantState : EnvironmentState { public override int Priority => 10; public PlantState() : base(new EnvironmentEffector[1] { (EnvironmentEffector)(object)new PlantMusicEffector() }) { } public override bool CanPlay(EnvironmentContext context) { return GamePhaseManager.IsPhase(); } } } namespace BoneStrike.Audio.Effectors { public class DefuseMusicEffector : AudioEffector { public override Enum Track => EffectorTrack.Music; public DefuseMusicEffector() : base((IContinuousPlayer)new MusicPlayer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new MusicPackLoader((MusicPackTags)0)))) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown } public enum EffectorTrack { Music } public class IntermissionMusicEffector : AudioEffector { public override Enum Track => EffectorTrack.Music; public IntermissionMusicEffector() : base((IContinuousPlayer)new MusicPlayer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new MusicPackLoader((MusicPackTags)2)))) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown } public class PlantMusicEffector : AudioEffector { public override Enum Track => EffectorTrack.Music; public PlantMusicEffector() : base((IContinuousPlayer)new MusicPlayer((IAudioContainer)new LoadOnDemandContainer((IAudioLoader)new MusicPackLoader((MusicPackTags)1)))) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown } }