Esempio n. 1
0
 private static void OnServerMessageActionAllowed(Player player, MsgAllowPlayerAction msg)
 {
     //throw new NotImplementedException();
     if (msg.actionChairID == player.ChairId)
     {
         // my actions
         player.MyWnd.OnAllowedActions(msg);
     }
 }
Esempio n. 2
0
        public void OnAllowedActions(MsgAllowPlayerAction msg)
        {
            HideAllActionButtons();
            CurrentAllowPlayerAction   = msg;
            CurrentAllowPlayerReAction = null;

            var actions = msg.allowedActions;

            if ((actions & (int)ActionType.enumActionType_DISCARD) != 0)
            {
                BtnAction5.Visibility = Visibility.Visible;
                BtnAction5.Content    = "出牌";
                BtnAction5.Tag        = (int)ActionType.enumActionType_DISCARD;

                if (MyOwner.CheckBoxAutoAction.IsChecked == false && IsAutoX)
                {
                    //var handTips = msg.tipsForAction;
                    //// 自动打牌
                    //if ((actions & (int)ActionType.enumActionType_FirstReadyHand) != 0)
                    //{
                    //    if (!IsBandker)
                    //    {
                    //        // 绝对不听牌
                    //        OnNonBankerTakeActionFirstHand(0);
                    //    }
                    //    else
                    //    {
                    //        OnTakeActionDiscardTile(handTips[0].targetTile, 0);
                    //    }
                    //}
                    //else if ((actions & (int)ActionType.enumActionType_DISCARD) != 0)
                    //{
                    //    OnTakeActionDiscardTile(handTips[0].targetTile);
                    //}

                    int specialCardID = -1;
                    if (CurrentAllowPlayerAction.timeoutInSeconds > 255)
                    {
                        specialCardID = (int)pokerface.CardID.R3H;
                    }

                    var current = AgariIndex.SearchLongestDiscardCardHand(TilesHandList, specialCardID);
                    if (current == null)
                    {
                        MessageBox.Show("auto discard: BIG BIG WORLD");
                        throw new System.Exception("Huge bug, darling");
                    }

                    OnTakeActionDiscardTile(current.cards);

                    HideAllActionButtons();
                }
            }
        }