public override int Visit(DuplicatorSpellAbility ability)
 {
     if (Target is CardTarget)
     {
         return(CheckImmunity());
     }
     return(-1);
 }
Esempio n. 2
0
 public override int Visit(DuplicatorSpellAbility duplicatorSpellAbility)
 {
     Log("in DuplicatorSpellAbility");
     foreach (CardTarget ct in CardTargets)
     {
         Place        origin = GameManager.UserDict[ct.Character].Player.GetCardFromId(ct.CardId, Place.INNER) == null ? Place.OUTER : Place.INNER;
         Place        dest;
         CreatureCard card  = (CreatureCard)(GameManager.UserDict[ct.Character].Player.GetCardFromId(ct.CardId, origin));
         CreatureCard clone = (CreatureCard)card.Original;
         clone.IsCloned = true;
         // TODO: gestire se l'area è piena
         if (origin == Place.OUTER)
         {
             if (GameManager.UserDict[ct.Character].Player.Outer.Count < AmaruConstants.OUTER_MAX_SIZE)
             {
                 dest = Place.OUTER;
                 GameManager.UserDict[ct.Character].Player.Outer.Add(clone);
             }
             else if (GameManager.UserDict[ct.Character].Player.Inner.Count < AmaruConstants.INNER_MAX_SIZE)
             {
                 dest = Place.INNER;
                 GameManager.UserDict[ct.Character].Player.Inner.Add(clone);
             }
             else
             {
                 return(0);
             }
         }
         else if (origin == Place.INNER)
         {
             if (GameManager.UserDict[ct.Character].Player.Inner.Count < AmaruConstants.INNER_MAX_SIZE)
             {
                 dest = Place.INNER;
                 GameManager.UserDict[ct.Character].Player.Inner.Add(clone);
             }
             else if (GameManager.UserDict[ct.Character].Player.Outer.Count < AmaruConstants.OUTER_MAX_SIZE)
             {
                 dest = Place.OUTER;
                 GameManager.UserDict[ct.Character].Player.Outer.Add(clone);
             }
             else
             {
                 return(0);
             }
         }
         else
         {
             return(0);
         }
         foreach (CharacterEnum c in GameManager.UserDict.Keys)
         {
             AddResponse(c, new EvocationResponse(Owner, card, clone, dest));
         }
     }
     return(0);
 }
Esempio n. 3
0
 public override int Visit(DuplicatorSpellAbility ability)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 // SpellAbility
 public abstract int Visit(DuplicatorSpellAbility duplicatorSpellAbility);
 public override int Visit(DuplicatorSpellAbility duplicatorSpellAbility)
 {
     return(0);
 }