Exemplo n.º 1
0
 public void Fallout()
 {
     OnReceiveAttack?.Invoke();
     playerInfo.CurrentHealthPoint   -= 100;
     playerInfo.CurrentKnockdownPoint = 0f;
     playerController.Fallout();
     OnReceiveCrit?.Invoke();
 }
Exemplo n.º 2
0
    public void ReceiveAttack(CombatInfo combatInfo, float enemyXPosition)
    {
        if (Invincible)
        {
            return;
        }
        OnReceiveAttack?.Invoke();

        GetComponent <AudioSource>().clip = combatInfo.hitClip;
        GetComponent <AudioSource>().Play();

        playerInfo.CurrentHealthPoint -= combatInfo.damage;

        if (combatInfo.isCrit)
        {
            OnReceiveCrit?.Invoke();
        }

        if (combatInfo.stateType == StateType.Combat)
        {
            playerInfo.CurrentKnockdownPoint += combatInfo.damage;
        }

        if (combatInfo.isKnockDown || playerInfo.IsDead)
        {
            playerInfo.CurrentKnockdownPoint = 0f;
            playerController.Damaged(combatInfo.applyVelocity, combatInfo.stiffTime, true, enemyXPosition);
        }
        else if (playerInfo.IsKnockdown)
        {
            playerInfo.CurrentKnockdownPoint = 0f;
            playerController.Damaged(combatInfo.applyVelocity, 0, true, enemyXPosition);
        }
        else
        {
            playerController.Damaged(combatInfo.applyVelocity, combatInfo.stiffTime, false, enemyXPosition);
        }
    }