Example #1
0
        //Set our combat behaviour.  If we are not using an override behaviour, start or restart the appropriate behaviour.
        public void SetCombatBehaviour(CustomAIBehaviour c)
        {
            combatBehaviour = c;

            if (canOverrideBehaviour)
            {
                SetBehaviour();
            }
        }
Example #2
0
        //Set our idle behaviour.  If we are not using an override behaviour, start or restart the appropriate behaviour.
        public void SetIdleBehaviour(CustomAIBehaviour c)
        {
            idleBehaviour = c;

            if (canOverrideBehaviour)
            {
                SetBehaviour();
            }
        }
Example #3
0
        void SetCurrentBehaviour(CustomAIBehaviour b)
        {
            //Call OnEndBehaviour on the behaviour we are replacing, if any.
            //This lets us perform any cleanup operations
            //For example, marking a cover location as "free"
            if (currentBehaviour && canOverrideBehaviour)
            {
                currentBehaviour.OnEndBehaviour();
            }

            currentBehaviour = b;
        }
Example #4
0
        public void SetTacticalBehaviour(CustomAIBehaviour c)
        {
            tacticalBehaviour = c;

            if (!engaging)
            {
                StartEngage();
            }

            if (canOverrideBehaviour)
            {
                SetBehaviour();
            }
        }
Example #5
0
        public void SetOverrideBehaviour(CustomAIBehaviour c, bool b)
        {
            //Only override behaviours if we don't already have an override behaviour.
            if (canOverrideBehaviour)
            {
                usingOverrideBehaviour = true;
                if (currentBehaviour)
                {
                    currentBehaviour.OnEndBehaviour();
                }

                canOverrideBehaviour = !b;
                currentBehaviour     = c;
            }
        }