コード例 #1
0
        public virtual void OnCardAnnounce(Room room, CardUseStruct use, bool ignore_rule)
        {
            use.Card = RoomLogic.ParseUseCard(room, use.Card).GetUsedCard();
            room.ShowSkill(use.From, use.Card.ShowSkill, use.Card.SkillPosition);

            if (!ignore_rule)
            {
                CheckTargetModSkillShow(room, use);
            }

            WrappedCard use_card = use.Card;

            //将卡牌转化为延时锦囊就相当于改写了该牌的牌名,必须对其重写以保证此延时锦囊将来可以正确生效
            if (Engine.GetFunctionCard(use_card.Name) is DelayedTrick && use_card.IsVirtualCard() && use_card.SubCards.Count == 1)
            {
                RoomCard wrapped = room.GetCard(use_card.GetEffectiveId());
                use_card.Id = wrapped.Id;
                wrapped.TakeOver(use_card);
                use.Card = wrapped.GetUsedCard();
            }

            //record big or small for fighttogether
            if (Engine.GetFunctionCard(use_card.Name) is FightTogether && use.To.Count > 0)
            {
                List <string> big_kingdoms = RoomLogic.GetBigKingdoms(room);
                if (big_kingdoms.Count > 0)
                {
                    string target_kingdom = (use.To[0].HasShownOneGeneral() ?
                                             (use.To[0].GetRoleEnum() == PlayerRole.Careerist ? use.To[0].Name : use.To[0].Kingdom) : string.Empty);
                    bool big = big_kingdoms.Contains(target_kingdom);
                    if (big)
                    {
                        use.Pattern = "big";
                    }
                    else
                    {
                        use.Pattern = "small";
                    }
                }
                else
                {
                    use.Pattern = "unknown";
                }
            }

            OnUse(room, use);
        }