示例#1
0
    public bool GetDamage(Stat.AttackStat attackStat, out bool isDead, float fMotionMulti = 0.5f)
    {
        //TODO: 모션에 따른 배율이 정확히 들어오는지 확인
        int nDamage = CalculateAttributes.CaculateDamage(attackStat, fMotionMulti, m_baseStat.resister);

        if (nDamage <= 0)
        {
            isDead = false;
            return(false);
        }

        int nCaculate = m_baseStat.hp - nDamage;

        if (nCaculate <= 0)
        {
            m_baseStat.hp = 0;
            m_state       = State.Dead;
            isDead        = true;
            return(false);
        }

        m_baseStat.hp = nCaculate;

        //TODO: 아머 조건에 따라서
        m_state = State.Hit;
        isDead  = false;
        return(true);
    }
示例#2
0
    public override void ApponentColliderIn(Stat.AttackStat attackStat, HitType hitType, ActionAnim actionAnim = null)
    {
        float fMul = actionAnim == null ? 1f : actionAnim.fMotionMagnifi;
        int   nDmg = CalculateAttributes.CaculateDamage(attackStat, fMul, m_resister);

        nDmg    = (int)(nDmg * m_dmgReduce);
        m_nDmg += nDmg;

        if (m_nDmg >= m_dmgLimit)
        {
            m_nDmg = 0;
            m_unit.GetDamage(attackStat, hitType, null, actionAnim);
        }
    }
示例#3
0
    public override void ApponentColliderIn(Stat.AttackStat attackStat, HitType hitType, ActionAnim actionAnim = null)
    {
        m_unit.GetDamage(attackStat, hitType, null, actionAnim);

        if (m_armorStat.armorDamage >= m_armorStat.armorLimit)
        {
            StartCoroutine(ArmorBreakCoroutine());
        }
        else
        {
            float fMul = actionAnim == null ? 1f : actionAnim.fMotionMagnifi;
            m_armorStat.armorDamage +=
                CalculateAttributes.CaculateDamage(attackStat, fMul, m_armorResister);
        }
    }