Exemple #1
0
        protected override void PrepareZoneSpawnScript(Triggers triggers, SpawnList spawnList)
        {
            this.spawnRateMultiplier = RateResourcesPvPDepositLithiumMultiplier.SharedValue;

            // this resource is not spawned on the world init
            triggers
            // trigger on time interval
            .Add(GetTrigger <TriggerTimeInterval>()
                 .Configure(
                     intervalFrom: TimeSpan.FromHours(0.5),
                     intervalTo: TimeSpan.FromHours(1)));

            var restrictionInfiniteGeothermalSpring = spawnList.CreateRestrictedPreset()
                                                      .Add <ObjectDepositGeothermalSpringInfinite>();

            var restrictionDepletedDeposit = spawnList.CreateRestrictedPreset()
                                             .Add <ObjectDepletedDeposit>();

            var presetGeothermalSpring = spawnList.CreatePreset(interval: 225, padding: 1, useSectorDensity: false);

            presetGeothermalSpring.SpawnLimitPerIteration = 1;
            presetGeothermalSpring.AddExact <ObjectDepositGeothermalSpring>()
            .SetCustomPaddingWithSelf(79)
            .SetCustomPaddingWith(restrictionInfiniteGeothermalSpring, 59)
            .SetCustomPaddingWith(restrictionDepletedDeposit, 49)
            // ensure no spawn near cliffs
            .SetCustomCanSpawnCheckCallback(
                (physicsSpace, position)
                => ServerCheckAnyTileCollisions(physicsSpace,
                                                // offset on object layout center
                                                new Vector2D(position.X + 1.5,
                                                             position.Y + 1.5),
                                                radius: 7));

            // don't spawn close to roads
            var restrictionPresetRoads = spawnList.CreateRestrictedPreset()
                                         .Add <ObjectPropRoadHorizontal>()
                                         .Add <ObjectPropRoadVertical>();

            presetGeothermalSpring.SetCustomPaddingWith(restrictionPresetRoads, 20);

            // special restriction preset for player land claims
            var restrictionPresetLandclaim = spawnList.CreateRestrictedPreset()
                                             .Add <IProtoObjectLandClaim>();

            // Let's ensure that we don't spawn geothermal spring too close to players' buildings.
            // take size of the largest land claim area
            var paddingToLandClaimsSize = (int)LandClaimSystem.MaxLandClaimSizeWithGraceArea.Value;

            // add few extra tiles (as the objects are not 1*1 tile)
            paddingToLandClaimsSize += 6;

            presetGeothermalSpring.SetCustomPaddingWith(restrictionPresetLandclaim, paddingToLandClaimsSize);
        }
Exemple #2
0
        protected override void PrepareZoneSpawnScript(Triggers triggers, SpawnList spawnList)
        {
            // this resource is not spawned on the world init
            triggers
            // trigger on time interval
            .Add(GetTrigger <TriggerTimeInterval>()
                 .Configure(
                     intervalFrom: TimeSpan.FromHours(1),
                     intervalTo: TimeSpan.FromHours(2)));

            var restrictionPresetPragmium = spawnList.CreateRestrictedPreset()
                                            .Add <ObjectMineralPragmiumSource>();

            var restrictionInfiniteOilSeep = spawnList.CreateRestrictedPreset()
                                             .Add <ObjectDepositOilSeepInfinite>();

            var presetOilSeep = spawnList.CreatePreset(interval: 160, padding: 1);

            presetOilSeep.AddExact <ObjectDepositOilSeep>()
            .SetCustomPaddingWithSelf(75)
            .SetCustomPaddingWith(restrictionInfiniteOilSeep, 75)
            // ensure no spawn near Pragmium
            .SetCustomPaddingWith(restrictionPresetPragmium,
                                  SpawnResourcePragmium.PaddingPragmiumWithOilDeposit)
            // ensure no spawn near cliffs
            .SetCustomCanSpawnCheckCallback(
                (physicsSpace, position)
                => ServerCheckAnyTileCollisions(physicsSpace,
                                                // offset on object layout center
                                                new Vector2D(position.X + 1.5,
                                                             position.Y + 1.5),
                                                radius: 7));

            // special restriction preset for player land claims
            var restrictionPresetLandclaim = spawnList.CreateRestrictedPreset()
                                             .Add <IProtoObjectLandClaim>();

            // Let's ensure that we don't spawn oil seep too close to players' buildings.
            // take size of the largest land claim area
            var paddingToLandClaimsSize = (int)LandClaimSystem.MaxLandClaimSizeWithGraceArea.Value;

            // add few extra tiles (as the objects are not 1*1 tile)
            paddingToLandClaimsSize += 6;

            presetOilSeep.SetCustomPaddingWith(restrictionPresetLandclaim, paddingToLandClaimsSize);
        }
