Create MonsterCard
This commit is contained in:
parent
169210efbe
commit
cce0b2891c
22 changed files with 203 additions and 27 deletions
26
Assets/Battle/CardsMonsters/MCardVampireFangs.cs
Normal file
26
Assets/Battle/CardsMonsters/MCardVampireFangs.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MCardVampireFangs : MonsterCard
|
||||
{
|
||||
public MCardVampireFangs(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];
|
||||
}
|
||||
}
|
||||
11
Assets/Battle/CardsMonsters/MCardVampireFangs.cs.meta
Normal file
11
Assets/Battle/CardsMonsters/MCardVampireFangs.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6958b53630a12ff42b90786d9ce5ff1b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue