Exemple #1
0
        public void RecordDelta(PodEntity prev)
        {
            var restart = HealthItems.Try <int>(Restart);

            if (restart == 0)
            {
                return;
            }
            var prevRestart = prev?.HealthItems.Try <int>(Restart) ?? 0;
            var delta       = restart - prevRestart;

            if (delta > 0)
            {
                HealthItems.Add(Delta.Restart, new Property(PropertyType.Number, delta, "Restart Delta", PropertySeverity.Info));
            }
        }
    public void BoughtItem(Item addItem)
    {
        switch (addItem)
        {
        case Item.healSM:
        {
            healSM = GetComponent <HealthItems>();
            healSM.GainHealixer(1, 1);
            break;
        }

        case Item.vitaSM:
        {
            vitaSM = GetComponent <StaminaItems>();
            vitaSM.GainVitalixer(1, 1);
            break;
        }

        case Item.healMD:
        {
            healMD = GetComponent <HealthItems>();
            healMD.GainHealixer(2, 1);
            break;
        }

        case Item.vitaMD:
        {
            vitaMD = GetComponent <StaminaItems>();
            vitaMD.GainVitalixer(2, 1);
            break;
        }

        case Item.powerGemSL:
        {
            PowerSL = GetComponent <PowerCounter>();
            PowerSL.AddPowerGem(1, 1);
            break;
        }

        case Item.healLG:
        {
            healLG = GetComponent <HealthItems>();
            healLG.GainHealixer(3, 1);
            break;
        }

        case Item.vitaLG:
        {
            vitaLG = GetComponent <StaminaItems>();
            vitaLG.GainVitalixer(3, 1);
            break;
        }

        case Item.powerGemGD:
        {
            powerGD = GetComponent <PowerCounter>();
            powerGD.AddPowerGem(2, 1);
            break;
        }

        case Item.spikeBoots:
        {
            spikeBoots = GetComponent <Boots>();
            spikeBoots.BuyBoots(1);
            break;
        }

        case Item.speedBoots:
        {
            speedBoots = GetComponent <Boots>();
            speedBoots.BuyBoots(2);
            break;
        }
        }
    }
 public void AddToHealth(string health)
 {
     dispatcher.Invoke(() => HealthItems.Add(new ListBoxItem {
         Content = health
     }));
 }
Exemple #4
0
 private void HealthItemUse(HealthItems healthItems)
 {
     _player.Health += healthItems.HealthChange;
     _player.Lives  += healthItems.LivesChange;
     _player.RemoveGameItemModelToInventory(_currentGameItem);
 }