コード例 #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 virtual bool GetDamage(Stat.AttackStat attackStat, HitType hitType = HitType.Normal, CUnit unit = null, ActionAnim actionAnim = null)
    {
        bool isDead = false;

        if (m_status.CurState == State.Dead)
        {
            return(false);
        }

        float fMotionMul = actionAnim != null ? actionAnim.fMotionMagnifi : 1f;

        if (m_status.GetDamage(attackStat, out isDead, fMotionMul))
        {
            if (m_unitUI != null)
            {
                m_unitUI.SetHPGuageFill(m_status.GetHpAmount());
            }
            MainHookClose();
            m_actCtrl.ResetAttack();
            m_actCtrl.GetHitAction(hitType);
            m_actCtrl.Target = unit;
            return(true);
        }

        if (isDead)
        {
            DeathProcess();
        }

        return(false);
    }
コード例 #3
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);
        }
    }
コード例 #4
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);
        }
    }
コード例 #5
0
 public virtual void ApponentColliderIn(Stat.AttackStat attackStat, HitType hitType, ActionAnim actionAnim = null)
 {
 }