Rename CardId to HCardId
This commit is contained in:
parent
33a28cf58e
commit
621069fd71
11 changed files with 40 additions and 41 deletions
|
|
@ -40,17 +40,17 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
HeroId.Shaman,
|
||||
};
|
||||
|
||||
CardId[] cardIds = new CardId[10] {
|
||||
CardId.CrashingPunch,
|
||||
CardId.CrashingPunch,
|
||||
CardId.CrashingPunch,
|
||||
CardId.Cover,
|
||||
CardId.Cover,
|
||||
CardId.Cover,
|
||||
CardId.Thunderstorm,
|
||||
CardId.Scarring,
|
||||
CardId.Scarring,
|
||||
CardId.Meditate,
|
||||
HCardId[] cardIds = new HCardId[10] {
|
||||
HCardId.CrashingPunch,
|
||||
HCardId.CrashingPunch,
|
||||
HCardId.CrashingPunch,
|
||||
HCardId.Cover,
|
||||
HCardId.Cover,
|
||||
HCardId.Cover,
|
||||
HCardId.Thunderstorm,
|
||||
HCardId.Scarring,
|
||||
HCardId.Scarring,
|
||||
HCardId.Meditate,
|
||||
};
|
||||
|
||||
MonsterId[] monsterIds = new MonsterId[3] {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class CardCover : HeroCard
|
||||
{
|
||||
public CardCover(BattleParticipant owner)
|
||||
: base(owner, CardId.Cover, "Cover", 1, CardType.Skill,
|
||||
: base(owner, HCardId.Cover, "Cover", 1, CardType.Skill,
|
||||
"Block 3 damage on another target ally.") {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class CardCrashingPunch : HeroCard
|
||||
{
|
||||
public CardCrashingPunch(BattleParticipant owner)
|
||||
: base(owner, CardId.CrashingPunch, "Crashing Punch", 3, CardType.Attack,
|
||||
: base(owner, HCardId.CrashingPunch, "Crashing Punch", 3, CardType.Attack,
|
||||
"Deals 3 damage to target.") {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class CardLightningStrike : HeroCard
|
||||
{
|
||||
public CardLightningStrike(BattleParticipant owner)
|
||||
: base(owner, CardId.LightningStrike, "Lightning Strike", 2, CardType.Attack,
|
||||
: base(owner, HCardId.LightningStrike, "Lightning Strike", 2, CardType.Attack,
|
||||
"Deals 3 damage to target.") {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class CardScarring : HeroCard
|
||||
{
|
||||
public CardScarring(BattleParticipant owner)
|
||||
: base(owner, CardId.Scarring, "Scarring", 2, CardType.Skill,
|
||||
: base(owner, HCardId.Scarring, "Scarring", 2, CardType.Skill,
|
||||
"Block 4 damage. The next time damage is taken until next turn, gain 1 Max HP.") {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ using UnityEngine;
|
|||
public class CardThunderstorm : HeroCard
|
||||
{
|
||||
public CardThunderstorm(BattleParticipant owner)
|
||||
: base(owner, CardId.Thunderstorm, "Thunderstorm", 3, CardType.Enchantment,
|
||||
: base(owner, HCardId.Thunderstorm, "Thunderstorm", 3, CardType.Enchantment,
|
||||
"Add 1 max energy. Acquire 2 Lightning Strike into draw pile.") {
|
||||
}
|
||||
|
||||
public override IEnumerator Use(IBattleEffectApplier effectApplier, BattlePlayerControls playerControls) {
|
||||
effectApplier.Apply(new IncreaseMaxEnergyEffect(1));
|
||||
effectApplier.Apply(new AcquireCardsEffect(new CardId[] {CardId.LightningStrike, CardId.LightningStrike}, BattleZone.DrawPile, this.owner));
|
||||
effectApplier.Apply(new AcquireCardsEffect(new HCardId[] {HCardId.LightningStrike, HCardId.LightningStrike}, BattleZone.DrawPile, this.owner));
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using UnityEngine;
|
|||
public class MeditateHCard : HeroCard
|
||||
{
|
||||
public MeditateHCard(BattleParticipant owner)
|
||||
: base(owner, CardId.Meditate, "Meditate", 2, CardType.Skill, "+1 insight. Draw a card.") {
|
||||
: base(owner, HCardId.Meditate, "Meditate", 2, CardType.Skill, "+1 insight. Draw a card.") {
|
||||
}
|
||||
|
||||
public override IEnumerator Use(
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ public class AcquireCardsEffect : IBattleEffect
|
|||
private BattleZone zone;
|
||||
private BattleParticipant participant;
|
||||
|
||||
public AcquireCardsEffect(CardId cardId, BattleZone zone, BattleParticipant participant) {
|
||||
public AcquireCardsEffect(HCardId cardId, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(new int[1] {(int) cardId}, zone, participant);
|
||||
}
|
||||
|
||||
public AcquireCardsEffect(CardId[] cardIds, BattleZone zone, BattleParticipant participant) {
|
||||
public AcquireCardsEffect(HCardId[] cardIds, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(cardIds.Cast<int>().ToArray(), zone, participant);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ using UnityEngine;
|
|||
|
||||
public abstract class HeroCard : BaseCard
|
||||
{
|
||||
private CardId id;
|
||||
private HCardId id;
|
||||
|
||||
public HeroCard(BattleParticipant owner, CardId id, string displayName, int cost, CardType type,
|
||||
public HeroCard(BattleParticipant owner, HCardId id, string displayName, int cost, CardType type,
|
||||
string effectText)
|
||||
: base(owner, displayName, cost, type, effectText) {
|
||||
this.id = id;
|
||||
|
|
@ -14,5 +14,5 @@ public abstract class HeroCard : BaseCard
|
|||
|
||||
public abstract IEnumerator Use(IBattleEffectApplier effectApplier, BattlePlayerControls playerControls);
|
||||
|
||||
public CardId GetId() {return this.id;}
|
||||
public HCardId GetId() {return this.id;}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public enum CardId {
|
||||
public enum HCardId {
|
||||
CrashingPunch,
|
||||
Cover,
|
||||
LightningStrike,
|
||||
|
|
@ -23,37 +23,37 @@ public enum CardId {
|
|||
|
||||
public class HeroCardDatabase : CardDatabase<HeroCard>
|
||||
{
|
||||
private static Dictionary<CardId, HeroId> CARD_TO_HERO = new Dictionary<CardId, HeroId>() {
|
||||
{CardId.CrashingPunch, HeroId.Brute},
|
||||
{CardId.Cover, HeroId.Brute},
|
||||
{CardId.LightningStrike, HeroId.Shaman},
|
||||
{CardId.Scarring, HeroId.Brute},
|
||||
{CardId.Thunderstorm, HeroId.Shaman},
|
||||
{CardId.Meditate, HeroId.Shaman},
|
||||
private static Dictionary<HCardId, HeroId> CARD_TO_HERO = new Dictionary<HCardId, HeroId>() {
|
||||
{HCardId.CrashingPunch, HeroId.Brute},
|
||||
{HCardId.Cover, HeroId.Brute},
|
||||
{HCardId.LightningStrike, HeroId.Shaman},
|
||||
{HCardId.Scarring, HeroId.Brute},
|
||||
{HCardId.Thunderstorm, HeroId.Shaman},
|
||||
{HCardId.Meditate, HeroId.Shaman},
|
||||
};
|
||||
|
||||
public override HeroCard CreateCard(int id, BattleParticipant owner) {
|
||||
CardId heroCardId = (CardId) id;
|
||||
HCardId heroCardId = (HCardId) id;
|
||||
switch (heroCardId)
|
||||
{
|
||||
case CardId.CrashingPunch:
|
||||
case HCardId.CrashingPunch:
|
||||
return new CardCrashingPunch(owner);
|
||||
case CardId.Cover:
|
||||
case HCardId.Cover:
|
||||
return new CardCover(owner);
|
||||
case CardId.LightningStrike:
|
||||
case HCardId.LightningStrike:
|
||||
return new CardLightningStrike(owner);
|
||||
case CardId.Scarring:
|
||||
case HCardId.Scarring:
|
||||
return new CardScarring(owner);
|
||||
case CardId.Thunderstorm:
|
||||
case HCardId.Thunderstorm:
|
||||
return new CardThunderstorm(owner);
|
||||
case CardId.Meditate:
|
||||
case HCardId.Meditate:
|
||||
return new MeditateHCard(owner);
|
||||
default:
|
||||
throw new System.ArgumentException("CardId unknown", "id");
|
||||
throw new System.ArgumentException("HCardId unknown", "id");
|
||||
}
|
||||
}
|
||||
|
||||
public static HeroId GetHeroIdOfCard(CardId id) {
|
||||
public static HeroId GetHeroIdOfCard(HCardId id) {
|
||||
return CARD_TO_HERO[id];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue