private void OutrunFailure() { logScreen.AddMessage("Attempting to run only angered the Space Pirates!"); int rndNumber = GetRandomNumber(1, 100); if (rndNumber >= 70) { logScreen.AddMessage("The Space Pirates attack and damaged the hull!"); cameraShaker.RumpShaker(.3f); gameManager.SetHullPercent(gameManager.GetHullPercent() - GetRandomNumber(5, 15)); } else if (rndNumber >= 50) { logScreen.AddMessage("The Space Pirates attack and damaged the engines!"); cameraShaker.RumpShaker(.3f); gameManager.SetEnginePercent(gameManager.GetEnginePercent() - GetRandomNumber(5, 15)); } else if (rndNumber >= 30) { logScreen.AddMessage("The Space Pirates attack and damaged both the hull and the engines!"); cameraShaker.RumpShaker(.5f); gameManager.SetHullPercent(gameManager.GetHullPercent() - GetRandomNumber(5, 15)); gameManager.SetEnginePercent(gameManager.GetEnginePercent() - GetRandomNumber(5, 15)); } playerShip.ChangeSprite(false, false); gameManager.SetFuel(gameManager.GetFuel() - 5); gameManager.CheckForFuel(); }
private void Refueling() { doFuel = false; fuelAndRepairCooldown = fuelAndRepairCooldownReset; stage++; switch (stage) { case 1: logScreen.AddMessage("Sensors indicate the fuel ship is approaching."); doFuel = true; break; case 2: cameraShaker.RumpShaker(.3f); logScreen.AddMessage("Fuel ship has connected and is commencing with the refuling."); doFuel = true; break; case 3: logScreen.AddMessage("Fuel ship has completed the refueling and has disconnected."); SetFuel(100); stage = 0; contactDispatchButton.enabled = true; break; } }