Implement Molotov Cocktail

This commit is contained in:
henriquenakashima 2020-10-23 00:16:34 -04:00
parent 938a56231a
commit a37adf2972
17 changed files with 255 additions and 20 deletions

View file

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MolotovCocktailHCard : HeroCard
{
public MolotovCocktailHCard(BattleParticipant owner)
: base(owner, HCardId.MolotovCocktail, "Molotov Cocktail", 3, CardType.Enchantment,
"At start of hero turn, deal 1 damage to all enemies.") {
}
public override IEnumerator Use(IBattleEffectApplier effectApplier,
MonsterViewpoint viewpoint, BattlePlayerControls playerControls) {
StepTrigger trigger = new StepTrigger(
RoundStep.StartOfHeroTurn,
this.AtStartOfHeroTurn,
TriggerExpiration.Never,
TriggerRepetition.Multiple);
effectApplier.Apply(new ArmStepTriggerEffect(trigger));
yield break;
}
private IEnumerator AtStartOfHeroTurn(IBattleEffectApplier effectApplier,
MonsterViewpoint viewpoint, BattlePlayerControls playerControls) {
yield return new WaitForSeconds(0.3f);
MassDamageEffect damageEffect = new MassDamageEffect(TeamChoice.Monsters, 1);
effectApplier.Apply(damageEffect);
yield break;
}
}