private void OnEndSet(PlayerActor player) { if (this.getAnimalFlag) { if (this.getIteminfo != null && this.addItem != null) { MapUIContainer.AddSystemItemLog(this.getIteminfo, this.addItem.Count, true); } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); } } player.ClearItems(); player.Animal = (AnimalBase)null; MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception); player.PlayerController.ChangeState("Normal"); }
protected override void EnterDepop() { this.AutoChangeAnimation = false; StuffItemInfo _itemInfo = this.ItemInfo; StuffItem _addItem = (StuffItem)null; if (_itemInfo != null) { _addItem = new StuffItem(_itemInfo.CategoryID, _itemInfo.ID, 1); } PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player; if ((!Object.op_Inequality((Object)playerActor, (Object)null) ? (List <StuffItem>)null : playerActor.PlayerData?.ItemList) != null && _addItem != null) { playerActor.PlayerData.ItemList.AddItem(_addItem); } if (Singleton <Resources> .IsInstance()) { AnimalDefinePack animalDefinePack = Singleton <Resources> .Instance.AnimalDefinePack; if (Object.op_Inequality((Object)animalDefinePack, (Object)null)) { AudioSource audioSource = this.Play3DSound(animalDefinePack.SoundID.MechaStartup); if (Object.op_Inequality((Object)audioSource, (Object)null)) { audioSource.Stop(); ((Component)audioSource).get_transform().SetPositionAndRotation(this.Position, this.Rotation); audioSource.Play(); } } } this.PlayInAnim(AnimationCategoryID.Etc, 1, (System.Action)(() => { this.AutoChangeAnimation = true; if (_itemInfo != null && _addItem != null) { MapUIContainer.AddSystemItemLog(_itemInfo, _addItem.Count, true); } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); } this.SetState(AnimalState.Destroyed, (System.Action)null); })); }
protected override void InitializeCommandLabels() { if (!((IReadOnlyList <CommandLabel.CommandInfo>) this.getLabels).IsNullOrEmpty <CommandLabel.CommandInfo>()) { return; } CommonDefine commonDefine = !Singleton <Resources> .IsInstance() ? (CommonDefine)null : Singleton <Resources> .Instance.CommonDefine; CommonDefine.CommonIconGroup commonIconGroup = !Object.op_Inequality((Object)commonDefine, (Object)null) ? (CommonDefine.CommonIconGroup)null : commonDefine.Icon; this.getLabels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "捕まえる", Transform = ((Component)this).get_transform(), IsHold = false, Icon = (Sprite)null, TargetSpriteInfo = commonIconGroup?.CharaSpriteInfo, Event = (Action)(() => { StuffItemInfo itemInfo = this.ItemInfo; if (itemInfo != null) { StuffItem stuffItem = new StuffItem(itemInfo.CategoryID, itemInfo.ID, 1); Singleton <Manager.Map> .Instance.Player.PlayerData.ItemList.AddItem(stuffItem); MapUIContainer.AddSystemItemLog(itemInfo, stuffItem.Count, true); } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); } this.Destroy(); }) } }; }
protected override void InitializeCommandLabels() { if (!((IReadOnlyList <CommandLabel.CommandInfo>) this.getLabels).IsNullOrEmpty <CommandLabel.CommandInfo>()) { return; } CommonDefine commonDefine = !Singleton <Resources> .IsInstance() ? (CommonDefine)null : Singleton <Resources> .Instance.CommonDefine; CommonDefine.CommonIconGroup commonIconGroup = !Object.op_Inequality((Object)commonDefine, (Object)null) ? (CommonDefine.CommonIconGroup)null : commonDefine.Icon; Resources instance = Singleton <Resources> .Instance; int guideCancelId = commonIconGroup.GuideCancelID; Sprite sprite; instance.itemIconTables.InputIconTable.TryGetValue(guideCancelId, out sprite); List <string> source; instance.Map.EventPointCommandLabelTextTable.TryGetValue(18, out source); int index = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt; this.getLabels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = source.GetElement <string>(index), Transform = this.LabelPoint, IsHold = false, Icon = sprite, TargetSpriteInfo = commonIconGroup?.CharaSpriteInfo, Event = (System.Action)(() => { bool flag1 = true; if (Object.op_Inequality((Object)this.habitatPoint, (Object)null) && Singleton <Resources> .IsInstance() && Singleton <Manager.Map> .IsInstance()) { PlayerActor player = Singleton <Manager.Map> .Instance.Player; Dictionary <int, ItemTableElement> tableInFrogPoint = Singleton <Resources> .Instance.GameInfo.GetItemTableInFrogPoint(this.habitatPoint.ItemID); Actor.SearchInfo searchInfo = player.RandomAddItem(tableInFrogPoint, true); if (searchInfo.IsSuccess) { bool flag2 = false; foreach (Actor.ItemSearchInfo itemSearchInfo in searchInfo.ItemList) { PlayerData playerData = player.PlayerData; List <StuffItem> itemList = playerData.ItemList; StuffItem stuffItem = new StuffItem(itemSearchInfo.categoryID, itemSearchInfo.id, itemSearchInfo.count); int possible; if (StuffItemExtensions.CanAddItem((IReadOnlyCollection <StuffItem>)itemList, playerData.InventorySlotMax, stuffItem, out possible) && 0 < possible) { int count = Mathf.Min(possible, itemSearchInfo.count); itemList.AddItem(stuffItem, count, playerData.InventorySlotMax); MapUIContainer.AddSystemItemLog(Singleton <Resources> .Instance.GameInfo.GetItem(itemSearchInfo.categoryID, itemSearchInfo.id), count, true); flag2 = true; } } if (!flag2) { flag1 = false; MapUIContainer.PushWarningMessage(Popup.Warning.Type.PouchIsFull); } } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); } } if (!flag1) { return; } this.Destroy(); }) } }; }
private void Elapsed(PlayerActor player) { ActionPoint currentPoint = player.CurrentPoint; System.Type type = ((object)currentPoint).GetType(); if (Singleton <Game> .IsInstance() && ((object)player.CurrentPoint).GetType() == typeof(SearchActionPoint)) { Dictionary <int, AIProject.SaveData.Environment.SearchActionInfo> searchActionLockTable = Singleton <Game> .Instance.Environment.SearchActionLockTable; AIProject.SaveData.Environment.SearchActionInfo searchActionInfo; if (!searchActionLockTable.TryGetValue(player.CurrentPoint.RegisterID, out searchActionInfo)) { searchActionInfo = new AIProject.SaveData.Environment.SearchActionInfo(); } ++searchActionInfo.Count; searchActionLockTable[player.CurrentPoint.RegisterID] = searchActionInfo; } Dictionary <int, ItemTableElement> itemTableInArea = Singleton <Resources> .Instance.GameInfo.GetItemTableInArea(currentPoint.IDList.IsNullOrEmpty <int>()?currentPoint.ID : currentPoint.IDList.GetElement <int>(0)); if (itemTableInArea != null) { ; } Actor.SearchInfo searchInfo = player.RandomAddItem(itemTableInArea, true); if (type == typeof(OnceSearchActionPoint)) { OnceSearchActionPoint searchActionPoint = currentPoint as OnceSearchActionPoint; if (searchActionPoint.HaveMapItems) { Manager.Map.FadeStart(-1f); } searchActionPoint.SetAvailable(false); } else if (type == typeof(DropSearchActionPoint)) { DropSearchActionPoint searchActionPoint = currentPoint as DropSearchActionPoint; if (searchActionPoint.HaveMapItems) { Manager.Map.FadeStart(-1f); } searchActionPoint.SetCoolTime(); } if (searchInfo.IsSuccess) { foreach (Actor.ItemSearchInfo itemSearchInfo in searchInfo.ItemList) { StuffItem stuffItem = new StuffItem(itemSearchInfo.categoryID, itemSearchInfo.id, itemSearchInfo.count); player.PlayerData.ItemList.AddItem(stuffItem); MapUIContainer.AddSystemItemLog(Singleton <Resources> .Instance.GameInfo.GetItem(itemSearchInfo.categoryID, itemSearchInfo.id), itemSearchInfo.count, true); } player.Controller.ChangeState("Normal"); } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); player.Controller.ChangeState("Normal"); } AgentActor agentPartner = player.AgentPartner; if (Object.op_Equality((Object)agentPartner.CurrentPoint, (Object)null)) { agentPartner.BehaviorResources.ChangeMode(Desire.ActionType.Ovation); } else { if (!player.OldEnabledHoldingHand) { return; } ((Behaviour)player.HandsHolder).set_enabled(true); player.OldEnabledHoldingHand = false; } }
private void Elapsed(PlayerActor player) { ActionPoint currentPoint = player.CurrentPoint; System.Type type = ((object)currentPoint).GetType(); if (Singleton <Game> .IsInstance() && type == typeof(SearchActionPoint)) { Dictionary <int, AIProject.SaveData.Environment.SearchActionInfo> searchActionLockTable = Singleton <Game> .Instance.Environment.SearchActionLockTable; AIProject.SaveData.Environment.SearchActionInfo searchActionInfo; if (!searchActionLockTable.TryGetValue(currentPoint.RegisterID, out searchActionInfo)) { searchActionInfo = new AIProject.SaveData.Environment.SearchActionInfo(); } ++searchActionInfo.Count; searchActionLockTable[currentPoint.RegisterID] = searchActionInfo; } Actor.SearchInfo searchInfo = new Actor.SearchInfo() { IsSuccess = false }; if (currentPoint is SearchActionPoint) { SearchActionPoint searchActionPoint = currentPoint as SearchActionPoint; Dictionary <int, ItemTableElement> itemTableInArea = Singleton <Resources> .Instance.GameInfo.GetItemTableInArea(searchActionPoint.IDList.IsNullOrEmpty <int>()?searchActionPoint.ID : searchActionPoint.IDList.GetElement <int>(0)); searchInfo = player.RandomAddItem(itemTableInArea, true); } else if (currentPoint is TutorialSearchActionPoint) { searchInfo = (currentPoint as TutorialSearchActionPoint).GetSearchInfo(); } if (type == typeof(OnceSearchActionPoint)) { OnceSearchActionPoint searchActionPoint = currentPoint as OnceSearchActionPoint; if (searchActionPoint.HaveMapItems) { Manager.Map.FadeStart(-1f); } searchActionPoint.SetAvailable(false); } else if (type == typeof(DropSearchActionPoint)) { DropSearchActionPoint searchActionPoint = currentPoint as DropSearchActionPoint; if (searchActionPoint.HaveMapItems) { Manager.Map.FadeStart(-1f); } searchActionPoint.SetCoolTime(); } if (searchInfo.IsSuccess) { foreach (Actor.ItemSearchInfo itemSearchInfo in searchInfo.ItemList) { StuffItem stuffItem = new StuffItem(itemSearchInfo.categoryID, itemSearchInfo.id, itemSearchInfo.count); if (player.PlayerData.ItemList.Count < player.PlayerData.InventorySlotMax) { player.PlayerData.ItemList.AddItem(stuffItem, stuffItem.Count, player.PlayerData.InventorySlotMax); } MapUIContainer.AddSystemItemLog(Singleton <Resources> .Instance.GameInfo.GetItem(itemSearchInfo.categoryID, itemSearchInfo.id), itemSearchInfo.count, true); } player.Controller.ChangeState("Normal"); } else { MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText); player.Controller.ChangeState("Normal"); } }