feat: add young_player_system feature flag to disable Young player system (#2445)

Adds an opt-in 'youngPlayerSystem.enabled' server setting (default true) that, when set to false, disables the Young player system server-wide:

- Account.Young and PlayerMobile.Young getters short-circuit to false.

- New characters no longer receive Young status or a NewPlayerTicket.

- All downstream Young checks (notoriety beneficial-action restriction, CheckYoungProtection, stealing penalties, YoungDeathTeleport, death-item movement, poison immunity, '(Young)' name suffix, CanLogout, renounce-young keyword/gump, BaseCreature.OnDeath fame penalty, OnLogin time-remaining message) become inert.

Setters are intentionally left untouched so serialized account/player flags round-trip cleanly when the setting is later re-enabled.
This commit is contained in:
Wyatt88 2026-05-06 04:09:49 +01:00 committed by GitHub
parent e9c7aac510
commit ee1bf23b72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@ using Server.Misc;
using Server.Mobiles;
using Server.Multis;
using Server.Network;
using Server.Systems.FeatureFlags;
namespace Server.Accounting;
@ -250,7 +251,7 @@ public partial class Account : IAccount, IComparable<Account>
/// </summary>
public bool Young
{
get => !GetFlag(1);
get => ContentFeatureFlags.YoungPlayerSystem && !GetFlag(1);
set
{
SetFlag(1, !value);

View file

@ -13,4 +13,5 @@ public static class ContentFeatureFlags
public static bool BoatPlacement { get; set; } = true;
public static bool BulkOrders { get; set; } = true;
public static bool PassiveDetectHidden { get; set; } = true;
public static bool YoungPlayerSystem { get; set; } = true;
}

View file

@ -975,6 +975,7 @@ public static class FeatureFlagManager
"boat_placement" => ContentFeatureFlags.BoatPlacement = enabled,
"bulk_orders" => ContentFeatureFlags.BulkOrders = enabled,
"passive_detect_hidden" => ContentFeatureFlags.PassiveDetectHidden = enabled,
"young_player_system" => ContentFeatureFlags.YoungPlayerSystem = enabled,
};
}

View file

@ -684,7 +684,7 @@ namespace Server.Mobiles
[CommandProperty(AccessLevel.GameMaster)]
public bool Young
{
get => GetFlag(PlayerFlag.Young);
get => ContentFeatureFlags.YoungPlayerSystem && GetFlag(PlayerFlag.Young);
set
{
SetFlag(PlayerFlag.Young, value);