//获取减少伤害值
        //等级越高,减伤越高
        public override int GetDmgDesValue(ICharactorAttr theCharactorAttr)
        {
            var theAttr = theCharactorAttr as PlayerAttr;

            if (theAttr == null)
            {
                return(0);
            }

            return((theAttr.GetLevel() - 1) * 2);
        }
        //属性初始化
        public override void InitAttr(ICharactorAttr theCharactorAttr)
        {
            var theAttr = theCharactorAttr as PlayerAttr;

            if (theAttr == null)
            {
                return;
            }

            var addHp = 0;
            var lv    = theAttr.GetLevel();

            if (lv > 0)
            {
                addHp = (lv - 1) * 2;
            }

            theAttr.AddHp(addHp);
            theAttr.Init(theAttr.GetMaxHp());
        }
 //攻击加成
 public override int GetAtkplusValue(ICharactorAttr theCharactorAttr)
 {
     return(0);
 }
Example #4
0
 //减伤
 public abstract int GetDmgDesValue(ICharactorAttr theCharactorAttr);
Example #5
0
 //伤害加成
 public abstract int GetAtkplusValue(ICharactorAttr theCharactorAttr);
Example #6
0
 //初始化属性
 public abstract void InitAttr(ICharactorAttr theCharactorAttr);
Example #7
0
 //设置角色属性
 protected void SetCharactorAttr(ICharactorAttr theCharactorAttr)
 {
     CharactorAttr = theCharactorAttr;
 }
 //属性设置
 public virtual void SetCharactorAttr(ICharactorAttr theCharactorAttr)
 {
     CharactorAttr = theCharactorAttr;
 }