コード例 #1
0
 public override void Process(UIStateMsg msg, params object[] paras)
 {
     if (msg == UIStateMsg.Init)
     {
         stateMachine.ChangeState((Type)paras[0], true, msg, paras);
     }
 }
コード例 #2
0
ファイル: KuangZhan.cs プロジェクト: xdestiny110/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 201:
            case 202:
            case 205:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <MessageType> .Notify(MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #3
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 801:
            case 803:
            case 804:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                break;
            }
            switch (state)
            {
            case 801:
            case 803:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("{0}: 请选择目标玩家以及卡牌", Skills[state].SkillName));

                break;

            case 804:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("{0}: 请选择目标玩家", Skills[state].SkillName));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #4
0
ファイル: StateSkill.cs プロジェクト: jianm1996/AGrailClient
        public override void Process(UIStateMsg msg, params object[] paras)
        {
            switch (msg)
            {
            case UIStateMsg.ClickSkill:
                if (BattleData.Instance.Agent.SelectSkill == null)
                {
                    //取消技能
                    stateMachine.BackState(msg, paras);
                    BattleData.Instance.Agent.SelectCards.Clear();
                    BattleData.Instance.Agent.SelectPlayers.Clear();
                    BattleData.Instance.Agent.SelectArgs.Clear();
                    MessageSystem <MessageType> .Notify(MessageType.AgentSelectPlayer);

                    MessageSystem <MessageType> .Notify(MessageType.AgentSelectCard);

                    MessageSystem <MessageType> .Notify(MessageType.CloseArgsUI);
                }
                else
                {
                    //点了别的技能
                    stateMachine.ChangeState <StateSkill>(msg, false, BattleData.Instance.Agent.SelectSkill, paras);
                }
                break;

            case UIStateMsg.ClickCard:
            case UIStateMsg.ClickPlayer:
                base.Process(msg, paras);
                break;
            }
        }
コード例 #5
0
ファイル: MoJian.cs プロジェクト: jianm1996/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 902:
            case 906:
                OKAction = () =>
                {
                    if (state == 901)
                    {
                        additionalState = 901;
                    }
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("是否发动{0}", Skills[state].SkillName));

                return;

            case 905:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                return;
            }
            base.UIStateChange(state, msg, paras);
            if (additionalState == 901)
            {
                //这代码真傻...应该做成list的
                //但懒得改了
                var t1 = OKAction;
                var t2 = ResignAction;
                OKAction     = () => { t1(); additionalState = 0; };
                ResignAction = () => { t2(); additionalState = 0; };
            }
        }
コード例 #6
0
ファイル: MoJian.cs プロジェクト: Rangocold/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 902:
            case 906:
                OKAction = () =>
                {
                    if (state == 901)
                    {
                        additionalState = 901;
                    }
                    if (state == 902)
                    {
                        IsStart = true;
                    }
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 905:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 2)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #7
0
        public override void Enter(UIStateMsg msg, params object[] paras)
        {
            BattleData.Instance.Agent.SelectCards.Clear();
            BattleData.Instance.Agent.SelectPlayers.Clear();
            BattleData.Instance.Agent.SelectSkill = null;
            MessageSystem <MessageType> .Notify(MessageType.AgentSelectPlayer);

            MessageSystem <MessageType> .Notify(MessageType.AgentSelectCard);

            MessageSystem <MessageType> .Notify(MessageType.AgentSelectSkill);

            base.Enter(msg, paras);
        }
コード例 #8
0
ファイル: MoDao.cs プロジェクト: Rangocold/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 801:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 2 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 804:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 2)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                return;

            case 803:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #9
0
        public override void Process(UIStateMsg msg, params object[] paras)
        {
            switch (msg)
            {
            case UIStateMsg.ClickCard:
                if (BattleData.Instance.Agent.SelectCards.Count == 0)
                {
                    stateMachine.BackState(UIStateMsg.Init, paras);
                }
                base.Process(msg, paras);
                break;

            default:
                base.Process(msg, paras);
                break;
            }
        }
