Esempio n. 1
0
    public void HitTarget(int damage)
    {
        if (!attackTarget)
        {
            return;
        }
        Hurtable targetHurtable = attackTarget.GetComponent <Hurtable>();

        if (targetHurtable)
        {
            targetHurtable.Hurt(damage);
        }
    }
Esempio n. 2
0
 private void ApplyCurrentDepthDamage()
 {
     if (currentDepthDamage != null)
     {
         if (!seenDamages.Contains(currentDepthDamage))
         {
             UIPopupManager.main.ShowPopup("Going too deep", currentDepthDamage.Message);
             seenDamages.Add(currentDepthDamage);
         }
         damageTimer += Time.deltaTime;
         if (damageTimer > currentDepthDamage.DamageInterval)
         {
             //Debug.Log($"Depthdmg: [{currentDepthDamage.DamageTaken}] player vs depthDmg -> ({GameManager.main.PlayerDepth} > {currentDepthDamage.Depth}) playerHp vs depthBelowHp -> ({playerHurtable.GetMaxHealth()} < {currentDepthDamage.HealthBelow})");
             playerHurtable.Hurt(currentDepthDamage.DamageTaken);
             damageTimer = 0f;
         }
     }
 }
Esempio n. 3
0
 public void Damaged(float amount)
 {
     if (amount > 0)
     {
         hurtable.Hurt(-amount);
     }
     if (amount > 21.0f)
     {
         Kill();
     }
     else if (amount > 0f && GameManager.main.FirstHitNormal)
     {
         UIPopupManager.main.ShowPopup("Breaking stalagmites", "It seems you need a stronger torpedo to get through these rock formations.");
         GameManager.main.FirstHitNormal = false;
     }
     else if (amount > 10.0f && GameManager.main.FirstHitMedium)
     {
         GameManager.main.FirstHitMedium = false;
         UIPopupManager.main.ShowPopup("Breaking stalagmites", "Still not enough. Get the strongest torpedo and you may get through!");
     }
 }
Esempio n. 4
0
 void DealDamage(Hurtable hurtable)
 {
     hurtable.Hurt(damage);
 }