Decompiled source of TerminalGames v2.0.7
ConsoleGames.dll
Decompiled 10 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using ConsoleGames; using GameNetcodeStuff; using HarmonyLib; using LethalNetworkAPI; using SimpleCommand.API; using SimpleCommand.API.Classes; using TerminalApi; using TerminalApi.Events; using TerminalGames; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ConsoleGames")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ConsoleGames")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("eb2faa14-23da-4cc8-9b23-00c454690835")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyVersion("1.0.0.0")] namespace ConsoleGames { internal class HintMethods { public static string character = "Null"; public static int turns = 0; public static bool[] displayMarks = new bool[21]; public static List<string> player2Knowns = new List<string>(); public static List<string> player3Knowns = new List<string>(); public static List<string> playerMarks = new List<string>(); public static List<string> player2Marks = new List<string>(); public static List<string> player3Marks = new List<string>(); public static string playerRoom = ""; public static List<string> allChoices = new List<string> { "Baron Bracken", "Lord Lootbug", "Tribune Thumper", "General Giant", "Sheriff Slime", "Foreman Flea", "Pool", "Bar", "Galley", "Cellar", "Lobby", "Canteen", "Gameroom", "Balcony", "Office", "Flail", "Dagger", "Bat", "Shotgun", "Shovel", "Landmine" }; public static List<string> referenceChoices = new List<string>(); public static string[] realHints = new string[3]; public static int player2Strat = -1; public static int player3Strat = -1; public static string player2WeaponGuess = ""; public static string player2CharacterGuess = ""; public static string player2Room = ""; public static string player3WeaponGuess = ""; public static string player3CharacterGuess = ""; public static string player3Room = ""; public static string accuseChara = ""; public static string accuseRoom = ""; public static string accuseWeapon = ""; public static string[] addedText = new string[27]; public static bool playerShowing = false; public static bool player2Guessing = false; public static bool player3Guessing = false; public static bool player2Elim = false; public static bool player3Elim = false; public static TerminalNode PlayerTurn(Terminal __terminal) { string text = SimpleCommand.GetInputValue(__terminal); if (ConsoleGamesMain.playingHint) { if (!playerShowing) { if (text.Length > 8) { text = text.Substring(7); } if (text.Equals("bar") || text.Equals("pool") || text.Equals("galley") || text.Equals("cellar") || text.Equals("lobby") || text.Equals("canteen") || text.Equals("gameroom") || text.Equals("balcony") || text.Equals("office")) { playerRoom = text.Substring(0, 1).ToUpper() + text.Substring(1); addedText[0] = "You have entered the "; addedText[1] = playerRoom + ". Enter your"; addedText[2] = "guess about who did it and"; addedText[3] = "with what weapon."; addedText[4] = "(Guess 'person', 'weapon')"; for (int i = 5; i < 18; i++) { addedText[i] = ""; } TerminalNode obj = TerminalApi.CreateTerminalNode(AssembleHUD(addedText), false, ""); obj.clearPreviousText = true; return obj; } TerminalNode obj2 = TerminalApi.CreateTerminalNode("Sorry, that room doesn't exist, or you spelled it wrong. Try again.\n" + AssembleHUD(), false, ""); obj2.clearPreviousText = true; return obj2; } TerminalNode obj3 = TerminalApi.CreateTerminalNode(MustShow(), false, ""); obj3.clearPreviousText = true; obj3.maxCharactersToType = 32; return obj3; } TerminalNode obj4 = TerminalApi.CreateTerminalNode("There was an issue with your request.\n\n", false, ""); obj4.clearPreviousText = true; obj4.maxCharactersToType = 32; return obj4; } public static TerminalNode ChooseChar(Terminal __terminal) { TerminalNode val = TerminalApi.CreateTerminalNode("", false, ""); val.clearPreviousText = true; string text = ""; ResetVars(); if (ConsoleGamesMain.playingHint) { string inputValue = SimpleCommand.GetInputValue(__terminal); if (inputValue.Length <= 7) { text = "You must enter a character to choose. Choose your character out of the following list by typing 'Choose (name)'. You can omit the first word of the name.\n\nBaron Bracken\nLord Lootbug\nTribune Thumper\nGeneral Giant\nSheriff Slime\nForeman Flea\n\n\n"; val.displayText = text; return val; } inputValue = inputValue.ToLower().Substring(7); if (inputValue.Length > 0) { string text2 = inputValue; character = FormatCharacter(inputValue); if (text2 == character) { text = "There was an issue with your request, or you entered this when you weren't supposed to. If you were in a game, your progress is still saved, and you can return by typing a command like \"mark\".\n\n"; val.displayText = text; return val; } realHints[0] = Choose(allChoices, "character"); realHints[1] = Choose(allChoices, "weapon"); realHints[2] = Choose(allChoices, "room"); for (int i = 0; i < 3; i++) { allChoices.Remove(realHints[i]); Debug.Log((object)realHints[i]); } for (int j = 0; j < 6; j++) { string item = Choose(allChoices); int num = referenceChoices.IndexOf(item); playerMarks.Add(item); displayMarks[num] = true; allChoices.Remove(item); item = Choose(allChoices); player2Marks.Add(item); allChoices.Remove(item); item = Choose(allChoices); player3Marks.Add(item); allChoices.Remove(item); } player2Strat = AIPersonality(); player3Strat = AIPersonality(); player2Knowns.AddRange(player2Marks); player3Knowns.AddRange(player3Marks); addedText[0] = "It's your turn. Select"; addedText[1] = "a room to start your guess"; addedText[2] = "in. Or, if you're ready,"; addedText[3] = "sue someone."; addedText[4] = ""; addedText[5] = "Your cards have been marked"; addedText[6] = "with an X on your notepad."; for (int k = 7; k < 18; k++) { addedText[k] = ""; } text = "You're playing as " + character + ". There are two other players.\n" + AssembleHUD(addedText); } else { text = "You must enter a character to choose. Choose your character out of the following list by typing 'Choose (name)'. You can omit the first word of the name.\n\nBaron Bracken\nLord Lootbug\nTribune Thumper\nGeneral Giant\nSheriff Slime\nForeman Flea\n\n\n"; } } else { text = "There was an issue with your request.\n\n"; } val.displayText = text; return val; } public static TerminalNode BeginHint(Terminal __terminal) { ConsoleGamesMain.playingHint = true; for (int i = 0; i < 21; i++) { displayMarks[i] = false; } allChoices = new List<string> { "Baron Bracken", "Lord Lootbug", "Tribune Thumper", "General Giant", "Sheriff Slime", "Foreman Flea", "Pool", "Bar", "Galley", "Cellar", "Lobby", "Canteen", "Gameroom", "Balcony", "Office", "Flail", "Dagger", "Bat", "Shotgun", "Shovel", "Landmine" }; ResetVars(); TerminalNode obj = TerminalApi.CreateTerminalNode("Choose your character out of the following list by typing 'Choose (name)'. You can omit the first word of the name.\n\nBaron Bracken\nLord Lootbug\nTribune Thumper\nGeneral Giant\nSheriff Slime\nForeman Flea\n\n\n", false, ""); obj.clearPreviousText = true; return obj; } public static TerminalNode Mark(Terminal __terminal) { if (ConsoleGamesMain.playingHint) { for (int i = 0; i < 18; i++) { addedText[i] = ""; } string inputValue = SimpleCommand.GetInputValue(__terminal); if (inputValue.Length > 5) { addedText[0] = "It's been marked."; addedText[1] = ""; if (playerShowing) { string text; string text2; string text3; if (player2Guessing) { text = player2CharacterGuess; text2 = player2WeaponGuess; text3 = player2Room; } else { text = player3CharacterGuess; text2 = player3WeaponGuess; text3 = player3Room; } addedText[2] = "Enter something to show."; addedText[3] = "They guessed it was "; addedText[4] = text + " in the "; addedText[5] = text3 + " with the"; addedText[6] = text2; } else { addedText[2] = "Select a room to enter or"; addedText[3] = "enter a guess."; } inputValue = inputValue.Substring(5).ToLower(); string item = FormatCharacter(inputValue); inputValue = inputValue.Substring(0, 1).ToUpper() + inputValue.Substring(1); if (referenceChoices.Contains(inputValue)) { displayMarks[referenceChoices.IndexOf(inputValue)] = !displayMarks[referenceChoices.IndexOf(inputValue)]; } else if (referenceChoices.Contains(item)) { displayMarks[referenceChoices.IndexOf(item)] = !displayMarks[referenceChoices.IndexOf(item)]; } else { addedText[0] = "Something went wrong."; addedText[1] = "Please try again."; addedText[2] = "(Ex. Mark 'thumper')"; addedText[3] = ""; for (int j = 4; j < 18; j++) { addedText[j] = ""; } AssembleHUD(addedText); } } else { addedText[0] = "Something went wrong."; addedText[1] = "Please try again."; addedText[2] = "(Ex. Mark 'thumper')"; addedText[3] = ""; } TerminalNode obj = TerminalApi.CreateTerminalNode(AssembleHUD(addedText), false, ""); obj.clearPreviousText = true; obj.maxCharactersToType = 32; return obj; } TerminalNode obj2 = TerminalApi.CreateTerminalNode("There was an issue with your request.", false, ""); obj2.clearPreviousText = true; return obj2; } public static TerminalNode Show(Terminal __terminal) { if (ConsoleGamesMain.playingHint) { string text = SimpleCommand.GetInputValue(__terminal); string text2 = ""; if (playerShowing) { for (int i = 0; i < 18; i++) { addedText[i] = ""; } if (text.Length > 4) { text = text.Substring(5); text = FormatCharacter(text); text = text.Substring(0, 1).ToUpper() + text.Substring(1); } if (referenceChoices.Contains(text) && playerMarks.Contains(text)) { if (player2Guessing) { player2Knowns.Add(text); player3Guessing = true; player2Guessing = false; addedText[0] = "It's player three's turn."; if (AIAccuse(3)) { addedText[1] = "Player three is sueing!"; addedText[2] = "Their guess was..." + EvaluateAccuse(); addedText[3] = "Game Over!"; ConsoleGamesMain.playingHint = false; for (int j = 8; j < 18; j++) { addedText[j] = ""; } if (player3Elim && !player2Elim && ConsoleGamesMain.playingHint) { player3Guessing = false; player2Guessing = false; addedText[4] = "Player three is eliminated."; addedText[5] = ""; addedText[6] = "It's your turn. Select a"; addedText[7] = "room to start your guess."; ConsoleGamesMain.playingHint = true; } else if (player3Elim && player2Elim) { addedText[4] = "Player three is eliminated."; addedText[5] = ""; addedText[6] = "You win by default!"; ConsoleGamesMain.playingHint = false; } text2 = AssembleHUD(addedText); TerminalNode obj = TerminalApi.CreateTerminalNode(text2, false, ""); obj.clearPreviousText = true; obj.maxCharactersToType = 32; return obj; } addedText[1] = NPCGuess() + "."; addedText[2] = "Player three guesses it was"; addedText[3] = player3CharacterGuess + " with the"; addedText[4] = player3WeaponGuess; if (PlayerHasIt(player3CharacterGuess, player3WeaponGuess, player3Room)) { addedText[5] = "Enter something to show."; } else { playerShowing = false; addedText[5] = NPCResult(); addedText[6] = "It's your turn. Select"; addedText[7] = "a room to start your guess"; addedText[8] = "in. Or, if you're ready,"; addedText[9] = "sue someone."; } } else if (player3Guessing) { player3Knowns.Add(text); player2Guessing = false; player3Guessing = false; playerShowing = false; addedText[0] = "It's your turn. Select"; addedText[1] = "a room to start your guess"; addedText[2] = "in. Or, if you're ready,"; addedText[3] = "sue someone."; } } else { text2 = "There was an issue with what you entered.\n"; if (player2Guessing) { addedText[0] = "Player two guesses it was"; addedText[1] = player2CharacterGuess + " with the"; addedText[2] = player2WeaponGuess + " in the " + player2Room; addedText[3] = "Enter something to show."; } else if (player3Guessing) { addedText[0] = "Player three guesses it was"; addedText[1] = player3CharacterGuess + " with the"; addedText[2] = player3WeaponGuess + " in the " + player3Room; addedText[3] = "Enter something to show."; } for (int k = 4; k < 18; k++) { addedText[k] = ""; } } } else { text2 = "It's not your turn to show something.\n"; addedText[0] = "It's your turn. Select"; addedText[1] = "a room to start your guess"; addedText[2] = "in. Or, if you're ready,"; addedText[3] = "sue someone."; } text2 += AssembleHUD(addedText); TerminalNode obj2 = TerminalApi.CreateTerminalNode(text2, false, ""); obj2.clearPreviousText = true; obj2.maxCharactersToType = 32; return obj2; } TerminalNode obj3 = TerminalApi.CreateTerminalNode("There was an issue with your request.\n\n", false, ""); obj3.clearPreviousText = true; obj3.maxCharactersToType = 32; return obj3; } public static TerminalNode Sue(Terminal __terminal) { string inputValue = SimpleCommand.GetInputValue(__terminal); inputValue.TrimStart(Array.Empty<char>()); string text = ""; string text2 = ""; string text3 = ""; string text4 = ""; if (ConsoleGamesMain.playingHint && inputValue.Length > 4) { if (!playerShowing) { ConsoleGamesMain.playingHint = false; inputValue = inputValue.Substring(4); int num = -1; try { for (int i = 0; i < inputValue.Length; i++) { if (inputValue[i] == ' ') { if (text2 == "") { text2 = inputValue.Substring(0, i); num = i + 1; string text5 = FormatCharacter(text2); text2 = ((!(text2 != text5)) ? (text2.Substring(0, 1).ToUpper() + text2.Substring(1)) : text5); } else if (text3 == "") { text3 = inputValue.Substring(num, i - num); num = i + 1; string text6 = FormatCharacter(text3); text3 = ((!(text3 != text6)) ? (text3.Substring(0, 1).ToUpper() + text3.Substring(1)) : text6); } } else if (i == inputValue.Length - 1) { text4 = inputValue.Substring(num).TrimEnd(Array.Empty<char>()); string text7 = FormatCharacter(text4); text4 = ((!(text4 != text7)) ? (text4.Substring(0, 1).ToUpper() + text4.Substring(1)) : text7); break; } } } catch (ArgumentOutOfRangeException) { Debug.Log((object)"Sue wasn't used right."); } if (realHints.Contains(text2) && realHints.Contains(text3) && realHints.Contains(text4)) { text = "You are absolutely correct! Congratulations, you have won this game of Hint.\n\n"; ConsoleGamesMain.playingHint = false; } else if (text4 != "") { text = "Sorry, but that's not quite right.\n\nIt was " + realHints[0] + " with the " + realHints[1] + " in the " + realHints[2] + ".\nBetter luck next time!\n\n"; ConsoleGamesMain.playingHint = false; } else { ConsoleGamesMain.playingHint = true; for (int j = 0; j < 18; j++) { addedText[j] = ""; } addedText[0] = "It's your turn. Select"; addedText[1] = "a room to start your guess"; addedText[2] = "in. Or, if you're ready,"; addedText[3] = "sue someone."; text = "You must enter your entire guess.\n" + AssembleHUD(addedText); } } else { text = MustShow(); } } else if (ConsoleGamesMain.playingHint) { for (int k = 0; k < 18; k++) { addedText[k] = ""; } addedText[0] = "To sue, enter 'sue' and"; addedText[1] = "the three cards you wish"; addedText[2] = "to guess. Order does not"; addedText[3] = "matter."; text = AssembleHUD(); } else { text = "There was an issue with your request.\n\n"; } TerminalNode obj = TerminalApi.CreateTerminalNode(text, false, ""); obj.clearPreviousText = true; return obj; } public static string NPCGuess() { string item = ""; string text = ""; string item2 = ""; List<string> list = player2Marks; List<string> list2 = player2Knowns; int num = player2Strat; if (player3Guessing) { num = player3Strat; list = player3Marks; list2 = player3Knowns; } switch (num) { case 1: item = Choose(referenceChoices, "character"); text = Choose(referenceChoices, "room"); item2 = Choose(referenceChoices, "weapon"); while (list2.Contains(item) && list2.Contains(item2) && list2.Contains(text)) { item = Choose(referenceChoices, "character"); text = Choose(referenceChoices, "room"); item2 = Choose(referenceChoices, "weapon"); } break; case 2: { string text2 = FindMost(); Debug.Log((object)("The AI will focus the " + text2)); List<string> list3 = new List<string>(); List<string> list4 = new List<string>(); List<string> list5 = new List<string>(); int num2 = 0; int num3 = 0; if (text2 == "character") { num3 = 6; } else if (text2 == "room") { num2 = 6; num3 = 15; } else { num2 = 15; num3 = referenceChoices.Count; } for (int i = num2; i < num3; i++) { if (!list2.Contains(referenceChoices[i])) { list3.Add(referenceChoices[i]); } } if (text2 == "character") { item = Choose(list3); for (int j = 6; j < referenceChoices.Count; j++) { if (list.Contains(referenceChoices[j])) { if (j < 15) { list4.Add(referenceChoices[j]); } else { list5.Add(referenceChoices[j]); } } } if (list4.Count == 0) { list4.Add(Choose(referenceChoices, "room")); } if (list5.Count == 0) { list5.Add(Choose(referenceChoices, "weapon")); } text = Choose(list4); item2 = Choose(list5); break; } if (text2 == "room") { text = Choose(list3); for (int k = 0; k < referenceChoices.Count; k++) { if (list.Contains(referenceChoices[k])) { if (k < 6) { list4.Add(referenceChoices[k]); } else if (k > 15) { list5.Add(referenceChoices[k]); } } } if (list4.Count == 0) { list4.Add(Choose(referenceChoices, "character")); } if (list5.Count == 0) { list5.Add(Choose(referenceChoices, "weapon")); } item = Choose(list4); item2 = Choose(list5); break; } item2 = Choose(list3); for (int l = 0; l < 15; l++) { if (list.Contains(referenceChoices[l])) { if (l < 6) { list4.Add(referenceChoices[l]); } else { list5.Add(referenceChoices[l]); } } } if (list4.Count == 0) { list4.Add(Choose(referenceChoices, "character")); } if (list5.Count == 0) { list5.Add(Choose(referenceChoices, "room")); } item = Choose(list4); text = Choose(list5); break; } } if (player2Guessing) { player2CharacterGuess = item; player2WeaponGuess = item2; player2Room = text; } else { player3CharacterGuess = item; player3WeaponGuess = item2; player3Room = text; } return "They chose the " + text; } public static string NPCResult() { string text = player2CharacterGuess; string text2 = player2Room; string text3 = player2WeaponGuess; List<string> list = player2Knowns; List<string> list2 = player3Marks; string text4 = "three"; _ = player2Strat; if (player3Guessing) { text = player3CharacterGuess; text2 = player3Room; text3 = player3WeaponGuess; list = player3Knowns; list2 = player2Marks; text4 = "two"; _ = player3Strat; } string result = "Player " + text4 + " had something."; if ((!list.Contains(text2) || !list2.Contains(text2)) && (!list.Contains(text) || !list2.Contains(text)) && (!list.Contains(text3) || !list2.Contains(text3))) { if (list2.Contains(text2) || list2.Contains(text3) || list2.Contains(text)) { if (list2.Contains(text2)) { list.Add(text2); } else if (list2.Contains(text3)) { list.Add(text3); } else { list.Add(text); } } else if (player2Guessing && PlayerHasIt(text, text3, text2)) { result = "Player three had nothing."; playerShowing = true; } else if (player2Guessing) { result = "Nobody had anything!"; AINothing(2); playerShowing = false; } else if (player3Guessing) { result = "Nobody had anything!"; AINothing(3); playerShowing = false; } } return result; } public static int AIPersonality() { return Random.Range(1, 3); } public static string Guess(string guessedCharacter, string guessedWeapon) { int num = -1; int num2 = -1; int num3 = -1; string text = ""; string text2 = "two"; if (!playerShowing) { for (int i = 2; i < 4; i++) { List<string> list = player2Marks; if (i == 3) { list = player3Marks; text2 = "three"; } if (list.Contains(guessedCharacter) || list.Contains(guessedWeapon) || list.Contains(playerRoom)) { if (list.Contains(guessedCharacter)) { num = list.IndexOf(guessedCharacter); text = guessedCharacter; } if (list.Contains(guessedWeapon)) { num2 = list.IndexOf(guessedWeapon); text = guessedWeapon; } if (list.Contains(playerRoom)) { num3 = list.IndexOf(playerRoom); text = playerRoom; } break; } } if (num != -1 && num2 != -1 && num3 != -1) { text = (playerMarks.Contains(guessedCharacter) ? character : (playerMarks.Contains(guessedWeapon) ? guessedWeapon : ((!playerMarks.Contains(playerRoom)) ? Choose(new List<string> { character, guessedWeapon, playerRoom }) : playerRoom))); } if (!text.Equals("")) { addedText[0] = "Player " + text2 + " had something."; if (new string[6] { "Baron Bracken", "Tribune Thumper", "General Giant", "Sheriff Slime", "Foreman Flea", "Lord Lootbug" }.Contains(text)) { addedText[1] = "You saw " + text + "."; } else { addedText[1] = "You saw the " + text + "."; } addedText[2] = "It's been put in your notes."; displayMarks[referenceChoices.IndexOf(text)] = true; } else { addedText[0] = "Nobody had anything!"; addedText[1] = ""; addedText[2] = ""; } addedText[3] = ""; if (!player2Elim) { addedText[4] = "It's player two's turn."; if (AIAccuse(2)) { addedText[5] = "Player two is sueing!"; addedText[6] = "Their guess was..." + EvaluateAccuse(); addedText[7] = "Game Over!"; ConsoleGamesMain.playingHint = false; for (int j = 8; j < 18; j++) { addedText[j] = ""; } if (player2Elim && !player3Elim && ConsoleGamesMain.playingHint) { player3Guessing = true; player2Guessing = false; ConsoleGamesMain.playingHint = true; addedText[7] = "Player two is eliminated."; addedText[8] = ""; addedText[9] = "It's player three's turn."; addedText[10] = NPCGuess() + "."; addedText[11] = "They guess it was"; addedText[12] = player3CharacterGuess + " with the"; addedText[13] = player3WeaponGuess + "."; if (PlayerHasIt(player3CharacterGuess, player3WeaponGuess, player3Room)) { playerShowing = true; addedText[14] = "Show a card."; } else { addedText[14] = "You don't have anything."; addedText[15] = "It's your turn. Select a"; addedText[16] = "room to start your guess."; } } else if (player2Elim && player3Elim) { addedText[7] = "Player two is eliminated."; addedText[8] = ""; addedText[9] = "You win by default!"; ConsoleGamesMain.playingHint = false; } return AssembleHUD(addedText); } player2Guessing = true; player3Guessing = false; addedText[5] = NPCGuess() + "."; addedText[6] = "Player two guesses it was"; addedText[7] = player2CharacterGuess + " with the"; addedText[8] = player2WeaponGuess + "."; addedText[9] = NPCResult(); if (!playerShowing) { player3Guessing = true; player2Guessing = false; addedText[10] = ""; addedText[11] = "It's player three's turn."; if (AIAccuse(3)) { addedText[12] = "Player three is sueing!"; addedText[13] = "Their guess was..." + EvaluateAccuse(); addedText[14] = "Game Over!"; ConsoleGamesMain.playingHint = false; for (int k = 15; k < 18; k++) { addedText[k] = ""; } if (player3Elim && !player2Elim && ConsoleGamesMain.playingHint) { player3Guessing = false; player2Guessing = false; ConsoleGamesMain.playingHint = true; addedText[14] = "Player three is eliminated."; addedText[15] = ""; addedText[16] = "It's your turn. Select a"; addedText[17] = "room to start your guess."; } else if (player3Elim && player2Elim) { addedText[14] = "Player three is eliminated."; addedText[15] = ""; addedText[16] = "You win by default!"; } return AssembleHUD(addedText); } addedText[12] = NPCGuess() + "."; addedText[13] = "They guess that it was"; addedText[14] = player3CharacterGuess + " with the"; addedText[15] = player3WeaponGuess + "."; addedText[16] = ""; if (PlayerHasIt(player3CharacterGuess, player3WeaponGuess, player3Room)) { playerShowing = true; addedText[17] = "Show a card."; } else { addedText[16] = NPCResult(); addedText[17] = "Select a room for a guess."; } } else { for (int l = 10; l < 18; l++) { addedText[l] = ""; } if (playerShowing) { addedText[10] = "Enter something to show."; } } } else if (!playerShowing) { player3Guessing = true; player2Guessing = false; addedText[10] = ""; addedText[11] = "It's player three's turn."; if (AIAccuse(3)) { addedText[5] = "Player three is sueing!"; addedText[6] = "Their guess was..." + EvaluateAccuse(); addedText[7] = "Game Over!"; ConsoleGamesMain.playingHint = false; for (int m = 8; m < 18; m++) { addedText[m] = ""; } if (player3Elim && !player2Elim && ConsoleGamesMain.playingHint) { player3Guessing = false; player2Guessing = false; addedText[7] = "Player three is eliminated."; addedText[8] = ""; addedText[9] = "It's your turn. Select a"; addedText[10] = "room to start your guess."; ConsoleGamesMain.playingHint = true; } else if (player3Elim && player2Elim) { addedText[7] = "Player three is eliminated."; addedText[8] = ""; addedText[9] = "You win by default!"; } return AssembleHUD(addedText); } addedText[12] = NPCGuess() + "."; addedText[13] = "They guess that it was"; addedText[14] = player3CharacterGuess + " with the"; addedText[15] = player3WeaponGuess + "."; addedText[16] = ""; if (PlayerHasIt(player3CharacterGuess, player3WeaponGuess, player3Room)) { playerShowing = true; addedText[17] = "Show a card."; } else { addedText[16] = NPCResult(); addedText[17] = "Select a room for a guess."; } } else { for (int n = 10; n < 18; n++) { addedText[n] = ""; } if (playerShowing) { addedText[10] = "Enter something to show."; } } return AssembleHUD(addedText); } return MustShow(); } public static string NoGuess() { addedText[0] = "There was an error with your"; addedText[1] = "guess. Please try again."; addedText[2] = "(Guess 'person', 'weapon')"; addedText[3] = ""; for (int i = 4; i < 18; i++) { addedText[i] = ""; } return AssembleHUD(addedText); } public static void AINothing(int whoIsGuessing) { List<string> list; string text; string text2; string text3; if (whoIsGuessing == 2) { list = player2Knowns; text = player2CharacterGuess; text2 = player2Room; text3 = player2WeaponGuess; } else { list = player3Knowns; text = player3CharacterGuess; text2 = player3Room; text3 = player3WeaponGuess; } bool item = false; bool item2 = false; bool item3 = false; if (list.Contains(text)) { item = true; } if (list.Contains(text2)) { item2 = true; } if (list.Contains(text3)) { item3 = true; } List<bool> list2 = new List<bool> { item, item2, item3 }; for (int i = 0; i < list2.Count; i++) { if (list2[i]) { continue; } switch (i) { case 0: { for (int j = 0; j < 6; j++) { if (text != referenceChoices[j]) { list.Add(referenceChoices[j]); } } continue; } case 1: { for (int k = 6; k < 15; k++) { if (text2 != referenceChoices[k]) { list.Add(referenceChoices[k]); } } continue; } } for (int l = 15; l < referenceChoices.Count; l++) { if (text3 != referenceChoices[l]) { list.Add(referenceChoices[l]); } } } } internal static string MustShow() { string text = "You have to show a card!\n"; if (player2Guessing) { addedText[0] = "Player two guessed it was "; addedText[1] = player2CharacterGuess + " with the"; addedText[2] = player2WeaponGuess; addedText[3] = "in the " + player2Room; } else { addedText[0] = "Player three guessed it was "; addedText[1] = player3CharacterGuess + "with the"; addedText[2] = player3WeaponGuess; addedText[3] = "in the " + player3Room; } addedText[4] = "Enter something to show."; for (int i = 5; i < 18; i++) { addedText[i] = ""; } return text + AssembleHUD(addedText); } internal static string[] DisplayHUD(bool[] marks) { string[] array = new string[30] { "╔═══════════════════════╗ ╔════════════════╗", "║ [Pool] [Bar] ║ ║ Notes ║", "║ [Galley] ║ ║────────────────║", "║ ║ ║ B. Bracken │ │ ║", "║ [Cellar] [Lobby] ║ ║ L. Lootbug │ │ ║", "║ ║ ║ T. Thumper │ │ ║", "║ [Canteen] ║ ║ G. Giant │ │ ║", "║ ║ ║ S. Slime │ │ ║", "║ [Gameroom] [Balcony] ║ ║ F. Flea │ │ ║", "║ ║ ║────────────────║", "║ [Office] ║ ║ Pool │ │ ║", "╚═══════════════════════╝ ║ Bar │ │ ║", " ║ Galley │ │ ║", " ║ Cellar │ │ ║", " ║ Lobby │ │ ║", " ║ Canteen │ │ ║", " ║ Gameroom │ │ ║", " ║ Balcony │ │ ║", " ║ Office │ │ ║", " ║────────────────║", " ║ Flail │ │ ║", " ║ Dagger │ │ ║", " ║ Bat │ │ ║", " ║ Shotgun │ │ ║", " ║ Shovel │ │ ║", " ║ Landmine │ │ ║", " ╚════════════════╝", " ", " ", " " }; int num = 0; for (int i = 0; i < array.Length; i++) { if (!array[i].Substring(44, 3).Equals("│ │")) { continue; } if (marks[num]) { if (playerMarks.Contains(referenceChoices[num])) { array[i] = array[i].Substring(0, 45) + "X" + array[i].Substring(46); } else { array[i] = array[i].Substring(0, 45) + "T" + array[i].Substring(46); } } num++; } return array; } public static string AssembleHUD(string[] addedText) { string[] array = DisplayHUD(displayMarks); string text = ""; if (array != null) { for (int i = 0; i < 12; i++) { text = text + array[i] + "\n"; } for (int j = 12; j < 30; j++) { if (addedText.Length > j - 12) { text += addedText[j - 12]; for (int k = addedText[j - 12].Length; k < 29; k++) { text += " "; } } if (array[j] != null && array[j].Length > 29) { text = text + array[j].Substring(29) + "\n"; } } return text; } Debug.Log((object)"Temp is null!"); return "You done messed up, fool!"; } public static string AssembleHUD() { string[] array = DisplayHUD(displayMarks); string text = ""; for (int i = 0; i < 28; i++) { text = text + array[i] + "\n"; } return text; } public static string EvaluateAccuse() { string result = "incorrect!"; if (realHints.Contains(accuseChara) && realHints.Contains(accuseWeapon) && realHints.Contains(accuseRoom)) { result = "correct!"; ConsoleGamesMain.playingHint = false; } if (player2Guessing) { player2Elim = true; player2Guessing = false; } else { player3Elim = true; player3Guessing = false; } return result; } public static bool PlayerHasIt(string guessedCharacter, string guessedWeapon, string guessedRoom) { if (playerMarks.Contains(guessedCharacter)) { return true; } if (playerMarks.Contains(guessedWeapon)) { return true; } if (playerMarks.Contains(guessedRoom)) { return true; } return false; } public static bool AIAccuse(int playerNumber) { int num = 0; int num2 = 0; int num3 = 0; string text = ""; string text2 = ""; string text3 = ""; List<string> list = new List<string>(); int num4; if (playerNumber == 2) { num4 = player2Strat; list.AddRange(player2Knowns); player2Guessing = true; } else { num4 = player3Strat; list.AddRange(player3Knowns); player3Guessing = true; } for (int i = 0; i < 6; i++) { if (list.Contains(referenceChoices[i])) { num++; } else { text = referenceChoices[i]; } } for (int j = 6; j < 15; j++) { if (list.Contains(referenceChoices[j])) { num3++; } else { text3 = referenceChoices[j]; } } for (int k = 15; k < referenceChoices.Count; k++) { if (list.Contains(referenceChoices[k])) { num2++; } else { text2 = referenceChoices[k]; } } int num5 = 3; if (num != 5) { text = ""; num5--; } if (num3 != 8) { text3 = ""; num5--; } if (num2 != 5) { text2 = ""; num5--; } int num6 = 0; if (num == 4) { num6++; } if (num3 == 7) { num6++; } if (num2 == 4) { num6++; } switch (num4) { case 1: { if (num5 == 3) { accuseChara = text; accuseWeapon = text2; accuseRoom = text3; return true; } int num10 = Random.RandomRange(0, 100); if (num6 != 1 || num5 != 2 || num10 <= 66) { break; } string text5 = ""; string item2 = ""; int num11 = 0; int num12 = 0; if (num != 6) { num11 = 0; num12 = 6; } else if (num3 != 9) { num11 = 6; num12 = 15; } else { num11 = 15; num12 = referenceChoices.Count; } for (int m = num11; m < num12; m++) { if (!list.Contains(referenceChoices[m])) { if (!(text5 == "")) { item2 = referenceChoices[m]; break; } text5 = referenceChoices[m]; } } text = Choose(new List<string> { text5, item2 }); accuseChara = text; accuseWeapon = text2; accuseRoom = text3; return true; } case 2: { if (num5 == 3) { accuseChara = text; accuseWeapon = text2; accuseRoom = text3; return true; } int num7 = Random.RandomRange(0, 100); if (num6 != 1 || num5 != 2 || num7 <= 50 || turns < 12) { break; } string text4 = ""; string item = ""; int num8 = 0; int num9 = 0; if (num != 6) { num8 = 0; num9 = 6; } else if (num3 != 9) { num8 = 6; num9 = 15; } else { num8 = 15; num9 = referenceChoices.Count; } for (int l = num8; l < num9; l++) { if (!list.Contains(referenceChoices[l])) { if (!(text4 == "")) { item = referenceChoices[l]; break; } text4 = referenceChoices[l]; } } text = Choose(new List<string> { text4, item }); accuseChara = text; accuseWeapon = text2; accuseRoom = text3; return true; } } return false; } public static string FindMost() { string text = ""; List<string> list = player2Knowns; if (player3Guessing) { list = player3Knowns; } int num = 0; int num2 = 0; int num3 = 0; for (int i = 0; i < referenceChoices.Count; i++) { if (list.Contains(referenceChoices[i])) { if (i < 6) { num++; } else if (i < 15) { num3++; } else { num2++; } } } float num4 = (float)num / 5f; float num5 = (float)num3 / 8f; float num6 = (float)num2 / 5f; if (num4 == 1f) { num4 = 0f; } if (num5 == 1f) { num5 = 0f; } if (num6 == 1f) { num6 = 0f; } if (num4 > num5 && num4 > num6) { return "character"; } if (num5 > num6 && num5 > num4) { return "room"; } return "weapon"; } internal static string FormatCharacter(string input) { string text = ""; switch (input) { case "baron bracken": case "bracken": return "Baron Bracken"; case "lootbug": case "lord lootbug": return "Lord Lootbug"; case "thumper": case "tribune thumper": return "Tribune Thumper"; case "general giant": case "giant": return "General Giant"; case "sheriff slime": case "slime": return "Sheriff Slime"; case "foreman flea": case "flea": return "Foreman Flea"; default: return input; } } internal static string Choose(List<string> choices) { int index = Random.Range(0, choices.Count); return choices[index]; } internal static string Choose(List<string> choices, string type) { int num = -1; num = (type.Equals("character") ? Random.Range(0, 6) : ((!type.Equals("room")) ? Random.Range(15, choices.Count) : Random.Range(6, 15))); return choices[num]; } internal static void ResetVars() { referenceChoices.Clear(); referenceChoices.AddRange(allChoices); playerMarks.Clear(); player2Knowns.Clear(); player3Knowns.Clear(); player2Marks.Clear(); player3Marks.Clear(); realHints[0] = ""; realHints[1] = ""; realHints[2] = ""; player2Guessing = false; player3Guessing = false; playerShowing = false; } } public class DiceClasses { public class Dice { public int faceValue; public Dice() { faceValue = Roll(); } public int Roll() { faceValue = Random.Range(1, 7); return faceValue; } } public static string DisplayDice(List<int> rolls) { string[] array = new string[5] { "", "", "", "", "" }; for (int i = 0; i < rolls.Count; i++) { if (rolls[i] == 1) { array[0] += "┌───────┐ "; array[1] += "│ │ "; array[2] += "│ ● │ "; array[3] += "│ │ "; array[4] += "└───────┘ "; } else if (rolls[i] == 2) { array[0] += "┌───────┐ "; array[1] += "│ ● │ "; array[2] += "│ │ "; array[3] += "│ ● │ "; array[4] += "└───────┘ "; } else if (rolls[i] == 3) { array[0] += "┌───────┐ "; array[1] += "│ ● │ "; array[2] += "│ ● │ "; array[3] += "│ ● │ "; array[4] += "└───────┘ "; } else if (rolls[i] == 4) { array[0] += "┌───────┐ "; array[1] += "│ ● ● │ "; array[2] += "│ │ "; array[3] += "│ ● ● │ "; array[4] += "└───────┘ "; } else if (rolls[i] == 5) { array[0] += "┌───────┐ "; array[1] += "│ ● ● │ "; array[2] += "│ ● │ "; array[3] += "│ ● ● │ "; array[4] += "└───────┘ "; } else { array[0] += "┌───────┐ "; array[1] += "│ ● ● │ "; array[2] += "│ ● ● │ "; array[3] += "│ ● ● │ "; array[4] += "└───────┘ "; } } return array[0] + "\n" + array[1] + "\n" + array[2] + "\n" + array[3] + "\n" + array[4]; } public static int TranslateString(string original) { return original switch { "one" => 1, "two" => 2, "three" => 3, "four" => 4, "five" => 5, "six" => 6, "seven" => 7, "eight" => 8, "nine" => 9, _ => 10, }; } public static string TranslateInt(int original) { return original switch { 1 => "one", 2 => "two", 3 => "three", 4 => "four", 5 => "five", 6 => "six", 7 => "seven", 8 => "eight", 9 => "nine", _ => "ten", }; } } } namespace TerminalGames { internal class AdventureMethods { private static string returnString = ""; private static bool flashlightOn = false; private static int gameState; private static int area; private static int cameFrom; private static List<string> inventory = new List<string> { "Empty", "Empty", "Empty", "Empty" }; private static int door0; private static int door3; private static int door5; private static int door12; private static int door12Locked; private static int flashlight; private static int ladder; private static int remote; private static int landmine; private static int turret; private static int key; private static int keyGiven; private static int arm; private static int fuse1; private static int fuse2; private static int fuse3; private static int fuse4; private static int bodyMoved; private static List<int> insertedFuses = new List<int> { 0, 0, 0, 0 }; public static TerminalNode LoadGame(Terminal __terminal) { ConsoleGamesMain.playingAdventure = true; gameState = PlayerPrefs.GetInt("GameState", 0); area = PlayerPrefs.GetInt("Area", 0); inventory[0] = PlayerPrefs.GetString("InvOne", "Empty"); inventory[1] = PlayerPrefs.GetString("InvTwo", "Empty"); inventory[2] = PlayerPrefs.GetString("InvThree", "Empty"); inventory[3] = PlayerPrefs.GetString("InvFour", "Empty"); door0 = PlayerPrefs.GetInt("Door0", 0); door3 = PlayerPrefs.GetInt("Door3", 0); door5 = PlayerPrefs.GetInt("Door5", 0); door12 = PlayerPrefs.GetInt("Door12", 0); door12Locked = PlayerPrefs.GetInt("Door12Locked", 1); flashlight = PlayerPrefs.GetInt("Flashlight", 0); ladder = PlayerPrefs.GetInt("Ladder", 0); remote = PlayerPrefs.GetInt("Remote", 0); landmine = PlayerPrefs.GetInt("Landmine", 0); turret = PlayerPrefs.GetInt("Turret", 0); key = PlayerPrefs.GetInt("Key", 0); keyGiven = PlayerPrefs.GetInt("KeyGiven", 0); arm = PlayerPrefs.GetInt("Arm", 0); fuse1 = PlayerPrefs.GetInt("Fuse1", 0); fuse2 = PlayerPrefs.GetInt("Fuse2", 0); fuse3 = PlayerPrefs.GetInt("Fuse3", 0); fuse4 = PlayerPrefs.GetInt("Fuse4", 0); bodyMoved = PlayerPrefs.GetInt("BodyMoved", 0); insertedFuses[0] = PlayerPrefs.GetInt("FuseOne", 0); insertedFuses[1] = PlayerPrefs.GetInt("FuseTwo", 0); insertedFuses[2] = PlayerPrefs.GetInt("FuseThree", 0); insertedFuses[3] = PlayerPrefs.GetInt("FuseFour", 0); returnString = ""; if (area == 0) { returnString += "<size=25>Salvage Synergy: The Company's Lost Legacy™</size>\n\nYou find yourself waking up on the cold, hard ground. You don't know where you are or how you got here.\nEnter an action, or type 'Actions' for a list of actions.\n\n"; } else { returnString = returnString + "Your save data was loaded.\n\n" + LoadIntro(area); } TerminalNode obj = TerminalApi.CreateTerminalNode(returnString, false, ""); obj.clearPreviousText = true; return obj; } public static string LoadIntro(int area) { string text = ""; switch (area) { case 1: text = "You're on a grated walkway above a large hole. Don't fall. To your west there is a corridor. To the south there is an open door, leading to a dark hall."; break; case 2: text = "You're in a dark corridor with pipes and valves jutting out of the wall. The smell of iron fills your nose. To the west there is a "; text = ((door3 != 0) ? (text + "open door leading to a blood stain.") : (text + "closed door.")); text += " To the east there is a dark hallway with a faint light at the end of it. To the south is a staircase leading into the dark. To the north is a grate pathway."; break; case 3: text = "You stand in a small room with a large blood stain adorning the center of the floor. To the north is a "; text = ((door0 != 0) ? (text + "open door leading to a dark turn,") : (text + "closed door,")); text = ((door3 != 0) ? (text + "and to the east is an open door leading to a faint light.") : (text + "and to the east is a closed door.")); text += "\nTo the west is a trail of blood leading into the darkness. You think you're alone."; break; case 4: text = "You're in a small electrical room. To the east is a bloodtrail leading down the hall."; break; case 5: text = "You've made your way to a four-way intersection. To the north is a room with a lot of light in it. To the east is a hallway bending out of sight. To the south is a long corridor with something lying at it's end, and to the west is a door."; break; case 6: text = "You stand before the main entrance to the facility. Light filters in from above you, a sight you sorely missed. To the south is the only exit from this room."; break; case 7: text = "You're on a landing platform between two sets of stairs, one ascending to the north and one descending to the south. To the east is a twisting hallway which elevates. It's so terribly dark down here, you can't see even three feet in front of you. Watch your step."; break; case 8: text = "You're beside a dead body which has been shot quite a few times. The scent of sulfur and blood is suffocating. To the south is a small room, to the east is a conjoining hall, to the north you can faintly see light, and to the west is a snaking hallway."; break; case 9: text = "You're right in front of a turret!\nA deactivated one, that is. Bullet casings litter the ground, and the only way out is to the north."; break; case 10: text = "You're at the foot of stairs which pierce the heavens. Well, close to it, anyway. To the west is a passage, and to the south is a corridor. To the north are the stairs. This room is the darkest room you've ever been in, maybe because of how deep into the ground it is."; break; case 11: text = "You are in a small, dark hallway. To the north you can continue to follow the hall, or to the east you can exit the hall. A shiver runs down your spine as you hear a clicking sound from far-away, but oh-so-close."; break; case 12: text = ((keyGiven != 0) ? "You're standing in a dark room where a bug once was. The only exit is to the south." : "You're in a mexican stand off with a giant bug. It stares at you intently, unbudging. You could go south, and leave this thing be."); break; case 13: text = "You're standing in front of a landmine. It's too wide to get around, so your forward progress has been blocked. To the west is the only way to leave, unless you want to get blown up, that is."; cameFrom = 10; break; case 14: text = "You're in a hall connecting a small nook to the east, a corridor to the west, and a door to the south. While you were glancing around in this room you swore you saw two white lights in the distance, but they vanished as soon as you saw them."; break; case 15: text = "You're at a dead-end. To the west is the way out. The back wall of this room is scratched up badly, and the scratches are far too deep to be human-made."; break; case 16: text = "You're standing on the opposite end of a hole in the ground to a giant spring-headed monster. You stare at it unblinking, as you know that if you break eye-contact, it will move. What will happen if it gets to you? You don't wanna find out. To the south is the only exit."; break; default: text = "You find yourself waking up on the cold, hard ground. You don't know where you are or how you got here.\nEnter an action, or type 'Actions' for a list of actions.\n\n"; break; } return text + "\nEnter an action, or type 'Actions' for a list of actions.\n\n"; } public static void Save() { PlayerPrefs.SetInt("GameState", gameState); PlayerPrefs.SetInt("Area", area); PlayerPrefs.SetString("InvOne", inventory[0]); PlayerPrefs.SetString("InvTwo", inventory[1]); PlayerPrefs.SetString("InvThree", inventory[2]); PlayerPrefs.SetString("InvFour", inventory[3]); PlayerPrefs.SetInt("Door0", door0); PlayerPrefs.SetInt("Door3", door3); PlayerPrefs.SetInt("Door5", door5); PlayerPrefs.SetInt("Door12", door12); PlayerPrefs.SetInt("Door12Locked", door12Locked); PlayerPrefs.SetInt("Flashlight", flashlight); PlayerPrefs.SetInt("Ladder", ladder); PlayerPrefs.SetInt("Remote", remote); PlayerPrefs.SetInt("Landmine", landmine); PlayerPrefs.SetInt("Turret", turret); PlayerPrefs.SetInt("Key", key); PlayerPrefs.SetInt("KeyGiven", keyGiven); PlayerPrefs.SetInt("Arm", arm); PlayerPrefs.SetInt("Fuse1", fuse1); PlayerPrefs.SetInt("Fuse2", fuse2); PlayerPrefs.SetInt("Fuse3", fuse3); PlayerPrefs.SetInt("Fuse4", fuse4); PlayerPrefs.SetInt("FuseOne", insertedFuses[0]); PlayerPrefs.SetInt("FuseTwo", insertedFuses[1]); PlayerPrefs.SetInt("FuseThree", insertedFuses[2]); PlayerPrefs.SetInt("FuseFour", insertedFuses[3]); PlayerPrefs.SetInt("BodyMoved", bodyMoved); PlayerPrefs.Save(); } public static int InputParse(string input) { try { input = input.Substring(5); if (input.Substring(0, 2).Equals("to")) { input = input.Substring(3); } return input switch { "north" => 0, "east" => 1, "west" => 2, "south" => 3, _ => -1, }; } catch { return -1; } } public static bool AreasConnected(int area, string input, out int translatedInput) { translatedInput = InputParse(input); if (translatedInput == -1) { return false; } switch (area) { case 0: return translatedInput switch { 0 => false, 1 => true, 2 => false, _ => true, }; case 1: return translatedInput switch { 0 => false, 1 => false, 2 => true, _ => true, }; case 14: if (translatedInput == 0) { return false; } return true; case 3: if (translatedInput == 3) { return false; } return true; case 4: if (translatedInput == 1) { return true; } return false; case 2: case 5: case 8: return true; case 6: return translatedInput switch { 0 => true, 1 => false, 2 => false, _ => true, }; case 7: if (translatedInput == 2) { return false; } return true; case 9: if (translatedInput == 0) { return true; } return false; case 10: return translatedInput switch { 0 => true, 1 => false, 2 => true, _ => true, }; case 11: return translatedInput switch { 0 => true, 1 => true, 2 => false, _ => false, }; case 12: case 16: if (translatedInput == 3) { return true; } return false; case 13: return translatedInput switch { 0 => false, 1 => true, 2 => true, _ => false, }; case 15: if (translatedInput == 2) { return true; } return false; default: return true; } } public static TerminalNode Actions(Terminal __terminal) { TerminalNode val = ((!ConsoleGamesMain.playingAdventure) ? TerminalApi.CreateTerminalNode("There was an issue with your request.\n\n", false, "") : TerminalApi.CreateTerminalNode("Inspect (optional: object)\n<size=13>Get a description of your general surroundings or of a specific object</size>\nWalk 'direction'\n<size=13>Travel to another location (Ex. walk east)</size>\nGrab 'item'\n<size=13>Pick up an item. (Ex. grab shovel)</size>\nInventory\n<size=13>List what you are holding</size>\nUse 'item'\n<size=13>Use an item. (Ex. use key)</size>\nRestart\n<size=13>If you find yourself wanting to start a new game, use this command.</size>\n\n", false, "")); val.clearPreviousText = true; return val; } public static TerminalNode Restart(Terminal __terminal) { TerminalNode val = TerminalApi.CreateTerminalNode("Data wiped.\n\n<size=25>Salvage Synergy: The Company's Lost Legacy™</size>\n\nYou find yourself waking up on the cold, hard ground. You don't know where you are or how you got here.\nEnter an action, or type 'Actions' for a list of actions.\n\n", false, ""); val.clearPreviousText = true; ConsoleGamesMain.playingAdventure = true; gameState = 0; area = 0; for (int i = 0; i < 4; i++) { inventory[i] = "Empty"; insertedFuses[i] = 0; } door0 = 0; door3 = 0; door5 = 0; door12 = 0; door12Locked = 1; flashlight = 0; ladder = 0; remote = 0; landmine = 0; turret = 0; key = 0; keyGiven = 0; arm = 0; fuse1 = 0; fuse2 = 0; fuse3 = 0; fuse4 = 0; bodyMoved = 0; try { PlayerPrefs.DeleteKey("Cheater"); } catch { } Save(); return val; } public static TerminalNode Inspect(Terminal __terminal) { string text = ""; if (ConsoleGamesMain.playingAdventure) { string inputValue = SimpleCommand.GetInputValue(__terminal); inputValue = inputValue.ToLower(); if (inputValue.Length > 8) { inputValue = inputValue.Substring(8); switch (area) { case 1: text = ((!inputValue.Equals("ladder") || ladder != 0) ? "No such object exists in this room." : "The ladder is in decent condition. Dried blood runs along the main chasis."); break; case 2: text = ((!inputValue.Equals("door")) ? "No such object exists in this room." : "You cannot see through either door's window, but both doors are unlocked."); break; case 3: text = ((!inputValue.Equals("door")) ? ((!inputValue.Equals("blood") && !inputValue.Equals("blood stain")) ? "No such object exists in this room." : "The blood is fresh, and it leads to the west.") : "You cannot see through either door's window, but both doors are unlocked."); break; case 4: { int num = 4; for (int j = 0; j < 4; j++) { if (insertedFuses[j] == 1) { num--; } } if ((inputValue.Equals("breaker") || inputValue.Equals("breaker box")) && num != 0) { text = "Opening the breaker, you notice that it's missing\n" + num + " fuses. With them, you bet the power would come on."; } else if (num == 0 && (inputValue.Equals("breaker") || inputValue.Equals("breaker box"))) { text = "You've placed the fuses in the breaker."; } else if (inputValue.Equals("arm") || (inputValue.Equals("severed arm") && arm == 0)) { text = "The blood is fresh."; if (key == 0) { text += " You notice a key in the arm's hand."; } } else { text = "No such object exists in this room."; } break; } case 5: text = "No such object exists in this room."; break; case 6: text = ((inputValue.Equals("door") && insertedFuses[3] == 0) ? "The door is hydraulically shut. It's opened by the scanner, but it has no power." : ((inputValue.Equals("door") && gameState != 150) ? "The door is hydraulically shut. It's opened by the scanner." : ((inputValue.Equals("door") && gameState == 150) ? "The door is open!" : (((inputValue.Equals("scanner") || inputValue.Equals("the scanner")) && insertedFuses[3] == 0) ? "The scanner is powered off" : ((!inputValue.Equals("scanner") && !inputValue.Equals("the scanner")) ? "No such object exists in this room." : "The scanner reads 'enter biometric data'."))))); break; case 7: text = "No such object exists in this room."; break; case 8: text = (((inputValue.Equals("body") || inputValue.Equals("the body")) && bodyMoved == 0) ? "There are a lot of bullet holes in the body. It's very cold. It seems like there's something under it. You could get it if you pushed the body out of the way." : ((!inputValue.Equals("body") && !inputValue.Equals("the body")) ? "No such object exists in this room." : "There are a lot of bullet holes in the body. It's very cold.")); break; case 9: text = (((inputValue.Equals("turret") || inputValue.Equals("the turret")) && fuse2 == 0) ? "The turret's been deactivated. On it's left side there's a fuse embedded in it. You could take it out." : ((!inputValue.Equals("turret") && !inputValue.Equals("the turret")) ? "No such object exists in this room." : "The turret's been deactivated. You took it's fuse.")); break; case 10: text = "No such object exists in this room."; break; case 11: text = "No such object exists in this room."; break; case 12: if (inputValue.Equals("bug") || inputValue.Equals("loot bug")) { text = "The bug has beady eyes, and it clicks loudly at you. It seems to be guarding whatever's behind it."; for (int i = 0; i < 4; i++) { if (inventory[i].Equals("Key") || inventory[i].Equals("Flashlight")) { text += "\nIt looks like it's fixated on some item you have.\n\n"; } } } else { text = "No such object exists in this room."; } break; case 13: text = (((inputValue.Equals("mine") || inputValue.Equals("landmine")) && landmine == 0) ? "There's a mine on the ground with a flashing red light. It's blocking the way forward from the west." : (((!inputValue.Equals("device") && !inputValue.Equals("the device")) || remote != 0) ? "No such object exists in this room." : ((landmine != 0) ? "There's a device laying on the ground. It looks like a television remote, but more scientific." : "There's some sort of device on the ground, but there's a landmine blocking the way from the west. Maybe you could get it from the east, or maybe you could get rid of the landmine."))); break; case 14: text = ((!inputValue.Equals("door") && !inputValue.Equals("the door")) ? "No such object exists in this room." : ((door12Locked != 0) ? "The door leads to a long hallway. It's unlocked" : "The door is locked!")); break; case 15: text = ((!inputValue.Equals("flashlight")) ? "No such object exists in this room." : "There's a flashlight on the ground. Looks like it still works, too."); break; case 16: text = ((!inputValue.Equals("coil head") && !inputValue.Equals("coilhead")) ? "No such object exists in this room." : "The thing is disturbing. It doesn't seem to move so long as you look at it. Good thing you have this flashlight."); break; default: text = ((!inputValue.Equals("door")) ? "No such object exists in this room." : "It's too dark to see through the door's window, but you notice that the door is unlocked."); break; } } else { switch (area) { case 1: text = "You're standing on a grate platform hovering above a chasm which you cannot see the bottom of. To be fair, it's so dark you can't see much of anything. To your west there is a corridor. To the south there is an open door, leading to a dark hall."; if (ladder == 0) { text += "\nYou notice a ladder leaning against the wall. It has blood on it."; } break; case 2: text = "You're in a dark corridor with pipes and valves jutting out of the wall. The smell of iron fills your nose. To the west there is a "; text = ((door3 != 0) ? (text + "open door leading to a blood stain.") : (text + "closed door.")); text += " To the east there is a dark hallway with a faint light at the end of it. To the south is a staircase leading into the dark. To the north is a grate pathway."; break; case 3: text = "You stand in a small room with a large blood stain adorning the center of the floor. To the north is a "; text = ((door0 != 0) ? (text + "open door leading to a dark turn,") : (text + "closed door,")); text = ((door3 != 0) ? (text + "and to the east is an open door leading to a faint light.") : (text + "and to the east is a closed door.")); text += "\nTo the west is a trail of blood leading into the darkness. You think you're alone."; break; case 4: text = "You're in a small electrical room. To the east is a hallway with a bloodtrail leading into it. There's a breakerbox on the wall."; if (arm == 0) { text += "\nThere's a severed arm on the ground sitting in a pool of blood."; } break; case 5: text = "The hall you're in is illuminated by the light filtering in from the room to the north. There's some sort of blueish-green muck scattered across the floor. To the west is a dark hall. To the east is a curved hallway. To the south is a hallway with a body at the end of it. To the north is a bright room."; break; case 6: text = "You're in the lobby of the facility, and light filters through a large fan in the ceiling. The north wall has a door. It has some sort of scanner next to it. To the south is a dark hallway."; break; case 7: text = "To the east is a long hallway that seems to turn. To the south are more stairs leading down, and to the north are more stairs leading up.\nIt's eerily quiet here, and the air is stale."; break; case 8: text = "In the middle of the walkway there is a body riddled with bullet holes. The smell is awful. To the north there is a light. To the east there looks to be a T-Junction. There's an open doorway to the west."; if (bodyMoved == 1 && fuse3 == 0) { text += "There's also a fuse on the ground."; } break; case 9: text = "The turret is deactivated. There are a lot of bullet casings on the ground. This seems to be a storage room, there are boxes and bits on shelves all around. Nothing catches your eye."; if (fuse2 == 0) { text += "There's a fuse in the turret. "; } text += "To the north is the ony exit."; break; case 10: text = "To the north are stairs. To the south the path curves out of sight. To the west stretches a long walkway.\nYou hear something far away, but you don't know what. After a moment silence returns."; break; case 11: text = "To the north the walkway continues. To the east is a corridor. It's cold in this room, much colder than other parts of the facility. You swear that you heard something behind you, but nothing was there."; break; case 12: text = ((keyGiven != 0) ? ((fuse1 != 0) ? "The room is empty. To the south is the way back.\nYou don't want to stick around for long." : "There's a fuse sitting on the ground. To the south is the way back.") : "There's a weird bug at the end of the hallway. It looks at you from afar. It seems like there's something behind it. To the south is the way back."); break; case 13: text = ((landmine == 0 && remote == 0) ? ((cameFrom != 10) ? "There's a device laying on the ground in front of the landmine. To the east is an open door. Through the blinking of the red light on the landmine you see that this room is very red. You hope it's paint." : "There's a device laying on the ground, but in front of it is a landmine. To the east is a door. To the west is an open passage. Through the blinking of the red light on the landmine you see that this room is very red. You hope it's paint.") : ((landmine != 0) ? "To the east is a door. To the west is an open passage way." : "There's a landmine on the ground. To the east is a door. To the west is an open passage. Through the blinking of the red light on the landmine you see that this room is very red. You hope it's paint.")); break; case 14: text = ((door12 != 0) ? "To the south is an open door. " : "To the south is a closed door. "); text += "To the east is a small room. To the west is a hallway with a body in it."; break; case 15: text = ((flashlight != 0) ? "To the west is the way back." : "There's a flashlight on the ground. To the west is the way back."); break; case 16: text = ((fuse3 != 0) ? "There's a giant mannequin with a spring for a head in the back of the room. To the south is the way back." : "There's a fuse on the ground in the middle of the room. A giant mannequin with a spring for a head is at the back of the room. To the south is the way back."); break; default: text = "As your eyes slowly adjust to the darkness you realize you are in the middle of a hallway. Jagged metal embroiders the walls, and soot covers the floor. To the south is a "; text = ((door0 != 0) ? (text + "open door leading to a blood stain") : (text + "closed door")); text += ", and to the east is an open doorway. It appears you are alone."; break; } } text += "\nEnter an action, or type 'Actions' for a list of actions.\n\n"; } else { text = "There was an issue with your request.\n\n"; } TerminalNode obj = TerminalApi.CreateTerminalNode(text, false, ""); obj.clearPreviousText = true; return obj; } public static TerminalNode GrabItem(Terminal __terminal) { TerminalNode val = TerminalApi.CreateTerminalNode("", false, ""); val.clearPreviousText = true; int num = -1; for (int i = 0; i < 4; i++) { if (inventory[i].Equals("Empty")) { num = i; break; } } string inputValue = SimpleCommand.GetInputValue(__terminal); inputValue = inputValue.ToLower(); string text; try { text = inputValue.Substring(5); } catch { val.displayText = "You have to enter an item. (Ex. Grab 'boombox')\n\n"; return val; } if (num == -1) { val.displayText = "Your inventory is full!\n\n"; return val; } if (text.Equals("ladder")) { if (area == 1 && ladder == 0) { ladder = 1; inventory[num] = "Ladder"; val.displayText = "You picked up the ladder. How did you store it, you ask? Don't worry about it.\n\n"; return val; } val.displayText = "There isn't a ladder in this room.\n\n"; return val; } if (text.Equals("key")) { if (area == 4 && key == 0) { key = 1; inventory[num] = "Key"; val.displayText = "You took the key and put it on your phone's keychain...sorry, wrong game.\n\n"; return val; } val.displayText = "There isn't a key in this room.\n\n"; return val; } if (text.Equals("arm")) { if (area == 4 && arm == 0) { arm = 1; inventory[num] = "Arm"; val.displayText = "You shoved the bloody arm into your pocket. Surely it won't attract any beasts.\n\n"; return val; } val.displayText = "The only arm in this room is yours.\n\n"; return val; } if (text.Equals("flashlight") || text.Equals("flash light")) { if (area == 15 && flashlight == 0) { flashlight = 1; inventory[num] = "Flashlight"; val.displayText = "You got the flashlight. Good thing the batteries are still working.\n\n"; return val; } val.displayText = "There isn't a flashlight in this room.\n\n"; return val; } if (text.Equals("remote") || text.Equals("device")) { if (area == 13 && remote == 0) { remote = 1; inventory[num] = "Device"; val.displayText = "You picked up the device. Let's just hope it's not to the garage.\n\n"; return val; } val.displayText = "There isn't any doohickey of any sort in this room.\n\n"; return val; } if (text.Equals("fuse")) { if (area == 12) { if (keyGiven == 0) { val.displayText = "You can't get past the bug, and you're not gonna risk it. You need the bug out of the way first.\n\n"; return val; } if (fuse1 == 0) { fuse1 = 1; inventory[num] = "Fuse"; val.displayText = "You picked up the fuse. Don't break it.\n\n"; return val; } val.displayText = "You already got this fuse, silly.\n\n"; return val; } if (area == 9) { if (fuse2 == 0) { fuse2 = 1; inventory[num] = "Fuse"; val.displayText = "You aquired this fuse. Good job.\n\n"; return val; } val.displayText = "This turret only had one fuse on it. Sorry.\n\n"; return val; } if (area == 8) { if (bodyMoved == 0) { val.displayText = "You're a cheater. You should have no way to know a fuse is under the body, but you somehow did. How'd you do that, huh? You gonna lie to me? You know how much time I put into planning where all the fuses would be, how you got them, the puzzle aspect of all of this? It took me like 10 minutes! I didn't spend all that time just for you to cheat your way through it. Inspect the damn body, learn there's something under it, move the body, and THEN grab the fuse. Until you do that, you aren't getting anything from me.\n\n"; PlayerPrefs.SetInt("Cheater", 1); return val; } if (fuse3 == 0) { fuse3 = 1; inventory[num] = "Fuse"; if (PlayerPrefs.GetInt("Cheater", 0) == 1) { val.displayText = "See? How hard was that? Was that so bad, taking the twenty, maybe thirty seconds to just play the game as it was intended to be played? Did you suffer? Was it agonizing? Did I even spell that word right? I'm not spell checking it, that's how disgruntled I am about this whole situation, it's just gonna be wrong most likely. Screw you, I hate you...I didn't mean that. I don't hate you. Thank you for downloading my mod. Truly. As of writing this I have over 7,000 downloads. That's crazy, so thank you. I'm still upset you tried to cheat, though. That's why I'm hopefully wasting your time with this unending paragraph I'm typing up. You could just not read it, but if you care enough about this game to play it for long enough to get to this fuse, you probably would take the time to read this. Although, if you're cheating, maybe not. Maybe you accidentally soft-locked yourself by using the ladder on the landmine, using the key in the door, and dropping the flashlight for the bug, leaving you with no way to get the final fuse from the coil-head. Did you do that? And then, trying to get back as soon as possible, you just try and pick the fuse in this room up? I feel bad for you. I included that on purpose, but I still feel bad. It sucks, I know, but I had to give you a chance to lose. Imagine an adventure game where you can't lose, wouldn't that be silly? And besides, I gave you so many options to do the bug room, if you somehow messed it up I think that's on you. Okay, this is long enough. I hope you read all of this and then reflected on your choices up to this point. Hopefully your future adventures will be within the confines of the rules. Anyway, you got the fuse.\n\n"; } else { val.displayText = "You picked the fuse up. It's very bloody, but it might still work.\n\n"; } return val; } val.displayText = "He didn't have two fuses, sadly.\n\n"; return val; } if (area != 16) { val.displayText = "There are many fuses in this facility, but there are none in this room.\n\n"; return val; } if (!flashlightOn && fuse4 == 0) { val.displayText = "You would get yourself killed trying to get it, it's far too dark.\n\n"; return val; } if (fuse4 == 1) { val.displayText = "You need to work on your short term memory, because you already have this fuse.\n\n"; return val; } if (flashlightOn && fuse4 == 0) { fuse4 = 1; inventory[num] = "Fuse"; val.displayText = "Very carefully and very slowly, with your flashlight fixated on the deadly monolith, you grab the fuse and back towards the door. Absolutely finnesed.\n\n"; return val; } } val.displayText = "Not only is that item not in this room, it isn't even in the entire facility.\n\n"; return val; } public static TerminalNode Push(Terminal __terminal) { TerminalNode val = TerminalApi.CreateTerminalNode("", false, ""); val.clearPreviousText = true; string inputValue = SimpleCommand.GetInputValue(__terminal); inputValue = inputValue.ToLower(); string text; try { text = inputValue.Substring(5); } catch { val.displayText = "You have to reference what you're pushing. (Ex. push body)\n\n"; return val; } if (text.Equals("body") || text.Equals("the body")) { if (area == 8) { bodyMoved = 1; val.displayText = "You roll the body over and find underneath an in-tact fuse!\n\n"; return val; } val.displayText = "The only body in this room is your body. And you can push that one by walking.\n\n"; return val; } val.displayText = "To keep it a buck with you, the 'push' command is for one very specific scenario, and nothing else. Unless you find yourself in such a scenario, don't use it. You have nothing to push.\n\n"; return val; } public static TerminalNode Inventory(Terminal __terminal) { string text = ""; for (int i = 0; i < inventory.Count; i++) { text = text + "Slot " + (i + 1) + ": " + inventory[i] + "\n"; } text += "\n\n"; TerminalNode obj = TerminalApi.CreateTerminalNode(text, false, ""); obj.clearPreviousText = true; return obj; } public static TerminalNode UseItem(Terminal __terminal) { TerminalNode val = TerminalApi.CreateTerminalNode("", false, ""); val.clearPreviousText = true; bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool flag5 = false; int index = -1; int index2 = -1; int index3 = -1; string inputValue = SimpleCommand.GetInputValue(__terminal); inputValue = inputValue.ToLower(); string text; try { text = inputValue.Substring(4); } catch { val.displayText = "You have to enter an item. (Ex. Use 'key')\n\n"; return val; } for (int i = 0; i < 4; i++) { if (inventory[i].Equals("Key")) { flag = true; index = i; } else if (inventory[i].Equals("Flashlight")) { flag2 = true; index3 = i; } else if (inventory[i].Equals("Arm")) { flag3 = true; } else if (inventory[i].Equals("Ladder")) { flag4 = true; index2 = i; } else if (inventory[i].Equals("Device")) { flag5 = true; } } if (text.Equals("fuse")) { int num = 0; for (int j = 0; j < 4; j++) { if (inventory[j].Equals("Fuse")) { num++; } } if (num == 0) { val.displayText = "You don't have that item."; return val; } if (area == 4) { string text2 = "You opened the box and inserted " + num + " fuses."; for (int k = 0; k < 4; k++) { if (inventory[k].Equals("Fuse")) { inventory[k] = "Empty"; } } for (int l = 0; l < 4; l++) { if (insertedFuses[l] == 0) { insertedFuses[l] = 1; num--; if (num == 0) { break; } } } if (insertedFuses[3] == 1) { gameState = 100; text2 += " With the final fuse in place the lights come on, illuminating the facility. Power has been restored.\n\n"; val.displayText = text2; return val; } int num2 = 0; for (int m = 0; m < 4; m++) { if (insertedFuses[m] == 0) { num2++; } } text2 = text2 + " Alas, it's not enough. There are still " + num2 + " slots empty in the breaker.\n\n"; val.displayText = text2; return val; } val.displayText = "I don't know how that could help here.\n\n"; return val; } if (text.Equals("scanner") || text.Equals("panel")) { if (area == 6) { if (gameState == 100) { val.displayText = "You place your hand on the panel and the screen lights up with 'Access Denied'.\n\n"; return val; } if (gameState < 100) { val.displayText = "You try to use the panel, but the power is off.\n\n"; return val; } val.displayText = "Instead of sprinting out of the open door, you instead play with the panel some more. You giggle to yourself as the panel lights up 'Access Denied' over and over. After a few minutes, you get bored and stop.\n\n"; return val; } val.displayText = "There's no such thing in this room.\n\n"; return val; } if (text.Equals("arm")) { if (flag3) { if (area == 6) { if (gameState == 100) { gameState = 150; val.displayText = "You place the severed hand onto the panel, and it lights up 'Access Granted'! The door next to you opens.\n\n"; return val; } if (gameState < 100) { val.displayText = "You place the hand on the panel, but the power's off. What did you expect?\n\n"; return val; } val.displayText = "Although you could leave, you instead play around with your dead coworker's severed arm. Look at you.\n\n"; return val; } val.displayText = "How would you even use this here?\n\n"; return val; } val.displayText = "You don't have this item.\n\n"; return val; } if (text.Equals("key")) { if (flag) { if (area == 12) { if (keyGiven == 0) { keyGiven = 1; inventory[index] = "Empty"; val.displayText = "You slowly place the key on the ground. The bug scutters over, takes it, and crawls away. Looking where the bug used to stand, you see a fuse on the ground!\n\n"; return val; } val.displayText = "That doesn't work here.\n\n"; return val; } if (area == 13 || area == 14) { door12Locked = 0; inventory[index] = "Empty"; val.displayText = "You put the key into the slot and turn it. As the door clicks open, the key breaks into two pieces!\n\n"; return val; } if (area == 6) { val.displayText = "Nice try.\n\n"; return val; } val.displayText = "You try to think of a way to use a key in this scenario, but you fail.\n\n"; return val; } val.displayText = "You don't have this item.\n\n"; return val; } if (text.Equals("flashlight")) { if (flag2) { if (area == 16) { flashlightOn = true; val.displayText = "You turn the flashlight on. Now you can see clearly what's in the room, and you see that there's a fuse on the ground next to the spring...thing.\n\n"; return val; } if (area == 12) { inventory[index3] = "Empty"; keyGiven = 1; val.displayText = "You slowly lower the flashlight to the ground. The bug scutters over and takes it, quickly leaving after. Looking back at where it used to be, you see that there's a fuse on the ground! I just hope you didn't need that light.\n\n"; return val; } val.displayText = "You turn the flashlight on. You're now able to see...not a lot. Debris, mostly. You turn it back off.\n\n"; return val; } val.displayText = "You don't have this item.\n\n"; return val; } if (text.Equals("ladder")) { if (flag4) { if (area == 12) { keyGiven = 1; val.displayText = "You set the ladder up in front of the bug. It doesn't move, content with watching you. You tip the ladder over, and it smashes the bug, killing it instantly. Why did that work? You pick up the ladder and continue. Looking past the bug's corpse, you see that it was guarding a fuse!\n\n"; return val; } if (area == 13) { inventory[index2] = "Empty"; landmine = 1; val.displayText = "You set the ladder up in front of the landmine. You tip it over and quickly exit the room. A second later you hear an ear-splitting explosion. You peek your head back into the room, and the landmine, as well as the ladder, is gone. Stepping into the room, you see a device lying on the ground. How did it survive the explosion?\n\n"; return val; } val.displayText = "Contrary to popular opinion, a ladder is not always useful. This is one such rare instance.\n\n"; return val; } val.displayText = "You don't have this item.\n\n"; return val; } if (text.Equals("device") || text.Equals("remote")) { if (flag5) { if (area == 8) { turret = 1; val.displayText = "You press the button on the middle of the device.\nSuddenly, you hear a whirring sound in the room to the south. Peaking your head inside, you see that the turret in the room has been deactivated!\n\n"; return val; } val.displayText = "You press the button on the middle of the device. It seems nothing happened."; return val; } val.displayText = "You don't have this item.\n\n"; return val; } val.displayText = "You cannot use that item.\n\n"; return val; } public static string GameOver() { PlayerPrefs.DeleteKey("GameState"); PlayerPrefs.DeleteKey("Area"); PlayerPrefs.DeleteKey("InvOne"); PlayerPrefs.DeleteKey("InvTwo"); PlayerPrefs.DeleteKey("InvThree"); PlayerPrefs.DeleteKey("InvFour"); PlayerPrefs.DeleteKey("Door0"); PlayerPrefs.DeleteKey("Door3"); PlayerPrefs.DeleteKey("Door5"); PlayerPrefs.DeleteKey("Door12"); PlayerPrefs.DeleteKey("Door12Locked"); PlayerPrefs.DeleteKey("Flashlight"); PlayerPrefs.DeleteKey("Ladder"); PlayerPrefs.DeleteKey("Remote"); PlayerPrefs.DeleteKey("Landmine"); PlayerPrefs.DeleteKey("Turret"); PlayerPrefs.DeleteKey("Key"); PlayerPrefs.DeleteKey("KeyGiven"); PlayerPrefs.DeleteKey("Arm"); PlayerPrefs.DeleteKey("Fuse1"); PlayerPrefs.DeleteKey("Fuse2"); PlayerPrefs.DeleteKey("Fuse3"); PlayerPrefs.DeleteKey("Fuse4"); PlayerPrefs.DeleteKey("BodyMoved"); PlayerPrefs.DeleteKey("FuseOne"); PlayerPrefs.DeleteKey("FuseTwo"); PlayerPrefs.DeleteKey("FuseThree"); PlayerPrefs.DeleteKey("FuseFour"); ConsoleGamesMain.playingAdventure = false; return "You step through the open door, sunlight beaming down on your face. After a moment basking in the sun, you begin your trek back to...wherever you came from; but that's a story for another game, and for a different day.\n\n<size=28>You win!</size>\n\n"; } public static string GetWalkMessage(int currentArea, int direction) { switch (currentArea) { case 1: switch (direction) { case 2: area = 0; return "You walk through the archway and into the small room. It smells awful in here, so you'd like to leave as soon as possible. To the south is a door, and to the east is the way you came."; case 3: area = 2; return "With how structurally sound this place seems, you're happy to get off that walkway. You step into a large hallway with a door to the east, a door to the west, and a staircase to the south. You can't see the end of it."; } break; case 2: switch (direction) { case 0: area = 1; return "You step out onto the platform, praying that it holds your weight. You don't know why there's a giant hole here, but you don't want to find out what's on the bottom. To the west is a doorway, and to the south is where you just were."; case 1: area = 5; if (door5 == 0) { door5 = 1; return "You open the door and step into the hallway. This room is much brighter than the others, because there's light coming from the passageway to the north. To the east is a hallway that turns away, and to the south is a hall with something big at the end of it on the ground."; } return "You step into the hallway. The light filtering through the passage to the north is a welcome sight. To the east is a twisting hallway, and to the south is a corridor with something large laying on the ground at the end."; case 2: area = 3; if (door3 == 0) { door3 = 1; return "You twist the doorknob and the door swings open, revealing a large pool of blood on the ground, with a trail leading off to the west. The smell is putrid. To the north is another door, and to the east is the way you came."; } return "You step into the room, making sure not to step on the blood. To the west is where the bloodtrail leads, to the north is a door and to the east is back the way you came."; case 3: area = 7; return "You slowly make your way down the stairs, watching your step. After what seems like an eternity you reach a landing platform with a long, long hallway to the east. It seems to raise slightly, effectively undoing all the stairs you just walked down. Alternatively, you could continue south down the stairs."; } break; case 3: switch (direction) { case 0: area = 0; if (door0 == 0) { door0 = 1; return "You step around the blood and to the door. You open it slowly, and realize you've made your way back to where you began. You step into the room. To the east is a doorway, and to the south is the way you came."; } return "Carefully avoiding the blood you step into the room. To the east is an open doorway, and to the south is the way you came."; case 1: area = 2; if (door3 == 0) { door3 = 1; return "You pull the door open and step through. Looking around, you see stairs leading down into a dark abyss to the south, a path leading to the north and a door to the east. To the west is back the way you came."; } return "You enter the hallway. There are stairs leading down to the south, a door to the east and a passage to the north."; case 2: area = 4; if (gameState < 2) { gameState = 2; return "You follow the bloodtrail (against your better judgement) and find yourself at a dead end. Two things stand out to you: a breakerbox on the wall and the severed arm laying right below it. Luckily, whatever did this has left. You're alone in this room. To the east is the way back."; } if (arm == 0) { return "You walk into the breaker room. The arm is still there, and the box is still on the wall. Good to see some things don't change. To the east is the way back."; } return "You walk into the breaker room. The box is still on the wall. Good to see some things don't change. To the east is the way back."; } break; case 4: area = 3; return "You follow the bloodtrail back, finding yourself back in the room with the large pool of blood. To the north and east are doors, to the west is the way back."; case 5: switch (direction) { case 0: area = 6; return "You step into the illuminated entrance. On the back wall to the north is a door and an electronic panel. The only other exit is the way you came, to the south."; case 1: area = 16; return "You traverse the winding corridor and find yourself in a large room with a hole in the middle. You take a few steps in when you hear a loud screeching coming from the back of the room. You snap your head to the sound and see a large manequein with a spring for a head standing motionless in the center of the room. You remember hearing about this thing, it moves when you don't look at it. The room is far too dark to see anything in without breaking eye contact with the thing, so you can't properly explore it. The only exit from this room is the way you came, to the south."; case 2: area = 2; if (door5 == 0) { door5 = 1; return "You crack the door open and step through. To the north is a walkway, to the south are stairs leading into pitch black darkness, and to the west is another door. To the east is the door you just opened."; } return "You enter the open door. To the north is a walkway, to the south are stairs leading into pitch black darkness, and to the west is another door. To the east is the way you came"; case 3: area = 8; return "You go down the hall and end up standing right next to a body with what has to be at least fifty bullet holes. To the east is small passage and to the south is an enclosed room. To the west is a twisting hallway, and to the north is the way you came from."; } break; case 6: switch (direction) { case 0: if (gameState < 100) { return "You cannot go north, as the door is closed."; } if (gameState > 100) { return GameOver(); } return "The power might be on, but the door is still closed. Try the panel, perhaps."; case 3: area = 5; return "You step back into the hall. To the east is a winding hallway, to the west is a door, and to the south is a corridor with something large on the ground at the end of it. To the north is the lobby you just came from."; } break; case 7: switch (direction) { case 0: area = 2; return "You climb the seemingly infinite stairs and reach the summit. To the east and west are doorways. To the north is a grate platform, and to the south are the stairs you just climbed for the past six minutes."; case 1: area = 8; return "You make your way slowly up the inclined hall. After a series of twists and turns you find yourself in a small passageway with a body on the ground. It's quite...perforated. To the north is a tunnel with a faint light at the end of it. To the east is a walkway and to the south is a small room. To the east is the way you came. "; case 3: area = 10; return "You climb the stairs even further down, finally reaching their end. It's extremely dark, but you can make out a doorway to your west and a path leading to the south. You could also climb the stairs to the north that you just came down. But why would you?"; } break; case 8: switch (direction) { case 0: area = 5; return "You walk towards the light, but you're not dead (yet). You find yourself in at a four-way intersection, with the lightsource to the north in a small room, a winding hallway to the east, a door to your west, and the way you came to the south."; case 1: area = 14; return "You continue down the walkway. You reach a T-junction with a small nook to the east and a further path to the south. Both ways are quite dark."; case 2: area = 7; return "You walk through the bending halls and reach a landing platform where stairs extend upwards to the north and stretch downwards to the south. To the east is back where you came. Something about this place makes you want to leave, and quickly."; case 3: if (turret == 0) { return "You take one step into the room and a bright red light appears and focuses on you. You quickly duck out of the doorway, and light dissapears. Whatever's in there, you don't think you can enter without turning it off."; } area = 9; return "This room is much nicer with the turret deactivated. To the north is the only way back."; } break; case 9: area = 8; return "You walk back into the room with the body. To the east is a bending hallway, to the north is a faint light at the end of a corridor, and to the east is a T-junction. To the south is the way you came from."; case 10: switch (direction) { case 0: area = 7; return "You climb the stairs back up. After a while you reach a small platform where a hallway extends to the east. To the north the stairs continue, and to the south is where you came from."; case 2: area = 11; if (keyGiven == 0) { return "You walk through the hallway and after a long while find yourself in front of an open doorway. In the other room you head scittering and what sounds like bird calls, but you know it's probably not from birds. You can go north, towards the sound, or east back where you came."; } return "You walk through the hallway and after a long while find yourself in front of an open doorway to your north. To the east is the way back."; case 3: area = 13; cameFrom = 10; if (landmine == 0) { return "You follow the hallway but are stopped by a landmine in the middle of the hall. The hallway is very narrow, so you doubt you could get around it. To the west is the way back."; } return "You follow the hallway, unfettered by an explosive device. To your east is a doorway, and to the wets is the way you came."; } break; case 11: switch (direction) { case 0: area = 12; if (keyGiven == 0) { return "You walk through the door and find yourself face-to-face with a giant bug thing. It doesn't move, it simply stares at you from a far, making noises. To the south is the way back."; } return "You slowly step into the room. No bugs. Good. To the south is the way back."; case 1: area = 10; return "You get into the hallway. It's very dark. To the south is a hallway that bends out of sight. To the north is a staircase which seems to go up forever. To the west is where you came from."; } break; case 12: area = 11; return "You exit the dead-end and walk back into the corridor. To the east is the bottom of the stairs, and to the north is where you came from."; case 13: switch (direction) { case 1: if (landmine == 0 && cameFrom == 10) { return "You're not going that way if you want to keep your legs on your body. The only available exit is to the west."; } if (landmine == 0 && cameFrom == 14) { area = 14; return "You turn around and go back. To the east is a small nook, and to the west is a corridor. To the south is where you just came from."; } if (door12Locked == 1) { return "You went to the door and tried to open it, but it was locked! Nothing can be easy."; } if (door12 == 0) { door12 = 1; area = 14; return "Now that the door's unlocked you push it open and step through. You walk down a brief hall and find yourself between a small corner to the east and an open path to the west. You could also return south to where you just were."; } area = 14; return "You go through the open door. You walk down a brief hall and find yourself between a small corner to the east and an open path to the west. You could also return south to where you just were."; case 2: if (landmine == 0 && cameFrom == 14) { return "You're not going that way if you want to keep your legs on your body. The only available exit is to the east."; } if (landmine == 0 && cameFrom == 10) { area = 10; return "You turn around and go back. To the north are interminable stairs, to the west is a twisting pathway and to the south is where you just were."; } area = 10; return "You traverse the corridor and find yourself at the foot of some stairs to the north. To the west is an offshooting path, and to the south is where you just were."; } break; case 14: switch (direction) { case 1: area = 15; return "The room is so small that you can see all of it, even in the darkness. There's a flashlight on the ground in front of you. The only exit is back where you came, to the west."; case 2: area = 8; return "Exiting the path you find yourself standing near a body filled with bullets. To the north you can see light, to the south is a small room and to the west is a twisting path. You could also go east, where you just were."; case 3: if (door12Locked == 1) { return "You try to open the door and step through, but the door's locked! To the east is a small room, to the west is a pathway, and to the south is the locked door."; } if (door12 == 0 && landmine == 0) { cameFrom = 14; door12 = 1; area = 13; return "Having unlocked the door you swing it open and enter. You take a few steps in when you see a landmine right in the middle of the path. You doubt you could get around it, so your only way to go is back to the east."; } if (door12 == 0 && landmine == 1) { door12 = 1; area = 13; return "Having unlocked the door you swing it open and enter. You find yourself in the middle of a hallway, with an open passage to the west and the way you came to the east."; } if (landmine == 0) { cameFrom = 14; area = 13; return "You enter the hallway but are stopped by a landmine in the middle of the path. Getting around it isn't going to happen, so the only way to go is east, where you came from."; } area = 13; return "You enter the hallway. To the west is an open doorway, and to the east is the way you came from."; } break; case 15: area = 14; return "You go back to the pathway. To the south is a door, and to the west is a corridor. To the east is where you just were."; case 16: area = 5; return "Keeping your eyes on the spring thing, you back out of the room. It clinks up against the doorway as you turn, but it's too large to get through the door. So that's good. To the north is a room with a lot of light, to the south is a hallway with something at the end of it, and to the west is a door. To the east is where you just were."; default: switch (direction) { case 1: area = 1; if (gameState == 0) { gameState = 1; return "You walk through the open doorway, still unsure where you are. You step out onto a grate walkway. Through the holes you can see a long, long way down. Better hold on to the guardrails. To the