Exemple #1
0
 public void getHurt(int hitPointsToSubstract, Vector3 positionImpact)
 {
     if (!isInvulnerable && !attackController.isDoingBlock() && !GameManager.isGameEnded && !GameManager.isGamePaused)
     {
         getHurtBigPappada.transform.position = positionImpact;
         getHurtBigPappada.GetComponent <ParticleSystem>().Play();
         if (!getIsSpaceJumping())
         {
             //fallDown();
         }
         GameManager.playerAnimator.SetTrigger("isHurt");
         GetComponent <DialogueController>().createNewExpression("Ouch!", 0.5f, true, true);
         GameManager.audioManager.PlayStableSound(8);
         GUIManager.getHurtEffect();
         killable.TakeDamage(hitPointsToSubstract);
         pappadaC.newProportionOfLife(killable.proportionHP());
         if (killable.HP <= 0 && !GameManager.isGameEnded)
         {
             onDieCallEvent();
             GameManager.playerAnimator.SetBool("isDerribado", true);
             StopMove();
             isInvulnerable = true;
             GameManager.audioManager.StopSong();
             GameManager.audioManager.PlayStableSound(9);
             StartCoroutine(dissolveAndLose());
         }
     }
     StartCoroutine("takeHit");
 }
 bool isCharacterAllowedToDash()
 {
     if (character.getIsSpaceJumping())
     {
         return(false);
     }
     else if (attackController.isDoingDash() || attackController.isDashOnCooldown())
     {
         return(false);
     }
     else if (attackController.isDoingBlock())
     {
         return(false);
     }
     return(true);
 }