/// <summary> /// Attempting to change rooms /// </summary> /// <param name="directionNoun"></param> public void AttemptToChangeRooms(string directionNoun) { // If the exit exists if (exitDictionary.ContainsKey(directionNoun)) { // Get the current room to the new room currentRoom = exitDictionary[directionNoun]; // If the next room to change to is the exit to vn room, switch to vn if (currentRoom == VNSwitch.exitToVNRoom) { // This is the exit room. Exit to the VN VNSwitch.enterVN(); } _controller.LogStringWithReturn("You head off to the " + directionNoun); // Displays the new room text _controller.DisplayRoomText(); } else { int randInt = Random.Range(0, invalidStrings.Length + 1); // Prints random invalid message with invalid input if (randInt == 0) { _controller.LogStringWithReturn("You cant go " + directionNoun + "."); } else { _controller.LogStringWithReturn(invalidStrings[randInt]); } } }
public Room[] StoryRooms; // Stores rooms for the story // Private variables //private bool _isInVN; //private bool _isInTA; #region public func /// <summary> /// Enters text adventure /// </summary> public void enterTA() { //_isInTA = true; //_isInVN = false; // Disable the VN stuff, enable TA stuff VN.SetActive(false); TA.SetActive(true); // Enter next room for dream world, ensure that it prints next room and everything _roomNav.currentRoom = StoryRooms[sleepTree.GetIntegerVariable("DayCount")]; // Prints out tons of blank space _controller.LogStringWithReturn("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); // Prints new room text _controller.DisplayRoomText(); _controller.DisplayLoggedText(); // Reactivates the input field when enter/return is pressed _inputField.ActivateInputField(); // Empties inputfield for the player _inputField.text = null; }
public override bool doActionResponse(TxtAdvController controller) { // If use the item in the right room, then change to room where doors open if (controller.roomNavigation.currentRoom.roomName == requiredString) { controller.roomNavigation.currentRoom = roomToChangeTo; controller.DisplayRoomText(); return(true); } return(false); }