Exemple #3
0
        protected override void PrepareZoneSpawnScript(Triggers triggers, SpawnList spawnList)
        {
            this.spawnRateMultiplier = RateResourcesPragmiumSourceMultiplier.SharedValue;

            // this resource is not spawned on the world init
            triggers
            // trigger on time interval
            .Add(GetTrigger <TriggerTimeInterval>().ConfigureForSpawn(TimeSpan.FromMinutes(30)));

            var presetPragmiumSource = spawnList.CreatePreset(interval: 183, padding: 2, useSectorDensity: false)
                                       .Add <ObjectMineralPragmiumSource>()
                                       .SetCustomPaddingWithSelf(79);

            // don't spawn close to oil seeps
            var restrictionPresetDepositOilSeep = spawnList.CreateRestrictedPreset()
                                                  .Add <ObjectDepositOilSeep>();

            presetPragmiumSource.SetCustomPaddingWith(restrictionPresetDepositOilSeep,
                                                      PaddingPragmiumWithOilDeposit);

            // don't spawn close to roads
            var restrictionPresetRoads = spawnList.CreateRestrictedPreset()
                                         .Add <ObjectPropRoadHorizontal>()
                                         .Add <ObjectPropRoadVertical>();

            presetPragmiumSource.SetCustomPaddingWith(restrictionPresetRoads, 30);

            // special restriction preset for player land claims
            var restrictionPresetLandclaim = spawnList.CreateRestrictedPreset()
                                             .Add <IProtoObjectLandClaim>();

            // Let's ensure that we don't spawn Pragmium Source too close to players' buildings.
            // take half size of the largest land claim area
            var paddingToLandClaimsSize = LandClaimSystem.MaxLandClaimSizeWithGraceArea.Value / 2.0;

            // add the explosion radius
            paddingToLandClaimsSize += Api.GetProtoEntity <ObjectMineralPragmiumSourceExplosion>()
                                       .DamageRadius;
            // add few extra tiles (as the objects are not 1*1 tile)
            paddingToLandClaimsSize += 6;

            presetPragmiumSource.SetCustomPaddingWith(restrictionPresetLandclaim, paddingToLandClaimsSize);
        }
Exemple #4
0
        protected override void PrepareZoneSpawnScript(Triggers triggers, SpawnList spawnList)
        {
            // this resource is not spawned on the world init
            triggers
            // trigger on time interval
            .Add(GetTrigger <TriggerTimeInterval>().ConfigureForSpawn(TimeSpan.FromMinutes(30)));

            var presetBroodNest = spawnList.CreatePreset(interval: 130, padding: 4, useSectorDensity: false)
                                  .Add <MobBroodNest>()
                                  .SetCustomPaddingWithSelf(69);

            // don't spawn close to roads
            var restrictionPresetRoads = spawnList.CreateRestrictedPreset()
                                         .Add <ObjectPropRoadHorizontal>()
                                         .Add <ObjectPropRoadVertical>();

            presetBroodNest.SetCustomPaddingWith(restrictionPresetRoads, 30);
        }
Exemple #5
0
        protected override void PrepareZoneSpawnScript(Triggers triggers, SpawnList spawnList)
        {
            triggers
            // trigger on world init
            .Add(GetTrigger <TriggerWorldInit>())
            // trigger on time interval
            .Add(GetTrigger <TriggerTimeInterval>()
                 .Configure(
                     intervalFrom: TimeSpan.FromHours(4),
                     intervalTo: TimeSpan.FromHours(16)));

            var presetGeothermalSpring = spawnList.CreatePreset(interval: 220, padding: 1);

            presetGeothermalSpring.AddExact <ObjectDepositGeothermalSpring>()
            .SetCustomPaddingWithSelf(75)
            // ensure no spawn near cliffs
            .SetCustomCanSpawnCheckCallback(
                (physicsSpace, position)
                => ServerCheckAnyTileCollisions(physicsSpace,
                                                // offset on object layout center
                                                new Vector2D(position.X + 1.5,
                                                             position.Y + 1.5),
                                                radius: 7));

            // special restriction preset for player land claims
            var restrictionPresetLandclaim = spawnList.CreateRestrictedPreset()
                                             .Add <IProtoObjectLandClaim>();

            // Let's ensure that we don't spawn geothermal spring too close to players' buildings.
            // take half size of the largest land claim area
            var paddingToLandClaimsSize = Api.GetProtoEntity <ObjectLandClaimT4>().LandClaimSize / 2.0;

            // add few extra tiles (as the objects are not 1*1 tile)
            paddingToLandClaimsSize += 6;

            presetGeothermalSpring.SetCustomPaddingWith(restrictionPresetLandclaim, paddingToLandClaimsSize);
        }