示例#1
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     AssignControls();
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     EnemyInventory.SetUpInventory(GameState.CurrentEnemy.Inventory, true);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     EnemyEquipment.SetUpEquipment(GameState.CurrentEnemy.Equipment, 0, null, true);
     ToggleLootGold();
 }
示例#2
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     AssignControls();
     _copyOfHero = new Hero(GameState.CurrentHero);
     UpdateLabels();
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     CheckSkillPoints();
 }
示例#3
0
 private void _on_BtnRepairAll_pressed()
 {
     GameState.CurrentHero.Gold -= GameState.CurrentHero.TotalRepairCost;
     GameState.CurrentHero.Inventory.ForEach(itm => itm.CurrentDurability = itm.MaximumDurability);
     GameState.CurrentHero.Equipment.AllEquipment.ForEach(itm => itm.CurrentDurability = itm.MaximumDurability);
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     GameState.UpdateDisplay = true;
 }
示例#4
0
 /// <summary>Assigns all controls to something usable in code.</summary>
 private void AssignControls()
 {
     HeroInventory     = (GridInventory)GetNode("HeroInventory");
     MerchantInventory = (MerchantInventory)GetNode("MerchantInventory");
     HeroEquipment     = (GridEquipment)GetNode("HeroEquipment");
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     MerchantInventory.SetUpInventory(GameState.MerchantInventory.Where(itm => itm.IsSold).ToList());
 }
示例#5
0
        /// <summary>Assigns all controls to something usable in code.</summary>
        private void AssignControls()
        {
            BtnRepair     = (Button)GetNode("BtnRepair");
            BtnRepairAll  = (Button)GetNode("BtnRepairAll");
            HeroInventory = (GridInventory)GetNode("HeroInventory");
            HeroEquipment = (GridEquipment)GetNode("HeroEquipment");
            LblRepair     = (Label)GetNode("LblRepair");
            LblRepairAll  = (Label)GetNode("LblRepairAll");
            orphanage     = (Orphanage)GetNode("Orphanage");
            RepairSlot    = (ItemSlot)GetNode("RepairSlot");

            HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
            HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
        }
示例#6
0
        /// <summary>Assigns all controls to something usable in code.</summary>
        private void AssignControls()
        {
            EnemyInventory = (GridInventory)GetNode("EnemyInventory");
            EnemyEquipment = (GridEquipment)GetNode("EnemyEquipment");

            LblName       = (Label)GetNode("Info/LblName");
            LblLevel      = (Label)GetNode("Info/LblLevel");
            LblExperience = (Label)GetNode("Info/LblExperience");

            LblStrength  = (Label)GetNode("Info/LblStrength");
            LblVitality  = (Label)GetNode("Info/LblVitality");
            LblDexterity = (Label)GetNode("Info/LblDexterity");
            LblWisdom    = (Label)GetNode("Info/LblWisdom");

            LblHealth = (Label)GetNode("Info/LblHealth");
            LblMagic  = (Label)GetNode("Info/LblMagic");

            LblGold = (Label)GetNode("Info/LblGold");
            EnemyInventory.SetUpInventory(GameState.CurrentEnemy.Inventory, true);
            EnemyEquipment.SetUpEquipment(GameState.CurrentEnemy.Equipment, 0, null, true);
        }