Exemple #1
0
    public virtual void TakeDamage()
    {
        if (this.GameManager.InstantKill)
        {
            this.GameManager.Hits += scoreValue;
            scoreValue             = 0;
        }
        else if (this.GameManager.DoubleBurn)
        {
            scoreValue            -= 2;
            this.GameManager.Hits += 2;
        }
        else
        {
            scoreValue--;
            this.GameManager.Hits++;
        }

        if (scoreValue < 1)
        {
            TargetDiedEvent?.Invoke(null, null);
            Destroy(this.gameObject);
        }
    }
Exemple #2
0
 protected void RaiseTargetDiedEvent()
 {
     CurrentAttackState = AttackState.TargetDied;
     TargetDiedEvent?.Invoke(this);
 }
Exemple #3
0
 /// <summary>
 /// Just kill the target without worrying about score.
 /// </summary>
 public void JustKill()
 {
     TargetDiedEvent?.Invoke(null, null);
     Destroy(this.gameObject);
 }