public void Setup(StateObject s, SpellCard target, float delay) { this.s = s; this.target = target; this.delay = delay; invoked = true; }
void Start () { CreatureCard c0 = new CreatureCard(3, 2, "Knight", 3, CardType.Creature, CardEffectName.Effect1, 0); SpellCard c1 = new SpellCard("Horse", 3, CardType.Spell, CardEffectName.Effect1, 1); SpellCard c2 = new SpellCard("Spearman", 1, CardType.Spell, CardEffectName.Effect1, 1); CreatureCard c3 = new CreatureCard(2, 1, "Bishop", 2, CardType.Creature, CardEffectName.Effect1, 0); CreatureCard c4 = new CreatureCard(2, 5, "King", 4, CardType.Creature, CardEffectName.Effect1, 0); Game game = new Game(p1, p2); p1.deck.Add(c1); p1.deck.Add(c0); p1.deck.Add(c2); p1.deck.Add(c3); p1.deck.Add(c4); p1.deck.Add(c1); p1.deck.Add(c0); p1.deck.Add(c2); p1.deck.Add(c3); p2.deck.Add(c1); p2.deck.Add(c0); p2.deck.Add(c2); p2.deck.Add(c3); p2.deck.Add(c4); p2.deck.Add(c1); p2.deck.Add(c0); p2.deck.Add(c2); p2.deck.Add(c3); ShuffleDeck(p1); ShuffleDeck(p2); }
public void Initialise (SpellCard card) { SetCard(card); this.sCard = card; SetCurrentCooldown(card.cooldown); GoOnCooldown(); SetCurrentManaCost(card.manaCost); }
public GameObject CreateHandSpell (SpellCard card) { GameObject go = Instantiate(manaCooldownCard); go.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform, false); HandSpell hs = go.GetComponent<HandSpell>() as HandSpell; hs.Initialise(card); return go; }
public HandSpell (SpellCard card): base (card) { this.sCard = card; }
int SpellOnHexValue(SpellCard sCard, Hex hex) { if(hex.Unit != null) { MockUnit mo = new MockUnit(hex.Unit); int originValue = mo.Value(CalculateHexValue); int newValue = sCard.MockOnPlay(mo, CalculateHexValue); if(mo.Team == player.Team) { return ((originValue - newValue) * -1); } else { return ((originValue - newValue)); } } return -1; }
bool PlaySpellCard(SpellCard card) { player.SetTargetsForCard(card); Hex targetHex = null; foreach(Hex hex in player.targets) { if(targetHex == null || SpellOnHexValue(card, hex) > SpellOnHexValue(card, targetHex)) { targetHex = hex; } } if(targetHex == null) { return false; } gameControl.EnemyCardPlayed(card); gameControl.PlayCardOnHex(card, targetHex, System.Guid.NewGuid().ToString()); player.SpendMana(card.Cost); player.Hand.Remove(card); return true; }
public static SpellCard NewCard(string name) { Uri baseUri = new Uri("ms-appx:///"); SpellCard card = new SpellCard(); card.Name = name; switch (name) { case "Block Attack": card.Description = "Select 1 of your opponent's monsters and shift it to Defense Position."; card.SetImage(baseUri, "Assets/Spell/BlockAttack.jpg"); card.ShortDescription = ""; card.Category = "Normal"; break; case "Dian Keto the Cure Master": card.Description = "Increases your Life Points by 1000 points."; card.SetImage(baseUri, "Assets/Spell/DianKetoTheCureMaster.jpg"); card.ShortDescription = ""; card.Category = "Normal"; break; case "Pot of Greed": card.Description = "Draw 2 cards from your Deck."; card.SetImage(baseUri, "Assets/Spell/PotOfGreed.jpg"); card.ShortDescription = ""; card.Category = "Normal"; break; case "Remove Trap": card.Description = "Destroys 1 face-up Trap Card on the field."; card.SetImage(baseUri, "Assets/Spell/RemoveTrap.jpg"); card.ShortDescription = ""; card.Category = "Normal"; break; case "Stop Defense": card.Description = "Select 1 of your opponent's monsters and switch it to Attack Position. If the card is face-down, flip it face-up. If the card has a flip effect, it is activated immediately."; card.SetImage(baseUri, "Assets/Spell/StopDefense.jpg"); card.ShortDescription = ""; card.Category = "Normal"; break; } return card; }
Texture2D SetTextureStats(Texture2D texture, SpellCard card) { return texture; }