/// <summary>
 /// Trigger OnActive WaveSetting from DataBlock
 /// </summary>
 /// <param name="node">Spawnnode</param>
 /// <param name="type">SpawnType</param>
 public void TriggerOnActiveWave(AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer)
 {
     if (WardenObjectiveManager.HasValidWaveSettings(ObjectiveData.WavesOnActivate))
     {
         TriggerWave(ObjectiveData.WavesOnActivate, node, type);
     }
 }
 private static void TriggerDefaultWave(AIG_CourseNode sourceNode)
 {
     Logger.Debug("Can't found good setting for scout, Spawning Default");
     Mastermind.Current.TriggerSurvivalWave(
         refNode: sourceNode,
         settingsID: _DefaultWaveSettingID,
         populationDataID: _DefaultWavePopulationID,
         eventID: out _,
         spawnType: SurvivalWaveSpawnType.InRelationToClosestAlivePlayer,
         spawnDelay: 0.0f,
         playScreamOnSpawn: true
         );
 }
        private static void TriggerWaves(WaveSetting[] waves, AIG_CourseNode sourceNode, ref List <ushort> stopOnDeathList)
        {
            foreach (var wave in waves)
            {
                var waveSpawnType = wave.SpawnSetting.SpawnType switch
                {
                    WaveSpawnType.ClosestAlive => SurvivalWaveSpawnType.InRelationToClosestAlivePlayer,
                    WaveSpawnType.ClosestNoBetweenPlayers => SurvivalWaveSpawnType.ClosestToSuppliedNodeButNoBetweenPlayers,
                    WaveSpawnType.InNode => SurvivalWaveSpawnType.InSuppliedCourseNode,
                    WaveSpawnType.InNodeZone => SurvivalWaveSpawnType.InSuppliedCourseNodeZone,
                    _ => SurvivalWaveSpawnType.InRelationToClosestAlivePlayer,
                };

                var node = sourceNode;
                switch (wave.SpawnSetting.NodeType)
                {
                case SpawnNodeType.FromArea:
                    if (Builder.CurrentFloor.TryGetZoneByLocalIndex(wave.SpawnSetting.Layer, wave.SpawnSetting.LocalIndex, out var zone))
                    {
                        if (wave.SpawnSetting.AreaIndex < zone.m_areas.Count)
                        {
                            node = zone.m_areas[wave.SpawnSetting.AreaIndex].m_courseNode;
                        }
                        else
                        {
                            node = zone.m_areas[0].m_courseNode;
                        }
                    }
                    break;

                case SpawnNodeType.FromElevatorArea:
                    node = Builder.GetElevatorArea().m_courseNode;
                    break;
                }

                Mastermind.Current.TriggerSurvivalWave(
                    refNode: node,
                    settingsID: wave.WaveSettingID,
                    populationDataID: wave.WavePopulationID,
                    eventID: out var eventID,
                    spawnType: waveSpawnType,
                    spawnDelay: wave.Delay,
                    playScreamOnSpawn: true
                    );

                if (wave.StopWaveOnDeath)
                {
                    stopOnDeathList.Add(eventID);
                }
            }
        }
Ejemplo n.º 4
0
        public static void Invoke(LG_PickupItem_Sync __instance, pPickupItemState oldState, pPickupItemState newState)
        {
            if (oldState.status != newState.status && newState.status == ePickupItemStatus.PickedUp)
            {
                AIG_CourseNode spawnNode = __instance.item.TryCast <CarryItemPickup_Core>()?.SpawnNode ?? __instance.item.TryCast <GenericSmallPickupItem_Core>()?.SpawnNode;
                if (spawnNode == null)
                {
                    return;
                }

                var blocks = EventListenerDataBlock.GetAllBlocks();
                var exp    = RundownManager.GetActiveExpeditionData();

                foreach (var block in blocks)
                {
                    if (block.Type == EventListenerType.ObjectiveItemSolved)
                    {
                        foreach (var expedition in block.ForExpeditions)
                        {
                            if (expedition.ExpeditionIndex == exp.expeditionIndex && expedition.Tier == exp.tier)
                            {
                                if (spawnNode.LayerType == block.ObjectiveItemSolved_Layer)
                                {
                                    var items = WardenObjectiveManager.Current.m_objectiveItemCollection[spawnNode.LayerType];
                                    int count = 0;

                                    foreach (var item in items)
                                    {
                                        if (item != null && item.ObjectiveItemSolved)
                                        {
                                            count++;
                                        }
                                    }

                                    if (block.ObjectiveItemSolved_RequiredCount == count)
                                    {
                                        EventSequenceManager.StartSequence(block.EventSequenceOnActivate);
                                    }
                                }
                                break;
                            }
                        }
                    }
                }
            }
        }
 public void TriggerWave(Il2CppSystem.Collections.Generic.List <GenericEnemyWaveData> waveData, AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer)
 {
     if (node == null)
     {
         node = Builder.GetStartingArea().m_courseNode;
     }
     WardenObjectiveManager.TriggerEnemyWaves(waveData, node, type);
 }
 /// <summary>
 /// Trigger Multiple WaveSetting
 /// </summary>
 /// <param name="waveData">WaveData(s) to use for spawn</param>
 /// <param name="node">Spawnnode</param>
 /// <param name="type">SpawnType</param>
 public void TriggerWave(List <GenericEnemyWaveData> waveData, AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer)
 {
     TriggerWave(waveData.ToIl2CppList(), node, type);
 }
 /// <summary>
 /// Trigger Single WaveSetting
 /// </summary>
 /// <param name="waveData">WaveData to use for spawn</param>
 /// <param name="node">Spawnnode</param>
 /// <param name="type">SpawnType</param>
 public void TriggerWave(GenericEnemyWaveData waveData, AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer)
 {
     TriggerWave(new GenericEnemyWaveData[] { waveData }.ToList(), node, type);
 }
 public void TriggerWave(uint waveSetting, uint wavePopulation, float delay = 0.0f, AIG_CourseNode node = null, SurvivalWaveSpawnType type = SurvivalWaveSpawnType.InRelationToClosestAlivePlayer)
 {
     TriggerWave(new GenericEnemyWaveData()
     {
         WaveSettings   = waveSetting,
         WavePopulation = wavePopulation,
         SpawnDelay     = delay,
         TriggerAlarm   = true
     }, node, type);
 }
        public static void PushFunctionMarker(LG_Zone zone, ZonePlacementWeights weight, ExpeditionFunction function, out LG_DistributeItem distItem, out AIG_CourseNode distNode)
        {
            var randNode    = LG_DistributionJobUtils.GetRandomNodeFromZoneForFunction(zone, function, Builder.BuildSeedRandom.Value("FindFunctionMarker"), 1f);
            var newDistItem = new LG_DistributeItem()
            {
                m_function     = function,
                m_amount       = 1.0f,
                m_assignedNode = randNode
            };

            randNode.m_zone.DistributionData.GenericFunctionItems.Enqueue(newDistItem);

            distItem = newDistItem;
            distNode = randNode;
        }
        public static bool TryFetchFunctionMarker(LG_Zone zone, ZonePlacementWeights weight, ExpeditionFunction function, out LG_DistributeItem distItem, out AIG_CourseNode distNode, bool createNew = true)
        {
            float rand  = RandomUtil.Value("LG_Distribute_WardenObjective");
            var   exist = LG_DistributionJobUtils.TryGetExistingZoneFunctionDistribution(zone, function, rand, weight, out distItem, out distNode);

            if (!exist && createNew)
            {
                PushFunctionMarker(zone, weight, function, out distItem, out distNode);
                return(true);
            }

            return(exist);
        }
Ejemplo n.º 11
0
 public static void Prefix(AIG_CourseNode node)
 {
     OnCalled?.Invoke(node);
 }