this idiot forgot to commit an entire month's worth of code
This commit is contained in:
parent
c67146ea1a
commit
a3321d361c
51 changed files with 3644 additions and 84 deletions
26
Assets/Scripts/Abilities/Upgrades/EnemyCountRuntime.cs
Normal file
26
Assets/Scripts/Abilities/Upgrades/EnemyCountRuntime.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnemyCountRuntime : MonoBehaviour
|
||||
{
|
||||
private List<Collider2D> enemiesInRange = new(); //was supposed to be entity list but trygetcomponent isn't needed because we aren't using the actual entity values
|
||||
public EnemyCountPowerup baseSO;
|
||||
public PlayerAbility thisAbility;
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (!other.CompareTag(tag))
|
||||
{
|
||||
enemiesInRange.Add(other);
|
||||
}
|
||||
thisAbility.powerMultiplier = 1 + baseSO.damageIncreasePercentage * enemiesInRange.Count; //does not stack with other multipliers and must be fixed
|
||||
}
|
||||
|
||||
private void OnTriggerExit2D(Collider2D other)
|
||||
{
|
||||
if (!other.CompareTag(tag) && enemiesInRange.Contains(other))
|
||||
{
|
||||
enemiesInRange.Remove(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue