public static Chest SpawnChestEasy(IntVector2 location, ChestTier tier, bool locked, Chest.GeneralChestType type = Chest.GeneralChestType.UNSPECIFIED, ThreeStateValue mimic = ThreeStateValue.UNSPECIFIED, ThreeStateValue fused = ThreeStateValue.UNSPECIFIED) { GameObject chestPrefab = null; switch (tier) { case ChestTier.BLACK: chestPrefab = GameManager.Instance.RewardManager.S_Chest.gameObject; break; case ChestTier.BLUE: chestPrefab = GameManager.Instance.RewardManager.C_Chest.gameObject; break; case ChestTier.BROWN: chestPrefab = GameManager.Instance.RewardManager.D_Chest.gameObject; break; case ChestTier.GREEN: chestPrefab = GameManager.Instance.RewardManager.B_Chest.gameObject; break; case ChestTier.RED: chestPrefab = GameManager.Instance.RewardManager.A_Chest.gameObject; break; case ChestTier.SYNERGY: chestPrefab = GameManager.Instance.RewardManager.Synergy_Chest.gameObject; break; case ChestTier.RAINBOW: chestPrefab = GameManager.Instance.RewardManager.Rainbow_Chest.gameObject; break; case ChestTier.SECRETRAINBOW: chestPrefab = GameManager.Instance.RewardManager.D_Chest.gameObject; break; case ChestTier.GLITCHED: chestPrefab = GameManager.Instance.RewardManager.B_Chest.gameObject; break; case ChestTier.RAT: chestPrefab = LoadHelper.LoadAssetFromAnywhere <GameObject>("chest_rat"); break; case ChestTier.TRUTH: Debug.LogError("ERROR: Chest Toolbox cannot spawn Truth Chest."); break; case ChestTier.OTHER: Debug.LogError("ERROR: Chest Toolbox cannot spawn 'Other' Chest."); break; } if (chestPrefab != null) { Chest spawnedChest = Chest.Spawn(chestPrefab.GetComponent <Chest>(), location); if (locked) { spawnedChest.IsLocked = true; } else { spawnedChest.IsLocked = false; } if (tier == ChestTier.GLITCHED) { spawnedChest.BecomeGlitchChest(); } if (tier == ChestTier.SECRETRAINBOW) { spawnedChest.IsRainbowChest = true; spawnedChest.ChestIdentifier = Chest.SpecialChestIdentifier.SECRET_RAINBOW; } if (type == Chest.GeneralChestType.ITEM) { spawnedChest.lootTable.lootTable = GameManager.Instance.RewardManager.ItemsLootTable; } else if (type == Chest.GeneralChestType.WEAPON) { spawnedChest.lootTable.lootTable = GameManager.Instance.RewardManager.GunsLootTable; } else if (type == Chest.GeneralChestType.UNSPECIFIED) { bool IsAGun = UnityEngine.Random.value <= 0.5f; spawnedChest.lootTable.lootTable = (IsAGun ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable); } if (mimic == ThreeStateValue.FORCEYES) { spawnedChest.overrideMimicChance = 100; } if (mimic == ThreeStateValue.FORCENO) { spawnedChest.overrideMimicChance = 0; } spawnedChest.MaybeBecomeMimic(); if (fused == ThreeStateValue.FORCEYES) { spawnedChest.AddFuse(); } if (fused == ThreeStateValue.FORCENO) { spawnedChest.PreventFuse = true; } spawnedChest.RegisterChestOnMinimap(spawnedChest.GetAbsoluteParentRoom()); return(spawnedChest); } else { return(null); } }