Esempio n. 1
0
        public HeroAttributeFormat CalculateAttributesWithEquipments(HeroAttributeFormat attributesOrigin, List <CommonEquipmentFormat> equipmentList, bool heroBaseAttributesOnly = false)
        {
            if (equipmentList == null || equipmentList.Count == 0)
            {
                return(attributesOrigin.CloneEx());
            }

            var _attributesWithEquipments = new HeroAttributeFormat(true);

            HeroAttributeFormat _heroEquiptmentBuff = new HeroAttributeFormat(true);

            equipmentList.ForEach(item => {
                var _attributesBuff  = (item.AttributesBuff as HeroAttributeFormat);
                _heroEquiptmentBuff += _attributesBuff;
            });

            _attributesWithEquipments.AddBaseOnly(attributesOrigin).AddBaseOnly(_heroEquiptmentBuff);
            _attributesWithEquipments.AddLevelOnly(attributesOrigin);
            if (heroBaseAttributesOnly)
            {
                return(_attributesWithEquipments);
            }

            _attributesWithEquipments.CalculateCommonAttribute();
            _attributesWithEquipments.AddCommonOnly(_heroEquiptmentBuff);

            return(_attributesWithEquipments);
        }
Esempio n. 2
0
 public FightDataFormat(HeroAttributeFormat heroAttributes)
 {
     this.attributeOriginCache = heroAttributes.CloneEx();
     this.SlotID = heroAttributes.SlotID;
     this.Type   = CHARACTER_TYPE.HERO;
 }