Example #1
0
 public void SkillDataListUpdate(HeroDataFormat heroData)
 {
     for (int i = 0; i < heroData.SkillList.Count; i++)
     {
         SkillControllers [i].InitDisplayAndLoadData(heroData);
     }
 }
Example #2
0
        // Use this for initialization
        public void Init(HeroDataFormat data)
        {
            heroData = data.CloneEx();

            int[] _points = new int[SkillNumber];
            for (int i = 0; i < SkillNumber; i++)
            {
                _points [i] = -1;
            }

            int dataLength = heroData.SkillList.Count;

            for (int i = 0; i < dataLength; i++)
            {
                _points [i] = heroData.Attributes.SkillPoint;
            }

            for (int i = 0; i < SkillControllers.Length; i++)
            {
                SkillControllers [i].Init(_points[i]);
            }


            SkillDataListUpdate(heroData);

            SkillPointZeroOrNot(heroData.Attributes.SkillPoint);
        }
        void OnHeroCacheChanged(int slotID, HeroDataFormat heroDataCache)
        {
            if (this.heroData == null)
            {
                return;
            }
            if (this.heroData.Attributes.SlotID != slotID)
            {
                return;
            }

            this.heroData = heroDataCache.CloneEx();

            if (this.heroData.EquipmentList != null && this.heroData.EquipmentList.Count > 0)
            {
                for (int i = 0; i < this.heroData.EquipmentList.Count; i++)
                {
                    if (this.heroData.EquipmentList [i].EquipmentType == this.heroEquipment.EquipmentType)
                    {
                        this.heroEquipment        = this.heroData.EquipmentList [i].CloneEx();
                        this.reinforceSuccessRate = EquipmentDataManager.Instance.GetEquipmentReinforceSuccessRate(this.heroEquipment.ReinforcementLevel);
                        ReinforceSuccessRateView.SetParam(this.reinforceSuccessRate);
                        ReinforceSuccessRateView.Display();
                        LabelControllerScript.LoadDataToDisplay(this.heroEquipment);
                        IsReinforceLevelMax(this.heroEquipment.ReinforcementLevel);
                    }
                }
            }
        }
Example #4
0
        public void InitDisplayAndLoadData(HeroDataFormat heroData)
        {
            this.selfHeroData = heroData.CloneEx();

            //hero jumped
            if (!heroData.Attributes.Active)
            {
                SkillOperaterButtonView.gameObject.SetActive(false);
            }

            for (int i = 0; i < this.selfHeroData.SkillList.Count; i++)
            {
                if (this.selfHeroData.SkillList [i].SlotID == this.SlotId)
                {
                    this.selfHeroSkillData = this.selfHeroData.SkillList [i];
                }
            }

            var _multiSkillName        = SkillStringsTableReader.Instance.GetMultiLangStringWithoutParam(this.selfHeroSkillData.DBSkillID, SkillNameLabel);
            var _multiSkillDescription = SkillStringsTableReader.Instance.GetMultiLangStringWithParam(this.selfHeroSkillData.DBSkillID, this.selfHeroSkillData.Level, SkillDescriptionLabel);

            SkillName.SetNewMultiStringAndDisplay(_multiSkillName);
            SkillDescription.SetNewMultiStringAndDisplay(_multiSkillDescription);
            SkillIconViewScript.SetSkillIconByPath(this.selfHeroSkillData.TexturePath, this.selfHeroSkillData.TextureIconID);
            SkillLevelDisplay(this.selfHeroSkillData.Level);
        }
Example #5
0
 void DisplayPlayerInfo(HeroDataFormat hero)
 {
     BasicAttributeController.SetDataForDisplay(hero);
     CharacterAttributeController.SetDataForDisplay(hero);
     SkillLayoutController.SetDataForDisplay(hero);
     EquipmentLayoutControllerScript.SetDataForDisplay(hero);
 }
Example #6
0
        void OnHeroCacheChanged(int slotID, HeroDataFormat heroDataCache)
        {
            if (this.heroData == null)
            {
                return;
            }
            if (this.heroData.Attributes.SlotID != slotID)
            {
                return;
            }

            this.heroData = heroDataCache.CloneEx();

            if (this.heroData.EquipmentList != null && this.heroData.EquipmentList.Count > 0)
            {
                for (int i = 0; i < this.heroData.EquipmentList.Count; i++)
                {
                    if (this.heroData.EquipmentList [i].EquipmentType == this.equipmentType)
                    {
                        this.EquipmentBuildData.HeroEquipmentData = this.heroData.EquipmentList [i].CloneEx();

                        CurrentEquipment.LoadDataToDisplay(this.EquipmentBuildData.HeroEquipmentData);
                        CurrentAttribute.SetDataForDisplay(this.heroData, this.EquipmentBuildData.HeroEquipmentData);
                    }
                }
            }
        }
Example #7
0
 public void Init(HeroDataFormat heroData)
 {
     HeroName.Init();
     HeroLevel.Init();
     HeroIcon.Init();
     HeroBeSavedButton.Init();
     heroFullManager = FindObjectOfType <HeroFullManager> ();
 }
Example #8
0
        public void InitFight(HeroDataFormat hero)
        {
            this.Clear();
            var _attribute = (hero.Attributes as HeroAttributeFormat).CloneEx();

            this.SlotID = _attribute.SlotID;
            this.Type   = CHARACTER_TYPE.HERO;
            this.attributeOriginCache = _attribute;
        }
Example #9
0
 public FightDataFormat(HeroDataFormat hero)
 {
     this.attributeOriginCache    = new CommonAttributeFormat(true);
     this.attributesAggregateBuff = new CommonAttributeFormat(true);
     this.finalAttributesCache    = new CommonAttributeFormat(true);
     this.DotManager       = new BattleDotManagerFormat();
     this.OneTurnFightData = new OneTurnFightDataFormat();
     this.InitFight(hero);
 }
        public void SetDataForDisplay(HeroDataFormat heroDataFormat)
        {
            equipmentList = heroDataFormat.EquipmentList;

            WeaponIconView.ShowEquipmentIcon(this.weaponDefaultTexturePath, 0);
            ArmorIconView.ShowEquipmentIcon(this.armorDefaultTexturePath, 0);
            AccessoryIconView.ShowEquipmentIcon(this.accessoryDefaultTexturePath, 0);

            SetEquipmentIcon(equipmentList);
        }
Example #11
0
        public void AddHeroEXP()
        {
            var _heroSaveData = HeroSaveDataManager.Instance.GetSaveData((int)this.HeroSlotID);

            if (_heroSaveData != null)
            {
                HeroDataFormat _heroData = new HeroDataFormat(_heroSaveData);
                _heroData.EXPUp(this.OffsetEXP, true, this.OnGotEXP);
            }
        }
        public void Add(HeroDataFormat heroGameData, bool write = true)
        {
            if (!UserSaveDataManager.Instance.DataExist)
            {
                UserSaveDataManager.Instance.InitUserData(true);
            }

            HeroSaveDataFormat _heroSaveData = new HeroSaveDataFormat(heroGameData);

            Add(_heroSaveData, write);
        }
Example #13
0
        void HeroSaveDataListChanged(List <HeroSaveDataFormat> heroSaveDataList)
        {
            List <HeroDataFormat> _list = new List <HeroDataFormat> ();

            heroSaveDataList.ForEach(heroSaveData => {
                HeroDataFormat _hero = new HeroDataFormat(heroSaveData);
                _list.Add(_hero);
            });
            heroes = _list.CloneEx();
            DisplayPlayerInfo(heroes [this.currentSlotID]);
        }
        public bool Overwrite(HeroDataFormat heroGameData, bool write = true)
        {
            if (!UserSaveDataManager.Instance.DataExist)
            {
                return(false);
            }

            HeroSaveDataFormat _heroSaveData = new HeroSaveDataFormat(heroGameData);

            return(Overwrite(_heroSaveData, write));
        }
Example #15
0
        public void InitFight(HeroDataFormat heroData)
        {
            this.HeroDataCache = heroData.CloneEx();
            base.FightData.InitFight(this.HeroDataCache);

            base.InitBodyView(this.HeroDataCache.AnimationInfo.TexturePath,
                              this.HeroDataCache.AnimationInfo.IdleID,
                              this.HeroDataCache.AnimationInfo.AttackID,
                              this.HeroDataCache.AnimationInfo.GetDamageID,
                              this.HeroDataCache.AnimationInfo.DeadID);

            this.state = STATES.ALIVE;
        }
        void OnHeroCacheChanged(int slotId, HeroDataFormat heroData)
        {
            if (this.selfHeroData == null)
            {
                return;
            }
            if (this.selfHeroData.Attributes.SlotID != slotId)
            {
                return;
            }

            this.selfHeroData = heroData.CloneEx();
        }
Example #17
0
        void OnHeroCacheChanged(int slotID, HeroDataFormat heroCache)
        {
            if (this.HeroDataCache == null)
            {
                return;
            }
            if (this.HeroDataCache.Attributes.SlotID != slotID)
            {
                return;
            }

            this.HeroDataCache = heroCache.CloneEx();
        }
Example #18
0
        void OnHeroCacheChanged(int slotID, HeroDataFormat heroDataCache)
        {
            if (this.heroDataFormat == null)
            {
                return;
            }
            if (this.heroDataFormat.Attributes.SlotID != slotID)
            {
                return;
            }

            this.heroDataFormat = heroDataCache.CloneEx();
            AttributeTakeOff.DisplayWithUnequippedEquipment(this.heroDataFormat, this.equipmentTakeOff);
        }
Example #19
0
        void OnHeroCacheChanged(int slotId, HeroDataFormat heroData)
        {
            if (this.heroData == null)
            {
                return;
            }
            if (this.heroData.Attributes.SlotID != slotId)
            {
                return;
            }

            this.heroData = heroData.CloneEx();
            SkillPointZeroOrNot(this.heroData.Attributes.SkillPoint);
        }
        void OnHeroCacheChanged(int slotID, HeroDataFormat heroCache)
        {
            if (this.selfHeroData == null)
            {
                return;
            }
            if (this.selfHeroData.Attributes.SlotID != slotID)
            {
                return;
            }

            this.selfHeroData = heroCache.CloneEx();
            ClearOldData();
            DisplayData();
        }
Example #21
0
        void HeroCacheUpdate(List <HeroSaveDataFormat> newHeroSaveDataList)
        {
            List <HeroDataFormat> _list = new List <HeroDataFormat> ();

            newHeroSaveDataList.ForEach(heroSaveData => {
                HeroDataFormat _hero = new HeroDataFormat(heroSaveData);
                _list.Add(_hero);
            });

            this.heroDataCacheList = _list;

            this.heroDataCacheList.ForEach(cache => {
                this.HeroDataCacheChangedEvent.Invoke(cache.Attributes.SlotID, cache);
            });
            this.HeroDataCacheListChangedEvent.Invoke(this.heroDataCacheList);
        }
Example #22
0
        public void SetDataForDisplay(HeroDataFormat heroDataFormat)
        {
            skillList = heroDataFormat.SkillList;
            if (skillList != null)
            {
                for (int i = 0; i < skillList.Count; i++)
                {
                    SkillLabelList [i].SkillLevelDisplay(skillList[i].Level);

                    SkillNormalIconList [i].SetSkillIconByPath(skillList[i].TexturePath, skillList[i].TextureIconID);
                }

                //FIXME : yangzhi-wang ,do it next version, load path from csv
                SkillSpecialIconView.SetSkillIconBySprite(SkillLockSprite);
            }
        }
Example #23
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);
        }
Example #25
0
        public void InitTurn(HeroDataFormat hero, BATTLE_FIGHT_TYPE fightType)
        {
            this.FightType = fightType;

            var _skill = hero.SkillList.CloneEx();

            this.SkillList = _skill.Cast <ICommonSkill> ().ToList();
            this.SkillList.ForEach(skill => skill.Reset());

            var _equipt = hero.EquipmentList.CloneEx();

            this.EquipmentList = _equipt.Cast <CommonEquipmentFormat>().ToList();

            this.OneTurnFightData.Clear();

            this.CalculateFinalAttributes();
        }
Example #26
0
        public HeroDataFormat GetHeroData(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);
            }

            HeroDataFormat _heroData = new HeroDataFormat(_heroSaveData);

            return(_heroData);
        }
Example #27
0
        public HeroEquipmentFormat GetEquipment(int heroSlotID, EQUIPMENT_TYPE equipmentType)
        {
            if (UserSaveDataManager.Instance == null)
            {
                UserSaveDataManager.Instance.InitUserData();
            }

            HeroDataFormat _hero = GetHeroData(heroSlotID);

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

            HeroEquipmentFormat _equipment = _hero.EquipmentList.Find(item => {
                return(item.EquipmentType == equipmentType);
            });

            return(_equipment);
        }
Example #28
0
        public HeroSkillFormat GetSkill(int heroSlotID, int skillSlotID)
        {
            if (UserSaveDataManager.Instance == null)
            {
                UserSaveDataManager.Instance.InitUserData();
            }

            HeroDataFormat _hero = GetHeroData(heroSlotID);

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

            HeroSkillFormat _skill = _hero.SkillList.Find(item => {
                return(item.SlotID == skillSlotID);
            });

            return(_skill);
        }
        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);
        }
Example #30
0
        void OnHeroCacheChanged(int slotId, HeroDataFormat heroData)
        {
            if (this.selfHeroData == null)
            {
                return;
            }
            if (this.selfHeroData.Attributes.SlotID != slotId)
            {
                return;
            }

            this.selfHeroData = heroData.CloneEx();

            for (int i = 0; i < this.selfHeroData.SkillList.Count; i++)
            {
                if (this.selfHeroData.SkillList [i].SlotID == this.SlotId)
                {
                    // skillID changed, new multiLang
                    if (this.selfHeroData.SkillList [i].DBSkillID != this.selfHeroSkillData.DBSkillID)
                    {
                        var _multiSkillName        = SkillStringsTableReader.Instance.GetMultiLangStringWithoutParam(this.selfHeroData.SkillList [i].DBSkillID, SkillNameLabel);
                        var _multiSkillDescription = SkillStringsTableReader.Instance.GetMultiLangStringWithParam(this.selfHeroData.SkillList [i].DBSkillID, this.selfHeroData.SkillList [i].Level, SkillDescriptionLabel);
                        SkillName.SetNewMultiStringAndDisplay(_multiSkillName);
                        SkillDescription.SetNewMultiStringAndDisplay(_multiSkillDescription);
                        SkillIconViewScript.SetSkillIconByPath(this.selfHeroData.SkillList [i].TexturePath, this.selfHeroData.SkillList [i].TextureIconID);
                    }
                    // skill data changed, do not need new multiLang
                    else if (this.selfHeroData.SkillList [i].DBSkillID == this.selfHeroSkillData.DBSkillID)
                    {
                        SkillName.DisplayMessage();
                        var _descriptionParam = SkillStringsTableReader.Instance.GetSkillDescriptionParameter(this.selfHeroData.SkillList [i].DBSkillID, this.selfHeroData.SkillList [i].Level);
                        var _parameterArray   = _descriptionParam.Cast <object> ().ToArray();

                        SkillDescription.MultiLangParamUpdate(_parameterArray);
                    }
                    this.selfHeroSkillData = this.selfHeroData.SkillList [i];
                }
            }

            SkillLevelDisplay(this.selfHeroSkillData.Level);
        }