public void EndQuest(GameObject player, string questName) { if (ActiveQuest != null) { trace("Ending quest {0}", questName); if (ActiveQuest.Definition.Prototyped) { dispatcher.DispatchEvent(new RewardServiceEvents.MyRewardEarned(RewardSource.QUEST_COMPLETED, "", ActiveQuest.Definition.CompleteReward.ToReward())); } if (ActiveQuest.TimesCompleted > 0) { new ShowRewardPopup.Builder(DRewardPopup.RewardPopupType.replay, new Reward()).setMascotName(ActiveQuest.Mascot.Definition.name).Build().Execute(); } pendingQuest = null; pendingQuestStart = false; pendingQuestReplay = false; Service.Get <ICPSwrveService>().EndTimer("questtime"); dispatcher.DispatchEvent(new QuestEvents.QuestCompleted(ActiveQuest)); MascotDefinition definition = ActiveQuest.Mascot.Definition; EventManager.Instance.PostEvent("MIX/MusicWorldOff", EventAction.PlaySound, null); lastEndScreenMusicPlayed = (string.IsNullOrEmpty(ActiveQuest.Definition.RewardPopupMusicOverride) ? definition.QuestEndMusic : ActiveQuest.Definition.RewardPopupMusicOverride); EventManager.Instance.PostEvent(lastEndScreenMusicPlayed, EventAction.PlaySound, null); deactivateQuest(Quest.QuestState.Completed); disableUI(); } }
public MascotService(Manifest manifest) { ScriptableObject[] assets = manifest.Assets; foreach (ScriptableObject scriptableObject in assets) { MascotDefinition mascotDefinition = (MascotDefinition)scriptableObject; mascots[mascotDefinition.name] = new Mascot(mascotDefinition); } Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionEndedEvent>(onSessionEnded); Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionTerminatedEvent>(onSessionTerminated); Service.Get <EventDispatcher>().AddListener <SceneTransitionEvents.TransitionStart>(onTransitionStart); }
public Mascot(MascotDefinition definition) { Definition = definition; InteractionBehaviours.Reset(); }