public void OnGotoClick() { Mascot mascot = Service.Get <MascotService>().GetMascot(questData.Mascot.name); Service.Get <TutorialManager>().SetTutorial(mascot.Definition.QuestReminderTutorialId, isComplete: true); if (mascot == null) { return; } PlayerSpawnPositionManager component = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject.GetComponent <PlayerSpawnPositionManager>(); if (component != null) { SpawnedAction spawnedAction = new SpawnedAction(); spawnedAction.Quest = associatedQuest; if (replayQuest) { spawnedAction.Action = SpawnedAction.SPAWNED_ACTION.ReplayQuest; } else { spawnedAction.Action = SpawnedAction.SPAWNED_ACTION.StartQuest; } component.SpawnPlayer(new SpawnPlayerParams.SpawnPlayerParamsBuilder(mascot.Definition.SpawnPlayerNearMascotPosition).Zone(mascot.Definition.Zone).SpawnedAction(spawnedAction).Build()); } }
protected override void OnEnable() { if (!Owner.CompareTag("Player")) { return; } EventDispatcher eventDispatcher = Service.Get <EventDispatcher>(); MascotController componentInParent = ClubPenguin.SceneRefs.ActionSequencer.GetTrigger(Owner).GetComponentInParent <MascotController>(); Mascot mascot = componentInParent.Mascot; if (mascot.InteractionBehaviours.ZoomIn && Controller != null) { CinematographyEvents.CameraLogicChangeEvent evt = default(CinematographyEvents.CameraLogicChangeEvent); evt.Controller = Controller; eventDispatcher.DispatchEvent(evt); } if (mascot.InteractionBehaviours.LowerTray && TrayClosed) { GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Tray_Root); if (gameObject != null) { StateMachineContext component = gameObject.GetComponent <StateMachineContext>(); component.SendEvent(new ExternalEvent("Root", "minnpc")); } } if (MainNavDisabled) { eventDispatcher.DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: false)); eventDispatcher.DispatchEvent(new UIDisablerEvents.DisableUIElementGroup("MainNavButtons")); } if (mascot.InteractionBehaviours.SuppressQuestNotifier) { eventDispatcher.DispatchEvent(new HudEvents.SuppressQuestNotifier(suppress: true, autoShow: true)); } if (mascot.InteractionBehaviours.MoveToTalkSpot) { LocomoteToAction component2 = Owner.GetComponent <LocomoteToAction>(); if (component2 != null) { component2.IsEnabled = true; if (mascot.InteractionBehaviours.OverrideInteracteeTxform) { component2.Waypoints = new List <Transform>(1); component2.IsEnabled = true; Transform transform = new GameObject().transform; transform.position = mascot.InteractionBehaviours.DesiredInteracteeTxform.position; transform.rotation = mascot.InteractionBehaviours.DesiredInteracteeTxform.rotation; component2.Waypoints.Add(transform); } } } else { LocomoteToAction component2 = Owner.GetComponent <LocomoteToAction>(); if (component2 != null) { component2.IsEnabled = false; } } }
public byte GetItemTimeFlag(UInt32 TypeId, uint Day) { switch (GetItemGroup(TypeId)) { case TITEMGROUP.ITEM_TYPE_CADDIE: if (Caddie.GetSalary(TypeId) > 0) { return(2); } return(0); case TITEMGROUP.ITEM_TYPE_MASCOT: if (Mascot.GetSalary(TypeId, Day) > 0) { return(2); } return(0); case TITEMGROUP.ITEM_TYPE_SKIN: // SKIN FLAG return(Skin.GetSkinFlag(TypeId)); default: return(0); } }
public override void OnEnter() { Mascot mascot = Service.Get <MascotService>().GetMascot(MascotName); mascot.RandomWorldDialogOverride = Dialog; Finish(); }
private void Start() { if (MascotDefinition != null) { mascot = Service.Get <MascotService>().GetMascot(MascotDefinition.name); } }
private void Start() { questsScreenController = GetComponentInParent <QuestsScreenController>(); questsScreenController.GetComponent <MainNavBarBackButtonEventToFSMEvent>().enabled = false; currentMascot = Service.Get <MascotService>().ActiveMascot; if (currentMascot == null) { string currentMascotID = questsScreenController.CurrentMascotID; if (!string.IsNullOrEmpty(currentMascotID)) { currentMascot = Service.Get <MascotService>().GetMascot(currentMascotID); } } currentChapter = questsScreenController.CurrentChapterData; if (currentMascot != null) { if (currentChapter.Number > 0) { LoadQuestsForMascot(currentMascot.Name, currentChapter.Number); return; } QuestDefinition nextAvailableQuest = currentMascot.GetNextAvailableQuest(); int chapterNumber = ((nextAvailableQuest != null) ? (nextAvailableQuest.ChapterNumber - 1) : currentMascot.Definition.ChapterData[currentMascot.Definition.ChapterData.Length - 1].Number); LoadQuestsForMascot(currentMascot.Name, chapterNumber); } }
public void LoadQuestsForMascot(string mascotID, int chapterNumber) { clearCurrentLog(); Mascot mascot = Service.Get <MascotService>().GetMascot(mascotID); LogPanel.SetActive(value: true); QuestDefinition nextAvailableQuest = mascot.GetNextAvailableQuest(chapterNumber); int num = ((nextAvailableQuest != null) ? (nextAvailableQuest.QuestNumber - 1) : (-1)); List <QuestDefinition> validQuests = mascot.GetValidQuests(chapterNumber); totalAdventuresItems = validQuests.Count; adventureItemsLoaded = 0; if (num != -1) { scrollPosition = (float)num / (float)(totalAdventuresItems - 1); } else { scrollPosition = 0f; } for (int i = 0; i < validQuests.Count; i++) { CoroutineRunner.Start(loadQuestLogAdventureItem(validQuests[i]), this, "loadQuestLogAdventureItem"); } }
public byte GetItemTimeFlag(uint TypeID, uint Day) { switch (TypeID.GetItemGroup()) { case IffGroupFlag.ITEM_TYPE_CADDIE: if (Caddie.GetSalary(TypeID) > 0) { return(2); } return(0); case IffGroupFlag.ITEM_TYPE_MASCOT: if (Mascot.GetSalary(TypeID, Day) > 0) { return(2); } return(0); case IffGroupFlag.ITEM_TYPE_SKIN: // SKIN FLAG return(Skin.GetSkinFlag(TypeID)); default: return(0); } }
private IEnumerator showQuestMessage(HudEvents.ShowQuestMessage evt) { Mascot mascot = Service.Get <MascotService>().GetMascot(evt.SpeechData.MascotName); Service.Get <EventDispatcher>().AddListener <QuestEvents.MascotAudioComplete>(onMascotAudioComplete); if (ContinueImage != null) { ContinueImage.gameObject.SetActive(value: false); } if (mascot == null) { Log.LogError(this, "QuestMascotMessageHud recieved a ShowQuestMessage event with a mascot that was not present in the mascot service: " + evt.SpeechData.MascotName); yield break; } yield return(CoroutineRunner.Start(loadImageSprite(mascot.Definition.CommunicatorIconContentKey, CommunicatorIconImage), this, "LoadIconImage")); yield return(CoroutineRunner.Start(loadImageSprite(mascot.Definition.HudAvatarContentKey, MascotImage), this, "LoadMascotImage")); if (this.MascotImageLoaded != null) { this.MascotImageLoaded(); } SetSpeechData(evt.SpeechData); setCanvasParent(topCanvasParentTransform); questHudTransform.anchorMin = Vector2.zero; questHudTransform.anchorMax = Vector2.one; questHudTransform.sizeDelta = Vector2.zero; questHudTransform.anchoredPosition = Vector2.zero; yield return(new WaitForSeconds(0.8f)); IsOpening = false; IsOpen = true; FullScreenButton.gameObject.SetActive(evt.SpeechData.ClickToClose); }
public override void OnEnter() { Mascot mascot = Service.Get <MascotService>().GetMascot(MascotName); prevDialog = mascot.ActiveQuestDialog; mascot.ActiveQuestDialog = Dialog; Finish(); }
public void LoadMascot(Mascot mascot) { progressBar.Pause(); progressBar.SetProgress(0f); progressBar.AnimateProgress(Service.Get <ProgressionService>().MascotLevelPercent(mascot.Name)); LevelText.text = Service.Get <ProgressionService>().MascotLevel(mascot.Name).ToString(); CoroutineRunner.Start(loadMascotIcon(mascotImageContentKey, mascot.Name), this, "MascotProgressDisplayItem.loadMascotIcon"); }
private void tintTextForMascot(string mascotName) { Mascot mascot = Service.Get <MascotService>().GetMascot(mascotName); if (mascot != null) { GetComponent <Text>().color = mascot.Definition.BannerTextColor; } }
public void LoadMascotData(Mascot mascot) { this.mascot = mascot; if (FeatureLabel != null) { FeatureLabel.TypeId = mascot.Name; FeatureLabel.SetBreadcrumbVisibility(); } }
private void applyLockedState() { int num = Service.Get <ProgressionService>().MascotLevel(questData.Mascot.name); if (num < questData.LevelRequirement) { LockedOverlay.SetActive(value: true); LevelLockIcon.SetActive(value: true); MemberLockIcon.SetActive(value: false); LevelLockIcon.GetComponentInChildren <Text>().text = questData.LevelRequirement.ToString(); return; } Mascot mascot = null; QuestDefinition questDefinition = null; bool flag = false; bool flag2 = false; for (int i = 0; i < questData.CompletedQuestRequirement.Length; i++) { questDefinition = questData.CompletedQuestRequirement[i]; mascot = mascotService.GetMascot(questDefinition.Mascot.name); foreach (Quest availableQuest in mascot.AvailableQuests) { if (availableQuest.Definition.name == questDefinition.name) { flag = true; if (availableQuest.TimesCompleted == 0) { flag2 = true; break; } } } } if (flag2 || !flag) { OffTextNextQuest.SetActive(value: true); string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("QuestLog.CompleteQuest.Text"); tokenTranslation = string.Format(tokenTranslation, Service.Get <Localizer>().GetTokenTranslation(questDefinition.AbbreviatedTitle)); OffTextNextQuest.GetComponentInChildren <Text>().text = tokenTranslation; } else if (associatedQuest != null) { associatedQuest.UpdateLockedState(); if (associatedQuest.State != Quest.QuestState.Locked) { ShowState(associatedQuest.State); return; } OffTextTime.SetActive(value: true); onTimerTick(); CoroutineRunner.Start(updateTimer.Start(), this, "QuestLogItemTimer"); } }
private SpriteContentKey getQuestStatusIconContentKey(string questMascotName) { Mascot mascot = Service.Get <MascotService>().GetMascot(questMascotName); if (mascot != null) { return(mascot.Definition.QuestStatusIconContentKey); } Log.LogErrorFormatted(this, "Could not get a mascot object for name {0}", questMascotName); return(new SpriteContentKey()); }
public bool SetMascotText(uint MascotIdx, string MascotText) { PlayerMascotData Mascot; Mascot = ItemMascot.GetMascotByIndex(MascotIdx); if (!(Mascot == null)) { Mascot.SetText(MascotText); return(true); } return(false); }
/// <summary> /// Get Item Name by TypeID /// </summary> public string GetName(uint TypeID) { switch (TypeID.GetItemGroup()) { case IffGroupFlag.ITEM_TYPE_CHARACTER: return(Character.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_PART: //Part return(Part.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_HAIR_STYLE: { return(HairStyle.GetItemName(TypeID)); } case IffGroupFlag.ITEM_TYPE_CLUB: return(ClubSet.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_BALL: // Ball return(Ball.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_USE: // Normal Item return(Item.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_CADDIE: // Cadie return(Caddie.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_CADDIE_ITEM: return(CaddieItem.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_SETITEM: // Part return(SetItem.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_SKIN: return(Skin.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_MASCOT: return(Mascot.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_CARD: return(Card.GetItemName(TypeID)); case IffGroupFlag.ITEM_TYPE_AUX: return(AuxPart.GetItemName(TypeID)); } return("Unknown Item Name"); }
private void loadDailies() { if (LoadingPanel != null) { LoadingPanel.SetActive(value: false); } dailyChallenges.Clear(); List <Task> list = new List <Task>(); List <Task> list2 = new List <Task>(); List <Task> list3 = new List <Task>(); List <Task> list4 = new List <Task>(); foreach (Task task in Service.Get <TaskService>().Tasks) { if (!IgnoredTaskCategories.Contains(task.Definition.Category)) { if (task.IsComplete) { if (!task.IsRewardClaimed) { list.Add(task); } else { list4.Add(task); } } else { string subGroupByTaskName = Service.Get <TaskService>().GetSubGroupByTaskName(task.Id); Mascot mascot = Service.Get <MascotService>().GetMascot(subGroupByTaskName); int highestCompletedQuest = mascot.GetHighestCompletedQuest(); bool isMember = Service.Get <CPDataEntityCollection>().IsLocalPlayerMember(); if (task.IsTaskAvailable(isMember, playerProgressionLevel, highestCompletedQuest)) { list2.Add(task); } else { list3.Add(task); } } } } dailyChallenges.AddRange(list); dailyChallenges.AddRange(list2); dailyChallenges.AddRange(list3); dailyChallenges.AddRange(list4); totalItems = dailyChallenges.Count; initList(); Content.LoadAsync(base.onPageIconLoaded, ScrollPageIconKey); }
private QuestDefinition getAvailableQuest() { List <Mascot> list = Service.Get <MascotService>().Mascots.ToList(); QuestDefinition questDefinition = null; do { int index = UnityEngine.Random.Range(0, list.Count); Mascot mascot = list[index]; list.RemoveAt(index); questDefinition = mascot.GetNextAvailableQuest(); }while (questDefinition == null && list.Count > 0); return(questDefinition); }
private Mascot getMascotClosestToNextLevel() { ProgressionService progressionService = Service.Get <ProgressionService>(); Mascot mascot = null; foreach (Mascot mascot2 in Service.Get <MascotService>().Mascots) { if (mascot2.IsQuestGiver && (mascot == null || progressionService.MascotLevelPercent(mascot2.Definition.name) > progressionService.MascotLevelPercent(mascot.Definition.name))) { mascot = mascot2; } } return(mascot); }
public bool IsExist(uint TypeID) { switch (TypeID.GetItemGroup()) { case IffGroupFlag.ITEM_TYPE_CLUB: return(ClubSet.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_CHARACTER: return(Character.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_PART: // Part return(Part.IsExist(TypeID)); //Hair case IffGroupFlag.ITEM_TYPE_HAIR_STYLE: return(HairStyle.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_BALL: // Ball return(Ball.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_USE: // Normal Item return(Item.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_CADDIE: return(Caddie.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_CADDIE_ITEM: return(CaddieItem.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_SETITEM: return(SetItem.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_SKIN: return(Skin.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_MASCOT: return(Mascot.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_CARD: return(Card.IsExist(TypeID)); case IffGroupFlag.ITEM_TYPE_AUX: return(AuxPart.IsExist(TypeID)); } return(false); }
public byte[] Build() { PangyaBinaryWriter Packet; using (Packet = new PangyaBinaryWriter()) { Packet.Write(new byte[] { 0xE1, 0x00 }); Packet.WriteByte((byte)Count); foreach (var Mascot in this) { Packet.Write(Mascot.GetMascotInfo()); } return(Packet.GetBytes()); } }
private int getXPfromMascot(Mascot mascot) { foreach (MascotXPRewardDefinition definition in Task.Definition.Reward.GetDefinitions <MascotXPRewardDefinition>()) { if (definition.Mascot != null) { string text = definition.Mascot.name; if (text == mascot.Name) { return(definition.XP); } } } return(0); }
private void Start() { if (!string.IsNullOrEmpty(MascotName)) { Mascot mascotFromString = getMascotFromString(MascotName); if (mascotFromString != null) { LoadMascot(mascotFromString); } else { Log.LogError(this, "Could not find mascot of name " + MascotName + " in mascot service."); } } }
private void goToActivityNotification(Reward reward) { if (notificationData.Definition is CellPhoneQuestActivityDefinition) { CellPhoneQuestActivityDefinition cellPhoneQuestActivityDefinition = (CellPhoneQuestActivityDefinition)notificationData.Definition; Mascot mascot = Service.Get <MascotService>().GetMascot(cellPhoneQuestActivityDefinition.Quest.Mascot.name); Vector3 spawnPlayerNearMascotPosition = mascot.Definition.SpawnPlayerNearMascotPosition; ZoneDefinition zone = mascot.Definition.Zone; goToLocationInZone(spawnPlayerNearMascotPosition, zone.ZoneName, notificationData.Definition, reward); } else if (notificationData.Definition.GetType() == typeof(CellPhoneLocationActivityDefinition) || notificationData.Definition.GetType().IsSubclassOf(typeof(CellPhoneLocationActivityDefinition))) { goToLocationInZone((CellPhoneLocationActivityDefinition)notificationData.Definition, reward); } }
private void toggleForMascot(string mascotName) { Mascot mascot = Service.Get <MascotService>().GetMascot(mascotName); if (mascot != null) { if (mascotDefinition.name == mascot.Definition.name) { base.gameObject.SetActive(value: true); } else { base.gameObject.SetActive(value: false); } } }
private void Start() { currentMascot = Service.Get <MascotService>().ActiveMascot; if (currentMascot == null) { string currentMascotID = GetComponentInParent <QuestsScreenController>().CurrentMascotID; if (!string.IsNullOrEmpty(currentMascotID)) { currentMascot = Service.Get <MascotService>().GetMascot(currentMascotID); } } if (currentMascot != null) { CoroutineRunner.Start(loadChapterItems(), this, "LoadQuestLogChapterItems"); } }
// Use this for initialization void Start() { tutCanvas = transform.GetChild(0).gameObject; nextBtn = GameObject.Find("TutorialNextBtn"); uiElements = GameObject.FindGameObjectsWithTag("TutorialUI"); // save the tutorial UI elements original positions for (int i = 0; i < uiElements.Length; i++) { uiElementsOrigPos[i] = uiElements[i].GetComponent <RectTransform>().position; } currPos = uiElementsPos.ORIG; mascot = GameObject.Find("Mascot").GetComponent <Mascot>(); currentState = TutorialState.STATE_INACTIVE; HideTutCanvas(); walkHere.SetActive(false); minigame = GameObject.Find("Minigame1").GetComponent <Minigame1>(); }
private IEnumerator loadMascotProgressItem(Mascot mascot) { UILoadingController.RegisterLoad(base.gameObject); PrefabContentKey assetKey = new PrefabContentKey(mascotItemContentKey, mascot.Name); if (Content.ContainsKey(assetKey.Key)) { AssetRequest <GameObject> assetRequest = Content.LoadAsync(assetKey); yield return(assetRequest); GameObject mascotItemGO = Object.Instantiate(assetRequest.Asset); mascotItemGO.transform.SetParent(MascotContentParent, worldPositionStays: false); MascotProgressDisplayItem mascotProgressItem = mascotItemGO.GetComponent <MascotProgressDisplayItem>(); mascotProgressItem.LoadMascot(mascot); } UILoadingController.RegisterLoadComplete(base.gameObject); }
public void LoadQuestData(QuestDefinition questData) { this.questData = questData; int num = 0; int num2 = 0; Quest.QuestState state = Quest.QuestState.Locked; Mascot mascot = Service.Get <MascotService>().GetMascot(questData.Mascot.name); foreach (Quest availableQuest in mascot.AvailableQuests) { if (availableQuest.Definition.name == questData.name) { state = availableQuest.State; associatedQuest = availableQuest; break; } } if ((associatedQuest == null || associatedQuest.TimesCompleted == 0) && questData.CompleteReward != null) { foreach (MascotXPRewardDefinition definition in questData.CompleteReward.GetDefinitions <MascotXPRewardDefinition>()) { num += definition.XP; } num2 = CoinRewardableDefinition.Coins(questData.CompleteReward); } HeaderText.text = Service.Get <Localizer>().GetTokenTranslation(questData.Title); if (associatedQuest != null && associatedQuest.TimesCompleted > 0) { ContentPanel.SetActive(value: false); CompletedPanel.SetActive(value: true); } else { XPText.text = num.ToString(); CoinsText.text = num2.ToString(); } if (!XPCheck.activeSelf) { bool flag = Service.Get <ProgressionService>().IsMascotMaxLevel(mascot.Name); MaxLevelIcon.SetActive(flag); XPText.gameObject.SetActive(!flag); } breadcrumb.SetBreadcrumbId(BreadcrumbType, questData.name); ShowState(state); }
void Start () { instance = this; anim = GetComponent<Animator>(); }