diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index f34137c006..858dbecf13 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -462,6 +462,9 @@ namespace Content.Server.Ghost if (HasComp(entity)) continue; + if (TryComp(entity, out var invisibilityComponent) && invisibilityComponent.Invisible) + continue; + var playerDepartmentId = _prototypeManager.Index("Specific").ID; var playerJobName = "Неизвестно"; diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index 6c80dce805..6399bc3bee 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -16,6 +16,7 @@ using Content.Shared.Chemistry.Reagent; using Content.Shared.Database; using Content.Shared.DoAfter; using Content.Shared.FixedPoint; +using Content.Shared.Hands.EntitySystems; using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; @@ -47,6 +48,7 @@ public sealed class DrinkSystem : SharedDrinkSystem [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; + [Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; [Dependency] private readonly StomachSystem _stomach = default!; @@ -155,6 +157,9 @@ public sealed class DrinkSystem : SharedDrinkSystem _appearance.SetData(uid, FoodVisuals.Visual, drainAvailable.Float(), appearance); } + /// + /// Tries to feed the drink item to the target entity + /// private bool TryDrink(EntityUid user, EntityUid target, DrinkComponent drink, EntityUid item) { if (!HasComp(target)) @@ -209,9 +214,9 @@ public sealed class DrinkSystem : SharedDrinkSystem BreakOnDamage = true, MovementThreshold = 0.01f, DistanceThreshold = 1.0f, - // Mice and the like can eat without hands. - // TODO maybe set this based on some CanEatWithoutHands event or component? - NeedHand = forceDrink, + // do-after will stop if item is dropped when trying to feed someone else + // or if the item started out in the user's own hands + NeedHand = forceDrink || _hands.IsHolding(user, item), }; _doAfter.TryStartDoAfter(doAfterEventArgs); diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 49d7374041..6293e76631 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -95,6 +95,9 @@ public sealed class FoodSystem : EntitySystem args.Handled = result.Handled; } + /// + /// Tries to feed the food item to the target entity + /// public (bool Success, bool Handled) TryFeed(EntityUid user, EntityUid target, EntityUid food, FoodComponent foodComp) { //Suppresses eating yourself and alive mobs @@ -185,9 +188,9 @@ public sealed class FoodSystem : EntitySystem BreakOnDamage = true, MovementThreshold = 0.01f, DistanceThreshold = MaxFeedDistance, - // Mice and the like can eat without hands. - // TODO maybe set this based on some CanEatWithoutHands event or component? - NeedHand = forceFeed, + // do-after will stop if item is dropped when trying to feed someone else + // or if the item started out in the user's own hands + NeedHand = forceFeed || _hands.IsHolding(user, food), }; _doAfter.TryStartDoAfter(doAfterArgs); diff --git a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs index aaea67ab96..e648bcdf94 100644 --- a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs +++ b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs @@ -20,6 +20,7 @@ using Content.Server.Mind; using Content.Server.Singularity.EntitySystems; using Content.Server.Standing; using Content.Server.Weapons.Ranged.Systems; +using Content.Shared._White.Antag; using Content.Shared._White.BetrayalDagger; using Content.Shared._White.Cult.Components; using Content.Shared._White.Events; @@ -184,6 +185,7 @@ public sealed class WizardSpellsSystem : EntitySystem SwapComponent(uid, target); SwapComponent(uid, target); SwapComponent(uid, target); + SwapComponent(uid, target); _mindSystem.TransferTo(mindId, target, mind: mind); @@ -195,6 +197,10 @@ public sealed class WizardSpellsSystem : EntitySystem TransferAllMagicActions(uid, target); + // This is bad, but EnsureComp cant copy variables + if (TryComp(target, out var globalAntagonistComponent)) + globalAntagonistComponent.AntagonistPrototype = "globalAntagonistWizard"; + _standing.TryLieDown(uid); _standing.TryLieDown(target); @@ -947,24 +953,26 @@ public sealed class WizardSpellsSystem : EntitySystem } } - private void SwapComponent(EntityUid uid1, EntityUid uid2) where T : Component, new() + private void SwapComponent(EntityUid uidFrom, EntityUid uidTo) where T : Component, new() { - var hasComp = HasComp(uid1); - var targetHasComp = HasComp(uid2); + var hasComp = HasComp(uidFrom); + var targetHasComp = HasComp(uidTo); if (hasComp == targetHasComp) return; if (hasComp) { - EnsureComp(uid2); - RemComp(uid1); + EnsureComp(uidTo); + RemComp(uidFrom); + + return; } - if (targetHasComp) + if (!targetHasComp) { - EnsureComp(uid1); - RemComp(uid2); + EnsureComp(uidFrom); + RemComp(uidTo); } } diff --git a/Content.Server/_White/Wizard/WizardRuleSystem.cs b/Content.Server/_White/Wizard/WizardRuleSystem.cs index e33eb21833..ad21269529 100644 --- a/Content.Server/_White/Wizard/WizardRuleSystem.cs +++ b/Content.Server/_White/Wizard/WizardRuleSystem.cs @@ -439,7 +439,7 @@ public sealed class WizardRuleSystem : GameRuleSystem if (HasComp(uid)) return; - MakeWizard(uid, rule, true); + MakeWizard(uid, rule); } private bool MakeWizard(EntityUid wizard, WizardRuleComponent rule, @@ -468,7 +468,7 @@ public sealed class WizardRuleSystem : GameRuleSystem return false; } - if (!SpawnMap((wizard, rule))) + if (!SpawnMap((rule.Owner, rule))) { _sawmill.Info("Failed to load shuttle for wizard"); return false; diff --git a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.cs b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.cs index b72a7c4eb3..5f30df094b 100644 --- a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.cs +++ b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.cs @@ -227,9 +227,17 @@ public abstract partial class SharedHandsSystem return true; } - public bool IsHolding(EntityUid uid, EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, HandsComponent? handsComp = null) + public bool IsHolding(Entity entity, [NotNullWhen(true)] EntityUid? item) + { + return IsHolding(entity, item, out _, entity); + } + + public bool IsHolding(EntityUid uid, [NotNullWhen(true)] EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, HandsComponent? handsComp = null) { inHand = null; + if (entity == null) + return false; + if (!Resolve(uid, ref handsComp, false)) return false; @@ -241,7 +249,6 @@ public abstract partial class SharedHandsSystem return true; } } - return false; } diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index cd19796dd2..e04778a20c 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -201,16 +201,31 @@ namespace Content.Shared.Preferences } // TODO: This should eventually not be a visual change only. - public static HumanoidCharacterProfile Random(HashSet? ignoredSpecies = null) + public static HumanoidCharacterProfile Random(HashSet? ignoredSpecies = null, bool includeSponsor = false) { var prototypeManager = IoCManager.Resolve(); var random = IoCManager.Resolve(); + // WD edit - fix free sponsor species + var speciesToIgnore = ignoredSpecies != null + ? new HashSet(ignoredSpecies) + : new HashSet(); + + if (!includeSponsor) + { + var sponsorSpecies = prototypeManager.EnumeratePrototypes() + .Where(x => x.SponsorOnly) + .Select(x => x.ID); + + speciesToIgnore.UnionWith(sponsorSpecies); + } + var species = random.Pick(prototypeManager .EnumeratePrototypes() - .Where(x => ignoredSpecies == null ? x.RoundStart : x.RoundStart && !ignoredSpecies.Contains(x.ID)) + .Where(x => !x.SponsorOnly && x.RoundStart && !speciesToIgnore.Contains(x.ID)) .ToArray() ).ID; + // WD edit end return RandomWithSpecies(species); } diff --git a/Resources/Maps/White/WhiteMoose.yml b/Resources/Maps/White/WhiteMoose.yml index bbf42e2651..a351e99747 100644 --- a/Resources/Maps/White/WhiteMoose.yml +++ b/Resources/Maps/White/WhiteMoose.yml @@ -9545,6 +9545,7 @@ entities: - type: NavMap - type: BecomesStation id: WhiteMooseStation + - type: MaterialStorage - uid: 3058 components: - type: MetaData @@ -77108,7 +77109,7 @@ entities: - stampedColor: '#006600FF' stampedName: stamp-component-stamped-name-centcom content: >- - Совместная работа отделов повышает эффективность всех сотрудников. Попроси помощи и помоги другим и увидишь, как тебе проще стало летать в космос. Грабеж и хамство последнее, что ты должен делать. + Совместная работа отделов повышает эффективность всех сотрудников. Попроси помощи и помоги другим и увидишь, как тебе проще стало летать в космос. Грабеж и хамство последнее, что ты должен делать. diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/pickaxe.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/pickaxe.yml index 98ed1f36a3..fa961dca56 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/pickaxe.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/pickaxe.yml @@ -32,7 +32,7 @@ size: Normal shape: - 0,0,2,0 - - 1,1,1,2 + - 1,1,1,1 sprite: Objects/Weapons/Melee/pickaxe.rsi storedRotation: -45 - type: UseDelay diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/chaplain.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/chaplain.yml index 0968de0ad6..de147e30b1 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/chaplain.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/chaplain.yml @@ -195,6 +195,15 @@ back: - ArmamentsBeacon +- type: itemLoadout # WD + id: Bible + equipment: Bible +- type: startingGear + id: Bible + storage: + back: + - Bible + # PDA - type: itemLoadout # WD diff --git a/Resources/Prototypes/Loadouts/loadout_groups.yml b/Resources/Prototypes/Loadouts/loadout_groups.yml index ef0abc65c8..d80f375b87 100644 --- a/Resources/Prototypes/Loadouts/loadout_groups.yml +++ b/Resources/Prototypes/Loadouts/loadout_groups.yml @@ -67,7 +67,6 @@ - CaptainBackpack - CaptainSatchel - CaptainDuffel - - CaptainDuffel - CommonSatchelLeather # WD - type: loadoutGroup @@ -374,8 +373,11 @@ - type: loadoutGroup # WD edit id: ChaplainJobTrinkets name: loadout-group-job-trinkets + minLimit: 2 + maxLimit: 2 loadouts: - ArmamentsBeacon + - Bible - type: loadoutGroup id: ChaplainPDA @@ -1590,12 +1592,6 @@ - BlackTie - RedTie -- type: loadoutGroup # WD - id: CommonSecurityHeadset - name: loadout-group-ears - loadouts: - - SecurityHeadset - - type: loadoutGroup # WD id: CommonSecurityCommandHeadset name: loadout-group-ears diff --git a/Resources/migration.yml b/Resources/migration.yml index 5ef20ab42d..1281d949fc 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -267,3 +267,5 @@ ComfyChairEngineering: OrangeComfyChair ComfyChairScience: PurpleComfyChair ComfyChairCargo: BrownComfyChair ComfyChairService: GreenComfyChair + +BoxTrashbag: TrashBag