Inheritance: Sanguosha.Core.Cards.CardHandler
Exemple #1
0
 protected override bool? AdditionalVerify(Player source, List<Card> cards, List<Player> players)
 {
     if (source[DuWuUsed] != 0) return false;
     if ((players == null || players.Count == 0) && (cards != null && cards.Count > 0)) return false;
     if (players == null || players.Count == 0) return null;
     int req = players[0].Health;
     if (players.Any(p => Game.CurrentGame.DistanceTo(source, p) > source[Player.AttackRange] + 1))
     {
         return false;
     }
     if (req > 0 && (cards == null || cards.Count < req)) return null;
     if (req > 0 && (cards != null && cards.Count > req)) return false;
     if (req > 0 && cards != null && cards.Count > 0)
     {
         var temp = new Sha();
         temp.HoldInTemp(cards);
         if (players.Any(p => Game.CurrentGame.DistanceTo(source, p) > source[Player.AttackRange] + 1))
         {
             temp.ReleaseHoldInTemp();
             return false;
         }
         temp.ReleaseHoldInTemp();
     }
     return true;
 }
Exemple #2
0
 protected override bool? AdditionalVerify(Player source, List<Card> cards, List<Player> players)
 {
     if (source[XueJiUsed] != 0 || source.LostHealth == 0) return false;
     if (players != null && players.Count > 0 && (cards == null || cards.Count == 0)) return false;
     if (players != null && source.LostHealth < players.Count) return false;
     var temp = new Sha();
     temp.HoldInTemp(cards);
     if (players.Any(p => Game.CurrentGame.DistanceTo(source, p) > source[Player.AttackRange] + 1))
     {
         temp.ReleaseHoldInTemp();
         return false;
     }
     temp.ReleaseHoldInTemp();
     return true;
 }
Exemple #3
0
 public override VerifierResult FastVerify(Player source, ISkill skill, List<Card> cards, List<Player> players)
 {
     if (skill != null)
     {
         return VerifierResult.Fail;
     }
     if (players != null && players.Count > 1)
     {
         return VerifierResult.Fail;
     }
     if (players != null && players.Count != 0 && (players[0] == source || players[0] == ShaSource))
     {
         return VerifierResult.Fail;
     }
     if (cards != null && cards.Count > 1)
     {
         return VerifierResult.Fail;
     }
     if ((cards == null || cards.Count == 0) && players != null && players.Count > 0)
     {
         // if we have players but we don't have cards. it's not allowed
         return VerifierResult.Fail;
     }
     if (cards == null || cards.Count == 0)
     {
         return VerifierResult.Partial;
     }
     if (!Game.CurrentGame.PlayerCanDiscardCard(source, cards[0]))
     {
         return VerifierResult.Fail;
     }
     CardHandler handler = new Sha();
     handler.HoldInTemp(cards);
     if (players != null && players.Count != 0 && Game.CurrentGame.DistanceTo(source, players[0]) > source[Player.AttackRange] + 1)
     {
         handler.ReleaseHoldInTemp();
         return VerifierResult.Fail;
     }
     handler.ReleaseHoldInTemp();
     if (players == null || players.Count == 0)
     {
         return VerifierResult.Partial;
     }
     return VerifierResult.Success;
 }
Exemple #4
0
 public NanManRuQin()
 {
     RequiredCard = new Sha();
 }
 public NanManRuQin()
 {
     RequiredCard = new Sha();
 }