示例#1
0
 public RefreshHeroInfoEventArgs Fill(string name, int level, int curExp, int maxExp, ActorAttribute attribute)
 {
     Type           = RefreshType.All;
     this.Name      = name;
     this.Level     = level;
     this.CurHp     = curExp;
     this.MaxHp     = maxExp;
     this.Attribute = attribute;
     return(this);
 }
示例#2
0
        protected override void InitAttribute(bool init = false)
        {
            m_BaseAttribute = new ActorAttribute();
            m_CurAttribute  = new ActorAttribute();
            Dictionary <PropertyType, int> propertys = AttributeTools.GetPlayerPropertys(m_PlayerData);

            m_BaseAttribute.CopyFrom(propertys);
            UpdateCurAttribute(init);

            ActorCard.SetName(m_PlayerData.Name);
            ActorCard.SetLevel(m_PlayerData.Level);
            ActorCard.SetMount(m_PlayerData.MountId);
            ActorCard.SetPartnerByPos(2, m_PlayerData.Partner1Id);
            ActorCard.SetPartnerByPos(3, m_PlayerData.Partner2Id);
        }
示例#3
0
        protected virtual void InitAttribute(bool init = false)
        {
            m_BaseAttribute = new ActorAttribute();
            m_CurAttribute  = new ActorAttribute();

            m_BaseAttribute.UpdateValue(AttributeType.Hp, m_ActorData.LHP);
            m_BaseAttribute.UpdateValue(AttributeType.MaxHp, m_ActorData.LHP);
            m_BaseAttribute.UpdateValue(AttributeType.Attack, m_ActorData.ATK);
            m_BaseAttribute.UpdateValue(AttributeType.Defense, m_ActorData.DEF);
            m_BaseAttribute.UpdateValue(AttributeType.Crit, m_ActorData.CRI);
            m_BaseAttribute.UpdateValue(AttributeType.CritDamage, m_ActorData.BUR);
            m_BaseAttribute.UpdateValue(AttributeType.Mp, m_ActorData.LMP);
            m_BaseAttribute.UpdateValue(AttributeType.MaxMp, m_ActorData.LMP);
            m_BaseAttribute.UpdateValue(AttributeType.SuckBlood, m_ActorData.VAM);
            m_BaseAttribute.UpdateValue(AttributeType.Hit, m_ActorData.HIT);
            m_BaseAttribute.UpdateValue(AttributeType.Dodge, m_ActorData.DOG);
            m_BaseAttribute.UpdateValue(AttributeType.Absorb, m_ActorData.BAF);
            m_BaseAttribute.UpdateValue(AttributeType.Speed, (int)m_ActorData.Speed);

            UpdateCurAttribute(init);
        }
示例#4
0
        public static ActorAttribute operator -(ActorAttribute a, ActorAttribute b)
        {
            ActorAttribute c = new ActorAttribute();

            c.Hp         = a.Hp - b.Hp;
            c.MaxHp      = a.MaxHp - b.MaxHp;
            c.Mp         = a.Mp - b.Mp;
            c.MaxMp      = a.MaxMp - b.MaxMp;
            c.Attack     = a.Attack - b.Attack;
            c.Defense    = a.Defense - b.Defense;
            c.HpRecover  = a.HpRecover - b.HpRecover;
            c.MpRecover  = a.MpRecover - b.MpRecover;
            c.Crit       = a.Crit - b.Crit;
            c.CritDamage = a.CritDamage - b.CritDamage;
            c.Speed      = a.Speed - b.Speed;
            c.SuckBlood  = a.SuckBlood - b.SuckBlood;
            c.Dodge      = a.Dodge - b.Dodge;
            c.Hit        = a.Hit - b.Hit;
            c.Absorb     = a.Absorb - b.Absorb;
            c.Reflex     = a.Reflex - b.Reflex;
            return(c);
        }
示例#5
0
        public virtual void UpdateCurAttribute(bool init = false)
        {
            ActorAttribute      bfAttr = new ActorAttribute();
            ActorAttribute      bpAttr = new ActorAttribute();
            Map <int, BuffBase> buffs  = m_ActorBuff.GetAllBuff();

            for (buffs.Begin(); buffs.Next();)
            {
                for (int i = 0; i < buffs.Value.AttrList.Count; i++)
                {
                    BuffAttrData attrData = buffs.Value.AttrList[i];
                    switch (attrData.ValueType)
                    {
                    case DataValueType.Fix:
                        bfAttr.UpdateValue(attrData.AttrType, attrData.Value);
                        break;

                    case DataValueType.Per:
                        bpAttr.UpdateValue(attrData.AttrType, attrData.Value);
                        break;
                    }
                }
            }

            int maxHp = m_BaseAttribute.MaxHp;//(m_BaseAttribute.MaxHp + bfAttr.MaxHp) * (1 + bpAttr.MaxHp / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.MaxHp, maxHp);

            int maxMp = (m_BaseAttribute.MaxMp + bfAttr.MaxMp) * (1 + bpAttr.MaxMp / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.MaxMp, maxMp);

            int attack = (m_BaseAttribute.Attack + bfAttr.Attack) * (1 + bpAttr.Attack / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Attack, attack);

            int defense = (m_BaseAttribute.Defense + bfAttr.Defense) * (1 + bpAttr.Defense / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Defense, defense);

            int absorb = (m_BaseAttribute.Absorb + bfAttr.Absorb) * (1 + bpAttr.Absorb / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Absorb, absorb);

            int speed = (m_BaseAttribute.Speed + bfAttr.Speed) * (1 + bpAttr.Speed / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Speed, speed);

            int reflex = (m_BaseAttribute.Reflex + bfAttr.Reflex) * (1 + bpAttr.Reflex / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Reflex, reflex);

            int suckBlood = (m_BaseAttribute.SuckBlood + bfAttr.SuckBlood) * (1 + bpAttr.SuckBlood / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.SuckBlood, suckBlood);

            int crit = (m_BaseAttribute.Crit + bfAttr.Crit) * (1 + bpAttr.Crit / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Crit, crit);

            int critDamage = (int)((m_BaseAttribute.CritDamage + bfAttr.CritDamage) * (1 + bpAttr.CritDamage / Constant.Define.PerBase));

            m_CurAttribute.UpdateValue(AttributeType.CritDamage, critDamage);

            int dodge = (m_BaseAttribute.Dodge + bfAttr.Dodge) * (1 + bpAttr.Dodge / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Dodge, dodge);

            int hit = (m_BaseAttribute.Hit + bfAttr.Hit) * (1 + bpAttr.Hit / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.Hit, hit);

            int mpRecover = (m_BaseAttribute.MpRecover + bfAttr.MpRecover) * (1 + bpAttr.MpRecover / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.MpRecover, mpRecover);

            int hpRecover = (m_BaseAttribute.HpRecover + bfAttr.HpRecover) * (1 + bpAttr.HpRecover / Constant.Define.PerBase);

            m_CurAttribute.UpdateValue(AttributeType.MpRecover, hpRecover);

            if (init)
            {
                m_CurAttribute.UpdateValue(AttributeType.Hp, m_BaseAttribute.Hp);
                m_CurAttribute.UpdateValue(AttributeType.Mp, m_BaseAttribute.Mp);
            }
            else
            {
                int hp = m_CurAttribute.Hp > m_BaseAttribute.MaxHp ? m_BaseAttribute.MaxHp : m_CurAttribute.Hp;
                int mp = m_CurAttribute.Mp > m_BaseAttribute.MaxMp ? m_BaseAttribute.MaxMp : m_CurAttribute.Mp;

                m_CurAttribute.UpdateValue(AttributeType.MaxHp, hp);
                m_CurAttribute.UpdateValue(AttributeType.MaxMp, mp);
            }
        }
示例#6
0
 public RefreshHeroInfoEventArgs FillAttribute(ActorAttribute attribute)
 {
     Type           = RefreshType.Attribute;
     this.Attribute = attribute;
     return(this);
 }
示例#7
0
 protected override void InitAttribute(bool init = false)
 {
     m_CurAttribute = new ActorAttribute();
     m_CurAttribute.UpdateValue(AttributeType.Speed, (int)m_ActorData.Speed);
 }