Example #1
0
        protected void CalculateStats()
        {
            var shipUpgradeShipStats = Inventory.Items
                                       .Where(i => i.Data.ItemType == ItemType.ShipUpgrade)
                                       .Select(i => ((ShipUpgradeItemData)i.Data).ShipStats);

            int newHealth      = 0;
            int newShield      = 0;
            int newDamage      = 0;
            int newEnergy      = 0;
            int newEnergyRegen = 0;

            foreach (ShipStats stats in shipUpgradeShipStats)
            {
                newHealth      += stats.Health;
                newShield      += stats.Shield;
                newDamage      += stats.Damage;
                newEnergy      += stats.Energy;
                newEnergyRegen += stats.EnergyRegen;
            }

            modifiedStats = new ShipStats(newHealth, newShield, newDamage, newEnergy, newEnergyRegen);
        }
Example #2
0
 public PlayerShip(Transform transform, Texture2D sprite, ShipStats baseStats) : base(transform, sprite, baseStats)
 {
 }