Beispiel #1
0
        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);
        }
Beispiel #2
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            var selectList = new List <List <uint> >();
            var mList      = new List <string>();

            switch (state)
            {
            case 1:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    lastHit = (int)BattleData.Instance.Agent.SelectPlayers[0];
                    if (additionalState == 26031)
                    {
                        sendActionMsg(BasicActionType.ACTION_ATTACK_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, (uint)SkillID.多重射击);
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);
                    }
                    else
                    {
                        Attack(BattleData.Instance.Agent.SelectCards[0], BattleData.Instance.Agent.SelectPlayers[0]);
                    }
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                if (additionalState == 26031)
                {
                    ResignAction = () =>
                    {
                        sendActionMsg(BasicActionType.ACTION_NONE, BattleData.Instance.MainPlayer.id, null, null, null, null);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);
                    };
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(2603));
                }
                return;

            case (uint)SkillID.充能:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    if (BattleData.Instance.MainPlayer.hand_count > 4)
                    {
                        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));
                    }
                    selectList.Clear();
                    mList.Clear();
                    for (uint i = 1; i < 5; i++)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        mList.Add("摸" + i.ToString() + "张牌");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);
                }
                else if ((BattleData.Instance.MainPlayer.hand_count < 4 || BattleData.Instance.MainPlayer.hand_count - BattleData.Instance.Agent.SelectCards.Count == 4))
                {
                    IsStart         = true;
                    isChongNengUsed = true;
                    chongNengCnt    = BattleData.Instance.Agent.SelectArgs[0];
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1,
                        (uint)BattleData.Instance.Agent.SelectCards.Count,
                        BattleData.Instance.Agent.SelectArgs [0]
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                else if (msg == UIStateMsg.ClickArgs)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 2));
                }

                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);
                };
                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);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format(StateHint.GetHint(state), chongNengCnt));

                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>()
                    {
                        1, 1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                else
                {
                    OKAction = () =>
                    {
                        IsStart = true;
                        sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                        {
                            1, 0
                        });
                        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.SelectCards.Count == 1)
                {
                    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;
                }
                if (BattleData.Instance.MainPlayer.hand_count == 0)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.充能魔眼:
                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);

                selectList.Clear();
                mList.Clear();
                if (BattleData.Instance.MainPlayer.crystal + BattleData.Instance.MainPlayer.gem > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        1
                    });
                    mList.Add("充能");
                }
                if (BattleData.Instance.MainPlayer.gem > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        2
                    });
                    mList.Add("魔眼");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

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

                return;

            case (uint)SkillID.雷光散射:
                OKAction = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state);
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

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

                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

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

                return;

            case (uint)SkillID.魔贯冲击:
            case (uint)SkillID.魔贯冲击追加:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, new List <uint>()
                    {
                        1
                    });
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, false);

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

                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentHandChange, true);

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

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #3
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            if (state != 1102)
            {
                additionalState = 0;
            }
            switch (state)
            {
            case 1101:
            case 1103:
            case 1104:
            case 1105:
                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.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 1106:
            case 1107:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, null, 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 1108:
                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 1102:
                OKAction = () =>
                {
                    if (additionalState == 11021)
                    {
                        selectPlayers.Add(BattleData.Instance.Agent.SelectPlayers[0]);
                        sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                      selectPlayers, BattleData.Instance.Agent.SelectCards, state);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    }
                    else
                    {
                        additionalState = 11021;
                        selectPlayers.Clear();
                        selectPlayers.Add(BattleData.Instance.Agent.SelectPlayers[0]);
                        BattleData.Instance.Agent.RemoveSelectPlayer(BattleData.Instance.Agent.SelectPlayers[0]);
                    }
                };
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                if (additionalState == 11021)
                {
                    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;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #4
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 401:
            case 402:
            case 403:
            case 404:
            case 405:
                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);
                    return;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 407:
                if (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;
                }
                ;
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 408:
                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.SelectArgs, state);
                    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);
                };
                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 selectList  = new List <List <uint> >();
                        var 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;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
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);
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            var selectList = new List <List <uint> >();
            var mList      = new List <string>();

            switch (state)
            {
            case 2701:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (msg == UIStateMsg.ClickArgs)
                {
                    if (BattleData.Instance.Agent.SelectArgs[0] == 2)
                    {
                        sendReponseMsg(2701, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                        {
                            1
                        });
                    }
                    else
                    {
                        BattleData.Instance.Agent.Cmd.respond_id = 2704;
                        BattleData.Instance.Agent.FSM.ChangeState <StateSkill>(UIStateMsg.Init, true);
                    }
                    return;
                }
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(2071, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                selectList.Clear();
                mList.Clear();
                if (BattleData.Instance.MainPlayer.blue_token > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        1
                    });
                    mList.Add("魔纹融合");
                }
                if (BattleData.Instance.MainPlayer.yellow_token > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        2
                    });
                    mList.Add("怒火压制");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

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

                return;

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

                OKAction = () =>
                {
                    if (BattleData.Instance.MainPlayer.is_knelt && (BattleData.Instance.MainPlayer.blue_token > 1))
                    {
                        sendReponseMsg(2701, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                       new List <uint>()
                        {
                            2, BattleData.Instance.Agent.SelectArgs[0]
                        });
                    }
                    else
                    {
                        sendReponseMsg(2701, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                       new List <uint>()
                        {
                            2, 0
                        });
                    }
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    BattleData.Instance.Agent.Cmd.respond_id = 2701;
                    BattleData.Instance.Agent.FSM.ChangeState <StateSkill>(UIStateMsg.Init, true);
                };
                if (msg == UIStateMsg.ClickArgs)
                {
                    sendReponseMsg(2701, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                   new List <uint>()
                    {
                        2, BattleData.Instance.Agent.SelectArgs[0]
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }

                if (BattleData.Instance.Agent.SelectCards.Count > 1 &&
                    BattleData.Instance.MainPlayer.is_knelt && (BattleData.Instance.MainPlayer.blue_token > 1))
                {
                    selectList.Clear();
                    mList.Clear();
                    for (uint i = BattleData.Instance.MainPlayer.blue_token; i > 0; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i - 1
                        });
                        mList.Add(i - 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));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                return;

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

                OKAction = () =>
                {
                    if (BattleData.Instance.MainPlayer.is_knelt && (BattleData.Instance.MainPlayer.yellow_token > 1))
                    {
                        sendReponseMsg(2703, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                       new List <uint>()
                        {
                            1, BattleData.Instance.Agent.SelectArgs[0]
                        });
                    }
                    else
                    {
                        sendReponseMsg(2703, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                       new List <uint>()
                        {
                            1, 0
                        });
                    }
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(2703, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                if (msg == UIStateMsg.ClickArgs)
                {
                    sendReponseMsg(2703, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                   new List <uint>()
                    {
                        1, BattleData.Instance.Agent.SelectArgs[0]
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                if (BattleData.Instance.Agent.SelectCards.Count > 1 &&
                    BattleData.Instance.MainPlayer.is_knelt && BattleData.Instance.MainPlayer.yellow_token > 1)
                {
                    selectList.Clear();
                    mList.Clear();
                    for (uint i = BattleData.Instance.MainPlayer.yellow_token; i > 0; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i - 1
                        });
                        mList.Add(i - 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));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                return;

            case 2705:
                OKAction = () =>
                {
                    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 27051:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (msg == UIStateMsg.ClickArgs)
                {
                    sendReponseMsg(27051, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        1, BattleData.Instance.Agent.SelectArgs[0]
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                selectList.Clear();
                mList.Clear();
                for (uint i = 0; i < 4; i++)
                {
                    selectList.Add(new List <uint>()
                    {
                        i
                    });
                    mList.Add(i + "战" + (3 - i) + "魔");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

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

                return;

            case 2706:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    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,
                                   BattleData.Instance.Agent.SelectPlayers, 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;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #10
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList = new List <List <uint> >();

            switch (state)
            {
            case 1:             //躺斩
                if (BattleData.Instance.MainPlayer.is_knelt && BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 1 &&
                    Card.GetCard(BattleData.Instance.Agent.SelectCards[0]).Element != Card.CardElement.water && Card.GetCard(BattleData.Instance.Agent.SelectCards[0]).Element != Card.CardElement.darkness)
                {
                    sendActionMsg(BasicActionType.ACTION_ATTACK_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, (uint)SkillID.MO_NV_ZHI_NU_ATTACK);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                else
                {
                    base.UIStateChange(state, msg, paras);
                }
                return;

            case (uint)SkillID.CANG_YAN_FA_DIAN:
                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);
                    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.TIAN_HUO_DUAN_KONG:
                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;

            case (uint)SkillID.TI_SHEN_WAN_OU:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    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);
                    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.TONG_KU_LIAN_JIE:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, 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.MO_NENG_FAN_ZHUAN:

                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    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);
                    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.MO_NV_ZHI_NU:
                //MessageSystem<Framework.Message.MessageType>.Notify(Framework.Message.MessageType.CloseNewArgsUI);
                if (msg == UIStateMsg.ClickArgs)
                {
                    IsStart = true;
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                   null, null, new List <uint> ()
                    {
                        1, 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, null, null, new List <uint> ()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle> (UIStateMsg.Init, true);
                };
                selectList = new List <List <uint> >()
                {
                    new List <uint>()
                    {
                        0
                    }, new List <uint>()
                    {
                        1
                    },
                    new List <uint>()
                    {
                        2
                    }
                };
                var mList = new List <string>()
                {
                    "0张手牌", "1张手牌", "2张手牌"
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

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

                return;

            default:
                base.UIStateChange(state, msg, paras);
                return;
            }
        }
Beispiel #11
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 5:
                if (BattleData.Instance.Agent.Cmd.args[0] == 1803)
                {
                    if (BattleData.Instance.Agent.SelectCards.Count == 1)
                    {
                        Drop(BattleData.Instance.Agent.SelectCards);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                        return;
                    }
                    ;
                    CancelAction = () =>
                    {
                        sendReponseMsg((uint)BasicRespondType.RESPOND_DISCARD, 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(1803));

                    return;
                }
                break;

            case 8:
                if (BattleData.Instance.Agent.Cmd.args[0] == 1804)
                {
                    if (BattleData.Instance.Agent.SelectCards.Count == 1)
                    {
                        sendReponseMsg((uint)BasicRespondType.RESPOND_DISCARD_COVER, BattleData.Instance.MainPlayer.id,
                                       null, 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.AgentHandChange, false);

                        return;
                    }
                    CancelAction = () =>
                    {
                        sendReponseMsg((uint)BasicRespondType.RESPOND_DISCARD_COVER, 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.AgentHandChange, false);
                    };
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(1804));

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

                    return;
                }
                break;

            case 1801:
            case 1802:
                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;
                }
                else if (BattleData.Instance.Agent.SelectCards.Count == 0)
                {
                    BattleData.Instance.Agent.SelectPlayers.Clear();
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.AgentSelectPlayer);
                }
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1804:
                OKAction = () =>
                {
                    sendReponseMsg(1804, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers,
                                   null, new List <uint>()
                    {
                        (BattleData.Instance.Agent.SelectPlayers.Count == 1) ? (uint)0 : 1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                if (BattleData.Instance.Agent.Cmd.args[0] == 1)
                {
                    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, 2));
                }
                return;

            case 1805:
                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;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #12
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case (uint)SkillID.秩序之印:
                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 (uint)SkillID.英灵召唤:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                   new List <uint>()
                    {
                        1, (BattleData.Instance.Agent.SelectCards.Count > 0) ? (uint)1 : 0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                   new List <uint>()
                    {
                        1, (BattleData.Instance.Agent.SelectCards.Count > 0) ? (uint)1 : 0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0, 0
                    });
                    BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init);
                };
                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)
                {
                    if (BattleData.Instance.Agent.SelectArgs[0] == 2)
                    {
                        if (BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team] >= 2)
                        {
                            BattleData.Instance.Agent.SelectArgs.AddRange(new List <uint>()
                            {
                                0, 2
                            });
                        }
                        else if (BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team] >= 1)
                        {
                            BattleData.Instance.Agent.SelectArgs.AddRange(new List <uint>()
                            {
                                1, 1
                            });
                        }
                        else
                        {
                            BattleData.Instance.Agent.SelectArgs.AddRange(new List <uint>()
                            {
                                2, 0
                            });
                        }
                    }
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                var selectList = new List <List <uint> >();
                var mList      = new List <string>();
                selectList.Add(new List <uint>()
                {
                    1
                });
                mList.Add("+1治疗");
                if (BattleData.Instance.Gem[BattleData.Instance.MainPlayer.team] +
                    BattleData.Instance.Crystal[BattleData.Instance.MainPlayer.team] > 1)
                {
                    selectList.Add(new List <uint>()
                    {
                        2
                    });
                    mList.Add("移除我方战绩区2星石,无视上限+2治疗");
                }
                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);
        }
Beispiel #13
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            if (state != 605 && !(additionalState == 6053 && state != 0))
            {
                additionalState = 0;
            }

            switch (state)
            {
            case 601:
                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);
                    return;
                }
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            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, StateHint.GetHint(state));

                return;

            case 603:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id,
                                   BattleData.Instance.Agent.SelectPlayers, null, new List <uint>()
                    {
                        1
                    });
                    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 604:
                OKAction = () =>
                {
                    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 605:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    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);
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    }
                }
                CancelAction = () => { BattleData.Instance.Agent.FSM.BackState(UIStateMsg.Init); };
                if (additionalState == 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));
                }
                else if (additionalState == 6051)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                }
                else if (additionalState == 6052)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 2));
                }
                return;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #14
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 1401:
            case 1402:
                OKAction = () =>
                {
                    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);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 1403:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, null, 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 1405:
                if (msg == UIStateMsg.ClickArgs)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, null, 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);

                var selectList = new List <List <uint> >()
                {
                    new List <uint>()
                    {
                        0
                    }, new List <uint>()
                    {
                        1
                    }
                };
                var mList = new List <string>()
                {
                    "弃掉你的所有手牌", "将手牌补到上限,【战绩区】+1【宝石】"
                };
                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);
        }
Beispiel #15
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);
        }
Beispiel #16
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);
        }
Beispiel #17
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 2101:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, 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 2102:
                OKAction = () =>
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.MainPlayer.hands, 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 2103:
            case 2104:
            case 2105:
                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;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #18
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);
        }
Beispiel #19
0
        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>();

            if (state != (uint)SKILLID.水之神力 && state != (uint)SKILLID.神圣领域)
            {
                additionalState = 0;
            }
            switch (state)
            {
            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.神圣祈福:
                if (BattleData.Instance.Agent.SelectCards.Count == 2)
                {
                    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 (uint)SKILLID.水之神力:
                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);
                    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)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                ;
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint,
                                                                      string.Format("{0}: 选择要给予的牌", Skills[state].SkillName));

                return;

            case (uint)SKILLID.神圣契约:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    IsStart = true;
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers,
                                   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.BackState(UIStateMsg.Init);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    selectList.Clear();
                    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));
                }
                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 (BattleData.Instance.Agent.SelectCards.Count == Math.Min(BattleData.Instance.MainPlayer.hand_count, 2) &&
                    BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    if (additionalState == 15061)
                    {
                        sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state, new List <uint>()
                        {
                            1
                        });
                        BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    }
                    else if (additionalState == 15062)
                    {
                        sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                      BattleData.Instance.Agent.SelectPlayers, BattleData.Instance.Agent.SelectCards, state, new List <uint>()
                        {
                            2
                        });
                        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);
                };
                if (BattleData.Instance.Agent.SelectArgs.Count == 1)
                {
                    if (BattleData.Instance.Agent.SelectArgs[0] == 1)
                    {
                        additionalState = 15061;
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 1));
                    }

                    else
                    {
                        additionalState = 15062;
                        MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state, 2));
                    }
                }
                else
                {
                    selectList.Clear();
                    var mList = new List <string>();
                    if (BattleData.Instance.MainPlayer.heal_count > 0)
                    {
                        selectList.Add(new List <uint>()
                        {
                            1
                        });
                        mList.Add("(移除你的1[治疗])对目标角色造成2点法术伤害");
                    }
                    selectList.Add(new List <uint>()
                    {
                        2
                    });
                    mList.Add("你+2[治疗],目标队友+1[治疗]");
                    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);
        }
Beispiel #20
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            List <List <uint> > selectList = new List <List <uint> >();
            List <string>       mList      = new List <string>();

            switch (state)
            {
            case (uint)SkillID.灵魂震爆:
            case (uint)SkillID.灵魂赐予:
                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);
                    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 = () =>
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  null, 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 (uint)SkillID.灵魂镜像:
                if (BattleData.Instance.Agent.SelectCards.Count == MaxSelectCard(state) &&
                    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;

            case (uint)SkillID.灵魂增幅:
                OKAction = () =>
                {
                    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 (uint)SkillID.灵魂转换:
                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>()
                    {
                        2
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                selectList.Clear();
                mList.Clear();
                if (BattleData.Instance.MainPlayer.yellow_token > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        0
                    });
                    mList.Add("将一点黄魂转换为蓝魂");
                }
                if (BattleData.Instance.MainPlayer.blue_token > 0)
                {
                    selectList.Add(new List <uint>()
                    {
                        1
                    });
                    mList.Add("将一点蓝魂转换为黄魂");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                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>()
                    {
                        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)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, BattleData.Instance.Agent.SelectArgs);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                }
                ;
                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);
                };
                selectList.Clear();
                mList.Clear();
                for (uint i = Math.Min(BattleData.Instance.MainPlayer.blue_token, BattleData.Instance.Agent.Cmd.args[0]); i > 0; i--)
                {
                    selectList.Add(new List <uint>()
                    {
                        i
                    });
                    mList.Add(i + "点伤害");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                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);
        }
Beispiel #21
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            switch (state)
            {
            case 1903:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                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);
                };
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1 && BattleData.Instance.Agent.SelectArgs.Count == 1)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, BattleData.Instance.Agent.SelectPlayers,
                                   null, new List <uint>()
                    {
                        1, BattleData.Instance.Agent.SelectArgs[0]
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                else if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    var selectList = new List <List <uint> >();
                    var mList      = new List <string>();
                    for (uint i = Math.Min(3, BattleData.Instance.MainPlayer.yellow_token); i > 0; i--)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        mList.Add(i + "个剑气");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                    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 1905:
            case 1906:
                if (BattleData.Instance.Agent.SelectCards.Count == 1)
                {
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null,
                                   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.AgentHandChange, false);

                    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.AgentHandChange, false);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

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

                return;

            case 1907:
                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.AgentHandChange, false);

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

                return;
            }
            base.UIStateChange(state, msg, paras);
        }
Beispiel #22
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);
        }
Beispiel #23
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            var selectList = new List <List <uint> >();
            var mList      = new List <string>();

            switch (state)
            {
            case 2003:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    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);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case 2002:
            case 2005:
            case XULICANGYAN:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (msg == UIStateMsg.ClickArgs)
                {
                    sendReponseMsg(XULICANGYAN, 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(XULICANGYAN, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                selectList.Clear();
                mList.Clear();
                if (state == 2002 || state == XULICANGYAN)
                {
                    selectList.Add(new List <uint>()
                    {
                        1
                    });
                    mList.Add("蓄力一击");
                }
                if (state == 2005 || state == XULICANGYAN)
                {
                    selectList.Add(new List <uint>()
                    {
                        2
                    });
                    mList.Add("苍炎之魂");
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

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

                return;

            case 2004:
                OKAction = () =>
                {
                    IsStart = true;
                    sendReponseMsg(BAISHIDOUSHEN, BattleData.Instance.MainPlayer.id, null, null,
                                   new List <uint>()
                    {
                        1
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(BAISHIDOUSHEN, 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 2006:
                OKAction = () =>
                {
                    IsStart = true;
                    sendReponseMsg(BAISHIDOUSHEN, BattleData.Instance.MainPlayer.id, null, BattleData.Instance.Agent.SelectCards,
                                   new List <uint>()
                    {
                        2
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                CancelAction = () =>
                {
                    sendReponseMsg(BAISHIDOUSHEN, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                if (MaxSelectCard(state) > 0)
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, string.Format(StateHint.GetHint(state), MaxSelectCard(state)));
                }
                else
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, string.Format(StateHint.GetHint(state, 1)));
                }
                return;

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

                if (msg == UIStateMsg.ClickArgs)
                {
                    if (BattleData.Instance.Agent.SelectArgs[0] == 1)
                    {
                        BattleData.Instance.Agent.Cmd.respond_id = 2004;
                    }
                    else
                    {
                        BattleData.Instance.Agent.Cmd.respond_id = 2006;
                    }
                    BattleData.Instance.Agent.FSM.ChangeState <StateSkill>(UIStateMsg.Init, true);
                    return;
                }
                CancelAction = () =>
                {
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                    sendReponseMsg(BAISHIDOUSHEN, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        0
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                selectList.Clear();
                mList.Clear();
                selectList.Add(new List <uint>()
                {
                    1
                });
                mList.Add("百式幻龙拳");
                selectList.Add(new List <uint>()
                {
                    2
                });
                mList.Add("斗神天驱");
                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);
        }
Beispiel #24
0
        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;
            }
        }
Beispiel #25
0
        public override void UIStateChange(uint state, UIStateMsg msg, params object[] paras)
        {
            var selectList = new List <List <uint> >();
            var mList      = new List <string>();

            switch (state)
            {
            case (uint)SkillID.血之悲鸣:
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.CloseNewArgsUI);

                if (BattleData.Instance.Agent.SelectArgs.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);
                    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);
                };
                if (BattleData.Instance.Agent.SelectArgs.Count == 0)
                {
                    selectList.Clear();
                    mList.Clear();
                    for (uint i = 1; i <= 3; i++)
                    {
                        selectList.Add(new List <uint>()
                        {
                            i
                        });
                        mList.Add(i + "点伤害");
                    }
                    MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.ShowNewArgsUI, selectList, mList);

                    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.生共死:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, null, 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 = () =>
                {
                    IsStart = true;
                    sendReponseMsg(state, BattleData.Instance.MainPlayer.id, null, null, new List <uint>()
                    {
                        2
                    });
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                };
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    IsStart = true;
                    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);
                };
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;

            case (uint)SkillID.逆流:
                if (BattleData.Instance.Agent.SelectCards.Count == 2)
                {
                    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.血之诅咒:
                if (BattleData.Instance.Agent.SelectPlayers.Count == 1)
                {
                    sendActionMsg(BasicActionType.ACTION_MAGIC_SKILL, BattleData.Instance.MainPlayer.id,
                                  BattleData.Instance.Agent.SelectPlayers, null, 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.血之诅咒弃牌:
                if (BattleData.Instance.Agent.SelectCards.Count == MaxSelectCard(state))
                {
                    sendReponseMsg((uint)state, BattleData.Instance.MainPlayer.id, null,
                                   BattleData.Instance.Agent.SelectCards, null);
                    BattleData.Instance.Agent.FSM.ChangeState <StateIdle>(UIStateMsg.Init, true);
                    return;
                }
                MessageSystem <Framework.Message.MessageType> .Notify(Framework.Message.MessageType.SendHint, StateHint.GetHint(state));

                return;
            }
            base.UIStateChange(state, msg, paras);
        }