Ejemplo n.º 1
0
        static LandClaimSystemConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            SharedRaidBlockDurationSeconds = MathHelper.Clamp(
                value: ServerRates.Get(
                    key: "RaidBlockDurationSeconds",
                    defaultValue: 10 * 60, // 10 minutes
                    description:
                    @"This rate determines the raid block duration in PvP.
                      Min value: 0 seconds.
                      Max value: 3600 seconds (one hour)."),
                min: 0,
                max: 60 * 60);

            SharedLandClaimsNumberLimitIncrease = (ushort)MathHelper.Clamp(
                value: ServerRates.Get(
                    key: "LandClaimsNumberLimitIncrease",
                    defaultValue: 0,
                    description:
                    @"This rate determines the EXTRA number of land claims ANY player can build.                                
                      Currently in the game every player can build max 3 land claims.
                      This rate allows to increase the number.
                      Please don't set it too high otherwise players might abuse this in order to block other players.
                      Min value: 0 (extra 0 land claims, that's the default value).
                      Max value: 50 (extra 50 land claims)."),
                min: 0,
                max: 9);
        }
Ejemplo n.º 2
0
        static PartyConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            ServerPartyMembersMax
                = (ushort)MathHelper.Clamp(
                      ServerRates.Get(
                          "PartyMembersMax",
                          defaultValue: 10,
                          @"How many party members are allowed per party.
                          The value should be within 1-100 range."),
                      min: 1,
                      max: 100);

            PartyLearningPointsSharePercent
                = MathHelper.Clamp(
                      ServerRates.Get(
                          "PartyLearningPointsSharePercent",
                          defaultValue: 30.0,
                          @"This rate determines the percent of gained learning points 
                            distributed to other online party members.
                            By default, 30% of gained LP is deducted and shared among
                            all the other online party members equally.
                            You also receive part of the said 30% LP from all other party members.
                            If there are no other online party members, 100% of gained LP goes to the player who gained it.
                            You can set this value at any number from 0 to 100 percents if it makes any sense."),
                      min: 0.0,
                      max: 100.0)
                  / 100.0;
        }
Ejemplo n.º 3
0
        static ItemFreshnessConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            const double minValue     = 0.01,
                         maxValue     = 100,
                         defaultValue = 1.0;
            var key         = "FreshnessDecaySpeedMultiplier";
            var description = $@"Adjusts the speed at which the food and some other items lose their freshness.
                                 (allowed range: from {minValue:0.0###} to {maxValue:0.0###})";

            SharedFreshnessDecaySpeedMultiplier = ServerRates.Get(
                key,
                defaultValue: defaultValue,
                description);

            var clampedValue = MathHelper.Clamp(SharedFreshnessDecaySpeedMultiplier, minValue, maxValue);

            // ReSharper disable once CompareOfFloatsByEqualityOperator
            if (SharedFreshnessDecaySpeedMultiplier != clampedValue)
            {
                // incorrect value, reset to the vanilla value
                clampedValue = defaultValue;
                ServerRates.Reset(key, defaultValue, description);
            }

            SharedFreshnessDecaySpeedMultiplier = clampedValue;
        }
Ejemplo n.º 4
0
        static LandClaimShieldProtectionConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            SharedIsEnabled =
                ServerRates.Get(
                    "PvP.ShieldProtection.Enabled",
                    defaultValue: 1,
                    @"Set it to 0 to disable the S.H.I.E.L.D. protection (PvP only).
                    Set it to 1 to enable the S.H.I.E.L.D. protection.")
                > 0;

            if (PveSystem.ServerIsPvE)
            {
                SharedIsEnabled = false;
            }

            SharedCooldownDuration = ServerRates.Get(
                "PvP.ShieldProtection.CooldownDuration",
                defaultValue: 30 * 60,
                @"Cannot reactivate a deactivated shield for this duration (in seconds).");

            SharedActivationDuration = ServerRates.Get(
                "PvP.ShieldProtection.ActivationDuration",
                defaultValue: 15 * 60,
                @"Shield activation duration (in seconds).");
        }
        static ItemsContainerLandClaimSafeStorage()
        {
            WhitelistItemPrototypes = new List <Type>()
            {
                typeof(IProtoItemAmmo),
                typeof(IProtoItemEquipment), // including devices and implants
                typeof(IProtoItemExplosive),
                typeof(IProtoItemMedical),
                typeof(IProtoItemSeed),
                typeof(IProtoItemTool),
                typeof(IProtoItemFuelElectricity),
                typeof(IProtoItemWeapon)
            };

            if (IsClient)
            {
                return;
            }

            ServerSafeItemsSlotsCapacity = (byte)MathHelper.Clamp(
                ServerRates.Get(
                    "SafeStorageCapacity",
                    defaultValue: 24,
                    @"How many safe storage slots are allowed per base.
                          The value should be within 0-128 range.
                          Doesn't apply to PvE mode (there is no safe storage in PvE)."),
                min: 0,
                max: 128);

            if (PveSystem.ServerIsPvE)
            {
                ServerSafeItemsSlotsCapacity = 0;
            }
        }
Ejemplo n.º 6
0
        static PartyConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            ServerPartyMembersMax
                = (ushort)MathHelper.Clamp(
                      ServerRates.Get(
                          "PartyMembersMax",
                          defaultValue: 10,
                          @"How many party members are allowed per party.
                          The value should be within 1-100 range."),
                      min: 1,
                      max: 100);

            PartyLearningPointsSharePercent
                = MathHelper.Clamp(
                      ServerRates.Get(
                          "PartyLearningPointsSharePercent",
                          defaultValue: 0,
                          @"This rate determines the percent of gained learning points 
                            distributed to other online party members.
                            By default, this feature is disabled: 0% of gained LP is deducted and shared among
                            all the other online party members equally.
                            You can enable it to any percent you want but generally we don't recommend going higher than 30!
                            If there are no other online party members, 100% of gained LP goes to the player who gained it.
                            You can set this value at any number from 0 to 100 percents if it makes any sense."),
                      min: 0.0,
                      max: 100.0)
                  / 100.0;

            PartyLearningPointsSharePercent = MathHelper.Clamp(PartyLearningPointsSharePercent, min: 0, max: 1);
        }
Ejemplo n.º 7
0
        static ItemStackSize()
        {
            if (Api.IsClient)
            {
                return;
            }

            const string key          = "ItemStackSizeMultiplier";
            const double defaultValue = 1.0,
                         minValue     = 1.0,
                         maxValue     = 50;

            var description
                = $@"Item stack size multiplier.
                     For example, by default one slot can contain up to 250 stone.
                     You can increase this number by raising this multiplier.
                     (allowed range: from {minValue:0.0###} to {maxValue:0.0###}).";

            itemStackSizeMultiplier = ServerRates.Get(key,
                                                      defaultValue,
                                                      description);

            if (itemStackSizeMultiplier < minValue ||
                itemStackSizeMultiplier > maxValue)
            {
                itemStackSizeMultiplier = defaultValue;
                ServerRates.Reset(key,
                                  defaultValue,
                                  description);
            }

            SharedApplyRates();
            Logger.Important($"Item stack size multiplier from rates config: x{itemStackSizeMultiplier:0.##}");
        }
Ejemplo n.º 8
0
        static MobPragmiumQueen()
        {
            var key          = "BossDifficultyPragmiumQueen";
            var defaultValue = 5.0; // by default the boss is balanced for 5 players
            var description  =
                @"Difficulty of the Pragmium Queen boss (and the amount of loot/reward).
                  The number is corresponding to the number of players necessary to kill the boss
                  with a reasonable challenge
                  (with mechs or without mechs but in T4 armor, machineguns, with Stimpacks).                  
                  You can setup this rate to make boss possible to kill
                  by a single player (set 1 or 1.5 for extra challenge and reward)
                  or any other number of players up to 10.
                  It's affecting the number of loot piles you get when the boss is killed.
                  The value range is from 1 to 10 (inclusive).";

            var requiredPlayersNumber = ServerRates.Get(key, defaultValue: defaultValue, description);

            {
                var clampedValue = MathHelper.Clamp(requiredPlayersNumber, 1, 10);
                if (clampedValue != requiredPlayersNumber)
                {
                    clampedValue = defaultValue;
                    ServerRates.Reset(key, defaultValue, description);
                }

                requiredPlayersNumber = clampedValue;
            }

            // coef range from 0.2 to 2.0
            ServerBossDifficultyCoef = requiredPlayersNumber / 5.0;

            MaxLootWinners = (int)Math.Ceiling(requiredPlayersNumber * 2);
            MaxLootWinners = Math.Max(MaxLootWinners, 5); // ensure at least 5 winners
        }
Ejemplo n.º 9
0
        static WeaponConstants()
        {
            DamageCreaturesMultiplier = ServerRates.Get(
                "DamageCreaturesMultiplier",
                defaultValue: 1.0,
                @"All damage dealt by creatures (to player and/or other creatures) is multiplied on this rate.
                  It allows to make it harder or easier to kill players by creatures.");

            DamageExplosivesToCharactersMultiplier = ServerRates.Get(
                "DamageExplosivesToCharactersMultiplier",
                defaultValue: 1.0,
                @"All damage dealt by bombs to characters is multiplied on this rate.
                  You can set it to 0 to disable bombs damage to characters.
                  Applies only on PvP servers - on PvE it will be always 0.");

            DamageExplosivesToStructuresMultiplier = ServerRates.Get(
                "DamageExplosivesToStructuresMultiplier",
                defaultValue: 1.0,
                @"All damage dealt by bombs to structures is multiplied on this rate.
                  You can set it to 0 to disable bombs damage to structures.
                  Applies only on PvP servers - on PvE it will be always 0.");

            DamageFriendlyFireMultiplier = MathHelper.Clamp(
                ServerRates.Get(
                    "DamageFriendlyFireMultiplier",
                    defaultValue: 0.0,
                    @"Multiplier for the friendly fire damage
                      (when one party member damaging another with any weapon except explosives).
                      0.0 - disable friendly fire completely.
                      1.0 - enable friendly fire completely.
                      You can also set it to something in between like 0.5
                      to reduce the damage but not eliminate it completely."),
                min: 0.0,
                max: 1.0);

            DamagePveMultiplier = ServerRates.Get(
                "DamagePveMultiplier",
                defaultValue: 1.0,
                @"All damage dealt from player to environment (NPC/creatures, world objects,
                  also trees and rocks when player is not using a woodcutting/mining tool)
                  is multiplied on this rate.
                  It allows to make it harder or easier to kill creatures by players.");

            DamagePvpMultiplier = ServerRates.Get(
                "DamagePvpMultiplier",
                defaultValue: 0.5,
                @"All damage dealt from player to player (via weapons only) is multiplied on this rate.
                  It allows to decrease or increase the combat duration.
                  You can set it to 0 to disable PvP damage (doesn't apply to bombs damage!).");

            if (!Api.IsServer ||
                PveSystem.ServerIsPvE)
            {
                // set explosives rates to zero for PvE servers and all clients
                DamageExplosivesToCharactersMultiplier = 0;
                DamageExplosivesToStructuresMultiplier = 0;
            }
        }
Ejemplo n.º 10
0
 static CraftingSystem()
 {
     ServerCraftingSpeedMultiplier = ServerRates.Get(
         "CraftingSpeedMultiplier",
         defaultValue: 1.0,
         @"This rate determines the crafting speed of recipes
           started from crafting menu or from any workbench.
           Does NOT apply to manufacturing structures (such as furnace) - edit ManufacturingSpeedMultiplier for these.");
 }
Ejemplo n.º 11
0
 static ChatSystem()
 {
     ServerIsTradeChatRoomEnabled
         = ServerRates.Get("IsTradeChatRoomEnabled",
                           defaultValue: 1,
                           description: @"Is ""Trade"" chat room available on this server?
                                          You can set it to 0 to disable it")
           > 0;
 }
Ejemplo n.º 12
0
 static DropItemsList()
 {
     DropListItemsCountMultiplier = ServerRates.Get(
         "DropListItemsCountMultiplier",
         defaultValue: 1.0,
         @"This rate determines the item droplist multiplier.                
           If you want the objects in game (such as trees, bushes, minerals, loot crates in radtowns, etc)
           to drop more items during gathering or destruction, you need to adjust this value.");
 }
Ejemplo n.º 13
0
 public override void ServerInitialize(IServerConfiguration serverConfiguration)
 {
     ServerPvpIsFullLootEnabled
         = ServerRates.Get(
               "PvP.IsFullLootEnabled",
               defaultValue: 0,
               @"For PvP servers you can enable full loot (dropping the equipped items on death)
                 or keep it by default (not dropping the equipped items on death).")
           != 0;
 }
Ejemplo n.º 14
0
 static EventBossPragmiumQueen()
 {
     ServerEventDelayHours = ServerRates.Get(
         "EventDelay.BossPragmiumQueen",
         defaultValue: 48.0,
         @"This hours value determines when the Pragmium Queen boss will start spawning for the first time.                  
           Please note: for PvP server this value will be substituted by time-gating setting
           for T4 specialized tech if it's larger than this value (as there is no viable way
           for players to defeat the boss until T4 weapons becomes available).");
 }
Ejemplo n.º 15
0
        static ToolsConstants()
        {
            ActionMiningSpeedMultiplier = ServerRates.Get(
                "ActionMiningSpeedMultiplier",
                defaultValue: 1.0,
                @"Adjusts the damage to minerals by mining tools.");

            ActionWoodcuttingSpeedMultiplier = ServerRates.Get(
                "ActionWoodcuttingSpeedMultiplier",
                defaultValue: 1.0,
                @"Adjusts the damage to trees by woodcutting tools.");
        }
Ejemplo n.º 16
0
        static WeaponConstants()
        {
            DamageCreaturesMultiplier = ServerRates.Get(
                "DamageCreaturesMultiplier",
                defaultValue: 1.0,
                @"All damage dealt by creatures (to player and/or other creatures) is multiplied on this rate.
                  It allows to make it harder or easier to kill players by creatures.");

            DamageExplosivesToCharactersMultiplier = ServerRates.Get(
                "DamageExplosivesToCharactersMultiplier",
                defaultValue: 1.0,
                @"All damage dealt by bombs to characters is multiplied on this rate.
                  You can set it to 0 to disable bomb/grenade damage to characters.
                  Please note that in PvE it's always not possible to damage other characters
                  unless the duel mode is explicitly enabled by players.");

            DamageExplosivesToStructuresMultiplier = ServerRates.Get(
                "DamageExplosivesToStructuresMultiplier",
                defaultValue: 2.0,
                @"All damage dealt by bombs and grenades to structures is multiplied on this rate.
                  You can set it to 0 to disable explosives damage to structures.
                  Applies only on PvP servers—on PvE it will be always 0.
                  Please note: in A27 the default value is 2.0 as the S.H.I.E.L.D. protection was introduced.");

            DamageFriendlyFireMultiplier = MathHelper.Clamp(
                ServerRates.Get(
                    "DamageFriendlyFireMultiplier",
                    defaultValue: 1.0,
                    @"Multiplier for the friendly fire damage
                      (when one party member damaging another with any weapon except explosives).
                      0.0 - disable friendly fire completely.
                      1.0 - enable friendly fire completely.
                      You can also set it to something in between like 0.5
                      to reduce the damage but not eliminate it completely."),
                min: 0.0,
                max: 1.0);

            DamagePveMultiplier = ServerRates.Get(
                "DamagePveMultiplier",
                defaultValue: 1.0,
                @"All damage dealt from player to environment (NPC/creatures, world objects,
                  also trees and rocks when player is not using a woodcutting/mining tool)
                  is multiplied on this rate.
                  It allows to make it harder or easier to kill creatures by players.");

            DamagePvpMultiplier = ServerRates.Get(
                "DamagePvpMultiplier",
                defaultValue: 0.5,
                @"All damage dealt from player to player (via weapons only) is multiplied on this rate.
                  It allows to decrease or increase the combat duration.
                  You can set it to 0 to disable PvP damage (doesn't apply to bombs damage!).");
        }
 static WorldMapResourceMarksSystem()
 {
     IsResourceDepositCoordinatesHiddenUntilCapturePossible =
         ServerRates.Get(
             "IsResourceDepositCoordinatesHiddenUntilCapturePossible",
             defaultValue: Api.IsEditor
                               ? 0
                               : 1,
             @"(for PvP servers only) Set it to 1 to hide the resource deposit (such as oil or Li)
                world coordinates until the capture is possible.
                When coordinates are hidden, players will receive only a biome name
                instead of the actual coordinates for the resource deposit.")
         > 0;
 }
Ejemplo n.º 18
0
        // This rate determines the LP rate between skill experience to learning points.
        // Example: with 0.01 conversion rate 100 EXP will result in 1 LP gained.
        // However, it's affected by LearningPointsGainMultiplier which is configured via server rates config.

        static TechConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            ServerLearningPointsGainMultiplier = ServerRates.Get(
                "LearningPointsGainMultiplier",
                defaultValue: Api.IsServer && ServerLocalModeHelper.IsLocalServer
                                  ? 2.0
                                  : 1.0,
                @"This rate determines the learning points rate
                  from skills experience and neural enhancer consumable item.");

            ServerSkillExperienceGainMultiplier = ServerRates.Get(
                "SkillExperienceGainMultiplier",
                defaultValue: Api.IsServer && ServerLocalModeHelper.IsLocalServer
                                  ? 2.0
                                  : 1.0,
                @"This rate determines the skill experience gain multiplier.                
                If you want to make faster or slower skill progression (and so faster LP gain as well)
                you can modify this multiplier to a higher value.");

            ServerSkillExperienceToLearningPointsConversionMultiplier = 0.01 * ServerLearningPointsGainMultiplier;

            {
                var key          = "PvP.TimeGating";
                var defaultValue = "24,72,120,168,216,216";

                var description =
                    @"This rate determines the time-gating values for Tier 3-5 technologies on PvP servers.
                  Please configure a sequence in hours for Tier 3-5 technologies in the following format:
                  T3 basic, T3 specialized, T4 basic, T4 advanced, T5 basic, T5 advanced
                  If you want to disable time-gating completely please use: 0,0,0,0,0,0";

                var currentValue = ServerRates.Get(key, defaultValue, description);

                try
                {
                    ParseTimeGating(currentValue);
                }
                catch
                {
                    Api.Logger.Error($"Incorrect format for server rate: {key} current value {currentValue}");
                    ServerRates.Reset(key, defaultValue, description);
                    currentValue = defaultValue;
                    ParseTimeGating(currentValue);
                }
Ejemplo n.º 19
0
        static OnlinePlayersSystem()
        {
            if (IsClient)
            {
                return;
            }

            ServerIsListHidden
                = ServerRates.Get(
                      "PvP.IsOnlinePlayersListHidden",
                      defaultValue: 0,
                      @"For PvP servers you can hide the online players list.
                        Please note: it's always visible for players with administrator and moderator access.")
                  != 0;
        }
Ejemplo n.º 20
0
        static PveSystem()
        {
            if (IsClient)
            {
                return;
            }

            serverIsPvE = ServerRates.Get(
                "PvE",
                defaultValue: Api.IsEditor ? 0 : 1,
                description:
                @"PvP / PvE mode switch.
                              Set it to 0 to make this server PvP-only. Otherwise it will default to PvE.")
                          > 0;
        }
Ejemplo n.º 21
0
        static PveSystem()
        {
            if (IsClient)
            {
                return;
            }

            serverIsPvE = ServerRates.Get("PvE",
                                          defaultValue: 0,
                                          description:
                                          @"PvP / PvE mode switch.
                              Set it to 1 to make this server PvE-only. Otherwise it will default to PvP.
                              Please note: this changes game mechanics dramatically.
                              Do NOT change it after the server world is created as it might lead to unexpected consequences.")
                          > 0;
        }
Ejemplo n.º 22
0
        static FarmingConstants()
        {
            if (Api.IsClient)
            {
                ServerFarmPlantsGrowthSpeedMultiplier = 1.0;
                SharedFarmPlantsSpoilSpeedMultiplier  = 1.0;
                return;
            }

            ServerFarmPlantsGrowthSpeedMultiplier = ServerRates.Get(
                "FarmPlantsGrowthSpeedMultiplier",
                defaultValue: 1.0,
                @"This rate determines how fast the farm plants grow.
                  (it doesn't apply to the already planted plants until harvested, watered, or fertilizer applied)");

            const double minValue     = 0.01,
                         maxValue     = 100,
                         defaultValue = 1.0;
            var key         = "FarmPlantsSpoilSpeedMultiplier";
            var description = $@"This rate determines how fast the farm plants spoil.
                                 To make plants spoil twice as slow set it 0.5, to make them spoil twice as fast set it to 2.0.
                                 (allowed range: from {minValue:0.0###} to {maxValue:0.0###})
                                 (it doesn't apply to the already planted plants until harvested, watered, or fertilizer applied)";

            SharedFarmPlantsSpoilSpeedMultiplier = ServerRates.Get(
                key,
                defaultValue: defaultValue,
                description);

            var clampedValue = MathHelper.Clamp(SharedFarmPlantsSpoilSpeedMultiplier, minValue, maxValue);

            // ReSharper disable once CompareOfFloatsByEqualityOperator
            if (SharedFarmPlantsSpoilSpeedMultiplier != clampedValue)
            {
                // incorrect value, reset to the vanilla value
                clampedValue = defaultValue;
                ServerRates.Reset(key, defaultValue, description);
            }

            SharedFarmPlantsSpoilSpeedMultiplier = clampedValue;

            Api.Logger.Important("Farm plants growth speed multiplier: "
                                 + ServerFarmPlantsGrowthSpeedMultiplier.ToString("0.###")
                                 + Environment.NewLine
                                 + "Farm plants spoil speed multiplier: "
                                 + SharedFarmPlantsSpoilSpeedMultiplier.ToString("0.###"));
        }
Ejemplo n.º 23
0
        static PveSystem()
        {
            if (IsClient)
            {
                return;
            }

            serverIsPvE = ServerRates.Get("PvE",
                                          defaultValue: Api.IsEditor ? 0 : 1,
                                          description:
                                          @"PvP / PvE mode switch.
                              Set it to 1 to make this server PvE-only. Otherwise it will default to PvP.
                              Please note: this changes some of the game mechanics.
                              It's better not to change it after the server world is created
                              as it might lead to unexpected consequences. But usually it's fine.")
                          > 0;
        }
Ejemplo n.º 24
0
        static LandClaimSystemConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            SharedLandClaimOwnersMax = (byte)MathHelper.Clamp(
                ServerRates.Get(
                    "LandClaimOwnersMax",
                    // by default it's 5 owners only, if players wish to add more they can create a faction
                    defaultValue: 5,
                    @"This rate determines the max number of land claim's owners (including the founder)
                      for land claims that are not transferred to faction ownership.
                      If you want to make a server where players must group in factions,
                      set it to 1 and reduce the faction create cost.
                      Min value: 1 owner (no access list displayed).
                      Max value: 255 owners (no limit displayed)."),
                min: 1,
                max: byte.MaxValue);

            SharedRaidBlockDurationSeconds = MathHelper.Clamp(
                ServerRates.Get(
                    "PvP.RaidBlockDurationSeconds",
                    defaultValue: 10 * 60, // 10 minutes
                    @"This rate determines the raid block duration in PvP.
                      Min value: 0 seconds.
                      Max value: 3600 seconds (one hour)."),
                min: 0,
                max: 60 * 60);

            SharedLandClaimsNumberLimitIncrease = (ushort)MathHelper.Clamp(
                ServerRates.Get(
                    "LandClaimsNumberLimitIncrease",
                    defaultValue: ServerLocalModeHelper.IsLocalServer
                                      ? 10 // more land claims for local server
                                      : 0,
                    @"This rate determines the EXTRA number of land claims ANY player can own simultaneously.                                
                      Currently in the game every player can build max 3 land claims.
                      This rate allows to increase the number.
                      Please note: it doesn't apply to faction-controlled land claims (see Faction.LandClaimsPerLevel).
                      Min value: 0 (extra 0 land claims, that's the default value).
                      Max value: 50 (extra 50 land claims)."),
                min: 0,
                max: 50);
        }
Ejemplo n.º 25
0
        static TechConstants()
        {
            ServerLearningPointsGainMultiplier = ServerRates.Get(
                "LearningPointsGainMultiplier",
                defaultValue: 1.0,
                @"This rate determines the learning points rate
                  from skills experience and neural enhancer consumable item.");

            SkillExperienceGainMultiplier = ServerRates.Get(
                "SkillExperienceGainMultiplier",
                defaultValue: 1.0,
                @"This rate determines the skill experience gain multiplier.                
                If you want to make faster or slower skill progression (and so faster LP gain as well)
                you can modify this multiplier to a higher value.");

            SkillExperienceToLearningPointsConversionMultiplier = 0.01 * ServerLearningPointsGainMultiplier;
        }
        static MigrantMutantConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            MigrationMutantDurationWithoutDelay = ServerRates.Get(
                "MigrationMutantDurationWithoutDelay",
                defaultValue: 15,
                @"Mutant migration duration in minutes without the 5 minutes delay.");

            MigrationMutantDurationWithoutDelay = MathHelper.Clamp(MigrationMutantDurationWithoutDelay, 1, 120);


            MigrationMutantWaveCount = ServerRates.Get(
                "MigrationMutantWaveCount",
                defaultValue: 5,
                @"Number of waves for mutant migration event.");

            MigrationMutantWaveCount = MathHelper.Clamp(MigrationMutantWaveCount, 0, 50);


            string mobCountString = ServerRates.Get(
                "MigrationMutantMobCount",
                defaultValue: "1,4,8,13,20",
                @"Number of mobs for each claims (T1 to T5).");

            string[] mobCountSplit = mobCountString.Replace(" ", "").Split(',');
            if (mobCountSplit.Length != 5)
            {
                MigrationMutantMobCount = new int[] { 1, 4, 8, 13, 20 }
            }
            ;
            else
            {
                MigrationMutantMobCount = Array.ConvertAll(mobCountSplit, s => int.Parse(s));
            }

            for (int i = 0; i < MigrationMutantMobCount.Length; i++)
            {
                MigrationMutantMobCount[i] = MathHelper.Clamp(MigrationMutantMobCount[i], 0, 50);
            }
        }
Ejemplo n.º 27
0
        static CharacterHungerThirstSystem()
        {
            if (IsClient)
            {
                // only server will update food and water values
                return;
            }

            var foodDecreaseSpeedMultiplier = ServerRates.Get(
                "PlayerFoodDecreaseSpeedMultiplier",
                defaultValue: 1.0,
                @"Food consumption speed multiplier for hunger mechanic. 
                  By default the game will consume 100 food points in 1.2 hours,
                  you can make it faster or slower, or disable altogether.");

            var waterDecreaseSpeedMultiplier = ServerRates.Get(
                "PlayerWaterDecreaseSpeedMultiplier",
                defaultValue: 1.0,
                @"Water consumption speed multiplier for thirst mechanic.
                  By default the game will consume 100 water points in 1 hour,
                  you can make it faster or slower, or disable altogether.
                  Please note the game will consume water twice as fast if player's stamina is regenerating.");

            if (foodDecreaseSpeedMultiplier < 0)
            {
                foodDecreaseSpeedMultiplier = 0;
            }

            if (waterDecreaseSpeedMultiplier < 0)
            {
                waterDecreaseSpeedMultiplier = 0;
            }

            FoodDecreasePerSecond  = 100.0 / (60.0 * 60.0 * 1.2);   // consume 100 food points in 1.2 hour(s).
            FoodDecreasePerSecond *= foodDecreaseSpeedMultiplier;   // apply the multiplier

            WaterDecreasePerSecond  = 100.0 / (60.0 * 60.0 * 1.0);  // consume 100 water points in 1.0 hour(s)
            WaterDecreasePerSecond *= waterDecreaseSpeedMultiplier; // apply the multiplier
        }
Ejemplo n.º 28
0
        static EventConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            ServerEventDelayMultiplier = ServerRates.Get(
                "WorldEventDelayMultiplier",
                defaultValue: ServerLocalModeHelper.IsLocalServer
                                  ? 0.2
                                  : 1.0,
                @"Determines the world event delay multiplier.
                  Most events have a configured delay to prevent them from starting until players could advance enough.
                  E.g. bosses will not spawn for the first 48 hours after the server wipe. 
                  With this multiplier it's possible to adjust the delay to make events starting earlier or later
                  (for example, if you want to get a boss spawn after 12 instead of 48 hours, set the multiplier to 0.25).
                  Please note: on PvP servers certain events like bosses will never start until
                  the T4 specialized tech time gate is unlocked (as there is no viable way
                  for players to defeat the boss until they can craft T4 weapons).");

            ServerEventDelayMultiplier = MathHelper.Clamp(ServerEventDelayMultiplier, 0, 10);
        }
Ejemplo n.º 29
0
        static StructureConstants()
        {
            IsStructuresDecayEnabled =
                ServerRates.Get(
                    "StructuresDecayEnabled",
                    defaultValue: 1,
                    @"Set it to 0 to disable the structures decay.
                    Set it to 1 to enable the structures decay.")
                > 0;

            StructuresAbandonedDecayDelaySeconds = ServerRates.Get(
                "StructuresAbandonedDecayDelaySeconds",
                defaultValue: 32 * 60 * 60,
                @"Time (in real world seconds) before an abandoned structure (without the land claim) will start decaying.
                  Default value: 32 hours or 115200 seconds. Don't set it higher than 2 billions.");

            StructuresLandClaimDecayDelayDurationMultiplier = ServerRates.Get(
                "StructuresLandClaimDecayDelayDurationMultiplier",
                defaultValue: 1.0,
                @"Time multiplier before an abandoned land claim (or base) will start decaying.
                  For example, the default decay delay for the land claims (T1) is 32 hours,
                  but with 2.0 multiplier it will be increased to 64 hours (for T1).");

            StructuresDecayDurationSeconds = ServerRates.Get(
                "StructuresDecayDurationSeconds",
                defaultValue: 24 * 60 * 60,
                @"Time (in real world seconds) for a structure to completely destroy by decay.
                  While decaying, the structure will receive a regular damage proportional to its HP.
                  It also means that if the structure is already damaged, it will decay even faster.
                  Default value: 24 hours or 86400 seconds. Don't set it higher than 2 billions.");

            ManufacturingSpeedMultiplier = ServerRates.Get(
                "ManufacturingSpeedMultiplier",
                defaultValue: 1.0,
                @"Manufacturing rate for all manufacturers (such as furnaces, oil/Li extractors, oil refineries, wells, mulchboxes, etc.)");
        }
Ejemplo n.º 30
0
        static FactionConstants()
        {
            if (Api.IsClient)
            {
                return;
            }

            sharedPublicFactionMembersMax
                = (ushort)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.MembersMax.PublicFaction",
                          defaultValue: 100,
                          @"How many faction members are allowed for a public faction
                          (that anyone can join freely at any time).
                          IMPORTANT: You can set this to 0 to disable public factions altogether.
                          The value should be within 0-250 range."),
                      min: 0,
                      max: 250);

            sharedPrivateFactionMembersMax
                = (ushort)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.MembersMax.PrivateFaction",
                          defaultValue: 10,
                          @"How many faction members are allowed for a private faction
                          (that players can join only by submitting an application or receiving an invite).
                          The value should be within 1-250 range."),
                      min: 1,
                      max: 250);

            SharedCreateFactionLearningPointsCost
                = (ushort)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.CreateCostLearningPoints",
                          defaultValue: PveSystem.ServerIsPvE
                                          ? 100
                                          : 200,
                          @"How many learning points are required in order to create a faction.
                          The default value is 100 for PvE and 200 for PvP servers.
                          The value should be within 1-65000 range."),
                      min: 1,
                      max: 65000);

            SharedFactionJoinCooldownDuration
                = (uint)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.JoinCooldownDuration",
                          defaultValue: 6 * 60 * 60,
                          @"Faction switch cooldown duration (in seconds).
                          Applied when leaving a faction so player cannot join or create another faction quickly.                          
                          Default value: 6 hours or 21600 seconds.
                          Min duration: 60 seconds. Max duration: 7 days (604800 seconds)."),
                      min: 60,
                      max: 7 * 24 * 60 * 60);

            SharedFactionJoinReturnBackCooldownDuration
                = (uint)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.JoinReturnCooldownDuration",
                          defaultValue: 24 * 60 * 60,
                          @"Faction join-return cooldown duration (in seconds).
                          Applied when player attempts to join the faction back after leaving it recently.
                          Please note: this value cannot be lower than Faction.JoinCooldownDuration.
                          Default value: 24 hours or 86400 seconds.
                          Min duration: 60 seconds. Max duration: 7 days (604800 seconds)."),
                      min: 60,
                      max: 7 * 24 * 60 * 60);

            if (SharedFactionJoinReturnBackCooldownDuration < SharedFactionJoinCooldownDuration)
            {
                SharedFactionJoinReturnBackCooldownDuration = SharedFactionJoinCooldownDuration;
            }

            SharedFactionLandClaimsPerLevel
                = (float)MathHelper.Clamp(
                      ServerRates.Get(
                          "Faction.LandClaimsPerLevel",
                          defaultValue: 1.2,
                          @"Determines how many land claims each faction level provides.
                          Total number is calculated as a faction level multiplied by this rate,
                          then rounded to the nearest integer number."),
                      min: 1,
                      max: 20);

            SharedPvpAlliancesEnabled
                = ServerRates.Get(
                      "Faction.PvP.AlliancesEnabled",
                      defaultValue: 1,
                      @"Determines whether the alliances list is available for PvP servers.
                        By default PvP alliances are allowed.
                        Change to 0 to disable alliances. Please note: already existing alliance will remain.")
                  == 1;

            {
                var key = "Faction.UpgradeCostPerLevel";
                var defaultValue
                    = ServerLocalModeHelper.IsLocalServer
                          ? "100,200,350,500,700,1000,1500,2500,5000" // cheaper for local server
                          : "200,500,1000,1700,2500,3500,5000,7000,10000";
                var description =
                    @"This rate determines the faction upgrade Learning Points cost for each faction level.
                      Please note: the max faction level is 10 and the first one is received automatically,
                      so this setting contains 9 comma-separated values.";

                var currentValue = ServerRates.Get(key, defaultValue, description);

                try
                {
                    SharedFactionUpgradeCosts = ParseFactionUpgradeCosts(currentValue);
                }
                catch
                {
                    Api.Logger.Error($"Incorrect format for server rate: {key} current value {currentValue}");
                    ServerRates.Reset(key, defaultValue, description);
                    currentValue = defaultValue;
                    SharedFactionUpgradeCosts = ParseFactionUpgradeCosts(currentValue);
                }