Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MonstrosDoRio v1.0.1
MonstrosDoRio.dll
Decompiled 5 hours agousing System.Collections.Generic; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace MonstrosDoRio; [BepInPlugin("yuri.MonstrosDoRio", "Monstros do Rio", "1.0.1")] public class Plugin : BaseUnityPlugin { private enum Fase { Nada, Forca, Espera, Fisgou, Barra, Aviso } [HarmonyPatch(typeof(ObjectDB), "Awake")] private static class AoAcordar { private static void Postfix(ObjectDB __instance) { Registrar(__instance); } } [HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")] private static class AoCopiar { private static void Postfix(ObjectDB __instance) { Registrar(__instance); } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] private static class SemAtaqueVanilla { private static bool Prefix(Humanoid __instance, ref bool __result) { if ((Object)(object)Inst == (Object)null || !Inst.Ligado.Value) { return true; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if ((Object)(object)val == (Object)null || (Object)(object)Player.m_localPlayer != (Object)(object)val) { return true; } if (!ComVara(val)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(Player), "TakeInput")] private static class SemAndar { private static void Postfix(ref bool __result) { if (Travado()) { __result = false; } } } [HarmonyPatch(typeof(ZInput), "GetMouseDelta")] private static class SemOlhar { private static bool Prefix(ref Vector2 __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!Travado()) { return true; } __result = Vector2.zero; return false; } } private const string NomeVara = "VaraMonstrosDoRio"; private const float Pista = 568f; public static Plugin Inst; public static Recipe Receita; private ConfigEntry<bool> Ligado; private Fase fase; private bool esperandoSoltar; private float forca; private float espera; private float janela; private float aviso; private float habilidade; private float dificuldade; private int jeito; private float barraY; private float barraH; private float velBarra; private float peixeY; private float peixeAlvo; private float peixeTempo; private float progresso; private string nomePremio = ""; private string itemA; private string itemB; private string itemC; private int qtdA; private float chanceB; private float chanceC; private string textoAviso = ""; private Vector3 boia; private Texture2D pixel; private GUIStyle estilo; private GUIStyle estiloGrande; private bool listaPronta; private List<string> peixes = new List<string>(); private List<string> monstros = new List<string>(); private void Awake() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown Inst = this; Ligado = ((BaseUnityPlugin)this).Config.Bind<bool>("Geral", "Ligado", true, "Liga a vara Monstros do Rio neste jogo. O servidor nao precisa do mod."); Harmony val = new Harmony("yuri.MonstrosDoRio"); val.PatchAll(typeof(Plugin).Assembly); if ((Object)(object)ObjectDB.instance != (Object)null) { Registrar(ObjectDB.instance); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Monstros do Rio 1.0.1"); } private void Update() { if ((Object)(object)Inst != (Object)(object)this) { return; } if (!Ligado.Value) { if (fase != Fase.Nada) { Encerrar("", mostrar: false); } return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { if (fase != Fase.Nada) { Encerrar("", mostrar: false); } return; } if (!ComVara(localPlayer)) { if (fase != Fase.Nada) { Encerrar("Guardou a vara.", mostrar: true); } return; } if (Console.IsVisible() || InventoryGui.IsVisible()) { if (fase == Fase.Forca) { fase = Fase.Nada; } if (fase == Fase.Espera || fase == Fase.Fisgou || fase == Fase.Barra) { Encerrar("A linha folgou.", mostrar: true); } return; } bool flag = Segurando(); bool flag2 = Apertou(); bool flag3 = Soltou(); float deltaTime = Time.deltaTime; if (fase == Fase.Nada) { if (esperandoSoltar) { if (!flag) { esperandoSoltar = false; } } else if (flag) { fase = Fase.Forca; forca = 0.08f; } } else if (ZInput.GetKeyDown((KeyCode)27, true)) { Encerrar("Voce recolheu a linha.", mostrar: true); esperandoSoltar = true; } else if (fase == Fase.Forca) { if (flag) { forca += deltaTime / 1.05f; if (forca > 1f) { forca = 1f; } } if (flag3 || !flag) { Soltar(localPlayer); } } else if (fase == Fase.Espera) { if (flag2) { Encerrar("Cedo demais. O bicho fugiu.", mostrar: true); esperandoSoltar = true; return; } espera -= deltaTime; if (espera <= 0f) { fase = Fase.Fisgou; janela = 0.72f + habilidade * 0.5f; Avisar("Fisgou!", guardar: false); } } else if (fase == Fase.Fisgou) { janela -= deltaTime; if (flag2) { ComecarBarra(); } else if (janela <= 0f) { Encerrar("Demorou. O bicho soltou.", mostrar: true); esperandoSoltar = true; } } else if (fase == Fase.Barra) { AtualizarBarra(localPlayer, deltaTime, flag); } else if (fase == Fase.Aviso) { aviso -= deltaTime; if (aviso <= 0f || flag2) { fase = Fase.Nada; esperandoSoltar = flag; } } } private void Soltar(Player jogador) { fase = Fase.Nada; if (!TemAgua(jogador, forca, out boia)) { Avisar("Nao tem agua ai. Olha pra agua e solta o ataque.", guardar: true); esperandoSoltar = true; return; } if (!((Character)jogador).HaveStamina(5f)) { Avisar("Sem folego pra arremessar.", guardar: true); esperandoSoltar = true; return; } MontarLista(); if (!Sortear(jogador)) { Avisar("Nada mordeu.", guardar: true); esperandoSoltar = true; return; } ((Character)jogador).UseStamina(5f); habilidade = ((Character)jogador).GetSkillFactor((SkillType)104); if (habilidade < 0f) { habilidade = 0f; } if (habilidade > 1f) { habilidade = 1f; } float num = 0.7f - habilidade * 0.25f; float num2 = 2.6f - habilidade * 0.7f; if (num < 0.35f) { num = 0.35f; } if (num2 < num + 0.3f) { num2 = num + 0.3f; } espera = Random.Range(num, num2); fase = Fase.Espera; esperandoSoltar = true; ((BaseUnityPlugin)this).Logger.LogInfo((object)("Arremessou " + nomePremio)); } private bool Sortear(Player jogador) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Invalid comparison between Unknown and I4 itemA = null; itemB = null; itemC = null; qtdA = 1; chanceB = 0f; chanceC = 0f; Biome val = Heightmap.FindBiome(boia); bool flag = (int)val == 256; float num = (flag ? 0.16f : 0.05f) + forca * 0.08f; float num2 = (flag ? (0.06f + forca * 0.04f) : 0.01f); float num3 = 0.22f + forca * 0.06f; float value = Random.value; if (value < num && Existe("SerpentMeat")) { nomePremio = "Serpente marinha"; itemA = "SerpentMeat"; qtdA = 1; if (Existe("SerpentScale")) { itemB = "SerpentScale"; chanceB = 0.55f; } if (Existe("TrophySerpent")) { itemC = "TrophySerpent"; chanceC = 0.1f; } dificuldade = 0.94f; jeito = 1; return true; } if (value < num + num2 && Existe("Chitin")) { itemA = "Chitin"; nomePremio = NomeDe(itemA); dificuldade = 0.8f; jeito = 0; return true; } if (value < num + num2 + num3 && monstros.Count > 0) { itemA = monstros[Random.Range(0, monstros.Count)]; nomePremio = NomeDe(itemA); if (itemA == "Bloodbag" || itemA == "Leech") { dificuldade = 0.68f; jeito = 1; } else { dificuldade = 0.52f; jeito = 3; } return true; } if (peixes.Count == 0) { if (!Existe("SerpentMeat")) { return false; } nomePremio = "Serpente marinha"; itemA = "SerpentMeat"; dificuldade = 0.94f; jeito = 1; return true; } itemA = peixes[Random.Range(0, peixes.Count)]; nomePremio = NomeDe(itemA); dificuldade = Random.Range(0.22f, 0.74f); jeito = Random.Range(0, 5); return true; } private void ComecarBarra() { float num = dificuldade * (1f - habilidade * 0.4f); if (num < 0.15f) { num = 0.15f; } dificuldade = num; barraH = Mathf.Lerp(184f, 62f, dificuldade) + habilidade * 52f; if (barraH > 240f) { barraH = 240f; } if (barraH < 56f) { barraH = 56f; } barraY = (568f - barraH) * 0.5f; velBarra = 0f; peixeY = Random.Range(40f, 528f); peixeAlvo = peixeY; peixeTempo = 0.2f; progresso = 0.32f; fase = Fase.Barra; } private void AtualizarBarra(Player jogador, float dt, bool segura) { float num = dt * 60f; if (num > 3f) { num = 3f; } float num2 = (segura ? (-0.25f) : 0f); velBarra += (num2 + 0.15f) * num; if (velBarra > 8f) { velBarra = 8f; } if (velBarra < -8f) { velBarra = -8f; } barraY += velBarra * num; if (barraY < 0f) { barraY = 0f; velBarra = (0f - velBarra) * 0.66f; } float num3 = 568f - barraH; if (barraY > num3) { barraY = num3; velBarra = (0f - velBarra) * 0.66f; } MoverPeixe(dt); if (peixeY >= barraY && peixeY <= barraY + barraH) { progresso += dt * (0.2f + habilidade * 0.05f); } else { progresso -= dt * (0.11f + dificuldade * 0.2f); } if (progresso > 1f) { progresso = 1f; } if (progresso >= 1f) { Entregar(jogador); } else if (progresso <= 0f) { ((Character)jogador).RaiseSkill((SkillType)104, 0.15f); Encerrar(nomePremio + " escapou.", mostrar: true); esperandoSoltar = true; } } private void MoverPeixe(float dt) { peixeTempo -= dt; float num = 80f + dificuldade * 200f; if (jeito == 1) { if (peixeTempo <= 0f) { peixeTempo = Random.Range(0.28f, 0.85f); if (Random.value < 0.62f) { peixeAlvo = Random.Range(8f, 560f); } num = 460f + dificuldade * 80f; } else { num = 36f; } } else if (peixeTempo <= 0f) { peixeTempo = Random.Range(0.4f, 1.25f); if (jeito == 2) { peixeAlvo = Mathf.Clamp(peixeAlvo + Random.Range(-90f, 90f), 16f, 552f); } else if (jeito == 3) { peixeAlvo = Random.Range(0f, 150f); } else if (jeito == 4) { peixeAlvo = Random.Range(400f, 560f); } else { peixeAlvo = Random.Range(0f, 560f); } if (jeito == 2) { num = 70f + dificuldade * 40f; } } peixeY = Mathf.MoveTowards(peixeY, peixeAlvo, num * dt); if (peixeY < 0f) { peixeY = 0f; } if (peixeY > 568f) { peixeY = 568f; } } private void Entregar(Player jogador) { string ganhos = ""; bool flag = Colocar(jogador, itemA, qtdA, ref ganhos); if (flag && itemB != null && Random.value < chanceB) { Colocar(jogador, itemB, 1, ref ganhos); } if (flag && itemC != null && Random.value < chanceC) { Colocar(jogador, itemC, 1, ref ganhos); } if (!flag) { Encerrar("Bolsa cheia. O bicho escapou com o premio.", mostrar: true); esperandoSoltar = true; return; } ((Character)jogador).RaiseSkill((SkillType)104, 1.15f); textoAviso = "Voce pescou: " + ganhos + "."; Avisar(textoAviso, guardar: true); fase = Fase.Aviso; aviso = 2.4f; esperandoSoltar = true; } private bool Colocar(Player jogador, string prefab, int qtd, ref string ganhos) { if (string.IsNullOrEmpty(prefab) || qtd <= 0) { return false; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(prefab); if ((Object)(object)itemPrefab == (Object)null) { return false; } Inventory inventory = ((Humanoid)jogador).GetInventory(); if (inventory == null || !inventory.CanAddItem(itemPrefab, qtd)) { return false; } if (!inventory.AddItem(itemPrefab, qtd)) { return false; } string text = NomeDe(prefab); if (qtd > 1) { text = text + " x" + qtd; } if (ganhos.Length == 0) { ganhos = text; } else { ganhos = ganhos + " e " + text; } return true; } private void Encerrar(string texto, bool mostrar) { fase = Fase.Nada; if (mostrar && !string.IsNullOrEmpty(texto)) { Avisar(texto, guardar: true); } } private void Avisar(string texto, bool guardar) { if (string.IsNullOrEmpty(texto)) { return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)texto); if (!((Object)(object)MessageHud.instance == (Object)null)) { MessageHud.instance.ShowMessage((MessageType)2, texto, 0, (Sprite)null, true, guardar); if (guardar) { MessageHud.instance.ShowMessage((MessageType)1, texto, 0, (Sprite)null, true, true); } } } private bool TemAgua(Player jogador, float potencia, out Vector3 ponto) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) ponto = ((Component)jogador).transform.position; Vector3 val = ((Character)jogador).GetLookDir(); if ((Object)(object)GameCamera.instance != (Object)null) { val = ((Component)GameCamera.instance).transform.forward; } val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = ((Component)jogador).transform.forward; } ((Vector3)(ref val)).Normalize(); if (((Character)jogador).InWater()) { Vector3 position = ((Component)jogador).transform.position; if (Superficie(position, out var superficie)) { ponto = superficie; return true; } } float num = 2f + potencia * 18f; float num2 = -1f; Vector3 val2 = ponto; for (float num3 = num; num3 >= 1.2f; num3 -= 1.2f) { Vector3 teste = ((Component)jogador).transform.position + val * num3; if (Superficie(teste, out var superficie2)) { float num4 = ((Component)jogador).transform.position.y - superficie2.y; if (num4 < 18f && num4 > -6f && num3 > num2) { num2 = num3; val2 = superficie2; } } } if (num2 < 0f) { return false; } ponto = val2; return true; } private bool Superficie(Vector3 teste, out Vector3 superficie) { //IL_0001: 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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) superficie = teste; WaterVolume val = null; float waterLevel = Floating.GetWaterLevel(teste, ref val); if ((Object)(object)val != (Object)null && (int)val.GetLiquidType() != 0) { return false; } float num = teste.y; if ((Object)(object)ZoneSystem.instance != (Object)null) { num = ZoneSystem.instance.GetGroundHeight(teste); } if (waterLevel < num - 0.05f) { return false; } superficie = new Vector3(teste.x, waterLevel, teste.z); return true; } private void MontarLista() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Invalid comparison between Unknown and I4 if (listaPronta || (Object)(object)ObjectDB.instance == (Object)null) { return; } peixes.Clear(); monstros.Clear(); foreach (GameObject item in ObjectDB.instance.m_items) { if ((Object)(object)item == (Object)null) { continue; } ItemDrop component = item.GetComponent<ItemDrop>(); if (!((Object)(object)component == (Object)null) && component.m_itemData != null && component.m_itemData.m_shared != null && (int)component.m_itemData.m_shared.m_itemType == 21) { string text = ((Object)item).name.ToLowerInvariant(); if (!text.Contains("bait") && !text.Contains("rod") && !text.Contains("cooked") && !text.Contains("grilled")) { peixes.Add(((Object)item).name); } } } if (peixes.Count == 0) { string[] array = new string[13] { "FishRaw", "Fish1", "Fish2", "Fish3", "Fish4_cave", "Fish5", "Fish6", "Fish7", "Fish8", "Fish9", "Fish10", "Fish11", "Fish12" }; for (int i = 0; i < array.Length; i++) { if (Existe(array[i])) { peixes.Add(array[i]); } } } string[] array2 = new string[3] { "NeckTail", "Bloodbag", "Leech" }; for (int j = 0; j < array2.Length; j++) { if (Existe(array2[j])) { monstros.Add(array2[j]); } } listaPronta = true; ((BaseUnityPlugin)this).Logger.LogInfo((object)("Peixes " + peixes.Count + ", monstros " + monstros.Count)); } private bool Existe(string nome) { if ((Object)(object)ObjectDB.instance != (Object)null) { return (Object)(object)ObjectDB.instance.GetItemPrefab(nome) != (Object)null; } return false; } private string NomeDe(string prefab) { if ((Object)(object)ObjectDB.instance == (Object)null) { return prefab; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(prefab); if ((Object)(object)itemPrefab == (Object)null) { return prefab; } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null || component.m_itemData == null || component.m_itemData.m_shared == null) { return prefab; } string text = component.m_itemData.m_shared.m_name; if (Localization.instance != null) { text = Localization.instance.Localize(text); } return text; } public static bool ComVara(Player jogador) { if ((Object)(object)jogador == (Object)null) { return false; } ItemData rightItem = ((Humanoid)jogador).RightItem; if (rightItem == null || rightItem.m_shared == null) { return false; } if (rightItem.m_shared.m_name == "Vara Monstros do Rio") { return true; } if (rightItem.m_shared.m_name == "$item_fishingrod") { return true; } if ((Object)(object)rightItem.m_dropPrefab == (Object)null) { return false; } string name = ((Object)rightItem.m_dropPrefab).name; if (!(name == "VaraMonstrosDoRio")) { return name == "FishingRod"; } return true; } private static bool Segurando() { if (!ZInput.GetButton("Attack")) { return ZInput.GetMouseButton(0); } return true; } private static bool Apertou() { if (!ZInput.GetButtonDown("Attack")) { return ZInput.GetMouseButtonDown(0); } return true; } private static bool Soltou() { if (!ZInput.GetButtonUp("Attack")) { return ZInput.GetMouseButtonUp(0); } return true; } private static bool Travado() { if ((Object)(object)Inst == (Object)null || !Inst.Ligado.Value) { return false; } if (Inst.fase != Fase.Espera && Inst.fase != Fase.Fisgou && Inst.fase != Fase.Barra) { return Inst.fase == Fase.Aviso; } return true; } public static void Registrar(ObjectDB db) { if ((Object)(object)db == (Object)null || db.m_items == null || db.m_recipes == null) { return; } for (int i = 0; i < db.m_items.Count; i++) { GameObject val = db.m_items[i]; if ((Object)(object)val != (Object)null && ((Object)val).name == "VaraMonstrosDoRio") { return; } } GameObject itemPrefab = db.GetItemPrefab("FishingRod"); if ((Object)(object)itemPrefab == (Object)null) { return; } GameObject val2 = Object.Instantiate<GameObject>(itemPrefab); ((Object)val2).name = "VaraMonstrosDoRio"; val2.SetActive(false); val2.transform.SetParent(((Component)db).transform, false); ItemDrop component = val2.GetComponent<ItemDrop>(); ItemDrop component2 = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null || component.m_itemData == null || component.m_itemData.m_shared == null) { return; } if ((Object)(object)component2 != (Object)null && component.m_itemData.m_shared == component2.m_itemData.m_shared) { Object.Destroy((Object)(object)val2); return; } SharedData shared = component.m_itemData.m_shared; if ((Object)(object)component2 != (Object)null && component2.m_itemData != null && component2.m_itemData.m_shared != null && shared.m_attack != null && shared.m_attack == component2.m_itemData.m_shared.m_attack) { shared.m_attack = shared.m_attack.Clone(); } shared.m_name = "Vara Monstros do Rio"; shared.m_description = "Pesca qualquer peixe e monstro da agua, inclusive a serpente. Nao gasta isca. Segura o ataque olhando pra agua, solta pra arremessar, e clica quando fisgar."; shared.m_ammoType = ""; if (shared.m_attack != null) { shared.m_attack.m_attackProjectile = null; shared.m_attack.m_spawnOnTrigger = null; shared.m_attack.m_consumeItem = false; shared.m_attack.m_attackStamina = 0f; } if (shared.m_secondaryAttack != null) { shared.m_secondaryAttack.m_attackProjectile = null; shared.m_secondaryAttack.m_spawnOnTrigger = null; shared.m_secondaryAttack.m_consumeItem = false; } component.m_itemData.m_dropPrefab = val2; db.m_items.Add(val2); Recipe val3 = ScriptableObject.CreateInstance<Recipe>(); ((Object)val3).name = "Recipe_VaraMonstrosDoRio"; val3.m_item = component; val3.m_amount = 1; val3.m_enabled = true; val3.m_craftingStation = AcharBancada(db); List<Requirement> list = new List<Requirement>(); Requirement val4 = Custo(db, "Wood", 8); if (val4 != null) { list.Add(val4); } Requirement val5 = Custo(db, "Resin", 4); if (val5 != null) { list.Add(val5); } val3.m_resources = list.ToArray(); db.m_recipes.Add(val3); Receita = val3; MethodInfo method = typeof(ObjectDB).GetMethod("UpdateRegisters", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method != null) { method.Invoke(db, null); } } private static CraftingStation AcharBancada(ObjectDB db) { for (int i = 0; i < db.m_recipes.Count; i++) { Recipe val = db.m_recipes[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val.m_craftingStation == (Object)null)) { string text = ((Object)((Component)val.m_craftingStation).gameObject).name.ToLowerInvariant(); if (text.Contains("workbench")) { return val.m_craftingStation; } } } return null; } private static Requirement Custo(ObjectDB db, string prefab, int qtd) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown GameObject itemPrefab = db.GetItemPrefab(prefab); if ((Object)(object)itemPrefab == (Object)null) { return null; } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); if ((Object)(object)component == (Object)null) { return null; } Requirement val = new Requirement(); val.m_resItem = component; val.m_amount = qtd; return val; } private void OnGUI() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0092: 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_00b9: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) if (fase != Fase.Nada && Ligado.Value) { if ((Object)(object)pixel == (Object)null) { pixel = new Texture2D(1, 1); pixel.SetPixel(0, 0, Color.white); pixel.Apply(); } if (estilo == null) { estilo = new GUIStyle(GUI.skin.label); estilo.alignment = (TextAnchor)4; estilo.fontSize = 18; estilo.normal.textColor = Color.white; estilo.wordWrap = true; estiloGrande = new GUIStyle(estilo); estiloGrande.fontSize = 64; estiloGrande.fontStyle = (FontStyle)1; estiloGrande.normal.textColor = new Color(1f, 0.86f, 0.2f); } float num = (float)Screen.height / 1080f; if (num < 0.7f) { num = 0.7f; } if (fase == Fase.Forca) { float num2 = 280f * num; float num3 = 28f * num; float num4 = ((float)Screen.width - num2) * 0.5f; float num5 = (float)Screen.height - 160f * num; Caixa(new Rect(num4, num5, num2, num3), new Color(0.05f, 0.08f, 0.1f, 0.85f)); Caixa(new Rect(num4 + 3f, num5 + 3f, (num2 - 6f) * forca, num3 - 6f), new Color(0.35f, 0.75f, 0.28f, 0.95f)); GUI.Label(new Rect(num4, num5 - 28f * num, num2, 24f * num), "Forca do arremesso", estilo); } else if (fase == Fase.Espera) { GUI.Label(new Rect(0f, (float)Screen.height * 0.72f, (float)Screen.width, 40f), "A boia esta na agua...", estilo); } else if (fase == Fase.Fisgou) { GUI.Label(new Rect(0f, (float)Screen.height * 0.38f, (float)Screen.width, 80f), "!", estiloGrande); GUI.Label(new Rect(0f, (float)Screen.height * 0.38f + 70f, (float)Screen.width, 36f), "Clica!", estilo); } else if (fase == Fase.Aviso) { GUI.Label(new Rect((float)Screen.width * 0.2f, (float)Screen.height * 0.4f, (float)Screen.width * 0.6f, 80f), textoAviso, estilo); } else if (fase == Fase.Barra) { float num6 = 520f * num; float num7 = 46f * num; float num8 = (float)Screen.width - num7 - 110f * num; float num9 = ((float)Screen.height - num6) * 0.5f; float num10 = 18f * num; Caixa(new Rect(num8 - 16f * num, num9 - 36f * num, num7 + num10 + 40f * num, num6 + 78f * num), new Color(0.08f, 0.12f, 0.1f, 0.55f)); Caixa(new Rect(num8 - num10 - 8f * num, num9, num10, num6), new Color(0.04f, 0.05f, 0.06f, 0.9f)); Color c = Color.Lerp(new Color(0.75f, 0.22f, 0.16f), new Color(0.32f, 0.78f, 0.28f), progresso); float num11 = num6 * progresso; Caixa(new Rect(num8 - num10 - 8f * num, num9 + num6 - num11, num10, num11), c); Caixa(new Rect(num8, num9, num7, num6), new Color(0.05f, 0.16f, 0.22f, 0.94f)); float num12 = barraH / 568f * num6; float num13 = num9 + num6 - barraY / 568f * num6 - num12; Caixa(new Rect(num8 + 3f, num13, num7 - 6f, num12), new Color(0.45f, 0.78f, 0.28f, 0.92f)); Caixa(new Rect(num8 + 3f, num13, num7 - 6f, 4f * num), new Color(0.75f, 0.95f, 0.55f, 0.95f)); float num14 = num9 + num6 - peixeY / 568f * num6; float num15 = 16f * num; Color c2 = ((nomePremio == "Serpente marinha") ? new Color(0.15f, 0.72f, 0.32f) : new Color(0.95f, 0.55f, 0.16f)); Caixa(new Rect(num8 + (num7 - num15) * 0.5f, num14 - num15 * 0.5f, num15, num15), c2); GUI.Label(new Rect(num8 - 80f * num, num9 - 32f * num, num7 + 120f * num, 28f * num), nomePremio, estilo); GUI.Label(new Rect(num8 - 160f * num, num9 + num6 + 8f * num, num7 + 220f * num, 48f * num), "Segura o ataque para subir", estilo); } } } private void Caixa(Rect r, Color c) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)pixel); GUI.color = color; } }