Esempio n. 1
0
        public override void ActionDescription(out bool moved,
                                               out bool acted)
        {
            moved = false;
            acted = false;

            switch (currentStatus)
            {
            case Status.Wandering:
                // Movement in last direction
                if (ControlledCharacter.SensePg(ControlledCharacter, Game.Current.CurrentPg))
                {
                    currentStatus = Status.Chasing;
                    ControlledCharacter.Talk();
                }
                currentDirection = RandomDirectionChange(currentDirection, 5);
                if (!(moved = ControlledCharacter.Move(currentDirection, out acted)))
                {
                    // Change direction
                    currentDirection = currentDirection.RandomDifferentFromThis();
                    ControlledCharacter.Move(currentDirection, out acted);
                }
                break;

            case Status.Chasing:
                var direction = FindDirection(ControlledCharacter, Game.Current.CurrentPg);
                moved = ControlledCharacter.Move(direction, out acted);
                break;
            }
        }
Esempio n. 2
0
        public void ExecuteAction()
        {
            bool acted;
            bool moved;

            ActionDescription(out moved, out acted);

            if (acted)
            {
                ControlledCharacter.EffectOfTurn();
            }
        }
Esempio n. 3
0
 public virtual void SetAI(World w, ControlledCharacter c)
 {
     ((AI)this).SetAI(w, c);
     GetComponentInParent <CharacterBody>().obj.GetComponent <Renderer>().material.color = Color.blue;
 }
Esempio n. 4
0
 public virtual void SetAI(World w, ControlledCharacter c)
 {
     world   = w;
     charpos = c;
 }