Beispiel #1
0
        public override int Visit(DamageDependingOnCPAbility ability)
        {
            //Log(OwnerCard.Name + " used KillIfPDAbility");
            List <CreatureCard> modCards = new List <CreatureCard>();

            foreach (CardTarget t in CardTargets)
            {
                CreatureCard targetCard = (CreatureCard)(GameManager.UserDict[t.Character].Player.GetCardFromId(t.CardId, Place.INNER) ?? GameManager.UserDict[t.Character].Player.GetCardFromId(t.CardId, Place.OUTER));
                //Log("Target is " + (deadCard.Name ?? "null") + " of " + t.Character.ToString());
                targetCard.Health -= (int)Math.Ceiling((double)Caller.Mana / 2);
                modCards.Add(targetCard);
            }
            foreach (CharacterEnum c in GameManager.UserDict.Keys)
            {
                if (modCards.Any())
                {
                    AddResponse(c, new CardsModifiedResponse(modCards));
                }
            }
            // Case target is Player
            foreach (PlayerTarget t in PlayerTargets)
            {
                Player targetPlayer = GameManager.UserDict[t.Character].Player;
                targetPlayer.Health -= Caller.Mana;
                foreach (CharacterEnum c in GameManager.UserDict.Keys.ToList())
                {
                    AddResponse(c, new PlayerModifiedResponse(targetPlayer.Character, targetPlayer.Mana, targetPlayer.Health));
                }
            }
            return(0);
        }
Beispiel #2
0
 public override int Visit(DamageDependingOnCPAbility spendCPToDealDamageAbility)
 {
     return(0);
 }
 public override int Visit(DamageDependingOnCPAbility ability)
 {
     return(CheckImmunity());
 }
Beispiel #4
0
 public abstract int Visit(DamageDependingOnCPAbility spendCPToDealDamageAbility);