// load the combat scene // combatType is an int value that corresponds to a value in the CombatTypeEnum public static void LoadCombatScene(int combatType) { var combatTypeEnum = (SceneTypeEnum)combatType; SceneManager.LoadScene(COMBAT_SCENE_NAME); ProgressTracker.GetTracker().CurCombatType = combatTypeEnum; }
// Start is called before the first frame update // update the player's progress on the HomeScene void Start() { var tracker = ProgressTracker.GetTracker(); weekTxtObj.text = $"Week {tracker.WeekNum} / {ProgressTracker.finalWeekNum}"; moneyTxtObj.text = ItemTracker.GetTracker().Money.ToString(); if (tracker.ProductionMode) { if (tracker.WeekNum > 2) { return; } foreach (Button panel in panels) { if (tracker.WeekNum == 1) { if (panel.name == "GoToClassPanel") { continue; } } else if (tracker.WeekNum == 2) { if (panel.name == "GoToClassPanel" || panel.name == "ExtraStudyPanel" || panel.name == "BCITStorePanel") { continue; } } panel.interactable = false; } } }
// get the rewards for winning then move to the next scene // increment the week // if it's the final week and they pass, display an end scene public void GetWinRewards() { EventController controller = GameObject.Find("EventController").GetComponent <EventController>(); Wave wave = controller.weekData.weeks.Find(x => x.weekNum == controller.weekNum).waves[controller.waveNum]; foreach (Character player in controller.players) { player.exp += wave.exp; player.LevelUp(); } int money = wave.coins; UpdateProgress(money); List <CharStats> statsList = new List <CharStats>(); //Update the player's level foreach (Character player in controller.players) { CharStats stats = new CharStats(); stats.level = player.level; stats.exp = player.exp; stats.id = player.id; statsList.Add(stats); } ProgressTracker.GetTracker().charStats = statsList; if (controller.waveNum != controller.weekData.weeks.Find(x => x.weekNum == controller.weekNum).waves.Count - 1) { controller.ClearSpawners(); controller.waveNum++; controller.StartWave(); Object.Destroy(gameObject); } else { // see if we need to progress to next week var tracker = ProgressTracker.GetTracker(); if (tracker.CurCombatType == SceneTypeEnum.WEEKLY_COMBAT) { int curWeek = tracker.WeekNum; if (curWeek == ProgressTracker.finalWeekNum) { SceneLoader.LoadEndScene(); return; } else { tracker.NextWeek(); } } SceneLoader.LoadHomeScene(); } }
public void Start() { if (ProgressTracker.GetTracker().ProductionMode) { DialogueData dialogueData = GetDialogues(); DisplayDialogue(dialogueData.onStartDialogue); // hide the choice menu so player can play while dialogue is open choiceMenu.SetActive(false); } }
public void Start() { if (ProgressTracker.GetTracker().WeekNum == weekAlreadyDisplayed) { return; } if (ProgressTracker.GetTracker().WeekNum > 2) { return; } DialogueData dialogueData = GetDialogues(); DisplayDialogue(dialogueData.onStartDialogue); weekAlreadyDisplayed = ProgressTracker.GetTracker().WeekNum; }
// Start is called before the first frame update public void Start() { weekData = JsonUtility.FromJson <WeekDatabase>(weekJson.text); skillManager = GetComponent <SkillManager>(); ItemManager = GetComponent <ItemManager>(); weekNum = ProgressTracker.GetTracker().WeekNum; wavesInWeek = weekData.weeks.Find(x => x.weekNum == weekNum).waves.Count; foreach (Character player in players) { if (weekNum > 1) { CharStats stats = ProgressTracker.GetTracker().charStats.FirstOrDefault(x => player.id == x.id); player.exp = stats.exp; player.LevelUp(stats.level); } } StartWave(); clearDescription(); }
private DialogueData GetDialogues() { string jsonName = $"StoryDialogues/{ProgressTracker.GetTracker().StorylinePhase}"; return(base.GetDialogues(jsonName)); }
private DialogueData GetDialogues() { int weekNum = ProgressTracker.GetTracker().WeekNum; return(base.GetDialogues("WeeklyDialogues/WeeklyCombat_wk" + weekNum)); }
private DialogueData GetDialogues() { string jsonName = $"HomeSceneDialogues/Home_wk{ProgressTracker.GetTracker().WeekNum}"; return(base.GetDialogues(jsonName)); }