예제 #1
0
        public override bool IsAvailable(Room room, Player invoker, CardUseReason reason, string pattern, string position)
        {
            if (reason == CardUseReason.CARD_USE_REASON_PLAY)
            {
                return(!invoker.HasShownSkill(Name, position == "head"));
            }

            return(false);
        }
예제 #2
0
        public override bool IsProhibited(Room room, Player from, Player to, WrappedCard card, List <Player> others = null)
        {
            if (from != null && from.GetPile("commissariat").Count > 0 && card != null && card.Name.Contains("Slash"))
            {
                CardUseReason reason = room.GetRoomState().GetCurrentCardUseReason();
                return(reason == CardUseReason.CARD_USE_REASON_PLAY || reason == CardUseReason.CARD_USE_REASON_RESPONSE_USE);
            }

            return(false);
        }
예제 #3
0
        public override bool IsAvailable(Room room, Player invoker, CardUseReason reason, string pattern, string position)
        {
            DistanceSkill skill = (DistanceSkill)Engine.GetSkill(Name);
            bool          head  = (position == "head" ? true : false);

            if (skill != null && reason == CardUseReason.CARD_USE_REASON_PLAY && !invoker.HasShownSkill(Name, head))
            {
                return(true);
            }

            return(false);
        }
예제 #4
0
        public virtual bool IsAvailable(Room room, Player invoker, CardUseReason reason, string pattern, string position = null)
        {
            bool huashen = false;

            if (invoker.ContainsTag("Huashens"))
            {
                //List<string> huashens = (List<string>)(invoker.GetTag("Huashens"));                 //for huashen
                //foreach (string general in huashens) {
                //    if (Engine.GetHuashenSkills(general).contains(Name))
                //    {
                //        huashen = true;
                //        break;
                //    }
                //}
            }

            if (!RoomLogic.PlayerHasSkill(room, invoker, Name) && !huashen)
            {
                return(false);
            }

            if (reason == CardUseReason.CARD_USE_REASON_RESPONSE_USE && pattern == Nullification.ClassName)
            {
                return(IsEnabledAtNullification(room, invoker));
            }

            switch (reason)
            {
            case CardUseReason.CARD_USE_REASON_PLAY:
                return(IsEnabledAtPlay(room, invoker));

            case CardUseReason.CARD_USE_REASON_RESPONSE:
            case CardUseReason.CARD_USE_REASON_RESPONSE_USE:
                return(IsEnabledAtResponse(room, invoker, pattern));

            default:
                return(false);
            }
        }
예제 #5
0
        public override bool GetDistanceLimit(Room room, Player from, Player to, WrappedCard card, CardUseReason reason, string pattern)
        {
            if (reason == CardUseReason.CARD_USE_REASON_RESPONSE_USE && to.HasFlag("SlashAssignee") &&
                (room.GetRoomState().GetCurrentResponseSkill() == "fangong" || pattern == "Slash:fangong"))
            {
                return(true);
            }

            return(false);
        }
예제 #6
0
 public virtual bool GetDistanceLimit(Room room, Player from, Player to, WrappedCard card, CardUseReason reason, string pattern) => false;
예제 #7
0
 public void SetCurrentCardUseReason(CardUseReason reason) => m_currentCardUseReason = reason;