yeah i think that's commit worthy
This commit is contained in:
parent
49cf2f2bb9
commit
fada3af715
16 changed files with 658 additions and 29 deletions
|
|
@ -3,12 +3,17 @@ using UnityEngine;
|
|||
|
||||
public class OfficerAbilities : MonoBehaviour
|
||||
{
|
||||
public PlayerEntity thisEntity;
|
||||
[Header("Kills")]
|
||||
[SerializeField] private int killQuota;
|
||||
private int currentKills;
|
||||
public PlayerEntity thisEntity;
|
||||
[Header("Length")]
|
||||
[SerializeField] private int abilityLength;
|
||||
[SerializeField] private int roundsRemaining;
|
||||
private void Start()
|
||||
{
|
||||
Enemy.OnKill += UpdateKillQuota;
|
||||
TurnHandler.waveUpdate += UpdateRounds;
|
||||
}
|
||||
|
||||
private void UpdateKillQuota(Entity entity)
|
||||
|
|
@ -19,8 +24,34 @@ public class OfficerAbilities : MonoBehaviour
|
|||
currentKills = Mathf.Clamp(currentKills, 0, killQuota);
|
||||
}
|
||||
}
|
||||
private void UpdateRounds()
|
||||
{
|
||||
if (roundsRemaining > 0)
|
||||
{
|
||||
roundsRemaining--;
|
||||
if (roundsRemaining <= 0)
|
||||
{
|
||||
DeactivateAbility();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ActivateAbility()
|
||||
{
|
||||
if (currentKills >= killQuota)
|
||||
{
|
||||
currentKills = 0;
|
||||
roundsRemaining = abilityLength;
|
||||
AbilityEffects();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void AbilityEffects()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void DeactivateAbility()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue