Exemplo n.º 1
0
 public static void Invoke()
 {
     GameInfo.State = GameState.Startup;
     EventListenerDataBlock.Load();
     EventsDataBlock.Load();
     EventSequenceDataBlock.Load();
     LightSequenceDataBlock.Load();
     LightStateDataBlock.Load();
     ExpeditionSettingsDataBlock.Load();
 }
        public static bool Invoke(ElevatorCargoCage __instance)
        {
            var blocks = ExpeditionSettingsDataBlock.GetAllBlocks();
            var exp    = RundownManager.GetActiveExpeditionData();

            foreach (var block in blocks)
            {
                if (block.Expedition.ExpeditionIndex == exp.expeditionIndex && block.Expedition.Tier == exp.tier)
                {
                    List <uint> bigPickupToSpawn = new List <uint>();
                    for (int index = 0; index < block.CargoCage.BigPickup.Count; index++)
                    {
                        var bigPickup = block.CargoCage.BigPickup[index];
                        if (GameInfo.MeetsProgressionRequirements(bigPickup.RequiredProgression))
                        {
                            bigPickupToSpawn.Add(bigPickup.ItemID);
                        }
                    }

                    List <ConsumableCargoInfo> consumablesToSpawn = new List <ConsumableCargoInfo>();
                    for (int index = 0; index < block.CargoCage.Consumables.Count; index++)
                    {
                        var consumable = block.CargoCage.Consumables[index];
                        if (GameInfo.MeetsProgressionRequirements(consumable.RequiredProgression))
                        {
                            consumablesToSpawn.Add(consumable);
                        }
                    }

                    int length = bigPickupToSpawn.Count + consumablesToSpawn.Count;

                    __instance.m_itemsToMoveToCargo = new Transform[length];

                    if (length < 1)
                    {
                        return(false);
                    }

                    int itemIndex = 0;
                    foreach (var bigPickup in bigPickupToSpawn)
                    {
                        LG_PickupItem lgPickupItem = LG_PickupItem.SpawnGenericPickupItem(ElevatorShaftLanding.CargoAlign);
                        lgPickupItem.SpawnNode = Builder.GetElevatorArea().m_courseNode;
                        lgPickupItem.SetupAsBigPickupItem(Random.Range(0, int.MaxValue), bigPickup, false);
                        __instance.m_itemsToMoveToCargo[itemIndex] = lgPickupItem.transform;
                        itemIndex++;
                    }

                    foreach (var consumable in consumablesToSpawn)
                    {
                        LG_PickupItem lgPickupItem = LG_PickupItem.SpawnGenericPickupItem(ElevatorShaftLanding.CargoAlign);
                        lgPickupItem.SpawnNode = Builder.GetElevatorArea().m_courseNode;
                        lgPickupItem.SetupAsConsumable(Random.Range(0, int.MaxValue), consumable.ItemID);

                        __instance.m_itemsToMoveToCargo[itemIndex] = lgPickupItem.transform;
                        itemIndex++;

                        //Item item = ItemSpawnManager.SpawnItem(consumable.ItemID, ItemMode.Pickup, ElevatorShaftLanding.CargoAlign.position, ElevatorShaftLanding.CargoAlign.rotation, true, new Player.pItemData()
                        //{
                        //    custom = new Player.pItemData_Custom()
                        //    {
                        //        ammo = consumable.UsageRel
                        //    }
                        //}, ElevatorShaftLanding.CargoAlign);

                        //foreach (var comp in item.gameObject.GetComponentsInChildren<iLG_SpawnedInNodeHandler>(true))
                        //{
                        //    comp.SpawnNode = Builder.GetElevatorArea().m_courseNode;
                        //}

                        //__instance.m_itemsToMoveToCargo[itemIndex] = item.transform;
                    }

                    ElevatorRide.Current.m_cargoCageInUse = true;
                    return(false);
                }
            }
            return(true);
        }
        public static void Invoke()
        {
            var state          = WardenObjectiveManager.CurrentState;
            var exp            = RundownManager.GetActiveExpeditionData();
            var completionData = CompletionData.LoadFromCache();
            var data           = completionData.GetData(exp.tier, exp.expeditionIndex);

            bool pe = true;

            if (state.main_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.highCompletes++;
            }
            else
            {
                pe = false;
            }

            if (state.second_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.extremeCompletes++;
            }
            else
            {
                pe = false;
            }

            if (state.third_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.overloadCompletes++;
            }
            else
            {
                pe = false;
            }

            if (pe)
            {
                data.peCompletes++;
            }

            completionData.Save();

            bool highSolved     = WardenObjectiveManager.CurrentState.main_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;
            bool extremeSolved  = RundownManager.HasSecondaryLayer(RundownManager.ActiveExpedition) && WardenObjectiveManager.CurrentState.second_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;
            bool overloadSolved = RundownManager.HasThirdLayer(RundownManager.ActiveExpedition) && WardenObjectiveManager.CurrentState.third_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;

            var progressionData          = ExtendedPlayerAgent.LocalPlayer.ProgressionData;
            var expeditionSettingsBlocks = ExpeditionSettingsDataBlock.GetAllBlocks();

            foreach (var expeditionSettingsBlock in expeditionSettingsBlocks)
            {
                if (expeditionSettingsBlock.Expedition.ExpeditionIndex == exp.expeditionIndex && expeditionSettingsBlock.Expedition.Tier == exp.tier)
                {
                    var completionSettings = expeditionSettingsBlock.CompletionSettings;
                    foreach (var progressionUpdate in completionSettings.ProgressionUpdates)
                    {
                        if (GameInfo.MeetsProgressionRequirements(progressionUpdate.ProgressionRequirements))
                        {
                            if (progressionUpdate.HighCompleted == highSolved && progressionUpdate.ExtremeCompleted == extremeSolved && progressionUpdate.OverloadCompleted == overloadSolved)
                            {
                                progressionData.SetProgressionValue(exp.tier, exp.expeditionIndex, progressionUpdate.Value);
                            }
                        }
                    }
                }
            }

            progressionData.Save();
        }