Skip to content
Snippets Groups Projects
Commit a6850bad authored by ReinaldoAntolis's avatar ReinaldoAntolis
Browse files

feat: pet bird functionality

parent e0cf42b5
Branches feat/pet
Tags
No related merge requests found
......@@ -10,6 +10,9 @@ public class EnemyHealth : MonoBehaviour
public EnemyType enemyType;
GameObject pet;
PetHealth petHealth;
PetType petType;
Animator anim;
AudioSource enemyAudio;
ParticleSystem hitParticles;
......@@ -28,6 +31,10 @@ public class EnemyHealth : MonoBehaviour
currentHealth = startingHealth;
questTemple = FindObjectOfType<Temple>();
pet = GameObject.FindGameObjectWithTag ("Pet");
petHealth = pet.GetComponent <PetHealth> ();
petType = petHealth.GetPetType();
print(petType);
}
......@@ -54,6 +61,12 @@ public class EnemyHealth : MonoBehaviour
enemyAudio.Play();
currentHealth -= amount;
//print(currentHealth);
if (petType == PetType.Bird)
{
currentHealth -= 10;
}
//print(currentHealth);
hitParticles.transform.position = hitPoint;
hitParticles.Play();
......
......@@ -48,7 +48,6 @@ public class PetHealth : MonoBehaviour
// }
currentHealth -= amount;
print(currentHealth);
if (currentHealth <= 0)
{
......@@ -77,4 +76,9 @@ public class PetHealth : MonoBehaviour
isSinking = true;
Destroy (gameObject, 2f);
}
public PetType GetPetType ()
{
return petType;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment