public void ResetGame() { Camera.main.transform.position = SavedCameraPos; Camera.main.orthographicSize = SavedCameraZoom; sound.stopBGM(); //Deactivate uneeded gameobjects and activate needed gameobjects isGameFinished = false; TitleScreen.SetActive(false); MainGameObjs.SetActive(true); // Initial values to restart game startingTime = Time.time; heartCount = kHeartCount; // Reset texture for (int i = 0; i < 3; i++) { GameHearts [i].GetComponent <Image>().sprite = heartSprite; } // Reset rules system, since it is static but stateful RulesSystem.Initialize(); // Reset body as well body.Reset(); HeartScript.StartHeart(); }
public void applyCure(ToolBox.Tool tool, BodyPartType part) { // Skip if no tool set if (tool == ToolBox.Tool.None) { return; } // Test out the rule system bool fixesColor = false; bool success = RulesSystem.EvaluateCure(bodyParts, tool, part, bodyColor, ref heartbeat, out fixesColor); // Did color get fixed? if (fixesColor) { bodyColor = BodyPartColor.White; SetupColor(); } // Tell game controller if we did this wrong if (!success) { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController"); GameController gameController = gameControllerObject.GetComponent(typeof(GameController)) as GameController; gameController.FailedCureAttempt(); painLevel = BodyPainLevel.Worse; lastOuch = Time.time; } sound.playBodyEffect(tool, success); }
void LoadOptions() { try { RollHP = CoreSettings.LoadBoolValue("RollHP", false); UseCore = CoreSettings.LoadBoolValue("UseCore", true); UseAPG = CoreSettings.LoadBoolValue("UseAPG", true); UseChronicles = CoreSettings.LoadBoolValue("UseChronicles", true); UseModules = CoreSettings.LoadBoolValue("UseModules", true); UseUltimateMagic = CoreSettings.LoadBoolValue("UseUltimateMagic", true); UseUltimateCombat = CoreSettings.LoadBoolValue("UseUltimateCombat", true); UseOther = CoreSettings.LoadBoolValue("UseOther", true); ConfirmCharacterDelete = CoreSettings.LoadBoolValue("ConfirmCharacterDelete", false); ConfirmInitiativeRoll = CoreSettings.LoadBoolValue("ConfirmInitiativeRoll", false); ConfirmClose = CoreSettings.LoadBoolValue("ConfirmClose", false); ShowAllDamageDice = CoreSettings.LoadBoolValue("ShowAllDamageDice", false); PlayerMiniMode = CoreSettings.LoadBoolValue("PlayerMiniMode", false); MonsterMiniMode = CoreSettings.LoadBoolValue("MonsterMiniMode", false); MainWindowWidth = CoreSettings.LoadIntValue("MainWindowWidth", -1); MainWindowHeight = CoreSettings.LoadIntValue("MainWindowHeight", -1); MainWindowLeft = CoreSettings.LoadIntValue("MainWindowLeft", int.MinValue); MainWindowTop = CoreSettings.LoadIntValue("MainWindowTop", int.MinValue); SelectedTab = CoreSettings.LoadIntValue("SelectedTab", 0); AlternateInitRoll = CoreSettings.LoadStringValue("AlternateInitRoll", "3d6"); AlternateInit3d6 = CoreSettings.LoadBoolValue("AlternateInit3d6", false); InitiativeShowPlayers = CoreSettings.LoadBoolValue("InitiativeShowPlayers", true); InitiativeShowMonsters = CoreSettings.LoadBoolValue("InitiativeShowMonsters", true); InitiativeHideMonsterNames = CoreSettings.LoadBoolValue("InitiativeHideMonsterNames", false); InitiativeHidePlayerNames = CoreSettings.LoadBoolValue("InitiativeHidePlayerNames", false); InitiativeShowConditions = CoreSettings.LoadBoolValue("InitiativeShowConditions", false); InitiativeConditionsSize = CoreSettings.LoadIntValue("InitiativeConditionsSize", 2); InitiativeAlwaysOnTop = CoreSettings.LoadBoolValue("InitiativeAlwaysOnTop", false); InitiativeScale = CoreSettings.LoadDoubleValue("InitiativeScale", 1.0); InitiativeFlip = CoreSettings.LoadBoolValue("InitiativeFlip", false); RunCombatViewService = CoreSettings.LoadBoolValue("RunCombatViewService", false); ShowHiddenInitValue = CoreSettings.LoadBoolValue("ShowHiddenInitValue", false); AddMonstersHidden = CoreSettings.LoadBoolValue("AddMonstersHidden", false); StatsOpenByDefault = CoreSettings.LoadBoolValue("StatsOpenByDefault", false); CheckForUpdates = CoreSettings.LoadBoolValue("CheckForUpdates", true); DefaultHPMode = (Character.HPMode)CoreSettings.LoadIntValue("DefaultHPMode", 0); MonsterDBFilter = (MonsterSetFilter)CoreSettings.LoadIntValue("MonsterDBFilter", (int)MonsterSetFilter.Monsters); MonsterTabFilter = (MonsterSetFilter)CoreSettings.LoadIntValue("MonsterTabFilter", (int)MonsterSetFilter.Monsters); ColorScheme = CoreSettings.LoadIntValue("ColorScheme", 0); DarkScheme = CoreSettings.LoadBoolValue("DarkScheme", false); RulesSystem = (RulesSystem)CoreSettings.LoadIntValue("RulesSystem", 0); RunLocalService = CoreSettings.LoadBoolValue("RunLocalService", false); RunWebService = CoreSettings.LoadBoolValue("RunWebService", true); LocalServicePort = (ushort)CoreSettings.LoadIntValue("LocalServicePort", LocalCombatManagerService.DefaultPort); LocalServicePasscode = CoreSettings.LoadStringValue("LocalServicePasscode", ""); optionsLoaded = true; } catch (System.Security.SecurityException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } }
private void NotifyMonsterSystem(RulesSystem system) { switch (system) { case RulesSystem.PF1: Notify("Monster"); Notify("Stats"); break; case RulesSystem.PF2: Notify("PF2Monster"); break; } }
public static string SystemName(RulesSystem system) { String text = ""; switch (system) { case RulesSystem.DD5: text = "Dungeons & Dragons 5th"; break; case RulesSystem.PF2: text = "Pathfinder 2.0"; break; case RulesSystem.PF1: default: text = "Pathfinder 1.0"; break; } return(text); }