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; } }
public void ExecuteAction() { bool acted; bool moved; ActionDescription(out moved, out acted); if (acted) { ControlledCharacter.EffectOfTurn(); } }
public virtual void SetAI(World w, ControlledCharacter c) { ((AI)this).SetAI(w, c); GetComponentInParent <CharacterBody>().obj.GetComponent <Renderer>().material.color = Color.blue; }
public virtual void SetAI(World w, ControlledCharacter c) { world = w; charpos = c; }