Exemplo n.º 1
0
        private eAI_State TransitionsCheck()
        {
            if (monsterAggroed)
            {
                monsterAggroed = false;
                AI_StateAggroEnemy monsterAggroedState = (AI_StateAggroEnemy)machine.states[(int)eAI_State.aggroEnemy];
                monsterAggroedState.SetMonster(aggroMonster);
                return(eAI_State.aggroEnemy);
            }

            return(eAI_State.nil);
        }
Exemplo n.º 2
0
        public AI_StateMachine(CompanionsManager owner)
        {
            this.owner = owner;

            states    = new AI_State[2];
            states[0] = new AI_StateFollowCharacter(owner.companion, owner.farmer, this);
            states[1] = new AI_StateAggroEnemy(owner.companion, owner.farmer, this);

            bools = new Dictionary <string, bool>();

            ChangeState(eAI_State.followFarmer);

            ModEntry.modHelper.Events.Player.Warped += Player_Warped;
        }
        private eAI_State TransitionsCheck()
        {
            if (monsterAggroed)
            {
                monsterAggroed = false;
                AI_StateAggroEnemy monsterAggroedState = (AI_StateAggroEnemy)machine.states[(int)eAI_State.aggroEnemy];
                monsterAggroedState.SetMonster(aggroMonster);
                return(eAI_State.aggroEnemy);
            }

            if (--idleTimer == 0)
            {
                if (CheckForMonstersInThisLocation(me.currentLocation))
                {
                    idleTimer = -1;
                }
                else
                {
                    return(eAI_State.idle);
                }
            }

            return(eAI_State.nil);
        }