Implement Molotov Cocktail
This commit is contained in:
parent
938a56231a
commit
a37adf2972
17 changed files with 255 additions and 20 deletions
30
Assets/Battle/CardsHeroes/MolotovCocktailHCard.cs
Normal file
30
Assets/Battle/CardsHeroes/MolotovCocktailHCard.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
11
Assets/Battle/CardsHeroes/MolotovCocktailHCard.cs.meta
Normal file
11
Assets/Battle/CardsHeroes/MolotovCocktailHCard.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7662730dc6ed8643813c916a0f0372f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -14,15 +14,18 @@ public class ScarringHCard : HeroCard
|
|||
effectApplier.Apply(new BlockEffect(this.owner, 4));
|
||||
DamageTrigger trigger = new DamageTrigger(
|
||||
new List<BattleParticipant>() {this.owner},
|
||||
this.NotifyDamageDealt,
|
||||
this.WhenDamageDealt,
|
||||
TriggerExpiration.StartOfNextHeroTurn,
|
||||
TriggerRepetition.Once);
|
||||
effectApplier.Apply(new ArmDamageTriggerEffect(trigger));
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void NotifyDamageDealt(IBattleEffectApplier effectApplier) {
|
||||
public IEnumerator WhenDamageDealt(IBattleEffectApplier effectApplier,
|
||||
MonsterViewpoint viewpoint, BattlePlayerControls playerControls) {
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
IncreaseMaxHPEffect effect = new IncreaseMaxHPEffect(this.owner, 1);
|
||||
effectApplier.Apply(effect);
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue