public String eqiupWeapon(String itemName) { String temp = ""; IGoods.IGoods targetItem = playerInventory.equipItem(itemName); if (targetItem != null) { try { if (weapon == null) { weapon = (IGoods.NewEquipments)targetItem; } else { playerInventory.addItem(weapon); weapon = (IGoods.NewEquipments)targetItem; } } catch (InvalidCastException e) { temp = "You can not equip this item!"; } } return(temp); }
//default constructor private Player() { Name = "Ash"; Level = 1; EXP = 0; ATK = DEF = 5; // ATK = 5; DEF = 5; MaxHP = CurrentHP = 15; MaxMP = CurrentMP = 10; // MP = 10; TP = 10; Alive = true; abilityList = new List <PlayerAbility>(); InCombat = false; weapon = null; playerInventory = Inventory.haveOne(); endGame = EndOfGame.oneEnd(); }