Use VampireFangs instead of flat 2 damage

This commit is contained in:
henriquenakashima 2020-09-19 23:35:47 -04:00
parent cce0b2891c
commit c34b065ff5
6 changed files with 22 additions and 13 deletions

View file

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VampireFangsMCard : MonsterCard
{
public VampireFangsMCard(BattleParticipant owner)
: base(owner, MCardId.VampireFangs, "VampireFangs", 2, CardType.Attack,
"Steals 2 HP from target.") {
}
public override IEnumerator Use(IBattleEffectApplier effectApplier, MonsterViewpoint monsterViewpoint) {
BattleParticipant target = DetermineTarget(monsterViewpoint);
DealDamageEffect damageEffect = new DealDamageEffect(target, 2);
effectApplier.Apply(damageEffect);
if (damageEffect.AmountDealt > 0) {
HealEffect healEffect = new HealEffect(this.owner, damageEffect.AmountDealt);
effectApplier.Apply(healEffect);
}
yield break;
}
private BattleParticipant DetermineTarget(MonsterViewpoint monsterViewpoint) {
return monsterViewpoint.Heroes[0];
}
}