using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EasterIsland.src;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using WarioPill.NetcodePatcher;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bcs4313")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds a suspicious looking pill that is very good for you")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+cd9e2c801759e115bb3ab98ef537ed8ed3634744")]
[assembly: AssemblyProduct("WarioPill")]
[assembly: AssemblyTitle("WarioPill")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace WarioPill
{
public class EatenWarioScript : NetworkBehaviour
{
public Random random;
public AudioSource eatenAudioSource;
public PlayerControllerB eater;
public float jumpBoost = 1f;
public float speedBoost = 1f;
public float healthBoost = 1f;
public float impurity = 1f;
public int durationMs = 1;
private bool hasPlayedAudio = false;
public void Start()
{
random = new Random();
if (((NetworkBehaviour)RoundManager.Instance).IsHost && !((Component)this).GetComponent<NetworkObject>().IsSpawned)
{
((Component)this).GetComponent<NetworkObject>().Spawn(false);
}
applyBuffs();
}
public void Update()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.position = ((Component)eater).transform.position;
if (!hasPlayedAudio)
{
eatenAudioSource.Play();
hasPlayedAudio = true;
}
}
public async void applyBuffs()
{
if (Object.op_Implicit((Object)(object)eater))
{
Plugin.highPlayers.Add(eater);
eater.DamagePlayer((int)((0f - healthBoost) * 100f), true, true, (CauseOfDeath)0, 0, false, default(Vector3));
if (eater.health > 100)
{
eater.health = 100;
}
float genericSpeed = 4.6f;
float genericJumpHeight = 13f;
int genericClimbSpeed = 3;
eater.drunkness = impurity;
eater.movementSpeed = genericSpeed * speedBoost;
eater.jumpForce = genericJumpHeight * jumpBoost;
eater.climbSpeed = (float)genericClimbSpeed * speedBoost * jumpBoost;
await Task.Delay(durationMs);
eater.movementSpeed = genericSpeed;
eater.jumpForce = genericJumpHeight;
eater.climbSpeed = genericClimbSpeed;
if (eater.health > 100)
{
eater.health = 100;
}
Plugin.highPlayers.Remove(eater);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "EatenWarioScript";
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("WarioPill", "Wario Pill", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static Harmony _harmony;
public static ManualLogSource Logger;
public static AssetBundle warioBundle;
public static GameObject WarioPrefab;
public static TerminalNode WarioItemNode;
public static Item WarioPillItem;
public static GameObject EatenWarioPrefab;
internal static InputMap controls;
public static List<PlayerControllerB> highPlayers = new List<PlayerControllerB>();
public static ConfigEntry<int> warioCost;
public static ConfigEntry<float> nightfallChance;
public void LogIfDebugBuild(string text)
{
Logger.LogInfo((object)text);
}
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
PopulateAssets();
bindVars();
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
Type[] array = types;
foreach (Type type in array)
{
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array2 = methods;
foreach (MethodInfo methodInfo in array2)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
WarioPillItem = warioBundle.LoadAsset<Item>("WarioItemDef");
WarioPrefab = warioBundle.LoadAsset<GameObject>("WarioPillItem");
WarioItemNode = warioBundle.LoadAsset<TerminalNode>("WarioPillItemTN");
EatenWarioPrefab = warioBundle.LoadAsset<GameObject>("EatenWario");
Debug.Log((object)("Wario Item Prefab: " + (object)WarioPrefab));
Debug.Log((object)("Wario Item Node: " + (object)WarioItemNode));
Debug.Log((object)("Wario Item Def: " + (object)WarioPillItem));
Random.InitState((int)DateTime.Now.Ticks);
NetworkPrefabs.RegisterNetworkPrefab(WarioPrefab);
NetworkPrefabs.RegisterNetworkPrefab(EatenWarioPrefab);
Items.RegisterShopItem(WarioPillItem, (TerminalNode)null, (TerminalNode)null, WarioItemNode, warioCost.Value);
controls = new InputMap();
}
public void bindVars()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: 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_003b: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
//IL_004d: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
warioCost = ((BaseUnityPlugin)this).Config.Bind<int>("Global", "Wario Pill Cost", 15, "Cost to buy the pill.");
ConfigEntry<int> obj = warioCost;
IntInputFieldOptions val = new IntInputFieldOptions
{
RequiresRestart = true
};
((BaseRangeOptions<int>)val).Min = 0;
((BaseRangeOptions<int>)val).Max = 100000000;
IntInputFieldConfigItem val2 = new IntInputFieldConfigItem(obj, val);
LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
}
public static void PopulateAssets()
{
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
warioBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "wariopill"));
Debug.Log((object)("Wario Pill Bundle::: " + (object)warioBundle));
}
}
public class WarioScript : NetworkBehaviour
{
public Random random;
public AudioClip[] warioDropSounds;
public AudioClip[] warioPickupSounds;
public AudioClip consumeSound;
public GrabbableObject wario;
public bool held = true;
public ScanNodeProperties scan;
private float rarity;
public float jumpBoost;
public float speedBoost;
public float healthBoost;
public float impurity;
public int durationMs;
private readonly (float threshold, float probability)[] rarityProbabilities = new(float, float)[6]
{
(1f, 0.35f),
(2f, 0.25f),
(3f, 0.18f),
(4f, 0.12f),
(6f, 0.07f),
(10f, 0.03f)
};
public void Start()
{
random = new Random();
if (!((NetworkBehaviour)RoundManager.Instance).IsHost)
{
return;
}
rarity = GenerateRarity();
List<string> list = new List<string> { "Jump", "Speed", "Health" };
float num = 1f;
int num2 = 1;
while (random.NextDouble() < (double)num && list.Count > 0)
{
string text = list[random.Next(0, list.Count)];
list.Remove(text);
if (text.Equals("Jump"))
{
jumpBoost = (float)((random.NextDouble() * 0.2 + 0.05) * (double)rarity + 1.0);
}
if (text.Equals("Health"))
{
healthBoost = (float)(random.NextDouble() * 0.25 * (double)rarity);
}
if (text.Equals("Speed"))
{
speedBoost = (float)((random.NextDouble() * 0.5 + 0.1) * (double)rarity + 1.0);
}
num = Math.Max(0.1f, 0.5f * rarity / (float)num2);
num2++;
}
durationMs = (int)((float)random.Next(1000, (int)(800f * rarity + 4000f)) * rarity);
impurity = (float)Math.Max(0.0, 1.0 - random.NextDouble() * random.NextDouble() * (double)rarity);
setWarioStatsClientRpc(speedBoost, healthBoost, jumpBoost, durationMs, impurity, rarity);
}
[ClientRpc]
public void setWarioStatsClientRpc(float _speedBoost, float _healthboost, float _jumpboost, int _durationMs, float _impurity, float _rarity)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_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_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: 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_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3571248796u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref _speedBoost, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref _healthboost, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref _jumpboost, default(ForPrimitives));
BytePacker.WriteValueBitPacked(val2, _durationMs);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref _impurity, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref _rarity, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3571248796u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
rarity = _rarity;
impurity = _impurity;
durationMs = _durationMs;
jumpBoost = _jumpboost;
healthBoost = _healthboost;
speedBoost = _speedBoost;
if (rarity >= 10f)
{
scan.headerText = "Wario Pill (Mythical)";
}
else if (rarity >= 6f)
{
scan.headerText = "Wario Pill (Legendary)";
}
else if (rarity >= 4f)
{
scan.headerText = "Wario Pill (Epic)";
}
else if (rarity >= 3f)
{
scan.headerText = "Wario Pill (Rare)";
}
else if (rarity >= 2f)
{
scan.headerText = "Wario Pill (Uncommon)";
}
else
{
scan.headerText = "Wario Pill (Common)";
}
}
}
private float GenerateRarity()
{
float num = (float)random.NextDouble();
float num2 = 0f;
(float, float)[] array = rarityProbabilities;
for (int i = 0; i < array.Length; i++)
{
(float, float) tuple = array[i];
float item = tuple.Item1;
float item2 = tuple.Item2;
num2 += item2;
if (num < num2)
{
return item;
}
}
return 1f;
}
public void Update()
{
if (!wario.isHeld || (wario.isHeld && wario.isPocketed))
{
if (held && ((NetworkBehaviour)RoundManager.Instance).IsHost)
{
changeDropAndPickupSFX();
}
held = false;
}
else
{
held = true;
}
if (Plugin.controls.InspectWario.triggered && wario.isHeld && !wario.isPocketed && ((NetworkBehaviour)wario.playerHeldBy).NetworkObject.NetworkObjectId == ((NetworkBehaviour)RoundManager.Instance.playersManager.localPlayerController).NetworkObject.NetworkObjectId)
{
showItemStats();
}
if (wario.isBeingUsed && ((NetworkBehaviour)wario.playerHeldBy).NetworkObject.NetworkObjectId == ((NetworkBehaviour)RoundManager.Instance.playersManager.localPlayerController).NetworkObject.NetworkObjectId)
{
if (((NetworkBehaviour)RoundManager.Instance).IsHost)
{
eatWario();
}
else
{
eatWarioServerRpc();
}
}
}
public void eatWario()
{
activateBuffClientRpc(Plugin.highPlayers.Contains(wario.playerHeldBy));
}
[ClientRpc]
public void warnPlayerClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2229414107u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2229414107u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && Object.op_Implicit((Object)(object)wario.playerHeldBy) && ((NetworkBehaviour)wario.playerHeldBy).NetworkObject.NetworkObjectId == ((NetworkBehaviour)RoundManager.Instance.playersManager.localPlayerController).NetworkObject.NetworkObjectId)
{
HUDManager.Instance.DisplayTip("Chill Brah", "You are already high off a Wario Pill. Wait for it to wear off!", false, false, "LC_Tip1");
wario.isBeingUsed = false;
}
}
}
[ClientRpc]
public void activateBuffClientRpc(bool guard)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(48468497u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref guard, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 48468497u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
if (Plugin.highPlayers.Contains(wario.playerHeldBy) || guard)
{
HUDManager.Instance.DisplayTip("Chill Brah", "You are already high off a Wario Pill. Wait for it to wear off!", false, false, "LC_Tip1");
wario.isBeingUsed = false;
return;
}
if (Object.op_Implicit((Object)(object)wario.playerHeldBy) && ((NetworkBehaviour)wario.playerHeldBy).NetworkObject.NetworkObjectId == ((NetworkBehaviour)RoundManager.Instance.playersManager.localPlayerController).NetworkObject.NetworkObjectId)
{
GameObject val3 = Object.Instantiate<GameObject>(Plugin.EatenWarioPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation);
EatenWarioScript component = val3.GetComponent<EatenWarioScript>();
component.eater = wario.playerHeldBy;
component.jumpBoost = jumpBoost;
component.speedBoost = speedBoost;
component.healthBoost = healthBoost;
component.durationMs = durationMs;
component.impurity = impurity;
((Behaviour)HUDManager.Instance.itemSlotIcons[wario.playerHeldBy.currentItemSlot]).enabled = false;
if (!(Plugin.highPlayers.Contains(wario.playerHeldBy) || guard))
{
destroyWithLocalProofServerRpc();
}
}
wario.DiscardItemOnClient();
}
[ServerRpc(RequireOwnership = false)]
public void destroyWithLocalProofServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2365833290u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2365833290u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
wario.DestroyObjectInHand(wario.playerHeldBy);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void eatWarioServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4007658854u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4007658854u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
eatWario();
}
}
}
public void changeDropAndPickupSFX()
{
setSFXClientRpc(random.Next(0, warioDropSounds.Length), random.Next(0, warioPickupSounds.Length));
}
[ClientRpc]
public void setSFXClientRpc(int dropIndex, int pickupIndex)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2744972096u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, dropIndex);
BytePacker.WriteValueBitPacked(val2, pickupIndex);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2744972096u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
AudioClip dropSFX = warioDropSounds[dropIndex];
AudioClip grabSFX = warioPickupSounds[pickupIndex];
wario.itemProperties.dropSFX = dropSFX;
wario.itemProperties.grabSFX = grabSFX;
}
}
}
public void showItemStats()
{
string text = "";
string text2 = "";
text2 = ((rarity >= 10f) ? (text2 + "Rarity: Mythical ") : ((rarity >= 6f) ? (text2 + "Rarity: Legendary ") : ((rarity >= 4f) ? (text2 + "Rarity: Epic ") : ((rarity >= 3f) ? (text2 + "Rarity: Rare ") : ((!(rarity >= 2f)) ? (text2 + "Rarity: Common ") : (text2 + "Rarity: Uncommon "))))));
text2 = text2 + "Time: " + durationMs / 1000 + "s\n";
if (speedBoost != 1f)
{
text = text + "Speed Boost: " + 100f * (speedBoost - 1f) + "%\n";
}
if (healthBoost != 1f)
{
text = text + "HP Heal: " + healthBoost * 100f + "\n";
}
if (jumpBoost != 1f)
{
text = text + "Jump Boost: " + (jumpBoost - 1f) * 100f + "%\n";
}
text = text + "Purity: " + (100f - 100f * impurity) + "%\n";
HUDManager.Instance.DisplayTip(text2, text, false, false, "LC_Tip1");
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_WarioScript()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3571248796u, new RpcReceiveHandler(__rpc_handler_3571248796));
NetworkManager.__rpc_func_table.Add(2229414107u, new RpcReceiveHandler(__rpc_handler_2229414107));
NetworkManager.__rpc_func_table.Add(48468497u, new RpcReceiveHandler(__rpc_handler_48468497));
NetworkManager.__rpc_func_table.Add(2365833290u, new RpcReceiveHandler(__rpc_handler_2365833290));
NetworkManager.__rpc_func_table.Add(4007658854u, new RpcReceiveHandler(__rpc_handler_4007658854));
NetworkManager.__rpc_func_table.Add(2744972096u, new RpcReceiveHandler(__rpc_handler_2744972096));
}
private static void __rpc_handler_3571248796(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: 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_004a: 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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: 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_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
float num = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num, default(ForPrimitives));
float healthboost = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref healthboost, default(ForPrimitives));
float jumpboost = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref jumpboost, default(ForPrimitives));
int num2 = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref num2);
float num3 = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num3, default(ForPrimitives));
float num4 = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref num4, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)2;
((WarioScript)(object)target).setWarioStatsClientRpc(num, healthboost, jumpboost, num2, num3, num4);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2229414107(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((WarioScript)(object)target).warnPlayerClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_48468497(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: 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_0044: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool guard = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref guard, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)2;
((WarioScript)(object)target).activateBuffClientRpc(guard);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2365833290(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((WarioScript)(object)target).destroyWithLocalProofServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4007658854(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((WarioScript)(object)target).eatWarioServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2744972096(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int dropIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref dropIndex);
int pickupIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref pickupIndex);
target.__rpc_exec_stage = (__RpcExecStage)2;
((WarioScript)(object)target).setSFXClientRpc(dropIndex, pickupIndex);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "WarioScript";
}
}
}
namespace EasterIsland
{
internal class ConfigModel
{
public static ConfigEntry<float> moaiGlobalSize;
public static ConfigEntry<float> moaiGlobalMusicVol;
public static ConfigEntry<float> moaiGlobalRarity;
public static ConfigEntry<float> moaiGlobalSpeed;
public static void setupConfig()
{
//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_0016: Expected O, but got Unknown
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
//IL_0028: Expected O, but got Unknown
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Expected O, but got Unknown
//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_003e: Expected O, but got Unknown
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0050: Expected O, but got Unknown
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Expected O, but got Unknown
//IL_0078: Expected O, but got Unknown
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Expected O, but got Unknown
//IL_007e: 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_008e: Expected O, but got Unknown
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Expected O, but got Unknown
//IL_00a0: Expected O, but got Unknown
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
ConfigEntry<float> obj = moaiGlobalSize;
FloatSliderOptions val = new FloatSliderOptions();
((BaseRangeOptions<float>)val).Min = 0.05f;
((BaseRangeOptions<float>)val).Max = 5f;
FloatSliderConfigItem val2 = new FloatSliderConfigItem(obj, val);
ConfigEntry<float> obj2 = moaiGlobalMusicVol;
FloatSliderOptions val3 = new FloatSliderOptions();
((BaseRangeOptions<float>)val3).Min = 0f;
((BaseRangeOptions<float>)val3).Max = 2f;
FloatSliderConfigItem val4 = new FloatSliderConfigItem(obj2, val3);
ConfigEntry<float> obj3 = moaiGlobalRarity;
FloatSliderOptions val5 = new FloatSliderOptions();
((BaseRangeOptions<float>)val5).Min = 0f;
((BaseRangeOptions<float>)val5).Max = 10f;
FloatSliderConfigItem val6 = new FloatSliderConfigItem(obj3, val5);
ConfigEntry<float> obj4 = moaiGlobalSpeed;
FloatSliderOptions val7 = new FloatSliderOptions();
((BaseRangeOptions<float>)val7).Min = 0f;
((BaseRangeOptions<float>)val7).Max = 5f;
FloatSliderConfigItem val8 = new FloatSliderConfigItem(obj4, val7);
}
}
}
namespace EasterIsland.src
{
internal class InputMap : LcInputActions
{
[InputAction(/*Could not decode attribute arguments.*/)]
public InputAction InspectWario { get; set; }
}
}
namespace WarioPill.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}