Ejemplo n.º 1
0
        void Start()
        {
            _PlayerAttr = new PlayerAttr();

            _playerAttrStrategy = new PlayerAttrStrategy();

            SetCharacterAttr(_PlayerAttr);

            //Debug.Log("AttrName    " + PlayerAttr._AttrName + "    ShootSpeed    " + PlayerAttr._ShootSpeed + "    LV    " + PlayerAttr._LV + "    CurMaxEXP    " + _playerAttrStrategy.CurMaxEXP + "    CurMaxHP    " + _playerAttrStrategy.CurMaxHP + "    CurAttack    " + _playerAttrStrategy.CurAttack + "    CurDefense    " + _playerAttrStrategy.CurDefense);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }