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);
|
||||
}
|
||||
}
|
||||
11
Assets/Battle/Triggers/DamageTrigger.cs.meta
Normal file
11
Assets/Battle/Triggers/DamageTrigger.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d53e7c1da2653f45a48f309980a7ca4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue