using System.Collections; using System.Collections.Generic; using Beyond; using ES3Types; using Invector.vCharacterController; using Invector.vMelee; using PixelCrushers; using UnityEngine; using UnityEngine.SceneManagement; using PixelCrushers.QuestMachine; using UnityEditor; using System.ComponentModel; public partial class SROptions { private const int VERSION = 1988; private bool m_fastRunning = false; private bool m_damageBooster; private bool m_immortal = false; private Quest m_currentQuest; [Category("Build")] public string Version { get { //return PlayerSettings.iOS.buildNumber; var bv = Resources.Load("Build"); return bv.version; } } [Category("Scenes")] [field: Range(0, 10)] public int SceneToLoad { get; set; } = 0; [Category("Scenes")] // Options will be grouped by category public void LoadSeleced() { //SaveSystem.LoadScene($"index:{SceneToLoad}"); ProxySceneLoader.LoadScene($"index:{SceneToLoad}"); } [Category("Quests Controll")] public string QuestIdToActive { get; set; } [Category("Locomotion")] public bool FastRunning { get { return m_fastRunning; } set { m_fastRunning = value; var tp = Player.Instance.GetComponent(); if (tp) tp.freeSpeed.runningSpeed = value ? 10f : 1f; } } [Category("Locomotion")] public void Spawn1() { SpawnTelepoerter.Instance.SpawnToPoint(0); } [Category("Locomotion")] public void Spawn2() { SpawnTelepoerter.Instance.SpawnToPoint(1); } [Category("Locomotion")] public void Spawn3() { SpawnTelepoerter.Instance.SpawnToPoint(2); } [Category("Locomotion")] public void SetNormalSpeed() { var tp = Player.Instance.GetComponent(); if (tp) { tp.speedMultiplier = 1f; tp.freeSpeed.movementSmooth = 6f; tp.freeSpeed.animationSmooth = 0.2f; tp.freeSpeed.rotationSpeed = 4; tp.freeSpeed.walkSpeed = 1f; tp.freeSpeed.runningSpeed = 1f; tp.freeSpeed.sprintSpeed = 2f; tp.freeSpeed.crouchSpeed = 2f; } } [Category("Locomotion")] public void SetHightSpeed() { var tp = Player.Instance.GetComponent(); if (tp) { tp.speedMultiplier = 1.1f; tp.freeSpeed.movementSmooth = 10f; tp.freeSpeed.animationSmooth = 0.12f; tp.freeSpeed.rotationSpeed = 9; tp.freeSpeed.walkSpeed = 1.1f; tp.freeSpeed.runningSpeed = 1.2f; tp.freeSpeed.sprintSpeed = 2.5f; tp.freeSpeed.crouchSpeed = 2.5f; } } [Category("Locomotion")] public void SetVHightSpeed() { var tp = Player.Instance.GetComponent(); if (tp) { tp.speedMultiplier = 1.2f; tp.freeSpeed.movementSmooth = 15f; tp.freeSpeed.animationSmooth = 0.08f; tp.freeSpeed.rotationSpeed = 12; tp.freeSpeed.walkSpeed = 1.3f; tp.freeSpeed.runningSpeed = 1.4f; tp.freeSpeed.sprintSpeed = 3f; tp.freeSpeed.crouchSpeed = 3f; } } [Category("Combat")] public bool DamageBooster { get { return m_damageBooster; } set { m_damageBooster = value; var mm = Player.Instance.GetComponent(); if (mm) { mm.rightWeapon.damageModifier = value ? 100 : 0; } } } [Category("Combat")] public bool Immortal { get { return m_immortal; } set { m_immortal = value; Player.Instance.ThirdPersonController.GodMode = value; } } [Category("Save")] public void SaveGame() { SaveSystem.SaveToSlot(6); } [Category("Save")] public void LoadGame() { SaveSystem.LoadFromSlot(6); } [Category("Save")] public void LoadLastCheckpoint() { SaveUtility.Instance.LoadCheckpoint(); } [Category("Save")] public void SaveLastCheckpoint() { SaveUtility.Instance.SaveCheckpoint(); } [Category("Save")] public void ClearLastCheckpoint() { SaveUtility.Instance.ClearCheckpoint(); } [Category("Quests Controll")] public void ActiveQuest() { m_currentQuest = QuestMachine.GiveQuestToQuester(QuestIdToActive, "Bascileus"); } [Category("Quests Controll")] public void CompleteQuestPart() { var journal = QuestMachine.GetQuestJournal(); if (!m_currentQuest || m_currentQuest.GetState() == QuestState.Successful) { for (int i = 0; i < journal.questList.Count; i++) { var quest = journal.questList[i]; if (!quest.isTrackable || quest.GetState() == QuestState.Successful) { continue; } m_currentQuest = quest; break; } } for (int i = 0; i < m_currentQuest.nodeList.Count; i++) { if (m_currentQuest.nodeList[i].GetState() == QuestNodeState.True) { continue; } if (m_currentQuest.nodeList[i].GetState() == QuestNodeState.Active) { m_currentQuest.nodeList[i].SetState(QuestNodeState.True); break; } } } [Category("Items")] public int ItemId { get; set; } [Category("Items")] public int ItemAmount { get; set; } [Category("Items")] public void AddItem() { Player.Instance.ItemManager.AddItemsByID(ItemId, ItemAmount); } [Category("Skills")] public Skills skillToLevelUp { get; set; } [Category("Skills")] public void LvlUpSkill() { SkillsManager.instance.LevelUpSkill(skillToLevelUp); } [Category("Guilts")] public void OpenScrollOfAccusation() { var m_mainMenuController = Player.Instance.transform.parent.GetComponentInChildren(); if (m_mainMenuController == null) { Debug.LogError("There is no MainMenuController on Scene"); return; } m_mainMenuController.OpenJudgementMenu(); } [Category("Guilts")] public string GuiltId { set; get; } [Category("Guilts")] public void ActiveGuilt() { QuestMachine.GiveQuestToQuester(GuiltId, "Bascileus"); } }