Ejemplo n.º 1
0
        void CalculateMythicalBoost(EquippedGears gears, ItemData stats)
        {
            ItemData boostStats = new ItemData();

            if (gears.weapon1Gear != null && gears.weapon1Gear.item_class == ItemClass.Mythical)
            {
                GetBoostedStats(boostStats, stats, gears.weapon1Gear.mythicalBoost);
            }

            if (gears.weapon2Gear != null && gears.weapon2Gear.item_class == ItemClass.Mythical)
            {
                GetBoostedStats(boostStats, stats, gears.weapon2Gear.mythicalBoost);
            }

            if (gears.bodyGear != null && gears.bodyGear.item_class == ItemClass.Mythical)
            {
                GetBoostedStats(boostStats, stats, gears.bodyGear.mythicalBoost);
            }

            if (gears.headGear != null && gears.headGear.item_class == ItemClass.Mythical)
            {
                GetBoostedStats(boostStats, stats, gears.headGear.mythicalBoost);
            }

            if (gears.LegsGear != null && gears.LegsGear.item_class == ItemClass.Mythical)
            {
                GetBoostedStats(boostStats, stats, gears.LegsGear.mythicalBoost);
            }

            AddStatsInfo(stats, boostStats);
        }
Ejemplo n.º 2
0
 void UpdateStatsForSet(EquippedGears gears, ItemData stats)
 {
     AddStats(gears.headGear, stats);
     AddStats(gears.bodyGear, stats);
     AddStats(gears.LegsGear, stats);
     AddStats(gears.weapon1Gear, stats);
     AddStats(gears.weapon2Gear, stats);
 }
Ejemplo n.º 3
0
        public EquippedGears GetClone()
        {
            EquippedGears clone = new EquippedGears
            {
                headGear    = headGear,
                weapon1Gear = weapon1Gear,
                weapon2Gear = weapon2Gear,
                bodyGear    = bodyGear,
                LegsGear    = LegsGear
            };

            return(clone);
        }
Ejemplo n.º 4
0
        //public void ItemEquipped(ItemAndSlot item)
        //{
        //    if (item == null)
        //        return;
        //    AddStats(item.item, overAllStats);
        //    CalculateAdditionalStats(overAllStats);
        //    CalculateMythicalBoost(equipments.gears, overAllStats);
        //    UpdateUIValues();
        //}


        //public void ItemDequipped(ItemAndSlot item)
        //{
        //    if (item == null)
        //        return;
        //    SubstractStatsForItem(item.item, overAllStats);
        //    CalculateAdditionalStats(overAllStats);
        //    CalculateMythicalBoost(equipments.gears, overAllStats);
        //    UpdateUIValues();
        //}


        ItemData CalculatePreviewValues(Item item = null)
        {
            previewEquipments = equipments.gears.GetClone();

            //GetCurrentValues(tempOverAllStats);
            if (item != null)
            {
                switch (item.slot)              //switch corrosponding item with selected item
                {
                case ItemSlot.Weapon:
                    if (equipments.IsWeaponAlreadyEquipped(item.item_name) == 0)
                    {
                        if (previewStatsOnDequip && equipments.isItemEquipped(item))
                        {
                            previewEquipments.weapon2Gear = null;
                        }
                        else
                        {
                            previewEquipments.weapon2Gear = item;
                        }
                    }
                    else
                    {
                        if (previewStatsOnDequip && equipments.isItemEquipped(item))
                        {
                            previewEquipments.weapon1Gear = null;
                        }
                        else
                        {
                            previewEquipments.weapon1Gear = item;
                        }
                    }
                    break;

                case ItemSlot.Head:
                    if (previewStatsOnDequip && equipments.isItemEquipped(item))
                    {
                        previewEquipments.headGear = null;
                    }
                    else
                    {
                        previewEquipments.headGear = item;
                    }
                    break;

                case ItemSlot.Body:
                    if (previewStatsOnDequip && equipments.isItemEquipped(item))
                    {
                        previewEquipments.bodyGear = null;
                    }
                    else
                    {
                        previewEquipments.bodyGear = item;
                    }
                    break;

                case ItemSlot.Feet:
                    if (previewStatsOnDequip && equipments.isItemEquipped(item))
                    {
                        previewEquipments.LegsGear = null;
                    }
                    else
                    {
                        previewEquipments.LegsGear = item;
                    }
                    break;

                default:
                    break;
                }
            }
            else
            {
                return(null);
            }

            tempOverAllStats = new ItemData();
            UpdateStatsForSet(previewEquipments, tempOverAllStats);

            CalculateMythicalBoost(previewEquipments, tempOverAllStats);
            CalculateAdditionalStats(tempOverAllStats);
            return(tempOverAllStats);
        }