final commit?
This commit is contained in:
parent
0e2a7cc7c3
commit
3f53e2caa8
59 changed files with 3989 additions and 1668 deletions
|
|
@ -104,7 +104,6 @@ public class Enemy : Entity
|
|||
{
|
||||
DialogueManager.instance.battleUIAnimator.SetTrigger(DialogueManager.instance.nobossTrigger);
|
||||
WaveManager.instance.musicSource.clip = WaveManager.instance.musicLoop;
|
||||
WaveManager.instance.musicSource.volume = WaveManager.instance.musicVolume;
|
||||
WaveManager.instance.musicSource.Play();
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +133,7 @@ public class Enemy : Entity
|
|||
if (isBossEnemy && !hasStartedDialogue)
|
||||
{
|
||||
hasStartedDialogue = true;
|
||||
if (thisBossDialogue)
|
||||
if (thisBossDialogue && !GameManager.instance.isEndless)
|
||||
{
|
||||
DialogueManager.instance.StartDialogue(thisBossDialogue); //the worst code ever
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class Entity : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public void Heal(int healing)
|
||||
public virtual void Heal(int healing)
|
||||
{
|
||||
health += healing;
|
||||
health = Math.Clamp(health, 0, maxHealth);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ public class Player : Entity
|
|||
[SerializeField] private float hurtVolume = 1f;
|
||||
[SerializeField] private AudioClip gameOverSound;
|
||||
[SerializeField] private float gameOverVolume = 1f;
|
||||
[SerializeField] private AudioClip healSound;
|
||||
[SerializeField] private float healVolume = 1f;
|
||||
private void Update()
|
||||
{
|
||||
if (!isStalled)
|
||||
|
|
@ -62,6 +64,13 @@ public class Player : Entity
|
|||
}
|
||||
}
|
||||
|
||||
public override void Heal(int healing)
|
||||
{
|
||||
base.Heal(healing);
|
||||
UpdateLivesUI();
|
||||
WaveManager.instance.audioSource.PlayOneShot(healSound, healVolume);
|
||||
}
|
||||
|
||||
public override void TakeDamage(int damage)
|
||||
{
|
||||
base.TakeDamage(damage);
|
||||
|
|
|
|||
|
|
@ -5,17 +5,20 @@ public class ZombieFairy : Enemy
|
|||
[SerializeField] private Ability deathAbility;
|
||||
[SerializeField] private bool hasDiedOnce;
|
||||
[SerializeField] private float disappearanceTime;
|
||||
[SerializeField] private Color disappearanceColor;
|
||||
[SerializeField] private BoxCollider2D boxCollider;
|
||||
private float currentDisappearanceTime;
|
||||
protected override void OnDeath()
|
||||
{
|
||||
if (!hasDiedOnce)
|
||||
{
|
||||
hasDiedOnce = true;
|
||||
health = maxHealth;
|
||||
invulnerable = true;
|
||||
isStalled = true;
|
||||
hasDiedOnce = true;
|
||||
boxCollider.enabled = false;
|
||||
currentDisappearanceTime = disappearanceTime;
|
||||
sprite.color = Color.black;
|
||||
sprite.color = disappearanceColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -34,6 +37,7 @@ public class ZombieFairy : Enemy
|
|||
currentDisappearanceTime -= Time.deltaTime;
|
||||
if (currentDisappearanceTime <= 0)
|
||||
{
|
||||
boxCollider.enabled = true;
|
||||
invulnerable = false;
|
||||
isStalled = false;
|
||||
sprite.color = Color.white;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue