DoAction() публичный Метод

public DoAction ( ) : bool
Результат bool
Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpGet httpGet  = new HttpGet();
            String  ActionID = string.Empty;

            if (httpGet.GetString("ActionID", ref ActionID))
            {
                try
                {
                    string   actionName = string.Concat("Action", ActionID);
                    string   sname      = string.Concat("FzCompany.HXSC.BLL.Action." + actionName);
                    Assembly a          = Assembly.Load("FzCompany.HXSC.BLL");

                    BaseAction obj = (BaseAction)Assembly.Load("FzCompany.HXSC.BLL").CreateInstance(sname, true, BindingFlags.Default, null, new object[] { httpGet }, null, null);
                    if (obj.ReadUrlElement() && obj.DoAction())
                    {
                        obj.BuildPacket();
                        //obj.WriteAction();
                    }
                    else
                    {
                        //obj.WriteErrorAction();
                        //return;
                    }
                    obj.WritePacket();
                }
                catch (Exception ex)
                {
                    LogHelper.WriteException("接口请求出错", ex);
                }
            }
        }
Пример #2
0
        public void MoveBySpell(MoveCommand p_command)
        {
            BaseAction baseAction = m_actions[0][0];

            baseAction.DoAction(p_command);
            m_activeActions.Add(baseAction);
            m_waitFinishActions = true;
            if (!LegacyLogic.Instance.WorldManager.Party.HasAggro())
            {
                LegacyLogic.Instance.WorldManager.Party.FinishPartyRound();
                CheckInCombat(false);
            }
        }
Пример #3
0
        private void ProcessCommand(Command p_command)
        {
            Party      party      = LegacyLogic.Instance.WorldManager.Party;
            BaseAction baseAction = m_actions[party.CurrentCharacter][(Int32)p_command.Type];

            if (baseAction.ActionAvailable())
            {
                if (baseAction.CanDoAction(p_command))
                {
                    if (!baseAction.CanBeDelayedByLock() || m_lock == null)
                    {
                        baseAction.DoAction(p_command);
                        m_activeActions.Add(baseAction);
                        if (baseAction.ConsumeType == BaseAction.EConsumeType.CONSUME_CHARACTER_TURN)
                        {
                            if (party.HasAggro())
                            {
                                Boolean flag = false;
                                if (party.SelectedCharacter.Class.IsBlademaster() && baseAction is MeleeAttackAction && (baseAction as MeleeAttackAction).MonsterWasKilled)
                                {
                                    flag = true;
                                    party.AutoSelectMonster();
                                    (baseAction as MeleeAttackAction).MonsterWasKilled = false;
                                    if (party.SelectedMonster != null)
                                    {
                                        ExtraAttackEventArgs p_args = new ExtraAttackEventArgs(party.SelectedCharacter);
                                        party.SelectedCharacter.FightHandler.FeedActionLog(p_args);
                                    }
                                }
                                if (!flag && !m_turnsReseted)
                                {
                                    party.FinishCurrentCharacterTurn();
                                }
                            }
                        }
                        else if (baseAction.ConsumeType == BaseAction.EConsumeType.CONSUME_PARTY_TURN)
                        {
                            if (baseAction is InteractAction)
                            {
                                m_interactionOnlyRound = true;
                            }
                            party.FinishPartyRound();
                        }
                        CheckInCombat(false);
                        LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.UPDATE_AVAILABLE_ACTIONS, EventArgs.Empty);
                    }
                    else
                    {
                        m_delayedCommand = p_command;
                        m_lock();
                    }
                }
                else
                {
                    baseAction.DontDoAction(p_command);
                    p_command.CancelCommand();
                }
            }
            else
            {
                p_command.CancelCommand();
                if (LegacyLogic.Instance.WorldManager.Party.InCombat)
                {
                    Command.ECommandTypes type = p_command.Type;
                    if (type != Command.ECommandTypes.MOVE)
                    {
                        if (type == Command.ECommandTypes.REST)
                        {
                            LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.CANT_ACT);
                        }
                    }
                    else
                    {
                        LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.CANT_ACT);
                    }
                }
                if (LegacyLogic.Instance.WorldManager.Party.HasAggro())
                {
                    Command.ECommandTypes type = p_command.Type;
                    if (type != Command.ECommandTypes.INTERACT)
                    {
                        if (type == Command.ECommandTypes.REST)
                        {
                            LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.REST_DANGER);
                        }
                    }
                    else
                    {
                        LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.CANT_ACT);
                    }
                }
            }
        }