コード例 #10
0
        public override void Enter(UIStateMsg msg, params object[] paras)
        {
            var canUseHealCount = BattleData.Instance.Agent.Cmd.args[3];
            var harmPoint       = BattleData.Instance.Agent.Cmd.args[1];
            var selectList      = new List <List <uint> >();

            //服务器默认玩家有治疗时才会发这个响应
            for (uint i = Math.Min(canUseHealCount, harmPoint); i > 0; i--)
            {
                selectList.Add(new List <uint>()
                {
                    i
                });
            }
            MessageSystem <MessageType> .Notify(MessageType.ShowArgsUI, "Heal", selectList);

            base.Enter(msg, paras);
        }
コード例 #11
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 502:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <MessageType> .Notify(MessageType.SendHint, "水影: 请选择舍弃的水系牌");

                return;

            case 503:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <MessageType> .Notify(MessageType.SendHint, "是否发动潜行");

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #12
0
        public override void Process(UIStateMsg msg, params object[] paras)
        {
            switch (msg)
            {
            case UIStateMsg.ClickCard:
            case UIStateMsg.ClickPlayer:
                if (BattleData.Instance.Agent.SelectCards.Count == 1 &&
                    Card.GetCard(BattleData.Instance.Agent.SelectCards[0]).Element == Card.CardElement.light)
                {
                    BattleData.Instance.Agent.SelectPlayers.Clear();
                    MessageSystem <MessageType> .Notify(MessageType.AgentSelectPlayer);
                }
                base.Process(msg, paras);
                break;

            default:
                base.Process(msg, paras);
                break;
            }
        }
コード例 #13
0
        public override void Process(UIStateMsg msg, params object[] paras)
        {
            switch (msg)
            {
            case UIStateMsg.ClickCard:
                if (Card.GetCard(BattleData.Instance.Agent.SelectCards[0]).Type == Card.CardType.attack)
                {
                    stateMachine.ChangeState <StateAttack>(msg, true, paras);
                }
                else
                {
                    stateMachine.ChangeState <StateMagic>(msg, true, paras);
                }
                break;

            case UIStateMsg.ClickSkill:
                stateMachine.ChangeState <StateSkill>(msg, true, BattleData.Instance.Agent.SelectSkill.Value, paras);
                break;

            default:
                base.Process(msg, paras);
                break;
            }
        }
コード例 #14
0
        public override void Process(UIStateMsg msg, params object[] paras)
        {
            switch (msg)
            {
            case UIStateMsg.ClickCard:
                if (Card.GetCard(BattleData.Instance.Agent.SelectCards[0]).Type == Card.CardType.attack)
                {
                    stateMachine.ChangeState <StateAttack>(msg, true, paras);
                }
                else
                {
                    stateMachine.ChangeState <StateMagic>(msg, true, paras);
                }
                break;

            case UIStateMsg.ClickSkill:
                stateMachine.ChangeState <StateSkill>(msg, true, BattleData.Instance.Agent.SelectSkill.Value, paras);
                break;

            case UIStateMsg.ClickBtn:
                var cmd = paras[0].ToString();
                if (cmd == "Buy")
                {
                    stateMachine.ChangeState <StateBuy>(msg, true);
                }
                if (cmd == "Extract")
                {
                    stateMachine.ChangeState <StateExtract>(msg, true);
                }
                if (cmd == "Syntheis")
                {
                    stateMachine.ChangeState <StateSynthetize>(msg, true);
                }
                break;
            }
        }
コード例 #15
0
ファイル: JianSheng.cs プロジェクト: jianm1996/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 102:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <MessageType> .Notify(MessageType.SendHint, string.Format("是否发动{0}", Skills[state].SkillName));

                return;
            }
            base.UIStateChange(state, msg, paras);
            if (additionalState == 103)
            {
                //这代码真傻...应该做成list的
                //但懒得改了
                var t1 = OKAction;
                var t2 = ResignAction;
                OKAction     = () => { t1(); additionalState = 0; };
                ResignAction = () => { t2(); additionalState = 0; };
            }
        }
