public override int Visit(DealDamageDependingOnMAXHPSpellAbility speelAbility)
 {
     if (Target.Character != Owner)
     {
         return(CheckImmunity());
     }
     return(-1);
 }
Exemplo n.º 2
0
        public override int Visit(DealDamageDependingOnMAXHPSpellAbility spell)
        {
            int dmg = 0;
            List <CreatureCard> modCards = new List <CreatureCard>();

            foreach (CreatureCard card in GameManager.UserDict[GameManager.ActiveCharacter].Player.Inner)
            {
                if (card.Health > dmg)
                {
                    dmg = card.Health;
                }
            }

            foreach (CreatureCard card in GameManager.UserDict[GameManager.ActiveCharacter].Player.Outer)
            {
                if (card.Health > dmg)
                {
                    dmg = card.Health;
                }
            }

            foreach (CardTarget t in CardTargets)
            {
                CreatureCard card = (CreatureCard)(GameManager.UserDict[t.Character].Player.GetCardFromId(t.CardId, Place.INNER) ?? (GameManager.UserDict[t.Character].Player.GetCardFromId(t.CardId, Place.OUTER)));
                card.Health -= dmg;
                modCards.Add(card);
            }

            // Handle player targets
            List <PlayerMod> modPlayers = new List <PlayerMod>();

            foreach (PlayerTarget t in PlayerTargets)
            {
                GameManager.UserDict[t.Character].Player.Health -= dmg;
                modPlayers.Add(new PlayerMod(GameManager.UserDict[t.Character].Player));
            }

            // Prepare responses
            foreach (CharacterEnum ch in GameManager.UserDict.Keys.ToList())
            {
                if (modCards.Any())
                {
                    AddResponse(ch, new CardsModifiedResponse(modCards));
                }
                if (modPlayers.Any())
                {
                    AddResponse(ch, new PlayerModifiedResponse(modPlayers));
                }
            }

            return(0);
        }
Exemplo n.º 3
0
 public override int Visit(DealDamageDependingOnMAXHPSpellAbility dealDamageDependingOnMAXHPSpeelAbility)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public abstract int Visit(DealDamageDependingOnMAXHPSpellAbility dealDamageDependingOnMAXHPSpeelAbility);
 public override int Visit(DealDamageDependingOnMAXHPSpellAbility dealDamageDependingOnMAXHPSpeelAbility)
 {
     return(0);
 }