Esempio n. 1
0
        public HeroDataFormat(HeroSaveDataFormat heroSaveData)
        {
            HeroAttributeFormat _attributes = new HeroAttributeFormat(heroSaveData);

            List <HeroSkillFormat> _skillList = new List <HeroSkillFormat> ();

            heroSaveData.SkillSaveDataList.ForEach(item => {
                HeroSkillFormat _skill = new HeroSkillFormat(item);
                _skillList.Add(_skill);
            });


            List <HeroEquipmentFormat> _equipmentList = new List <HeroEquipmentFormat> ();

            heroSaveData.EquipmentSaveDataList.ForEach(item => {
                HeroEquipmentFormat _equip = new HeroEquipmentFormat(item);
                _equipmentList.Add(_equip);
            });

            this.Attributes    = _attributes;
            this.SkillList     = _skillList;
            this.EquipmentList = _equipmentList;

            var _data = HeroTableReader.Instance.FindDefaultUnique(heroSaveData.DBHeroID);;

            this.AnimationInfo = new HeroAnimationFormat(_data);
        }
Esempio n. 2
0
//    public HeroDataFormat()
//    {
//      this.Attributes = new HeroAttributeFormat();
//      this.SkillList = new List<HeroSkillFormat>();
//      this.EquipmentList = new List<HeroEquipmentFormat>();
//      this.AnimationInfo = new HeroAnimationFormat ();
//    }

        public HeroDataFormat(HeroAttributeFormat attributes, List <HeroSkillFormat> skillList, List <HeroEquipmentFormat> equipmentList, HeroAnimationFormat animation)
        {
            this.Attributes    = attributes.CloneEx();
            this.SkillList     = skillList.CloneEx();
            this.EquipmentList = equipmentList.CloneEx();
            this.AnimationInfo = animation.CloneEx();
        }
Esempio n. 3
0
        public HeroAttributeFormat AddBaseOnly(HeroAttributeFormat c2)
        {
            this.STR += c2.STR;
            this.VIT += c2.VIT;
            this.INT += c2.INT;
            this.DEX += c2.DEX;

            return(this);
        }
Esempio n. 4
0
        protected override CommonAttributeFormat Add(CommonAttributeFormat c2)
        {
            var _sumCommon = base.Add(c2);

            if (this is HeroAttributeFormat)
            {
                var _sumHero = new HeroAttributeFormat(_sumCommon);

                var _thisHero = this as HeroAttributeFormat;
                _sumHero.STR = _thisHero.STR;
                _sumHero.VIT = _thisHero.VIT;
                _sumHero.INT = _thisHero.INT;
                _sumHero.DEX = _thisHero.DEX;

                if (c2 is HeroAttributeFormat)
                {
                    var _c2Hero = c2 as HeroAttributeFormat;
                    _sumHero.STR += _c2Hero.STR;
                    _sumHero.VIT += _c2Hero.VIT;
                    _sumHero.INT += _c2Hero.INT;
                    _sumHero.DEX += _c2Hero.DEX;
                }
                return(_sumHero);
            }
            else if (c2 is HeroAttributeFormat)
            {
                var _sumHero = new HeroAttributeFormat(_sumCommon);

                var _c2Hero = c2 as HeroAttributeFormat;
                _sumHero.STR = _c2Hero.STR;
                _sumHero.VIT = _c2Hero.VIT;
                _sumHero.INT = _c2Hero.INT;
                _sumHero.DEX = _c2Hero.DEX;

                if (this is HeroAttributeFormat)
                {
                    var _thisHero = this as HeroAttributeFormat;
                    _sumHero.STR += _thisHero.STR;
                    _sumHero.VIT += _thisHero.VIT;
                    _sumHero.INT += _thisHero.INT;
                    _sumHero.DEX += _thisHero.DEX;
                }
                return(_sumHero);
            }

            return(_sumCommon);
        }
Esempio n. 5
0
 public HeroAttributeFormat AddCommonOnly(HeroAttributeFormat c2)
 {
     base.HPMax += c2.HPMax;
     base.HPMax  = Mathf.FloorToInt(base.HPMax);
     base.HP    += c2.HP;
     base.HP     = Mathf.FloorToInt(base.HP);
     base.RES   += c2.RES;
     base.ATK   += c2.ATK;
     base.MAG   += c2.MAG;
     base.DEF   += c2.DEF;
     base.AC    += c2.AC;
     base.CRI   += c2.CRI;
     base.PEN   += c2.PEN;
     base.HIT   += c2.HIT;
     base.AVD   += c2.AVD;
     base.Level += c2.Level;
     return(this);
 }
Esempio n. 6
0
        public HeroAttributeFormat AddLevelOnly(HeroAttributeFormat c)
        {
            base.Level += c.Level;

            return(this);
        }