Implement Triggers and Scarring
This commit is contained in:
parent
cbc8c8b6cd
commit
265c24ea1c
18 changed files with 247 additions and 5 deletions
29
Assets/Battle/Cards/CardScarring.cs
Normal file
29
Assets/Battle/Cards/CardScarring.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CardScarring : BaseCard
|
||||
{
|
||||
public CardScarring(BattleParticipant owner)
|
||||
: base(owner, CardId.Scarring, "Scarring", 2, CardType.Skill,
|
||||
"Block 4 damage. The next time damage is taken until next turn, gain 1 Max HP.") {
|
||||
}
|
||||
|
||||
public override IEnumerator Use(IBattleEffectApplier effectApplier, BattlePlayerControls playerControls) {
|
||||
effectApplier.Apply(new BlockEffect(this.owner, 4));
|
||||
// TODO: Trigger only until end of turn.
|
||||
DamageTrigger trigger = new DamageTrigger(
|
||||
new List<BattleParticipant>() {this.owner},
|
||||
this.NotifyDamageDealt,
|
||||
TriggerExpiration.StartOfNextHeroTurn,
|
||||
TriggerRepetition.Once);
|
||||
effectApplier.Apply(new ArmDamageTriggerEffect(trigger));
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void NotifyDamageDealt(IBattleEffectApplier effectApplier) {
|
||||
Debug.Log("NotifyDamageDealt ");
|
||||
IncreaseMaxHPEffect effect = new IncreaseMaxHPEffect(this.owner, 1);
|
||||
effectApplier.Apply(effect);
|
||||
}
|
||||
}
|
||||
11
Assets/Battle/Cards/CardScarring.cs.meta
Normal file
11
Assets/Battle/Cards/CardScarring.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fe7304b59bb0af4281311fce96c1218
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue