Implement Echolocation
This commit is contained in:
parent
5962ea9fd6
commit
939b3e2664
6 changed files with 149 additions and 16 deletions
21
Assets/Battle/CardsMonsters/EcholocationMCard.cs
Normal file
21
Assets/Battle/CardsMonsters/EcholocationMCard.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EcholocationMCard : MonsterCard
|
||||
{
|
||||
public EcholocationMCard(BattleParticipant owner)
|
||||
: base(owner, MCardId.Echolocation, "Echolocation", 1, CardType.Skill,
|
||||
"Block 1 damage on all Bats.") {
|
||||
}
|
||||
|
||||
public override IEnumerator Use(IBattleEffectApplier effectApplier, MonsterViewpoint monsterViewpoint) {
|
||||
yield return new WaitForSeconds(0.6f);
|
||||
foreach (BattleMonster monster in monsterViewpoint.Monsters) {
|
||||
if (monster.Id == MonsterId.Bat) {
|
||||
effectApplier.Apply(new BlockEffect(monster, 1));
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Battle/CardsMonsters/EcholocationMCard.cs.meta
Normal file
11
Assets/Battle/CardsMonsters/EcholocationMCard.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 301f1bb43e0ddae4daea107398db9c36
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -46,7 +46,7 @@ public class CheatBattle: MonoBehaviour
|
|||
MonsterId.Bat,
|
||||
};
|
||||
|
||||
MCardId[] mCardIds = new MCardId[17] {
|
||||
MCardId[] mCardIds = new MCardId[19] {
|
||||
MCardId.Eagerness,
|
||||
MCardId.Eagerness,
|
||||
MCardId.Eagerness,
|
||||
|
|
@ -57,20 +57,22 @@ public class CheatBattle: MonoBehaviour
|
|||
|
||||
MCardId.Eagerness,
|
||||
MCardId.Eagerness,
|
||||
MCardId.Echolocation,
|
||||
MCardId.VampireFangs,
|
||||
MCardId.VampireFangs,
|
||||
MCardId.Whirlwind,
|
||||
|
||||
MCardId.Eagerness,
|
||||
MCardId.Eagerness,
|
||||
MCardId.Echolocation,
|
||||
MCardId.VampireFangs,
|
||||
MCardId.VampireFangs,
|
||||
MCardId.Whirlwind,
|
||||
};
|
||||
int[] mCardOwnerIndexes = new int[17] {
|
||||
int[] mCardOwnerIndexes = new int[19] {
|
||||
0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2,
|
||||
1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 2,
|
||||
};
|
||||
BattleParameters parameters = new BattleParameters();
|
||||
parameters.SetHeroes(heroIds, hCardIds, hCardOwnerIndexes);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public enum MCardId {
|
|||
VampireFangs,
|
||||
Whirlwind,
|
||||
BlanketOfDarkness,
|
||||
Sonar,
|
||||
Echolocation,
|
||||
GolemFist,
|
||||
GraniteDefense,
|
||||
SelfRepair,
|
||||
|
|
@ -18,28 +18,35 @@ public enum MCardId {
|
|||
|
||||
public class MonsterCardDatabase : CardDatabase<MonsterCard>
|
||||
{
|
||||
public override MonsterCard CreateCard(int id, BattleParticipant owner) {
|
||||
MCardId monsterCardId = (MCardId) id;
|
||||
switch (monsterCardId)
|
||||
private System.Type GetCardClass(MCardId id) {
|
||||
switch (id)
|
||||
{
|
||||
case MCardId.Eagerness:
|
||||
return new EagernessMCard(owner);
|
||||
return typeof(EagernessMCard);
|
||||
case MCardId.QuickSwiftDeath:
|
||||
return new QuickSwiftDeathMCard(owner);
|
||||
return typeof(QuickSwiftDeathMCard);
|
||||
case MCardId.VampireFangs:
|
||||
return new VampireFangsMCard(owner);
|
||||
return typeof(VampireFangsMCard);
|
||||
case MCardId.Whirlwind:
|
||||
return new WhirlwindMCard(owner);
|
||||
return typeof(WhirlwindMCard);
|
||||
case MCardId.Echolocation:
|
||||
return typeof(EcholocationMCard);
|
||||
case MCardId.GolemFist:
|
||||
return new GolemFistMCard(owner);
|
||||
return typeof(GolemFistMCard);
|
||||
case MCardId.GraniteDefense:
|
||||
return new GraniteDefenseMCard(owner);
|
||||
return typeof(GraniteDefenseMCard);
|
||||
case MCardId.GolemCharge:
|
||||
return new GolemChargeMCard(owner);
|
||||
return typeof(GolemChargeMCard);
|
||||
case MCardId.GolemBerserk:
|
||||
return new GolemBerserkMCard(owner);
|
||||
return typeof(GolemBerserkMCard);
|
||||
default:
|
||||
throw new System.ArgumentException("MCardId unknown", "id");
|
||||
}
|
||||
}
|
||||
|
||||
public override MonsterCard CreateCard(int id, BattleParticipant owner) {
|
||||
MCardId monsterCardId = (MCardId) id;
|
||||
System.Type cardClass = GetCardClass(monsterCardId);
|
||||
return (MonsterCard) System.Activator.CreateInstance(cardClass, owner);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue