示例#1
0
        public ActionBump(Actor actor, Direction direction) : base(actor)
        {
            m_Direction      = direction;
            m_NewLocation    = actor.Location + direction; // tentatively excluding this ActionBump class from IsPerformable upgrade due to this
            m_ConcreteAction = Rules.IsBumpableFor(m_Actor, in m_NewLocation, out m_FailReason);
#if DEBUG
            if (null != m_ConcreteAction && !m_ConcreteAction.IsPerformable())
            {
                throw new ArgumentOutOfRangeException(nameof(m_ConcreteAction), m_ConcreteAction, "not performable");
            }
#endif
        }
示例#2
0
        // always execute.  Expire on execution
        public override bool UrgentAction(out ActorAction ret)
        {
            ret = null;
            if (Intent.IsPerformable() && !Intent.Abort())
            {
                // XXX need some sense of what a combat action is
                var ai = m_Actor.Controller;
                if (null != ai.enemies_in_FOV)
                {
                    return(false);
                }

                var oai = (ai as ObjectiveAI) !;
                if (!oai.VetoAction(Intent))
                {
                    oai.Stage(Intent);
                }
            }
            _isExpired = true;
            return(true);
        }