protected override IEnumerator OnRun() { int maxStackSize = 20; int additionalStackSize = 1; Cheats.GetWood(maxStackSize); Cheats.GetWood(2); int newItemIndexMax = 4; var cell = Context.Inventory.GetCells(Screens.Inventory.Cell.Pockets.Item).GetCell(newItemIndexMax); var currentStackSize = Cheats.CellCount(cell); if (new CellCountChecker(Context, Screens.Inventory.Cell.Pockets, newItemIndexMax, maxStackSize).Check() == false) { Fail($"Максимальный размер стака предмета в ячейке {newItemIndexMax} не совпадает. " + $"Текущее размер: {currentStackSize}, ожидаемый размер: {maxStackSize}"); } var checker = new CellCountChecker(Context, Screens.Inventory.Cell.Pockets, newItemIndexMax + 1, additionalStackSize); if (checker.Check() == false) { Fail($"Неправильный размер стака предмета в ячейке {newItemIndexMax + 1}. " + $"Текущее размер: {checker.GetCellCount()}, ожидаемый размер: {additionalStackSize}"); } yield break; }
public void Draw(SpriteBatch theSpriteBatch, ContentManager theContentManager) { if (MyMenuState == MenuState.Startup) { Logo.Draw(theSpriteBatch, theContentManager); PlayButton.Draw(theSpriteBatch, theContentManager); OptionsButton.Draw(theSpriteBatch, theContentManager); HighScoresButton.Draw(theSpriteBatch, theContentManager); ExitGameButton.Draw(theSpriteBatch, theContentManager); } else if (MyMenuState == MenuState.Options1) { MusicOn.Draw(theSpriteBatch, theContentManager); MusicOff.Draw(theSpriteBatch, theContentManager); SoundOn.Draw(theSpriteBatch, theContentManager); SoundOff.Draw(theSpriteBatch, theContentManager); Cheats.Draw(theSpriteBatch, theContentManager); Debug.Draw(theSpriteBatch, theContentManager); Cave1.Draw(theSpriteBatch, theContentManager); Cave2.Draw(theSpriteBatch, theContentManager); Cave3.Draw(theSpriteBatch, theContentManager); Back.Draw(theSpriteBatch, theContentManager); OptionsLabel.Draw(theSpriteBatch, theContentManager); MusicLabel.Draw(theSpriteBatch, theContentManager); SoundFXLabel.Draw(theSpriteBatch, theContentManager); CaveLabel.Draw(theSpriteBatch, theContentManager); } }
protected override IEnumerator OnRun() { int treeIndex = 0; var trees = Cheats.FindTree(); yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); for (int i = 0; i < 3; i++) { yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); } yield return(Commands.WaitForSecondsCommand(3, new ResultData <SimpleCommandResult>())); yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Inventory, new ResultData <SimpleCommandResult>())); if (new TreeCountChecker(Context, 3).Check() == false) { Fail($"В инвентаре не хватает бревна, а должно быть 3шт."); } yield return(Commands.UseButtonClickCommand(Screens.Inventory.Button.Close, new ResultData <SimpleCommandResult>())); }
protected override IEnumerator OnRun() { yield return(RemoveAxesFromInventory()); int treeIndex = 0; var trees = Cheats.FindTree(); yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); for (int i = 0; i < 3; i++) { yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); } yield return(Commands.WaitForSecondsCommand(3, new ResultData <SimpleCommandResult>())); if (new TreeFelledChecker(Context, trees[treeIndex]).Check() == true) { Fail($"Дерево срублено, хотя не должно быть."); } yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Inventory, new ResultData <SimpleCommandResult>())); if (new TreeCountChecker(Context, 0).Check() == false) { Fail($"В инвентаре есть бревно, хотя не должно быть."); } yield return(Commands.UseButtonClickCommand(Screens.Inventory.Button.Close, new ResultData <SimpleCommandResult>())); }
protected override IEnumerator OnRun() { var trees = Cheats.FindTree(); GameObject farthestTree = null; float farthestDist = 0f; for (int i = 0; i < trees.Count; i++) { var dist = Vector3.Distance(trees[i].transform.position, Context.GetPlayerPosition()); if (dist > farthestDist) { farthestDist = dist; farthestTree = trees[i]; } } var playerMoveResult = new ResultData <PlayerMoveResult>(); yield return(Commands.PlayerMoveCommand(farthestTree.transform.position, playerMoveResult)); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); if (playerMoveResult.GetData().FailMove == true) { Fail($"Игрок не смог переместится используя Dpad."); } }
protected override IEnumerator OnRun() { int moveFromIndex = 0; int moveToIndex = 5; var cellFrom = Context.Inventory.GetCells(Screens.Inventory.Cell.Pockets.Item).GetCell(moveFromIndex); var iconNameFrom = Context.GetCellIconName(cellFrom); var result = new ResultData <SimpleCommandResult>(); yield return(Commands.DragAndDropCommand(Screens.Inventory.Cell.Pockets, moveFromIndex, Screens.Inventory.Cell.Pockets, moveToIndex, result)); yield return(Context.WaitEndFrame); var cellTo = Context.Inventory.GetCells(Screens.Inventory.Cell.Pockets.Item).GetCell(moveToIndex); var iconNameTo = Context.GetCellIconName(cellTo); if (iconNameFrom == iconNameTo && !Cheats.IconIsEmpty(cellTo)) { } else { // yield return Commands.UseButtonClickCommand(Screens.Inventory.Button.Close, new ResultData<SimpleCommandResult>()); Fail($"Не удалось переместить предмет из позиции {moveFromIndex} на позицию {moveToIndex} в инвентаре."); } }
protected override IEnumerator OnRun() { int treeIndex = 0; var trees = Cheats.FindTree(); yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); for (int i = 0; i < 3; i++) { yield return(Commands.UseButtonClickCommand(Screens.Main.Button.Use, new ResultData <SimpleCommandResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); } if (new UseActiveChecker(Context).Check() == true) { Fail($"Кнопка действия ещё активна, хотя не должна быть."); } yield return(Commands.PlayerMoveCommand(trees[treeIndex + 1].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); if (new UseActiveChecker(Context).Check() == false) { Fail($"Кнопка действия не активна, хотя должна быть."); } }
// On start, turn off non P1 players. void Start () { GameObject cheatObj = GameObject.FindGameObjectWithTag ("Cheats"); if (cheatObj != null) { IsCheatingEnabled = true; cheats = cheatObj.GetComponent<Cheats> (); } else { IsCheatingEnabled = false; } NumPlayers = 0; maxPlayers = 2; // Deactive players, cameras, and the hud, but store references to activate them later. players = new GameObject[maxPlayers]; cameras = new GameObject[maxPlayers]; for (int i = 0; i < maxPlayers; i++) { players [i] = GameObject.Find ("Player" + i.ToString ()); cameras [i] = GameObject.Find ("PlayerCamera" + i.ToString ()); players [i].SetActive (false); cameras [i].SetActive (false); } hud = GameObject.Find ("HUD"); hud.SetActive (false); }
// On start, turn off non P1 players. void Start() { GameObject cheatObj = GameObject.FindGameObjectWithTag("Cheats"); if (cheatObj != null) { IsCheatingEnabled = true; cheats = cheatObj.GetComponent <Cheats> (); } else { IsCheatingEnabled = false; } NumPlayers = 0; maxPlayers = 2; // Deactive players, cameras, and the hud, but store references to activate them later. players = new GameObject[maxPlayers]; cameras = new GameObject[maxPlayers]; for (int i = 0; i < maxPlayers; i++) { players [i] = GameObject.Find("Player" + i.ToString()); cameras [i] = GameObject.Find("PlayerCamera" + i.ToString()); players [i].SetActive(false); cameras [i].SetActive(false); } hud = GameObject.Find("HUD"); hud.SetActive(false); }
void Start() { _cheats = FindObjectOfType <Cheats>(); var idx = 0; foreach (var cheatsSpell in _cheats.Spells) { var col = idx % ItemsInRow; var row = idx / ItemsInRow; var pos = new Vector3(col, 0, row) * Padding; var go = GameObject.Instantiate(Prefab, transform.position + pos, Quaternion.identity); if (go != null) { var dSpell = go.GetComponent <DroppedSpell>(); if (dSpell != null) { dSpell.Setup(cheatsSpell, 1); } go.transform.SetParent(transform, true); idx++; } } }
public void ApplyCode(Cheats cheat) { //return; //Debug.Log("ApplyCode: " + cheat); switch (cheat) { case Cheats.AllWeapons: for (Commandments.Element element = Commandments.Element.EARTH; element < Commandments.Element.NEUTRAL; element++) { UIManager.GetInstance().weapon.ObtainWeapon(element); } break; case Cheats.LeaveDeathWeapon: for (Commandments.Element element = Commandments.Element.EARTH; element < Commandments.Element.NEUTRAL; element++) { UIManager.GetInstance().weapon.ObtainWeapon(element, false); } UIManager.GetInstance().weapon.ObtainWeapon(Commandments.Element.DEATH); UIManager.GetInstance().weapon.SetSelectedWeapon(Commandments.Element.DEATH.toWeapon()); break; case Cheats.LeaveWaterWeapon: for (Commandments.Element element = Commandments.Element.EARTH; element < Commandments.Element.NEUTRAL; element++) { UIManager.GetInstance().weapon.ObtainWeapon(element, false); } UIManager.GetInstance().weapon.ObtainWeapon(Commandments.Element.WATER); UIManager.GetInstance().weapon.SetSelectedWeapon(Commandments.Element.WATER.toWeapon()); break; } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { MenuController.Instance.ToggleMenu(); } if (Input.GetKeyDown(KeyCode.I)) { Cheats.CheatToggle(); } /* Free looking around ship without rotating it. *NOT YET IMPLEMENTED* * if (Input.GetKeyDown(KeyCode.C)) * { * CameraController.PlayerCameraControllerInstance.SetFreeLookActive(true); * PlayerController.Instance.SetMouseControlsEnabled(false); * } * * if (Input.GetKeyUp(KeyCode.C)) * { * CameraController.PlayerCameraControllerInstance.SetFreeLookActive(true); * PlayerController.Instance.SetMouseControlsEnabled(true); * } */ }
protected override IEnumerator OnRun() { int treeIndex = 1; var trees = Cheats.FindTree(); int anotherAliveTreeIndex = -1; for (int i = 0; i < trees.Count; i++) { if (!Cheats.TreeFelled(trees[i])) { anotherAliveTreeIndex = i; break; } } yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); yield return(Commands.PlayerMoveCommand(trees[anotherAliveTreeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); if (new UseTargetChecker(Context, trees[treeIndex].transform.position).Check() == true) { Fail($"Объект {trees[treeIndex].name} в фокусе, хотя не должен быть."); } }
public void RefreshGameLB() { genreShowNum = GenreCB.SelectedIndex; GameLB.Items.Clear(); Cheats.Clear(); using (GCDBContext _dbc = new GCDBContext(ConString)) { IQueryable <Cheat> req; if (genreShowNum == 0) { req = from VAR in _dbc.Cheats select VAR; } else { req = from VAR in _dbc.Cheats where VAR.Genre == genreShowNum select VAR; } foreach (var cheat in req) { Cheats.Add(cheat); } foreach (var cheat in Cheats) { GameLB.Items.Add(cheat.GameName); } if (GameLB.Items.Count > 0) { GameLB.SelectedIndex = 0; } } }
protected override IEnumerator OnRun() { Cheats.GetWood(1); yield return(Commands.DragAndDropCommand(Screens.Inventory.Cell.Pockets, 4, Screens.Inventory.Cell.WorkbenchRow, 0, new ResultData <SimpleCommandResult>())); if (new IconEmptyChecker(Context, Screens.Inventory.Cell.WorkbenchRow, 0).Check() == false) { Fail($"Row ячейка станка не пустая, хотя должна быть пустая."); } yield return(Context.WaitEndFrame); if (Context.ProgressBarAmount() == 0f) { Fail($"Прогресс не идёт, а должен."); } yield return(Commands.WaitWorkbenchSawmillProgressCompleteCommand(new ResultData <WaitItemResult>())); if (new IconEmptyChecker(Context, Screens.Inventory.Cell.WorkbenchResult, 0).Check() == true) { Fail($"Result ячейка станка пустая, хотя не должна быть."); } }
public static void Initialize() { ConsoleHelper.Show(); Assembly.LoadFile(Directory.GetCurrentDirectory() + @"\AutoLoader\0Harmony.dll"); try { Cheats.Init(); Console.WriteLine("[RubySpook] Cheats Initialized!"); } catch (Exception e) { Console.WriteLine("Failed to Init Cheats!\n" + e); } try { SpeechWriter.Init(); Console.WriteLine("[RubySpook] Speech Writer Initialized!"); } catch (Exception e) { Console.WriteLine("Failed to Init Speech Writer!\n" + e); } try { MegaLobby.Init(); Console.WriteLine("[RubySpook] Mega Lobby Initialized!"); } catch (Exception e) { Console.WriteLine("Failed to Init Mega Lobby!\n" + e); } }
public void SetButtonBox(Button button, int itemNum) { ResetButton(); var textItemCount = new TextBox(); textItemCount.Text = itemCounts[itemNum].ToString(); textItemCount.SelectionStart = textItemCount.Text.Length; var comboItemType = new ComboBox(); comboItemType.Padding = new Thickness(0D); comboItemType.ItemsSource = Items.ItemNames; var selItem = itemTypes[itemNum * 2]; comboItemType.SelectedIndex = selItem > 68 ? 0 : selItem + 1; comboItemType.Width = 140; StackPanel buttonPanel = new StackPanel() { Orientation = Orientation.Horizontal }; buttonPanel.Children.Add(comboItemType); buttonPanel.Children.Add(textItemCount); buttonPanel.KeyDown += (o, eventArgs) => { switch (eventArgs.Key) { case Key.Enter: var newCount = byte.Parse(textItemCount.Text); var newItem = comboItemType.SelectedIndex - 1; if (newItem != -1 && newCount > 0) { Cheats.WriteItem(itemNum, newItem, newCount); } else { Cheats.WriteItem(itemNum, -1, 0); } ResetButton(); Refresh(); break; case Key.Escape: ResetButton(); break; default: break; } }; button.Content = buttonPanel; editingButton = button; editingItem = itemNum; }
protected override IEnumerator OnRun() { int currentIndex = 0; StringParam currentInventoryId = Screens.Inventory.Cell.Pockets; int nextIndex = currentIndex + 1; StringParam nextInventoryId = Screens.Inventory.Cell.Pockets; var itemCell = Context.Inventory.GetCells(currentInventoryId.Item).GetCell(currentIndex); var itemIconName = Context.GetCellIconName(itemCell); List <int> failedSlots = new List <int>(); for (int i = 0; i < 24; i++) { // Context.SendDebugLog($"текущий слот {currentIndex} и инв: {currentInventoryId.Item}"); // Context.SendDebugLog($"след слот {nextIndex} и инв: {nextInventoryId.Item}"); yield return(Commands.DragAndDropCommand(currentInventoryId, currentIndex, nextInventoryId, nextIndex, new ResultData <SimpleCommandResult>())); yield return(Context.WaitEndFrame); var nextCell = Context.Inventory.GetCells(nextInventoryId.Item).GetCell(nextIndex); var nextIconName = Context.GetCellIconName(nextCell); if (nextIconName == itemIconName && !Cheats.IconIsEmpty(nextCell)) { } else { failedSlots.Add(nextIndex); if (nextIndex >= 10 && nextInventoryId == Screens.Inventory.Cell.Pockets) { nextInventoryId = Screens.Inventory.Cell.Backpack; } } currentIndex++; if (currentIndex >= 10 && currentInventoryId == Screens.Inventory.Cell.Pockets) { currentInventoryId = Screens.Inventory.Cell.Backpack; } nextIndex++; if (nextIndex >= 10 && nextInventoryId == Screens.Inventory.Cell.Pockets) { nextInventoryId = Screens.Inventory.Cell.Backpack; } } if (failedSlots.Count > 0) { string text = "["; for (int i = 0; i < failedSlots.Count; i++) { text += $"{i},"; } text = text.Substring(0, text.Length - 2); text += "]"; Fail($"Слоты {text} не работают как надо, не удалось поместить в них предмет."); } }
private void OnRenderFrame() { Renderer.BeginFrame(); SetupViewportAndProjectionMatrix(); World.RenderAll(); Cheats.RenderDebugInfo(); Renderer.EndFrame(); }
protected override IEnumerator OnRun() { Cheats.GetWood(1); yield return(Commands.DragAndDropCommand(Screens.Inventory.Cell.Pockets, 4, Screens.Inventory.Cell.WorkbenchRow, 0, new ResultData <SimpleCommandResult>())); yield break; }
private void spawnPlayer() { Debug.Log("Spawning player"); Vertex spawnPoint; do // Don't spawn the player on portals. Warning: infinite loop if there are only 1-2 cells { spawnPoint = masterDt.vertices[mt.Next(masterDt.vertices.Count - 1)]; } while (spawnPoint.cell.hasPortal); SpawnPoint spawner = GameObject.FindGameObjectWithTag("Spawn Point").GetComponent <SpawnPoint>(); spawner.transform.position = spawnPoint.toVector3AtHeight(currentDungeonType.wallHeight * 0.8f); player = spawner.spawnPlayer(); // Attach any other stuff to player here Cheats cheater = GameObject.FindObjectOfType <Cheats>(); cheater.player = player; cheater.playerMovement = player.GetComponentInChildren <PlayerMovement>(); InGameMenu menu = GameObject.FindObjectOfType <InGameMenu>(); menu.player = player; // Set up HUD GameObject hud = GameObject.Find("HUD"); hud.GetComponent <Canvas>().enabled = true; HUD hudScript = hud.GetComponentInChildren <HUD>(); hudScript.escapeHatch = GameObject.Find("Escape Point").transform; hudScript.playerTransform = player.transform; // Enable firing script (disabled in hub) PlayerShoot shootScript = player.GetComponentInChildren <PlayerShoot>(); shootScript.enabled = true; if (StateManager.startedFromDungeon) { // Give player weapons when starting in dungeon, since that implies it's a dev starting in the editor Debug.Log("Looks like you launched this scene directly from the editor. Here's some free stuff..."); StateManager.cashOnHand = debugCash; Inventory playerInventory = GameObject.FindGameObjectWithTag("Player Inventory").GetComponentInChildren <Inventory>(); foreach (GameObject weapon in debugWeapons) { GameObject realWeapon = Instantiate(weapon); playerInventory.addWeapon(realWeapon); } } // Enable temporary player invincibility on spawn StartCoroutine(player.GetComponentInChildren <PlayerHealth>().enableIframes(5f)); }
private void applyCheatButton_Click(object sender, EventArgs e) { if (Cheats.ApplyCheatCode(cheatTextBox.Text)) { this.Dispose(); } else { invalidErrorLabel.Visible = true; } }
public void loadMenu() { if (OnBackButtonClick != null) { OnBackButtonClick(); } Utility.ShowLoadScreen(); Application.LoadLevel((int)GlobalVars.Scenes.Crafting); //CHEAT Cheats.IncreaseAllElements(); }
void Awake() { loadHelenaData(); introStart(); Cheats.cheatItems(); //WorldControl.PortraitIDLayer0 = 3000; Quest AbbadonQuest1 = new Quest(); Quest AlbaQuest1 = new Quest(); QuestsController.createQuest(AbbadonQuest1, "Meeting the elite: Abbadon.", "Following your head maid advice, you decide to meet one of the lords of one of the most important houses in the city, Abbadon's House.", 14, 1000); QuestsController.createQuest(AlbaQuest1, "Meeting the elite: Alba", "You'll have to face one of leaders of one of the most important houses in Aurorum, and get them to support you cause", 59, 13000); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public static bool StartPlasticSurgeryCAS(Sim sim, Hospital.SurgeryTypes type) { CASChangeReporter.Instance.ClearChanges(); SimDescription simDescription = sim.SimDescription; if (simDescription == null) { throw new Exception("EditSimInCAS: sim doesn't have a description!"); } switch (sim.CurrentOutfitCategory) { case OutfitCategories.Everyday: case OutfitCategories.Formalwear: case OutfitCategories.Sleepwear: case OutfitCategories.Swimwear: case OutfitCategories.Athletic: break; default: SimpleMessageDialog.Show(Cheats.LocalizeString("EditSimInCAS", new object[0x0]), Cheats.LocalizeString("CommonOutfitCategoryRequired", new object[0x0]), ModalDialog.PauseMode.PauseSimulator); return(false); } switch (type) { case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap: case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive: new Sims.Advanced.SurgeryFace().Perform(new GameHitParameters <GameObject>(sim, sim, GameObjectHit.NoHit)); break; case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap: case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive: new Sims.Advanced.SurgeryBody().Perform(new GameHitParameters <GameObject>(sim, sim, GameObjectHit.NoHit)); break; default: throw new Exception("PlasticSurgery: Option not defined!"); } while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode) { SpeedTrap.Sleep(); } bool flag = !CASChangeReporter.Instance.CasCancelled; CASChangeReporter.Instance.ClearChanges(); return(flag); }
protected override IEnumerator OnRun() { int treeIndex = 1; var trees = Cheats.FindTree(); yield return(Commands.PlayerMoveCommand(trees[treeIndex].transform.position, new ResultData <PlayerMoveResult>())); yield return(Commands.WaitForSecondsCommand(1, new ResultData <SimpleCommandResult>())); if (new UseTargetChecker(Context, trees[treeIndex].transform.position).Check() == false) { Fail($"Объект {trees[treeIndex].name} не в фокусе, хотя должен быть."); } }
void Update() { //Menu Toggle if (Input.GetKeyDown(KeyCode.Insert)) { _menuVisible = !_menuVisible; } //Stuff Cheats.SetAllowed(_enableCheats); Cheats.DebugConsole = _debugConsole; Cheats.GodMode = _godMode; Cheats.InfiniteEnergy = _infiniteEnergy; }
public void Update() { if (!Application.isPlaying) { return; } if (Input.GetKey(KeyCode.LeftShift)) { if (Input.GetKeyDown(KeyCode.Alpha0)) { SetCh(0); } else if (Input.GetKeyDown(KeyCode.Alpha1)) { SetCh(1); } else if (Input.GetKeyDown(KeyCode.Alpha2)) { SetCh(2); } else if (Input.GetKeyDown(KeyCode.Alpha3)) { SetCh(3); } else if (Input.GetKeyDown(KeyCode.Alpha4)) { SetCh(4); } else if (Input.GetKeyDown(KeyCode.Alpha5)) { SetCh(5); } else if (Input.GetKeyDown(KeyCode.Alpha6)) { SetCh(6); } if (Input.GetKeyDown(KeyCode.K)) { Cheats.HitPlayer(); } if (Input.GetKeyDown(KeyCode.R)) { Cheats.ResetTilLastCheckpoint(); } } }
private void PopulateCheats() { int randomMarker1 = 0, randomMarker2 = 0; cheatsToKick = new List <Cheats[]>(); for (int i = 0; i < 3; i++) { Cheats[] cheatSequence = new Cheats[3 + (i * 2)]; for (int j = 0; j < 3 + (i * 2); j++) { cheatSequence[j] = new CheatCodeSequence(); } cheatsToKick.Add(cheatSequence); } randomMarker1 = Random.Range(0, 3); cheatsToKick[0][randomMarker1] = new CheatCodeHold(); randomMarker1 = Random.Range(0, 5); cheatsToKick[1][randomMarker1] = new CheatCodeMany(); randomMarker1 = Random.Range(0, 7); do { randomMarker2 = Random.Range(0, 7); } while (randomMarker1 == randomMarker2); cheatsToKick[2][randomMarker1] = new CheatCodeHold(); cheatsToKick[2][randomMarker2] = new CheatCodeMany(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3 + (i * 2); j++) { Cheats cheat = cheatsToKick[i][j]; if (cheat.Type != Cheats.CheatType.Sequence) { cheat.CreateCheat(); } else { cheat.CreateCheat(3 + (i * 2)); } } } }
public override void UpdateGameplay(float elapsedTime) { MusicManager.play(MusicManager.ShipMusic); AquaticPhysics.Instance.DynamicsWorld.StepSimulation(GameModel.GlobalElapsedTime); Cheats.ApplyCheats(this.GameState.character); this.GameState.character.UpdateStats(new Stats(elapsedTime * this.GameState.character.MaxStats.Oxygen / 3, 0)); inventoryScene.Update(elapsedTime); craftingScene.Update(elapsedTime); selectableThings.ForEach(TellIfCameraIsLookingAtThing); GameState.character.Update(Camera); dialogBox.Update(elapsedTime); ShaderRepository.ShipAmbientShader.SetValue("time", elapsedTime); }