public ICharacterAttr(IAttrStrategy strategy, int lv, CharactorBaseAttr baseAttr)
 {
     mLv           = lv;
     mBaseAttr     = baseAttr;
     mAttrStrategy = strategy;
     mDmgDescValue = mAttrStrategy.GetDmgDescValue(mLv);
     mCurHp        = mBaseAttr.MaxHp + mAttrStrategy.GetExtraHPValue(mLv);
 }
 public ICharacterAttr(IAttrStrategy strategy, int lv, CharacterBaseAttr baseAttr)
 {
     mLv           = lv;
     mBaseAttr     = baseAttr;
     mStrategy     = strategy;
     mDmgDescValue = mStrategy.GetDmgDescValue(mLv);
     mCurrentHP    = baseAttr.maxHP + mStrategy.GetExtraHPValue(mLv);
 }
Ejemplo n.º 3
0
    //public int DmgDescValue { get { return m_DmgDescValue; } }
    //不使用方法返回是为了减少性能损耗
    //public int DmgDescValue { get { return m_Strategy.GetDmgDescValue(m_LV); } }

    public ICharacterAttr(IAttrStrategy strategy, int lv, CharacterBaseAttr baseAttr)
    {
        m_Strategy = strategy;
        m_LV       = lv;
        m_BaseAttr = baseAttr;

        m_DmgDescValue = m_Strategy.GetDmgDescValue(m_LV);
        m_CurrentHP    = baseAttr.MaxHP + m_Strategy.GetExtraHPValue(m_LV);
    }
Ejemplo n.º 4
0
 public ICharacterAttr(IAttrStrategy strategy, int lv, CharacterBaseAttr baseAttr)
 {
     mBaseAttr = baseAttr;
     mLv       = lv;
     mStrategy = strategy;
     //下面的两个字段当角色被创建出来的时候就已经确定了,所以在构造方法里面直接进行初始化
     mDmgDescValue = mStrategy.GetDmgDescValue(mLv);
     mCurrentHP    = baseAttr.maxHP + mStrategy.GetExtraHPValue(mLv);
 }
Ejemplo n.º 5
0
    public ICharacterAttr(IAttrStrategy strategy, int lv, CharacterBaseAttr baseAttr)
    {
        mStrategy          = strategy;
        mLv                = lv;
        mCharacterBaseAttr = baseAttr;

        mDmgDesValue = mStrategy.GetDmgDescValue(mLv);                  //根据等级计算出抵御的伤害值
        mCurrentHP   = baseAttr.MaxHP + mStrategy.GetExtraHPValue(mLv); //根据等级计算额外血量,加最大血量得到当前角色血量
    }