private void PopulateDrop(TypeDrop actualDrop) { switch (actualDrop) { case TypeDrop.Gold: { StatsManager.Instance.AddGold(CostDrop()); break; } case TypeDrop.Weapon: { InfoWeapon iw = new InfoWeapon(); iw.SetValues("Weapon", (float)RarityStats(), false, WeaponType.SimpleSword, WeaponEffect(), actualRarityDrop, 1f, CostDrop(), "/Weapons/" + IconNameWeapon()); if (InventoryManager.Instance.AvailableWeaponSpace > 0) { InventoryManager.Instance.AddToInventory(iw); } else { StatsManager.Instance.AddGold(iw.SellValue); } break; } case TypeDrop.Armor: { InfoArmor ia = new InfoArmor(); EquippedInSlot slot = SlotArmor(); Stats stats = ArmorStats(); ia.SetValues("Armadura", false, slot, CostDrop(), "Some description randomly to be implemented", stats, "/Armors/" + slot.ToString() + "/" + IconNameArmor(slot)); if (InventoryManager.Instance.AvailableArmorSpace > 0) { InventoryManager.Instance.AddToInventory(ia); } else { StatsManager.Instance.AddGold(ia.SellValue); } break; } case TypeDrop.Item: { InfoItem ii = new InfoItem(); ii.SetValues("Item", TypeItem.Other, "Some description randomly generated", ConsumeEffect.None, CostDrop(), 1, "/Items/" + IconNameItem()); if (InventoryManager.Instance.AvailableItemSpace > 0) { InventoryManager.Instance.AddToInventory(ii); } else { StatsManager.Instance.AddGold(ii.SellValue); } break; } } }
private void BattleEnded() { if (_playerIsDead) { _expGained = Mathf.RoundToInt(_expGained * 0.5f); _goldGained = Mathf.RoundToInt(_goldGained * 0.5f); } if (_bossBattle == true) { if (!(InventoryManager.Instance.PlayerHas("The Golden Key") || StatsManager.Instance.InfoPlayer.IsGameEnded == true)) { InfoItem key = new InfoItem(); key.SetValues("The Golden Key", TypeItem.Important, "A forgotten key, cursed, everyone who touched it before is now dead", ConsumeEffect.None, 0, 1, "/Items/Important/GoldenKey"); if (InventoryManager.Instance.AvailableItemSpace > 0) { InventoryManager.Instance.AddToInventory(key); } } _expGained = Mathf.RoundToInt(_expGained * _playerCombat.LuckAfterBattle); _goldGained = Mathf.RoundToInt(_goldGained * _playerCombat.LuckAfterBattle); } DungeonManager.Instance.CombatEnded(_enemiesInCombat.Count, _playerIsDead); _actualTurn = ActualTurn.None; _turnInProgress = false; _playerIsDead = false; _playerTurnInProgress = false; _combatUpdater.ResetSlots(); _enemiesAlive.Clear(); _enemiesInCombat.Clear(); _enemiesAddToBattle.Clear(); _bossBattle = false; _preloadTurn = ActualTurn.None; _startedBattle = false; _canEnemiesBeAdded = false; _enemyAttacked = -1; _enemyDoingAction = -1; GameManager.Instance.SwapContextToDungeonFromCombat(); }