/// <summary> /// Juega un hechizo en un fuerte /// </summary> /// <param name="playedCard"></param> /// <param name="tablePos"></param> public void PlayATargetSpellFromHand(SpellCard spellCard, Fort fort) { Gold.AddGold(-spellCard.CurrentGoldCost); //Borramos la carta de la mano Hand.RemoveCard(spellCard); Destroy(spellCard.gameObject); fort.ApplyEffect(spellCard.Effect); }
/// <summary> /// Juega un hechizo sin target /// </summary> /// <param name="playedCard"></param> /// <param name="tablePos"></param> public void PlayANoTargetSpellFromHand(SpellCard spellCard) { Gold.AddGold(-spellCard.CurrentGoldCost); //Borramos la carta de la mano Hand.RemoveCard(spellCard); Destroy(spellCard.gameObject); Effect effect = spellCard.Effect; switch (spellCard.SpellTarget) { case SpellTarget.ALLALLYCHARACTERS: Fort.ApplyEffect(effect); PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.ALLALLYMINIONS: PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.ALLCHARACTERS: Fort.ApplyEffect(effect); PlayerBattlefield.ApplyEffect(effect); OtherPlayer.Fort.ApplyEffect(effect); OtherPlayer.PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.ALLENEMYCHARACTERS: OtherPlayer.Fort.ApplyEffect(effect); OtherPlayer.PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.ALLENEMYMINIONS: OtherPlayer.PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.ALLMINIONS: PlayerBattlefield.ApplyEffect(effect); OtherPlayer.PlayerBattlefield.ApplyEffect(effect); break; case SpellTarget.NOTARGET: //TODO: MONEDA DEL PLAYER break; } }
//---------------------PRIVATE VARIABLES------------------------------ /// <summary> /// Obtenemos referencias /// </summary> protected override void Awake() { base.Awake(); spellCard = GetComponent <SpellCard>(); }