//use the method when a trigger has been destroyed by user public void ClearDegradationTrigger(DegradTrigger trigger) { // DegradData degradData = DataManager.Instance.GameData.Degradation.DegradationTriggers.Find(x => x.ID == trigger.ID); DegradData degradData = degradationTriggers.Find(x => x.TriggerID == trigger.ID); // instantiate a stats item from the trigger, but only if it's not the tutorial bool bTut = TutorialManager.Instance && TutorialManager.Instance.IsTutorialActive(); if (bTut == false) { int nXP = DataLoaderXpRewards.GetXP("CleanTrigger", new Hashtable()); StatsManager.Instance.ChangeStats(xpDelta: nXP, xpPos: trigger.transform.position, is3DObject: true); } // DataManager.Instance.GameData.Degradation.DegradationTriggers.Remove(degradData); degradationTriggers.Remove(degradData); // subtract one from the triggers left to clean DataManager.Instance.GameData.Degradation.UncleanedTriggers -= 1; // if there are no degradation triggers left, send out a task completion message // note -- this will all probably have to change a bit as we get more complex (triggers in the yard, or other locations) if (degradationTriggers.Count == 0) { WellapadMissionController.Instance.TaskCompleted("CleanRoom"); AudioManager.Instance.LowerBackgroundVolume(0.1f); AudioManager.Instance.PlayClip("inhalerCapstone"); StartCoroutine(ResumeBackgroundMusic()); } }
//Reward player after the animation is done private void GiveReward() { // Reward XP int xp = DataLoaderXpRewards.GetXP("DailyInhaler", new Hashtable()); StatsManager.Instance.ChangeStats(xpDelta: xp, coinsDelta: starIncrement); // Reward shards int fireShardReward = 50; if (isFirstTimeAux) // First time tutorial gives you full crystal { fireShardReward = 100; } FireCrystalManager.Instance.RewardShards(fireShardReward); // Check for badge reward BadgeManager.Instance.CheckSeriesUnlockProgress(BadgeType.Inhaler, 1, false); BadgeManager.Instance.CheckSeriesUnlockProgress(BadgeType.Retention, DataManager.Instance.GameData.Inhaler.timesUsedInARow, true); }