Exemplo n.º 1
0
        private void DecideSortieStart()
        {
            DebugUtils.Log("TaskRebellionOrganize", string.Empty);
            RebellionManager rebellionManager = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            List <UIRebellionParticipatingFleetInfo> participatingFleetList             = _ctrlRebellionOrganize.participatingFleetSelector.participatingFleetList;
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo  = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.VanguardFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo2 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.DecisiveBattlePrimaryFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo3 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.VanguardSupportFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo4 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.DecisiveBattleSupportFleet);

            int[] array = new int[4]
            {
                (!(uIRebellionParticipatingFleetInfo == null)) ? uIRebellionParticipatingFleetInfo.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo2 == null)) ? uIRebellionParticipatingFleetInfo2.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo3 == null)) ? uIRebellionParticipatingFleetInfo3.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo4 == null)) ? uIRebellionParticipatingFleetInfo4.deckModel.Id : (-1)
            };
            bool flag = rebellionManager.IsGoRebellion(array[0], array[1], array[2], array[3]);
            List <IsGoCondition> list  = null;
            List <IsGoCondition> list2 = null;

            if (array[2] != -1)
            {
                list = rebellionManager.IsValidMissionSub(array[2]);
            }
            if (array[3] != -1)
            {
                list2 = rebellionManager.IsValid_MissionMain(array[3]);
            }
            bool flag2 = list == null || (list != null && list.Count == 0);
            bool flag3 = list2 == null || (list2 != null && list2.Count == 0);

            if (flag && flag2 && flag3)
            {
                RebellionMapManager rebellionMapManager = rebellionManager.GoRebellion(array[0], array[1], array[2], array[3]);
                MapModel            map       = rebellionMapManager.Map;
                Hashtable           hashtable = new Hashtable();
                hashtable.Add("rebellionMapManager", rebellionMapManager);
                hashtable.Add("rootType", 0);
                hashtable.Add("shipRecoveryType", ShipRecoveryType.None);
                hashtable.Add("escape", false);
                RetentionData.SetData(hashtable);
                Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                SingletonMonoBehaviour <AppInformation> .Instance.prevStrategyDecks = StrategyTopTaskManager.GetLogicManager().UserInfo.GetDecks();
                StartCoroutine(PlayTransition(map, uIRebellionParticipatingFleetInfo2.deckModel));
            }
            SoundUtils.PlaySE(SEFIleInfos.CommonEnter1);
        }
Exemplo n.º 2
0
        private IEnumerator OneDeckGoSortie()
        {
            RebellionManager mng         = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            List <DeckModel> enableDecks = deckInfoManager.GetSortieEnableDeck(AreaDecks);

            if (enableDecks.Count != 1)
            {
            }
            DeckModel deck = enableDecks[0];

            if (mng.IsGoRebellion(-1, deck.Id, -1, -1))
            {
                StartCoroutine(OpenConfirmDialog(deck));
                GoSortieConfirm.Initialize(deck, isConfirm: true);
                GoSortieConfirm.SetPushYesButton(delegate
                {
                    this.StrategyDialog.CloseDialog();
                    this.StrategyDialog.setCloseAction(delegate
                    {
                        RebellionMapManager rebellionMapManager = mng.GoRebellion(-1, deck.Id, -1, -1);
                        MapModel map = rebellionMapManager.Map;
                        RetentionData.SetData(new Hashtable
                        {
                            {
                                "rebellionMapManager",
                                rebellionMapManager
                            },
                            {
                                "rootType",
                                0
                            },
                            {
                                "shipRecoveryType",
                                ShipRecoveryType.None
                            },
                            {
                                "escape",
                                false
                            }
                        });
                        Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                        this.StartCoroutine(this.PlayTransition(map, deck));
                    });
                });
                GoSortieConfirm.SetPushNoButton(delegate
                {
                    this.StrategyDialog.CloseDialog();
                    this.StrategyDialog.setCloseAction(delegate
                    {
                        this.StartCoroutine(this.NonDeckLose());
                    });
                });
            }
            else
            {
                if (AreaDecks.Count != 1)
                {
                    SingletonMonoBehaviour <AppInformation> .Instance.SlogDraw = true;
                }
                StartCoroutine(NonDeckLose());
            }
            yield return(null);
        }