コード例 #16
0
ファイル: StateSkill.cs プロジェクト: jianm1996/AGrailClient
        public override void Enter(UIStateMsg msg, params object[] paras)
        {
            if (msg == UIStateMsg.ClickSkill || msg == UIStateMsg.Init)
            {
                if (msg == UIStateMsg.ClickSkill)
                {
                    skillID = BattleData.Instance.Agent.SelectSkill.Value;
                }
                else
                {
                    skillID = BattleData.Instance.Agent.Cmd.respond_id;
                    BattleData.Instance.Agent.SelectSkill = skillID;
                }
                BattleData.Instance.Agent.SelectCards.Clear();
                BattleData.Instance.Agent.SelectPlayers.Clear();
                BattleData.Instance.Agent.SelectArgs.Clear();
                MessageSystem <MessageType> .Notify(MessageType.AgentSelectPlayer);

                MessageSystem <MessageType> .Notify(MessageType.AgentSelectCard);

                MessageSystem <MessageType> .Notify(MessageType.CloseArgsUI);
            }
            base.Enter(msg, paras);
        }
コード例 #17
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 301:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("是否发动{0}", Skills[state].SkillName));

                return;

            case 305:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("是否发动{0}", Skills[state].SkillName));

                return;

            case 302:
            case 303:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                if (state == 303)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          string.Format("{0}: 请选择目标玩家", Skills[state].SkillName));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          string.Format("{0}: 请选择目标玩家以及独有技卡牌", Skills[state].SkillName));
                }
                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #18
0
        public override void Exit(UIStateMsg msg, params object[] paras)
        {
            MessageSystem <MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

            base.Exit(msg, paras);
        }
コード例 #19
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            if (state != (uint)SkillID.倒逆之蝶)
            {
                additionalState = 0;
            }
            var selectList = new List <List <uint> >();
            var mList      = new List <string>();

            switch (state)
            {
            case (uint)SkillID.舞动:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, BattleData.Instance.Agent.SelectCards, state, new List <uint>()
                    {
                        2
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, null, state, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.朝圣:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    var args = new List <uint>()
                    {
                        1
                    };
                    if (BattleData.Instance.Agent.SelectCards.Count > 0)
                    {
                        args.Add(BattleData.Instance.Agent.SelectCards[0]);
                    }
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, args);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

                return;

            case (uint)SkillID.毒粉:
                if (BattleData.Instance.Agent.SelectCards.Count == MaxSelectCard(state))
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

                return;

            case (uint)SkillID.镜花水月:
                if (BattleData.Instance.Agent.SelectCards.Count == MaxSelectCard(state))
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

                return;

            case (uint)SkillID.蛹化:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null, null, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.凋零:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.Cmd.args[0] == 2)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                if (BattleData.Instance.Agent.Cmd.args[0] == 2)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                }
                return;

            case (uint)SkillID.倒逆之蝶:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (additionalState == 24081 && BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers,
                                  selectCards, state, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                else if (additionalState == 24082 && BattleData.Instance.Agent.SelectCards.Count == 2)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

                    foreach (var v in BattleData.Instance.Agent.SelectCards)
                    {
                        BattleData.Instance.Agent.SelectArgs.Add(v);
                    }
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null,
                                  selectCards, state, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                else if (additionalState == 24083)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null,
                                  selectCards, state, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                if (additionalState == 0 && msg == UIStateMsg.ClickSkill)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                else if (additionalState == 0 && msg == UIStateMsg.ClickArgs)
                {
                    additionalState = BattleData.Instance.Agent.SelectArgs[0] + (uint)SkillID.倒逆之蝶 * 10;
                    selectCards.Clear();
                    selectCards.AddRange(BattleData.Instance.Agent.SelectCards);
                    BattleData.Instance.Agent.RemoveAllSelectCard();
                }
                if (additionalState == 0 && BattleData.Instance.Agent.SelectCards.Count == MaxSelectCard(state))
                {
                    selectList.Add(new List <uint>()
                    {
                        1
                    });
                    mList.Add("对目标角色造成1点无视治疗的法术伤害");
                    if (BattleData.Instance.MainPlayer.yellow_token > 0)
                    {
                        if (BattleData.Instance.MainPlayer.covered_count > 1)
                        {
                            selectList.Add(new List <uint>()
                            {
                                2
                            });
                            mList.Add("移除2个【茧】,移除1个【蛹】");
                        }
                        selectList.Add(new List <uint>()
                        {
                            3
                        });
                        mList.Add("对自己造成4点法术伤害,移除1个【蛹】");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                }
                if (additionalState == 24081)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 2));
                }
                else if (additionalState == 24082)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 3));

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);
                }
                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #20
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 1301:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1303:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1304:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    var selectList  = new List <List <uint> >();
                    var explainList = new List <string>();
                    for (uint i = BattleData.Instance.MainPlayer.heal_count; i >= 2; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        explainList.Add(i + "个治疗");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, string.Format(StateHint.GetHint(state, 1), BattleData.Instance.Agent.SelectArgs[0]));

                    if (BattleData.Instance.Agent.SelectCards.Count >= 2 && BattleData.Instance.Agent.SelectPlayers.Count == 1)
                    {
                        sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards,
                                      state, BattleData.Instance.Agent.SelectArgs);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                        return;
                    }
                }
                return;

            case 1305:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null, null, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("是否发动{0}", Skills[state].SkillName));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #21
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 401:
            case 402:
            case 403:
            case 404:
            case 405:
            case 407:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("{0}: 请选择目标玩家以及独有技卡牌", Skills[state].SkillName));

                return;

            case 408:
                OKAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseArgsUI);

                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectArgs, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                if (msg == UIStateMsg.ClickPlayer)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseArgsUI);

                    if (BattleData.Instance.Agent.SelectPlayers.Count > 0)
                    {
                        var s          = BattleData.Instance.GetPlayerInfo(BattleData.Instance.Agent.SelectPlayers[0]);
                        var selectList = new List <List <uint> >();
                        foreach (var v in s.basic_cards)
                        {
                            selectList.Add(new List <uint>()
                            {
                                v
                            });
                        }
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowArgsUI, "Card", selectList);

                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                              "封印破碎: 请选择要移除的基础效果");
                    }
                }
                if (BattleData.Instance.Agent.SelectPlayers.Count <= 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          "封印破碎: 请选择目标玩家");
                }
                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #22
0
ファイル: ShengNv.cs プロジェクト: jianm1996/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            if (state != 605 && !(additionalState == 6053 && state != 0))
            {
                additionalState = 0;
            }

            switch (state)
            {
            case 601:
            case 602:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("{0}: 请选择目标玩家以及独有技卡牌", Skills[state].SkillName));

                return;

            case 603:
                OKAction = () => { sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                                  BattleData.Instance.Agent.SelectPlayers, null, new List <uint>()
                    {
                        1
                    }); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      "冰霜祷言: 请选择目标玩家为其增加一点治疗");

                return;

            case 604:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, "是否发动怜悯");

                return;

            case 605:
                OKAction = () =>
                {
                    if (additionalState == 0)
                    {
                        additionalState = 6051;
                        selectPlayers.Clear();
                        selectPlayers.Add(BattleData.Instance.Agent.SelectPlayers[0]);
                        BattleData.Instance.Agent.RemoveSelectPlayer(BattleData.Instance.Agent.SelectPlayers[0]);
                    }
                    else if (additionalState == 6051)
                    {
                        additionalState++;
                        selectPlayers.Add(BattleData.Instance.Agent.SelectPlayers[0]);
                        BattleData.Instance.Agent.RemoveSelectPlayer(BattleData.Instance.Agent.SelectPlayers[0]);
                    }
                    else if (additionalState == 6052)
                    {
                        additionalState++;
                        selectPlayers.Add(BattleData.Instance.Agent.SelectPlayers[0]);
                        BattleData.Instance.Agent.RemoveSelectPlayer(BattleData.Instance.Agent.SelectPlayers[0]);
                        BattleData.Instance.Agent.SelectArgs.Clear();
                        foreach (var v in selectPlayers)
                        {
                            var idx = BattleData.Instance.Agent.SelectPlayers.FindIndex((t) => { return(t == v); });
                            if (idx >= 0)
                            {
                                BattleData.Instance.Agent.SelectArgs[idx]++;
                            }
                            else
                            {
                                BattleData.Instance.Agent.SelectPlayers.Add(v);
                                BattleData.Instance.Agent.SelectArgs.Add(1);
                            }
                        }
                        sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, null, 605, BattleData.Instance.Agent.SelectArgs);
                    }
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                if (additionalState == 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          "请分配第一点治疗");
                }
                else if (additionalState == 6051)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          "请分配第二点治疗");
                }
                else if (additionalState == 6052)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          "请分配第三点治疗");
                }
                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #23
0
ファイル: HongLian.cs プロジェクト: xdestiny110/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList  = new List <List <uint> >();
            List <string>       explainList = new List <string>();

            switch (state)
            {
            case (uint)SkillID.腥红圣约:
            case (uint)SkillID.杀戮盛宴:
            case (uint)SkillID.戒骄戒躁:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.血腥祷言:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (additionalState == 0 && BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    selectList.Clear();
                    explainList.Clear();
                    for (uint i = 0; i <= BattleData.Instance.MainPlayer.heal_count; i++)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        explainList.Add(i + "个治疗");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          string.Format(StateHint.GetHint(state), allies[0].nickname));
                }
                else if (additionalState == 0 && BattleData.Instance.Agent.SelectArgs.Count == 1)
                {
                    selectPlayers.Clear();
                    selectHealCnt.Clear();
                    selectPlayers.Add(allies[0].id);
                    selectHealCnt.Add(BattleData.Instance.Agent.SelectArgs[0]);
                    BattleData.Instance.Agent.SelectArgs.Clear();
                    if (allies.Count == 1)
                    {
                        IsStart = true;
                        sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                       selectPlayers, null, selectHealCnt);
                    }
                    else
                    {
                        additionalState = 28031;
                        selectList.Clear();
                        explainList.Clear();
                        for (uint i = 0; i <= BattleData.Instance.MainPlayer.heal_count - selectHealCnt[0]; i++)
                        {
                            selectList.Add(new List <uint>()
                            {
                                i
                            });
                            explainList.Add(i + "个治疗");
                        }
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                              string.Format(StateHint.GetHint(state, 1), allies[1].nickname));
                    }
                }
                else if (additionalState == 28031 && BattleData.Instance.Agent.SelectArgs.Count == 1)
                {
                    IsStart = true;
                    if (selectHealCnt[0] == 0)
                    {
                        selectHealCnt.Clear();
                        selectPlayers.Clear();
                    }
                    selectPlayers.Add(allies[1].id);
                    selectHealCnt.Add(BattleData.Instance.Agent.SelectArgs[0]);
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                   selectPlayers, null, selectHealCnt);
                    additionalState = 0;
                }
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    if (additionalState == 0)
                    {
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                        sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                        {
                            0
                        });
                    }
                    else
                    {
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                        additionalState = 0;
                        BattleData.Instance.Agent.RemoveSelectPlayer(0);
                    }
                };
                return;

            case (uint)SkillID.腥红十字:
                if (BattleData.Instance.Agent.SelectCards.Count == 2 && BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #24
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList;
            List <string>       explainList;

            switch (state)
            {
            case 701:
                if (BattleData.Instance.Agent.SelectCards.Count == 1 && BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    return;
                }
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 702:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 703:
                if (msg == UIStateMsg.ClickArgs)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                  BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (BattleData.Instance.Agent.SelectPlayers.Count > 0 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    var s = BattleData.Instance.GetPlayerInfo(BattleData.Instance.Agent.SelectPlayers[0]);
                    selectList  = new List <List <uint> >();
                    explainList = new List <string>();
                    foreach (var v in s.basic_cards)
                    {
                        selectList.Add(new List <uint>()
                        {
                            v
                        });
                        var name = Card.GetCard(v).Name.ToString();
                        if (Card.GetCard(v).Type == Card.CardType.attack)
                        {
                            var property = Card.GetCard(v).Property.ToString();
                            name = name + "-" + property;
                        }
                        explainList.Add(name);
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                return;

            case 704:
                if (msg == UIStateMsg.ClickPlayer)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 705:
                if (msg == UIStateMsg.ClickArgs)
                {
                    //默认有能量才会触发该技能
                    //优先使用水晶
                    uint useGem = 1;
                    if (BattleData.Instance.MainPlayer.crystal > 0)
                    {
                        useGem = 0;
                    }
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, null,
                                   new List <uint>()
                    {
                        useGem, BattleData.Instance.Agent.SelectArgs[0]
                    });
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };

                if (msg == UIStateMsg.ClickPlayer)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    if (BattleData.Instance.Agent.SelectPlayers.Count > 0)
                    {
                        var s = BattleData.Instance.GetPlayerInfo(BattleData.Instance.Agent.SelectPlayers[0]);
                        selectList  = new List <List <uint> >();
                        explainList = new List <string>();
                        foreach (var v in s.basic_cards)
                        {
                            selectList.Add(new List <uint>()
                            {
                                v
                            });
                            var name = Card.GetCard(v).Name.ToString();
                            if (Card.GetCard(v).Type == Card.CardType.attack)
                            {
                                var property = Card.GetCard(v).Property.ToString();
                                name = name + "-" + property;
                            }
                            explainList.Add(name);
                        }
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                    }
                }
                if (BattleData.Instance.Agent.SelectPlayers.Count <= 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                return;

            case 706:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (msg == UIStateMsg.ClickArgs)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0, 0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                selectList  = new List <List <uint> >();
                explainList = new List <string>();
                for (uint i = 0; i <= Math.Min(BattleData.Instance.MainPlayer.gem, BattleData.Instance.Agent.Cmd.args[0]); i++)
                {
                    for (uint j = 0; j <= Math.Min(BattleData.Instance.MainPlayer.crystal, BattleData.Instance.Agent.Cmd.args[0] - i); j++)
                    {
                        if (i + j != 0)
                        {
                            selectList.Add(new List <uint>()
                            {
                                i, j
                            });
                            explainList.Add(i + "个宝石" + "," + j + "个水晶");
                        }
                    }
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, string.Format(StateHint.GetHint(state), BattleData.Instance.Agent.Cmd.args[0]));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #25
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList;
            List <string>       explainList;

            switch (state)
            {
            case 10:
                additionalState = 0;
                break;

            case 12:
                if (BattleData.Instance.Gem[BattleData.Instance.MainPlayer.team] + BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team] == 4)
                {
                    BattleData.Instance.Agent.PlayerRole.Buy(1, 0);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                else if (BattleData.Instance.Gem[BattleData.Instance.MainPlayer.team] + BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team] == 5)
                {
                    if (msg == UIStateMsg.ClickArgs)
                    {
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                        BattleData.Instance.Agent.PlayerRole.Buy(0, 0);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                        return;
                    }
                    CancelAction = () =>
                    {
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                        BattleData.Instance.Agent.FSM.BackState(UIStateMsg.ClickBtn);
                    };
                    selectList = new List <List <uint> >()
                    {
                        new List <uint>()
                        {
                            0, 0
                        }
                    };
                    explainList = new List <string>()
                    {
                        "不增加星石"
                    };
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);
                }
                else
                {
                    BattleData.Instance.Agent.PlayerRole.Buy(2, 0);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                break;

            case 13:
                if (msg == UIStateMsg.ClickArgs)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendActionMsg(BasicActionType.ACTION_SPECIAL_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, null, 1202, BattleData.Instance.Agent.SelectArgs);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                if (msg == UIStateMsg.ClickPlayer)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    if (BattleData.Instance.Agent.SelectPlayers.Count > 0)
                    {
                        var s            = BattleData.Instance.GetPlayerInfo(BattleData.Instance.Agent.SelectPlayers[0]);
                        var tGem         = BattleData.Instance.Gem[BattleData.Instance.MainPlayer.team];
                        var tCrystal     = BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team];
                        var maxEnergyCnt = RoleFactory.Create(s.role_id).MaxEnergyCount;
                        selectList  = new List <List <uint> >();
                        explainList = new List <string>();
                        if (maxEnergyCnt - s.gem - s.crystal >= 2)
                        {
                            if (tGem >= 2)
                            {
                                selectList.Add(new List <uint>()
                                {
                                    2, 0
                                });
                                explainList.Add("2个宝石");
                            }
                            if (tGem >= 1 && tCrystal >= 1)
                            {
                                selectList.Add(new List <uint>()
                                {
                                    1, 1
                                });
                                explainList.Add("1个宝石1个水晶");
                            }
                            if (tCrystal >= 2)
                            {
                                selectList.Add(new List <uint>()
                                {
                                    0, 2
                                });
                                explainList.Add("2个水晶");
                            }
                        }
                        if (maxEnergyCnt - s.gem - s.crystal >= 1)
                        {
                            if (tGem >= 1)
                            {
                                selectList.Add(new List <uint>()
                                {
                                    1, 0
                                });
                                explainList.Add("1个宝石");
                            }
                            if (tCrystal >= 1)
                            {
                                selectList.Add(new List <uint>()
                                {
                                    0, 1
                                });
                                explainList.Add("1个水晶");
                            }
                        }
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(1202));
                    }
                }
                if (BattleData.Instance.Agent.SelectPlayers.Count <= 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(1202, 1));
                }
                return;

            case 1201:
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                selectList = new List <List <uint> >()
                {
                    new List <uint>()
                    {
                        45
                    }, new List <uint>()
                    {
                        133
                    },
                    new List <uint>()
                    {
                        87
                    }, new List <uint>()
                    {
                        66
                    }, new List <uint>()
                    {
                        110
                    }
                };
                explainList = new List <string>()
                {
                    "地", "水", "火", "风", "雷"
                };
                if (Util.HasCard("same", BattleData.Instance.MainPlayer.hands, 3))
                {
                    selectList.Insert(0, new List <uint>()
                    {
                        39
                    });
                    explainList.Insert(0, "暗");
                }
                if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                          string.Format(StateHint.GetHint(state, 1), explainList[selectList.FindIndex(c => c[0].Equals(BattleData.Instance.Agent.SelectArgs[0]))]));

                    if (BattleData.Instance.Agent.SelectArgs[0] == 39)
                    {
                        qizhaSelectCard = 3;
                    }
                    else
                    {
                        qizhaSelectCard = 2;
                    }
                    if (BattleData.Instance.Agent.SelectCards.Count == qizhaSelectCard && BattleData.Instance.Agent.SelectPlayers.Count == 1)
                    {
                        sendActionMsg(BasicActionType.ACTION_ATTACK_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state,
                                      BattleData.Instance.Agent.SelectArgs);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    }
                }
                return;

            case 1203:
            case 1204:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null, null, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #26
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case (uint)SkillID.充盈:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, BattleData.Instance.Agent.SelectCards, state, null);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.暗之障壁:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.幻影星辰:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    IsStart = true;
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers,
                                   null, new List <uint>()
                    {
                        2
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                additionalState = 0;
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.暗之解放:
                OKAction = () =>
                {
                    IsStart         = true;
                    additionalState = 29011;
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.漆黑之枪:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (msg == UIStateMsg.ClickArgs)
                {
                    var args = new List <uint>()
                    {
                        1
                    };
                    args.Add(BattleData.Instance.Agent.SelectArgs[0]);
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, args);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                List <List <uint> > selectList = new List <List <uint> >();
                var mList = new List <string>();
                for (uint i = BattleData.Instance.MainPlayer.crystal + BattleData.Instance.MainPlayer.gem; i > 0; i--)
                {
                    selectList.Add(new List <uint>()
                    {
                        i
                    });
                    mList.Add(i.ToString() + "个能量");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #27
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 1001:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1002:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1003:
                if (msg == UIStateMsg.ClickSkill)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id, null, null, state);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                return;

            case 1004:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1005:
                if (msg == UIStateMsg.ClickArgs)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                var selectList  = new List <List <uint> >();
                var explainList = new List <string>();
                for (uint i = Math.Min(4, BattleData.Instance.MainPlayer.heal_count); i >= 1; i--)
                {
                    selectList.Add(new List <uint>()
                    {
                        i
                    });
                    explainList.Add(i + "个治疗");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
コード例 #28
0
 public override void Process(UIStateMsg msg, params object[] paras)
 {
     base.Process(msg, paras);
 }
コード例 #29
0
ファイル: ShiRen.cs プロジェクト: Rangocold/AGrailClient
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList  = new List <List <uint> >();
            List <string>       explainList = new List <string>();

            switch (state)
            {
            case (uint)SkillID.CHEN_LUN_XIE_ZOU_QU:
                if ((msg == UIStateMsg.ClickPlayer))
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                   BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    //MessageSystem<Framework.Message.MessageType>.Notify(Framework.Message.MessageType.CloseArgsUI);
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    return;
                }
                ;
                CancelAction = () => {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.BU_XIE_HE_XIAN:
                if (msg == UIStateMsg.ClickArgs)
                {
                    uint watch1 = BattleData.Instance.Agent.SelectArgs[0];
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state, new List <uint>()
                    {
                        BattleData.Instance.Agent.SelectArgs [0] % 5,
                        BattleData.Instance.Agent.SelectArgs [0] / 5 + 1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    //MessageSystem<Framework.Message.MessageType>.Notify (Framework.Message.MessageType.CloseArgsUI);
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    return;
                }
                ;
                CancelAction = () => {
                    //MessageSystem<Framework.Message.MessageType>.Notify (Framework.Message.MessageType.CloseArgsUI);
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                selectList.Clear();
                explainList.Clear();
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    for (uint i = BattleData.Instance.MainPlayer.yellow_token; i >= 2; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        explainList.Add(string.Format("与目标各摸{0:D1}张牌", i - 1));
                    }
                    for (uint i = BattleData.Instance.MainPlayer.yellow_token; i >= 2; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i + 5
                        });
                        explainList.Add(string.Format("与目标各弃{0:D1}张牌", i));
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, explainList);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                }
                //selectList = new List<List<uint>>() { new List<uint>() { 2 }, new List<uint>() { 3 },
                //	new List<uint>() { 4 },  new List<uint>() { 6 }, new List<uint>() { 7 }, new List<uint>() { 8 }};
                //var mList = new List<string>() { "与目标摸1","与目标摸2","与目标摸3","与目标弃2","与目标弃3","与目标弃4",};
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                return;

            case (uint)SkillID.XI_WANG_FU_GE_QU:
                if (msg == UIStateMsg.ClickPlayer)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, null, new List <uint>()
                    {
                        1
                    });
                    //sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List<uint>() { 1 });
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            default:
                base.UIStateChange(state, msg, paras);
                return;

            case (uint)SkillID.BAO_FENG_QIAN_ZOU_QU:
                OKAction = () => {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers, null, new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () => {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
        }
コード例 #30
0
        public override void Exit(UIStateMsg msg, params object[] paras)
        {
            MessageSystem <MessageType> .Notify(MessageType.CloseNewArgsUI);

            base.Exit(msg, paras);
        }