Beispiel #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);
        }
Beispiel #2
0
        public void SetDataForDisplay(HeroDataFormat heroDataFormat)
        {
            //Get attribute after calculated by equipment
            HeroAttributeFormat heroAttributeFinal = heroDataFormat.AttributesWithEquipments;

            HPView.DataIntDisplay(heroAttributeFinal.HPMax);
            RESView.DataIntDisplay(heroAttributeFinal.RES);
            ATKView.DataIntDisplay(heroAttributeFinal.ATK);
            MAGView.DataIntDisplay(heroAttributeFinal.MAG);
            DEFView.DataIntDisplay(heroAttributeFinal.DEF);
            ACView.DataIntDisplay(heroAttributeFinal.AC);
            CRIView.DataIntDisplay(heroAttributeFinal.CRI);
            PENView.DataIntDisplay(heroAttributeFinal.PEN);
            HITView.DataIntDisplay(heroAttributeFinal.HIT);
            AVDView.DataIntDisplay(heroAttributeFinal.AVD);
        }
        public void SetDataForDisplay(HeroDataFormat heroDataFormat)
        {
            HeroAttributeFormat _hero = heroDataFormat.Attributes;

            NameView.DataStringDisplay(_hero.NameString);
            LevelView.HeroLevelDisplay(_hero.Level);
            EXPView.DataStringDisplay(EXPBeforeNextLevel(_hero.EXP, _hero.EXPMax));
            SkillPointView.DataIntDisplay(_hero.SkillPoint);
            //Get attribute after calculated by equipment
            HeroAttributeFormat _heroFinal = heroDataFormat.AttributesWithEquipments;

            STRView.DataIntDisplay(_heroFinal.STR);
            INTView.DataIntDisplay(_heroFinal.INT);
            VITView.DataIntDisplay(_heroFinal.VIT);
            DEXView.DataIntDisplay(_heroFinal.DEX);
        }
Beispiel #4
0
        public HeroAttributeFormat GetAttributes(int slotID)
        {
            if (UserSaveDataManager.Instance == null)
            {
                UserSaveDataManager.Instance.InitUserData();
            }

            HeroSaveDataFormat _heroSaveData = UserSaveDataManager.Instance.UserData.HeroSaveDataList.Find(item => {
                return(item.SlotID == slotID);
            });

            if (_heroSaveData == null)
            {
                return(null);
            }

            HeroAttributeFormat _attribute = new HeroAttributeFormat(_heroSaveData);

            return(_attribute);
        }
        public void SetDataForDisplay(HeroDataFormat heroDataFormat, HeroEquipmentFormat equipmentEquipped)
        {
            HeroAttributeFormat _heroAttributeFinal = heroDataFormat.AttributesWithEquipments;

            HPView.DataDisplayImmediately(_heroAttributeFinal.HPMax);
            RESView.DataDisplayImmediately(_heroAttributeFinal.RES);
            ATKView.DataDisplayImmediately(_heroAttributeFinal.ATK);
            MAGView.DataDisplayImmediately(_heroAttributeFinal.MAG);
            DEFView.DataDisplayImmediately(_heroAttributeFinal.DEF);
            ACView.DataDisplayImmediately(_heroAttributeFinal.AC);
            CRIView.DataDisplayImmediately(_heroAttributeFinal.CRI);
            PENView.DataDisplayImmediately(_heroAttributeFinal.PEN);
            HITView.DataDisplayImmediately(_heroAttributeFinal.HIT);
            AVDView.DataDisplayImmediately(_heroAttributeFinal.AVD);
            STRView.DataDisplayImmediately(_heroAttributeFinal.STR);
            INTView.DataDisplayImmediately(_heroAttributeFinal.INT);
            VITView.DataDisplayImmediately(_heroAttributeFinal.VIT);
            DEXView.DataDisplayImmediately(_heroAttributeFinal.DEX);
            EquipmentIcon.ShowEquipmentIcon(equipmentEquipped.TexturePath, equipmentEquipped.TextureIconID);
        }
 void OnGotEXP(HeroAttributeFormat heroAttribute)
 {
     Debug.LogWarningFormat("[Debug] {0} got exp[{1}]", heroAttribute.NameString, this.OffsetEXP);
 }
Beispiel #7
0
 public FightDataFormat(HeroAttributeFormat heroAttributes)
 {
     this.attributeOriginCache = heroAttributes.CloneEx();
     this.SlotID = heroAttributes.SlotID;
     this.Type   = CHARACTER_TYPE.HERO;
 }
Beispiel #8
0
        void OnAllLevelUp(HeroAttributeFormat heroAttributes)
        {
            FightDataFormat _data = new FightDataFormat(heroAttributes);

            this.battleInfoManagerScript.EnqueueMessage(INFO_FORMAT_LABEL.LEVEL_UP, _data, null, heroAttributes.Level);
        }
Beispiel #9
0
        void OnGotEXP(HeroAttributeFormat heroAttributes)
        {
            FightDataFormat _data = new FightDataFormat(heroAttributes);

            this.battleInfoManagerScript.EnqueueMessage(INFO_FORMAT_LABEL.GOT_EXP, _data, null, this.Achievement.EXP);
        }