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);
        }
        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;
        }
示例#3
0
        private void Start()
        {
            if (!setup)
            {
                this.light            = GetComponent <LG_Light>();
                this.animator         = GetComponent <LG_LightAnimator>() ?? this.light?.GetC_Light()?.gameObject?.GetComponent <LG_LightAnimator>();
                this.currentColor     = this.light.m_color;
                this.currentIntensity = this.light.GetIntensity();
                this.startIntensity   = this.currentIntensity;

                this.area  = this.light?.GetC_Light()?.m_sourceNode?.CourseNode?.m_area;
                this.zone  = this.area?.m_zone;
                this.layer = this.zone?.Layer;

                controllers.Add(this);
                this.setup = true;
            }
        }
 public static bool TryGetRandomTerminal(LG_Zone zone, out LG_ComputerTerminal terminal)
 {
     terminal = RandomUtil.PickFromList(zone.TerminalsSpawnedInZone);
     return(terminal != null);
 }
 public static LG_ComputerTerminal GetRandomTerminal(LG_Zone zone)
 {
     return(RandomUtil.PickFromList(zone.TerminalsSpawnedInZone));
 }
 public static bool TryGetSpawnedDoor(LG_Zone zone, out LG_SecurityDoor door)
 {
     door = zone.m_sourceGate?.SpawnedDoor?.Cast <LG_SecurityDoor>() ?? null;
     return(door != null);
 }
 public static LG_SecurityDoor GetSpawnedDoor(LG_Zone zone)
 {
     return(zone.m_sourceGate.SpawnedDoor?.Cast <LG_SecurityDoor>());
 }
 public static bool TryGetZone(LG_LayerType layer, eLocalZoneIndex index, out LG_Zone zone)
 {
     return(Builder.Current.m_currentFloor.TryGetZoneByLocalIndex(layer, index, out zone));
 }
 public static LG_DistributeItem PushFunctionMarker(LG_Zone zone, ZonePlacementWeights weight, ExpeditionFunction function)
 {
     PushFunctionMarker(zone, weight, function, out var distItem, out _);
     return(distItem);
 }
 public static bool TryFetchFunctionMarker(LG_Zone zone, ZonePlacementWeights weight, ExpeditionFunction function, out LG_DistributeItem distItem)
 {
     return(TryFetchFunctionMarker(zone, weight, function, out distItem, out _));
 }
 public static bool TryGetRandomPlaceSingleZone(CustomExpHandlerBase handlerContext, out LG_Zone zone, out ZonePlacementWeights weight)
 {
     return(LG_DistributionJobUtils.TryGetRandomPlacementZone(handlerContext.Layer, handlerContext.LayerData.ObjectiveData.ZonePlacementDatas, out zone, out weight));
 }