Exemplo n.º 1
0
 protected void GetMecha()
 {
     if (!this.CanGet())
     {
         MapUIContainer.PushWarningMessage(Popup.Warning.Type.PouchIsFull);
     }
     else
     {
         this.LabelType = LabelTypes.None;
         this.SetState(AnimalState.Depop, (System.Action)null);
     }
 }
Exemplo n.º 2
0
        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(0, 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)(() =>
                    {
                        PlayerActor playerActor           = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player;
                        PlayerController playerController = !Object.op_Inequality((Object)playerActor, (Object)null) ? (PlayerController)null : playerActor.PlayerController;
                        EventPoint.SetCurrentPlayerStateName();
                        if (Object.op_Inequality((Object)playerController, (Object)null))
                        {
                            playerController.ChangeState("Idle");
                        }
                        RequestUI requestUi = MapUIContainer.RequestUI;
                        requestUi.SubmitEvent     = (System.Action)(() => this.GetMecha());
                        requestUi.SubmitCondition = (Func <bool>)(() => this.CanGet());
                        requestUi.ClosedEvent     = (System.Action)(() => EventPoint.ChangePrevPlayerMode());
                        requestUi.Open(Popup.Request.Type.Cuby);
                        if (!requestUi.IsImpossible)
                        {
                            return;
                        }
                        MapUIContainer.PushWarningMessage(Popup.Warning.Type.InsufficientBattery);
                    })
                }
            };
        }
Exemplo n.º 3
0
        protected override void OnAwake(PlayerActor player)
        {
            this._eventPoint = player.CurrentEventPoint;
            if (Object.op_Inequality((Object)this._eventPoint, (Object)null))
            {
                CommonDefine.EventStoryInfoGroup playInfo = !Singleton <Resources> .IsInstance() ? (CommonDefine.EventStoryInfoGroup)null : Singleton <Resources> .Instance.CommonDefine?.EventStoryInfo;

                Dictionary <int, List <string> > textTable = !Singleton <Resources> .IsInstance() ? (Dictionary <int, List <string> >)null : Singleton <Resources> .Instance.Map?.EventPointCommandLabelTextTable;

                MapUIContainer.RequestUI.CancelEvent = (System.Action)(() => EventPoint.ChangePrevPlayerMode());
                MapUIContainer.RequestUI.ClosedEvent = (System.Action)(() => player.CurrentEventPoint = (EventPoint)null);
                MapUIContainer.RequestUI.SubmitEvent = (System.Action)(() =>
                {
                    if (Object.op_Equality((Object)this._eventPoint, (Object)null))
                    {
                        EventPoint.ChangePrevPlayerMode();
                    }
                    else
                    {
                        this._eventPoint.RemoveConsiderationCommand();
                        int eventId = this._eventPoint.EventID;
                        int groupId = this._eventPoint.GroupID;
                        int pointId = this._eventPoint.PointID;
                        switch (eventId)
                        {
                        case 0:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.Generator.SEID, playInfo.Generator.SoundPlayDelayTime, playInfo.Generator.EndIntervalTime, (System.Action)(() =>
                            {
                                if (Singleton <Manager.Map> .IsInstance())
                                {
                                    Singleton <Manager.Map> .Instance.SetTimeRelationAreaOpenState(0, true);
                                }
                                Manager.Map.ForcedSetTutorialProgress(25);
                            }), (System.Action)(() =>
                            {
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(6, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 1:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.ShipRepair.SEID, playInfo.ShipRepair.SoundPlayDelayTime, playInfo.ShipRepair.EndIntervalTime, (System.Action)(() =>
                            {
                                if (!Object.op_Inequality((Object)this._eventPoint, (Object)null))
                                {
                                    return;
                                }
                                this._eventPoint.SetDedicatedNumber(1);
                                this.ChangeGameCleared();
                            }), (System.Action)(() =>
                            {
                                (!Singleton <Manager.Map> .IsInstance() ? (StoryPointEffect)null : Singleton <Manager.Map> .Instance.StoryPointEffect)?.FadeOutAndDestroy();
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(7, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                Manager.Map.ForcedSetTutorialProgress(28);
                                DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds(!Singleton <Resources> .IsInstance() ? 5.0 : (double)Singleton <Resources> .Instance.CommonDefine.EventStoryInfo.StoryCompleteNextSupportChangeTime)), (System.Action <M0>)(_ => Manager.Map.ForcedSetTutorialProgressAndUIUpdate(29))), (Component)Singleton <MapScene> .Instance);
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 2:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null || pointId != 4 && pointId != 5 && pointId != 6)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.PodDevice.SEID, playInfo.PodDevice.SoundPlayDelayTime, playInfo.PodDevice.EndIntervalTime, (System.Action)(() => this._eventPoint.SetAgentOpenState(true)), (System.Action)(() =>
                            {
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(9, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 3:
                            EventPoint.ChangePrevPlayerMode();
                            break;

                        case 4:
                        case 5:
                        case 6:
                            EventPoint.ChangePrevPlayerMode();
                            break;
                        }
                    }
                });
                MapUIContainer.OpenRequestUI((Popup.Request.Type) this._eventPoint.EventID);
                if (0 > this._eventPoint.WarningID || !MapUIContainer.RequestUI.IsImpossible)
                {
                    return;
                }
                MapUIContainer.PushWarningMessage((Popup.Warning.Type) this._eventPoint.WarningID);
            }
            else
            {
                player.PlayerController.ChangeState("Normal");
            }
        }
Exemplo n.º 4
0
        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();
                    })
                }
            };
        }