Exemplo n.º 1
0
 public virtual bool ViewFilter(Room room, WrappedCard to_select, Player player)
 {
     if (!string.IsNullOrEmpty(filter_pattern))
     {
         string pat = filter_pattern;
         if (pat.EndsWith("!"))
         {
             if (RoomLogic.IsJilei(room, player, to_select))
             {
                 return(false);
             }
             pat = pat.Substring(0, pat.Length - 1);
         }
         if (response_or_use && pat.Contains("hand"))
         {
             List <string> handlist = new List <string> {
                 "hand"
             };
             foreach (string pile in player.GetPileNames())
             {
                 if (pile.StartsWith("&") || pile == "wooden_ox")
                 {
                     handlist.Add(pile);
                 }
             }
             pat = pat.Replace("hand", string.Join(",", handlist));
         }
         return(Engine.MatchExpPattern(room, pat, player, to_select));
     }
     return(false);
 }
Exemplo n.º 2
0
        public override bool ViewFilter(Room room, List <WrappedCard> selected, WrappedCard to_select, Player player)
        {
            if (selected.Count >= num)
            {
                return(false);
            }

            string pat = pattern;

            if (pat.EndsWith("!"))
            {
                if (RoomLogic.IsJilei(room, player, to_select))
                {
                    return(false);
                }
                pat = pat.Substring(0, pat.Length - 1);
            }

            return(Engine.MatchExpPattern(room, pat, player, to_select));
        }
Exemplo n.º 3
0
 public override bool ViewFilter(Room room, List <WrappedCard> selected, WrappedCard to_select, Player player)
 {
     return(!RoomLogic.IsJilei(room, player, to_select) && selected.Count < player.MaxHp && to_select.Id != player.Treasure.Key);
 }