public static string Execute(params string[] args) { PlayerEnterExit playerEnterExit = GameManager.Instance.PlayerEnterExit;//GameObject.FindObjectOfType<PlayerEnterExit>(); if (playerEnterExit == null || !playerEnterExit.IsPlayerInside) { Console.Log(HelpCommand.Execute(TransitionToExterior.name)); return(error); } else { try { if (playerEnterExit.IsPlayerInsideDungeon) { playerEnterExit.TransitionDungeonExterior(); } else { playerEnterExit.TransitionExterior(); } return("Transitioning to exterior"); } catch { return("Error on transitioning"); } } }
static void ShitFaced() { int stats = playerEntity.Stats.LiveLuck + playerEntity.Stats.LivePersonality; int roll = Random.Range(0, 200) - stats; int playerGold = Mathf.Max(playerEntity.GoldPieces, 4); int goldPenalty = Random.Range(2, playerGold); if (roll < 1) { DaggerfallUI.AddHUDText("You are very drunk..."); } else { drunk = 0; Sleep.sleepyCounter = 0; Sleep.wakeOrSleepTime = DaggerfallUnity.Instance.WorldTime.DaggerfallDateTime.ToClassicDaggerfallTime(); DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); if (playerGold < 5) { PassTime(Random.Range(30000, 110000)); if (playerEnterExit.IsPlayerInside) { playerEnterExit.TransitionExterior(); } RandomLocation(); } else { playerEntity.GoldPieces -= (Mathf.Max(playerGold / goldPenalty, 1)); DrunkBed(); PassTime(Random.Range(50000, 160000)); if (goldPenalty > 1) { DaggerfallUI.AddHUDText("Your gold pouch seems lighter..."); } } Sleep.sleepyCounter = 0; Sleep.wakeOrSleepTime = DaggerfallUnity.Instance.WorldTime.DaggerfallDateTime.ToClassicDaggerfallTime(); DaggerfallUI.MessageBox("What happened last night...?."); playerEntity.CurrentHealth = playerEntity.MaxHealth; playerEntity.CurrentFatigue = playerEntity.MaxFatigue / 3; DaggerfallUI.Instance.FadeBehaviour.FadeHUDFromBlack(); } }
private void YesButton_OnMouseClick(BaseScreenComponent sender, Vector2 position) { DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); // Teleport to destination. PlayerEnterExit playerEnterExit = GameManager.Instance.PlayerEnterExit; if (playerEnterExit.IsPlayerInside) { playerEnterExit.TransitionExterior(); } GameManager.Instance.StreamingWorld.TeleportToCoordinates((int)destinationPos.X, (int)destinationPos.Y, StreamingWorld.RepositionMethods.RandomStartMarker); // Close windows. DaggerfallUI.Instance.UserInterfaceManager.PopWindow(); travelWindow.CloseTravelWindows(); CloseWindow(); DaggerfallUI.Instance.FadeBehaviour.FadeHUDFromBlack(); }
private static void FullMoon_OnNewMagicRound() { if (!DaggerfallUnity.Instance.IsReady || !playerEnterExit || GameManager.IsGamePaused || DaggerfallUI.Instance.FadeBehaviour.FadeInProgress) { return; } if (GameManager.Instance.PlayerEffectManager.HasLycanthropy() && !playerEntity.IsResting) { if (!IsWearingHircineRing() || beastWithRing) { if (fullMoon) { ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); if (Dice100.SuccessRoll(playerEntity.Stats.LiveLuck)) { playerEntity.PreventEnemySpawns = true; } int timeRaised = 109000 + UnityEngine.Random.Range(10, 400); timeNow.RaiseTime(timeRaised); if (playerEnterExit.IsPlayerInsideDungeon) { DungeonMoon(); } else { if (playerEnterExit.IsPlayerInside) { playerEnterExit.TransitionExterior(); } RandomLocation(); } if (Dice100.SuccessRoll(playerEntity.Stats.LiveLuck)) { playerEntity.PreventEnemySpawns = true; } } if (timeNow.SecundaLunarPhase == LunarPhases.Full || timeNow.MassarLunarPhase == LunarPhases.Full) { if (!fullWarning) { DaggerfallUI.MessageBox("The moon calls to you. You are unable to resist its pull."); ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); fullWarning = true; } else if (GameManager.Instance.PlayerEffectManager.HasLycanthropy() && !fullMoon) { GameManager.Instance.TransportManager.TransportMode = TransportModes.Foot; DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); fullMoon = true; } else { fullMoon = false; } } else { fullMoon = false; fullWarning = false; beastWithRing = false; } if (killAll && !GameManager.IsGamePaused) { DaggerfallUI.Instance.FadeBehaviour.FadeHUDFromBlack(); killAll = false; KillAll(); } } else { if (timeNow.SecundaLunarPhase == LunarPhases.Full || timeNow.MassarLunarPhase == LunarPhases.Full) { if (!fullWarning) { DaggerfallUI.MessageBox("The moon calls to you, but the Hircine Ring protects you. As long as you stay in your human shape."); ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); fullWarning = true; } else if (playerEntity.IsInBeastForm) { beastWithRing = true; } } else { fullMoon = false; fullWarning = false; beastWithRing = false; } } } }
private static void FullMoon_OnNewMagicRound() { if (GameManager.Instance.PlayerEffectManager.HasLycanthropy()) { if (!IsWearingHircineRing() || beastWithRing) { if (fullMoon) { ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); int timeRaised = 109000 + UnityEngine.Random.Range(10, 400); timeNow.RaiseTime(timeRaised); if (playerEnterExit.IsPlayerInside) { playerEnterExit.TransitionExterior(); } RandomLocation(); int roll = UnityEngine.Random.Range(-50, 101); if (roll < playerEntity.Stats.LiveLuck) { playerEntity.PreventEnemySpawns = true; } } if (timeNow.SecundaLunarPhase == LunarPhases.Full || timeNow.MassarLunarPhase == LunarPhases.Full) { if (!fullWarning) { DaggerfallUI.MessageBox("The moon calls to you. You can feel the change is about to happen."); ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); fullWarning = true; } else if (GameManager.Instance.PlayerEffectManager.HasLycanthropy() && !fullMoon) { GameManager.Instance.TransportManager.TransportMode = TransportModes.Foot; DaggerfallUI.Instance.FadeBehaviour.SmashHUDToBlack(); fullMoon = true; DropAllItems(); } else { fullMoon = false; } } else { fullMoon = false; fullWarning = false; beastWithRing = false; } if (killAll && !GameManager.IsGamePaused) { DaggerfallUI.Instance.FadeBehaviour.FadeHUDFromBlack(); killAll = false; KillAll(); } } else { if (timeNow.SecundaLunarPhase == LunarPhases.Full || timeNow.MassarLunarPhase == LunarPhases.Full) { if (!fullWarning) { DaggerfallUI.MessageBox("The moon calls to you. The Hircine Ring protects you, as long as you stay in your human shape."); ModManager.Instance.SendModMessage("TravelOptions", "pauseTravel"); fullWarning = true; } else if (playerEntity.IsInBeastForm) { beastWithRing = true; } } else { fullMoon = false; fullWarning = false; beastWithRing = false; } } } }