private void Start() { //init communcation channels textCommChannel = CommunicationChannelFactory.Make2WayTextChannel() as TextCommunicationChannel; oneWayCommChannel = CommunicationChannelFactory.MakeOneWayTextChannel() as OneWayTextCommunication; roomExitCommChannel = CommunicationChannelFactory.MakeRoomExitPathChannel() as RoomExitPathCommChannel; oneWayTimedComm = CommunicationChannelFactory.MakeOneWayTimedChannel() as OneWayTimedCommChannel; stillnessTimedComm = CommunicationChannelFactory.MakeTimedStillnessChannel() as StillnessTimedCommChannel; //init object mover objectMover = ObjectMover.CreateObjectMover(); playerCurrentCoords = player.MazeCellCoords; //start out not in communcation aiCommState = AICommunicationState.NotInCommuncation; aiAlignmentState = AIAlignmentState.Neutral; //initialize list of possible actions (for each state) InitializeActionLists(); roomsRequestedIn = new Dictionary <IntVector2, bool>(); rng = new System.Random(); }
//This region contains code for ending the game. //There are currently 3 types of endings the AI can initiate. #region //start off the end of the game. ending changes depending on ai state. private void FlyoverMonologueEnding() { Debug.LogError("about to close doors in cell monologueending"); maze.CloseDoorsInCell(playerCurrentCoords); player.PermanentlyFreezePlayer(); SendMessageToPlayer(GameLinesTextGetter.GetEndingMonologue(AIAlignmentState.Neutral), oneWayCommChannel); ObjectMover objMoverTwo = ObjectMover.CreateObjectMover(); objectMover.MoveObjectStraightLine(player.gameObject, new Vector3(0, 2.0f, 0), 1f); Action <GameObject> setGameOverFlag = (obj => gameOver = true); objMoverTwo.SpinObject(player.gameObject, 600f, 30f, setGameOverFlag); maze.StartRandomizingMaze(2.0f); }