Implement Triggers and Scarring
This commit is contained in:
parent
cbc8c8b6cd
commit
265c24ea1c
18 changed files with 247 additions and 5 deletions
16
Assets/Battle/Triggers/DamageTrigger.cs
Normal file
16
Assets/Battle/Triggers/DamageTrigger.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
public class DamageTrigger : Trigger {
|
||||
|
||||
private List<BattleParticipant> observedParticipants;
|
||||
|
||||
public DamageTrigger(List<BattleParticipant> observedParticipants, TriggeredEffect callback,
|
||||
TriggerExpiration expiration, TriggerRepetition repetition)
|
||||
: base(callback, expiration, repetition) {
|
||||
this.observedParticipants = observedParticipants;
|
||||
}
|
||||
|
||||
public bool IsTriggeredBy(DealDamageEffect effect) {
|
||||
return effect.Amount > 0 && this.observedParticipants.Contains(effect.Target);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue