Beispiel #1
0
        public override void UpdateAttr(ICharacterAttr CharacterAttr, ICharacter IC)
        {
            PlayerAttr playerAttr = CharacterAttr as PlayerAttr;

            IPlayer player = IC as IPlayer;

            if (playerAttr == null || player == null)
            {
                return;
            }

            CurAttack = GetAttackPlus(CharacterAttr, IC);

            CurDefense = GetDefensePlus(CharacterAttr, IC);

            CurMaxHP = GetMaxHP(CharacterAttr, IC);

            CurMaxEXP = GetLevelMaxEXP(CharacterAttr, IC);
        }
Beispiel #2
0
        public override int GetDefensePlus(ICharacterAttr CharacterAttr, ICharacter IC)
        {
            PlayerAttr playerAttr = CharacterAttr as PlayerAttr;

            IPlayer player = IC as IPlayer;

            if (playerAttr == null || player == null)
            {
                return(0);
            }

            int LV = playerAttr.GetLV();

            if (LV >= 1)
            {
                CurDefense = player.BaseAttr.BaseDefense + (LV - 1) * 50;
            }

            return(CurDefense);
        }
Beispiel #3
0
        public override int GetAttackPlus(ICharacterAttr CharacterAttr, ICharacter IC)
        {
            PlayerAttr playerAttr = CharacterAttr as PlayerAttr;

            IPlayer player = IC as IPlayer;

            if (playerAttr == null || player == null)
            {
                return(0);
            }

            int LV = playerAttr.GetLV();

            if (LV >= 1)
            {
                CurAttack = player.BaseAttr.BaseAttack + (LV - 1) * 100;
            }

            return(CurAttack);
        }
Beispiel #4
0
        public override int GetLevelMaxEXP(ICharacterAttr CharacterAttr, ICharacter IC)
        {
            PlayerAttr playerAttr = CharacterAttr as PlayerAttr;

            IPlayer player = IC as IPlayer;

            if (playerAttr == null || player == null)
            {
                return(0);
            }

            int LV = playerAttr.GetLV();

            if (LV >= 1)
            {
                CurMaxEXP = player.BaseAttr.BaseEXP + (LV - 1) * 100;
            }

            return(CurMaxEXP);
        }
 public virtual void SetCharacterAttr(ICharacterAttr CharacterAttr)
 {
 }
Beispiel #6
0
 /// <summary>
 /// 更新数据
 /// </summary>
 public abstract void UpdateAttr(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #7
0
 /// <summary>
 /// 经验属性
 /// </summary>
 /// <param name="CharacterAttr"></param>
 /// <returns></returns>
 public abstract int GetLevelMaxEXP(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #8
0
 /// <summary>
 /// 血量属性
 /// </summary>
 /// <param name="CharacterAttr"></param>
 /// <returns></returns>
 public abstract int GetMaxHP(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #9
0
 /// <summary>
 /// 防御属性
 /// </summary>
 /// <param name="CharacterAttr"></param>
 public abstract int GetDefensePlus(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #10
0
 /// <summary>
 /// 攻击属性
 /// </summary>
 public abstract int GetAttackPlus(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #11
0
 /// <summary>
 /// 初始数值
 /// </summary>
 /// <param name="CharacterAttr"></param>
 public abstract void InitAttr(ICharacterAttr CharacterAttr, ICharacter IC);
Beispiel #12
0
 public override void SetCharacterAttr(ICharacterAttr CharacterAttr)
 {
     ICharacterAttr = CharacterAttr;
     ICharacterAttr.InitAttr(_playerAttrStrategy, this);
 }