29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|