diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs index ddc9752b1ed..8845723bb7f 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs @@ -1,3 +1,4 @@ +using System.Globalization; using System.Linq; using Content.Client.UserInterface.Systems.Guidebook; using Content.Shared.Guidebook; @@ -192,6 +193,34 @@ public sealed partial class HumanoidProfileEditor ReloadPreview(); } + // Begin CD - Character Records + private void SetProfileHeight(float height) + { + Profile = Profile?.WithHeight(height); + SetDirty(); + ReloadProfilePreview(); + } + + + private void UpdateHeightControls() + { + if (Profile == null) + { + return; + } + + var species = _species.Find(x => x.ID == Profile.Species); + if (species != null) + _defaultHeight = species.DefaultHeight; + + var prototype = _prototypeManager.Index(Profile.Species); + var sliderPercent = (Profile.Height - prototype.MinHeight) / + (prototype.MaxHeight - prototype.MinHeight); + CDHeightSlider.Value = sliderPercent; + CDHeight.Text = Profile.Height.ToString(CultureInfo.InvariantCulture); + } + // End CD - Character Records + private void SetAge(int newAge) { Profile = Profile?.WithAge(newAge); diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.BasicInfo.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.BasicInfo.cs index b5ce8d0d6d7..07b25e921ab 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.BasicInfo.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.BasicInfo.cs @@ -1,5 +1,6 @@ using Content.Shared.Preferences; +using Robust.Client.UserInterface.Controls; namespace Content.Client.Lobby.UI; diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.FlavorText.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.FlavorText.cs index bcdeadff669..316ae29f17c 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.FlavorText.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.FlavorText.cs @@ -1,3 +1,4 @@ +using Content.Shared._CD.Records; using Robust.Client.UserInterface.Controls; using Robust.Shared.Utility; @@ -57,4 +58,16 @@ public sealed partial class HumanoidProfileEditor _flavorTextEdit.TextRope = new Rope.Leaf(Profile?.FlavorText ?? ""); } } + + + + // Start CD - Character Records + private void UpdateProfileRecords(PlayerProvidedCharacterRecords records) + { + if (Profile is null) + return; + Profile = Profile.WithCDCharacterRecords(records); + IsDirty = true; + } + // End CD - Character Records } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index e428840d530..4cbcd4767b3 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -27,7 +27,8 @@ using System.Globalization; using Content.Client._CD.Records.UI; using Content.Shared._CD.Records; // End CD - Character Records -using Content.Shared._DV.Traits; // DV - Traits +using Content.Shared._DV.Traits; +using Content.Shared.Humanoid.Prototypes; // DV - Traits namespace Content.Client.Lobby.UI { diff --git a/Content.Client/_Goobstation/Overlays/ThermalVisionOverlay.cs b/Content.Client/_Goobstation/Overlays/ThermalVisionOverlay.cs index 239ec3dc2ce..807a7044978 100644 --- a/Content.Client/_Goobstation/Overlays/ThermalVisionOverlay.cs +++ b/Content.Client/_Goobstation/Overlays/ThermalVisionOverlay.cs @@ -10,7 +10,7 @@ using System.Linq; using System.Numerics; using Content.Client.Stealth; using Content.Shared._Goobstation.Overlays; -using Content.Shared.Body.Components; +using Content.Shared.Body; using Content.Shared.Stealth.Components; using Robust.Client.GameObjects; using Robust.Client.Graphics; diff --git a/Content.Server/Bible/Components/BibleComponent.cs b/Content.Server/Bible/Components/BibleComponent.cs index 80467fc2073..de958f4742d 100644 --- a/Content.Server/Bible/Components/BibleComponent.cs +++ b/Content.Server/Bible/Components/BibleComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; // Goobstation using Robust.Shared.Audio; using Robust.Shared.Prototypes; @@ -44,7 +45,7 @@ namespace Content.Server.Bible.Components /// How much damage to deal to the entity being smitten - Goob /// [DataField] - public DamageSpecifier SmiteDamage = new() { DamageDict = new Dictionary() { { "Holy", 25 } } }; // Ungodly + public DamageSpecifier SmiteDamage = new() { DamageDict = new Dictionary, FixedPoint2>() { { "Holy", 25 } } }; // Ungodly /// /// How long to stun the entity being smitten - Goob diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index f601824e70e..51c9697571a 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -91,15 +91,7 @@ public sealed class RespiratorSystem : EntitySystem if (_mobState.IsDead(uid) || HasComp(uid)) // Shitmed: BreathingImmunity Goob immunity too continue; - // Begin DeltaV Additions - var organs = _bodySystem.GetBodyOrganEntityComps((uid, body)); - var multiplier = -1f; - foreach (var (_, lung, _) in organs) - { - multiplier *= lung.SaturationLoss; - } - // End DeltaV Additions - UpdateSaturation(uid, multiplier * (float) respirator.UpdateInterval.TotalSeconds, respirator); // DeltaV: use multiplier instead of negating + UpdateSaturation(uid, -(float) respirator.UpdateInterval.TotalSeconds, respirator); // DeltaV: use multiplier instead of negating if ((!_mobState.IsIncapacitated(uid) || TryComp(uid, out var cprComp) && cprComp.IsActive)) // DeltaV - Addition of CPR. diff --git a/Content.Server/Destructible/DestructibleSystem.cs b/Content.Server/Destructible/DestructibleSystem.cs index 77854010038..d4751356928 100644 --- a/Content.Server/Destructible/DestructibleSystem.cs +++ b/Content.Server/Destructible/DestructibleSystem.cs @@ -3,13 +3,13 @@ using System.Linq; using Content.Server._DV.Administration; // DeltaV - Admin QOL using Content.Server.Administration.Logs; using Content.Server.Atmos.EntitySystems; -using Content.Server.Body.Systems; // DeltaV Keep body here for shitmed using Content.Server.Construction; using Content.Server.Destructible.Thresholds; using Content.Server.Destructible.Thresholds.Behaviors; using Content.Server.Explosion.EntitySystems; using Content.Server.Fluids.EntitySystems; using Content.Server.Stack; +using Content.Shared.Body; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Damage; using Content.Shared.Damage.Systems; diff --git a/Content.Server/EntityEffects/Effects/MakeSentientEntityEffectSystem.cs b/Content.Server/EntityEffects/Effects/MakeSentientEntityEffectSystem.cs index c41e07e583e..479df68a806 100644 --- a/Content.Server/EntityEffects/Effects/MakeSentientEntityEffectSystem.cs +++ b/Content.Server/EntityEffects/Effects/MakeSentientEntityEffectSystem.cs @@ -37,9 +37,9 @@ public sealed partial class MakeSentientEntityEffectSystem : EntityEffectSystem< // Delta-V: Do not allow humanoids to become sentient. Intended to stop people from // repeatedly cloning themselves and using cognizine on their bodies. - // HumanoidAppearanceComponent is common to all player species, and is also used for the + // HumanoidProfileComponent is common to all player species, and is also used for the // Ripley pilot whitelist, so there's a precedent for using it for this kind of check. - if (HasComp(entity)) + if (HasComp(entity)) { return; } diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index 84cf224dd17..e6853abf067 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -135,7 +135,7 @@ namespace Content.Server.Preferences.Managers if (parsed is null) continue; - markingsList.Add(parsed); + markingsList.Add(parsed.Value); } if (Marking.ParseFromDbString($"{profile.HairName}@{profile.HairColor}") is { } facialMarking) diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index 99547fa196e..b50df0e7b3c 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -257,7 +257,7 @@ public sealed partial class RevenantSystem var ent = player.AttachedEntity.Value; - if (!HasComp(ent) || !HasComp(ent) || HasComp(ent)) + if (!HasComp(ent) || !HasComp(ent) || HasComp(ent)) return true; return !_interact.InRangeUnobstructed((uid, Transform(uid)), (ent, Transform(ent)), range: 0, collisionMask: CollisionGroup.Impassable); diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs index eba2c3075e7..feb46b68752 100644 --- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs +++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Access.Systems; +using Content.Server.Forensics; // Delta V using Content.Shared.Access.Components; using Content.Shared.Access.Systems; // DeltaV using Content.Shared.Forensics.Components; diff --git a/Content.Server/_DV/Abilities/Kitsune/KitsuneSystem.cs b/Content.Server/_DV/Abilities/Kitsune/KitsuneSystem.cs index df0649af813..0a00aa0bd05 100644 --- a/Content.Server/_DV/Abilities/Kitsune/KitsuneSystem.cs +++ b/Content.Server/_DV/Abilities/Kitsune/KitsuneSystem.cs @@ -56,8 +56,11 @@ public sealed class KitsuneSystem : SharedKitsuneSystem Dirty(fireUid, foxfire); } - if (TryComp(oldEntity, out var humanoidAppearance)) - RaiseLocalEvent(newEntity, new SexChangedEvent(Sex.Unsexed, humanoidAppearance.Sex)); + if (TryComp(oldEntity, out var humanoidAppearance)) + { + var ev = new SexChangedEvent(Sex.Unsexed, humanoidAppearance.Sex); + RaiseLocalEvent(newEntity, ref ev); + } // Code after this point will not run when reverting to human form. if (HasComp(oldEntity)) diff --git a/Content.Server/_DV/Administration/Commands/LoadCharacter.cs b/Content.Server/_DV/Administration/Commands/LoadCharacter.cs index 2711ae45688..1ac354e474a 100644 --- a/Content.Server/_DV/Administration/Commands/LoadCharacter.cs +++ b/Content.Server/_DV/Administration/Commands/LoadCharacter.cs @@ -60,7 +60,7 @@ public sealed class LoadCharacter : IConsoleCommand else { if (player.AttachedEntity == null || - !_entityManager.HasComponent(player.AttachedEntity.Value)) + !_entityManager.HasComponent(player.AttachedEntity.Value)) { shell.WriteError(Loc.GetString("shell-must-be-attached-to-entity")); return; @@ -75,10 +75,10 @@ public sealed class LoadCharacter : IConsoleCommand return; } - if (!_entityManager.TryGetComponent(target, out var humanoidAppearance)) + if (!_entityManager.TryGetComponent(target, out var humanoidAppearance)) { shell.WriteError(Loc.GetString("shell-entity-with-uid-lacks-component", ("uid", target.ToString()), - ("componentName", nameof(HumanoidAppearanceComponent)))); + ("componentName", nameof(HumanoidProfileComponent)))); return; } diff --git a/Content.Server/_DV/Chapel/SacrificialAltarSystem.cs b/Content.Server/_DV/Chapel/SacrificialAltarSystem.cs index 7500bf0df2b..87b7213fd59 100644 --- a/Content.Server/_DV/Chapel/SacrificialAltarSystem.cs +++ b/Content.Server/_DV/Chapel/SacrificialAltarSystem.cs @@ -1,11 +1,10 @@ using Content.Server.Bible.Components; using Content.Shared.Administration.Logs; -using Content.Shared.Body.Components; -using Content.Shared.Body.Systems; using Content.Shared.Database; using Content.Shared.Gibbing; using Content.Shared._DV.Chapel; using Content.Shared._DV.Psionics.Components; +using Content.Shared.Body; using Content.Shared.DoAfter; using Content.Shared.EntityTable; using Content.Shared.Humanoid; @@ -27,7 +26,7 @@ public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly SharedBodySystem _body = default!; + [Dependency] private readonly BodySystem _body = default!; [Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly GibbingSystem _gibbing = default!; @@ -98,7 +97,7 @@ public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem } // and no golems or familiars or whatever should be sacrificing - if (!HasComp(user)) + if (!HasComp(user)) { _popup.PopupEntity(Loc.GetString("altar-failure-reason-user-humanoid"), ent, user, PopupType.SmallCaution); return; @@ -119,7 +118,7 @@ public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem return; } - if (!HasComp(target)) + if (!HasComp(target)) { _popup.PopupEntity(Loc.GetString("altar-failure-reason-target-humanoid", ("target", target)), ent, user, PopupType.SmallCaution); return; diff --git a/Content.Server/_DV/CosmicCult/Abilities/CosmicBlankSystem.cs b/Content.Server/_DV/CosmicCult/Abilities/CosmicBlankSystem.cs index 6490a73f18e..95df8e52be4 100644 --- a/Content.Server/_DV/CosmicCult/Abilities/CosmicBlankSystem.cs +++ b/Content.Server/_DV/CosmicCult/Abilities/CosmicBlankSystem.cs @@ -93,7 +93,7 @@ public sealed class CosmicBlankSystem : EntitySystem return; args.Handled = true; - if (!TryComp(target, out var mindContainer) || !mindContainer.HasMind) + if (!TryComp(target, out var mindContainer) || !mindContainer.HasMind || mindContainer.Mind == null) { return; } diff --git a/Content.Server/_DV/CosmicCult/Abilities/CosmicLapseSystem.cs b/Content.Server/_DV/CosmicCult/Abilities/CosmicLapseSystem.cs index 09a4e2536ec..ba432990dc3 100644 --- a/Content.Server/_DV/CosmicCult/Abilities/CosmicLapseSystem.cs +++ b/Content.Server/_DV/CosmicCult/Abilities/CosmicLapseSystem.cs @@ -38,7 +38,7 @@ public sealed class CosmicLapseSystem : EntitySystem var tgtpos = Transform(action.Target).Coordinates; Spawn(uid.Comp.LapseVFX, tgtpos); _popup.PopupEntity(Loc.GetString("cosmicability-lapse-success", ("target", Identity.Entity(action.Target, EntityManager))), uid, uid); - var species = Comp(action.Target).Species; + var species = Comp(action.Target).Species; var polymorphId = "CosmicLapseMob" + species; if (_prototype.HasIndex(polymorphId)) diff --git a/Content.Server/_DV/CosmicCult/CosmicCultRuleSystem.cs b/Content.Server/_DV/CosmicCult/CosmicCultRuleSystem.cs index 2e59999c911..57e4b4abe36 100644 --- a/Content.Server/_DV/CosmicCult/CosmicCultRuleSystem.cs +++ b/Content.Server/_DV/CosmicCult/CosmicCultRuleSystem.cs @@ -62,6 +62,7 @@ using Robust.Shared.Random; using Robust.Shared.Timing; using System.Collections.Immutable; using System.Linq; +using Content.Shared.Body; namespace Content.Server._DV.CosmicCult; @@ -92,7 +93,7 @@ public sealed class CosmicCultRuleSystem : GameRuleSystem(); + var endQuery = EntityQueryEnumerator(); while (endQuery.MoveNext(out var player, out _, out _)) { var newSpawn = _rand.Pick(spawnPoints); @@ -589,7 +590,7 @@ public sealed class CosmicCultRuleSystem : GameRuleSystem session.Status == SessionStatus.InGame && HasComp(session.AttachedEntity)); + cult.Comp.TotalCrew = _playerMan.Sessions.Count(session => session.Status == SessionStatus.InGame && HasComp(session.AttachedEntity)); #if DEBUG if (cult.Comp.TotalCrew < 25) diff --git a/Content.Server/_DV/CosmicCult/CosmicCultSystem.Finale.cs b/Content.Server/_DV/CosmicCult/CosmicCultSystem.Finale.cs index f2a0f7ae36f..a913620aee8 100644 --- a/Content.Server/_DV/CosmicCult/CosmicCultSystem.Finale.cs +++ b/Content.Server/_DV/CosmicCult/CosmicCultSystem.Finale.cs @@ -29,7 +29,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem private void OnInteract(Entity ent, ref InteractHandEvent args) { - if (!HasComp(args.User)) + if (!HasComp(args.User)) return; // humanoids only! if (!EntityIsCultist(args.User) && !args.Handled && !ent.Comp.Occupied && ent.Comp.FinaleActive) { diff --git a/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs b/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs index 7b13b779301..549004f5965 100644 --- a/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs +++ b/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs @@ -134,7 +134,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem _eye.RefreshVisibilityMask(ent.Owner); _alerts.ShowAlert(ent.Owner, ent.Comp.EntropyAlert); - if (!HasComp(ent)) return; // Non-humanoids don't get abilities + if (!HasComp(ent)) return; // Non-humanoids don't get abilities foreach (var actionId in ent.Comp.CosmicCultActions) { var actionEnt = _actions.AddAction(ent, actionId); @@ -149,7 +149,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem { if (_cultRule.AssociatedGamerule(ent) is not { } cult) return; - if (!HasComp(ent)) return; // Non-humanoids don't get abilities + if (!HasComp(ent)) return; // Non-humanoids don't get abilities if (!cult.Comp.MonumentPlaced) // There's no monument, grant them an action to place one _actions.AddAction(ent, ref ent.Comp.CosmicMonumentPlaceActionEntity, ent.Comp.CosmicMonumentPlaceAction, ent); diff --git a/Content.Server/_DV/CosmicCult/CosmicGlyphSystem.cs b/Content.Server/_DV/CosmicCult/CosmicGlyphSystem.cs index 3160c5f0f54..e400a553748 100644 --- a/Content.Server/_DV/CosmicCult/CosmicGlyphSystem.cs +++ b/Content.Server/_DV/CosmicCult/CosmicGlyphSystem.cs @@ -26,7 +26,7 @@ public sealed class CosmicGlyphSystem : SharedCosmicGlyphSystem [Dependency] private readonly IGameTiming _timing = default!; private readonly HashSet> _cultists = []; - private readonly HashSet> _humanoids = []; + private readonly HashSet> _humanoids = []; public override void Initialize() { @@ -155,10 +155,10 @@ public sealed class CosmicGlyphSystem : SharedCosmicGlyphSystem /// The glyph. /// Radius for a lookup. /// Filter to exclude from return. - public HashSet> GetTargetsNearGlyph(EntityUid uid, float range, Predicate>? exclude = null) + public HashSet> GetTargetsNearGlyph(EntityUid uid, float range, Predicate>? exclude = null) { _humanoids.Clear(); - _lookup.GetEntitiesInRange(Transform(uid).Coordinates, range, _humanoids); + _lookup.GetEntitiesInRange(Transform(uid).Coordinates, range, _humanoids); if (exclude != null) _humanoids.RemoveWhere(exclude); _humanoids.RemoveWhere(target => HasComp(target) || HasComp(target)); // We never want these. diff --git a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicColossusSystem.cs b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicColossusSystem.cs index e8013312d69..4c6683dec38 100644 --- a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicColossusSystem.cs +++ b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicColossusSystem.cs @@ -69,7 +69,8 @@ public sealed class CosmicColossusSystem : EntitySystem Spawn(comp.CultBigVfx, Transform(ent).Coordinates); if (!TryComp(ent, out var damageable)) continue; - _damage.TryChangeDamage(ent, damageable.Damage / 2 * -1, true); + var dmg = _damage.GetPositiveDamage((ent, damageable)); + _damage.TryChangeDamage(ent, dmg / 2 * -1, true); } if (comp.Timed && _timing.CurTime >= comp.DeathTimer) { diff --git a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicSpireSystem.cs b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicSpireSystem.cs index 126a00c840f..cc6fdfd4654 100644 --- a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicSpireSystem.cs +++ b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicSpireSystem.cs @@ -1,10 +1,10 @@ using Content.Server.Atmos.EntitySystems; -using Content.Server.Atmos.Piping.Components; using Content.Server.Atmos.Piping.Unary.EntitySystems; using Content.Server.Audio; using Content.Server.Popups; using Content.Shared._DV.CosmicCult.Components; using Content.Shared.Atmos; +using Content.Shared.Atmos.Components; using Content.Shared.Atmos.Piping.Unary.Components; using Robust.Server.GameObjects; diff --git a/Content.Server/_DV/Curation/Systems/CwoinkSystem.cs b/Content.Server/_DV/Curation/Systems/CwoinkSystem.cs index 0a1491286a7..318229361d4 100644 --- a/Content.Server/_DV/Curation/Systems/CwoinkSystem.cs +++ b/Content.Server/_DV/Curation/Systems/CwoinkSystem.cs @@ -256,7 +256,7 @@ public sealed partial class CwoinkSystem : SharedCwoinkSystem } // Check if the user has been banned - var ban = await _dbManager.GetServerBanAsync(null, e.Session.UserId, null, null); + var ban = await _dbManager.GetBanAsync(null, e.Session.UserId, null, null); if (ban != null) { _activeConversations.Remove(e.Session.UserId); diff --git a/Content.Server/_DV/Feroxi/FeroxiDehydrateComponent.cs b/Content.Server/_DV/Feroxi/FeroxiDehydrateComponent.cs index 894e12fd366..17f48081df8 100644 --- a/Content.Server/_DV/Feroxi/FeroxiDehydrateComponent.cs +++ b/Content.Server/_DV/Feroxi/FeroxiDehydrateComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.Body.Prototypes; +using Content.Shared.Metabolism; using Robust.Shared.Prototypes; namespace Content.Server._DV.Feroxi; diff --git a/Content.Server/_DV/Feroxi/FeroxiDehydrateSystem.cs b/Content.Server/_DV/Feroxi/FeroxiDehydrateSystem.cs index 687a4c86ac1..e42078dc5aa 100644 --- a/Content.Server/_DV/Feroxi/FeroxiDehydrateSystem.cs +++ b/Content.Server/_DV/Feroxi/FeroxiDehydrateSystem.cs @@ -1,6 +1,6 @@ -using Content.Server.Body.Components; -using Content.Server.Body.Systems; +using Content.Shared.Body; using Content.Shared.Body.Components; +using Content.Shared.Metabolism; using Content.Shared.Nutrition.Components; namespace Content.Server._DV.Feroxi; @@ -34,7 +34,8 @@ public sealed class FeroxiDehydrateSystem : EntitySystem { ent.Comp.Dehydrated = shouldBeDehydrated; - foreach (var entity in _body.GetBodyOrganEntityComps(ent.Owner)) + _body.TryGetOrgansWithComponent(ent.Owner, out var organs); + foreach (var entity in organs) { if (!TryComp(entity, out var metabolizer) || metabolizer.MetabolizerTypes == null) { diff --git a/Content.Server/_DV/Psionics/Systems/PsionicPowers/PsionicEruptionPowerSystem.cs b/Content.Server/_DV/Psionics/Systems/PsionicPowers/PsionicEruptionPowerSystem.cs index 21bfe4adef5..ca7f5901e8c 100644 --- a/Content.Server/_DV/Psionics/Systems/PsionicPowers/PsionicEruptionPowerSystem.cs +++ b/Content.Server/_DV/Psionics/Systems/PsionicPowers/PsionicEruptionPowerSystem.cs @@ -7,7 +7,7 @@ using Content.Shared._DV.Psionics.Components.PsionicPowers; using Content.Shared._DV.Psionics.Events.PowerActionEvents; using Content.Shared._DV.Psionics.Events.PowerDoAfterEvents; using Content.Shared._DV.Psionics.Systems.PsionicPowers; -using Content.Shared.Body.Components; +using Content.Shared.Body; using Content.Shared.DoAfter; using Content.Shared.Gibbing; using Content.Shared.Popups; diff --git a/Content.Server/_DV/RoundEnd/RoundEndSystem.cs b/Content.Server/_DV/RoundEnd/RoundEndSystem.cs index 0327a4d9e9e..a309caae5b5 100644 --- a/Content.Server/_DV/RoundEnd/RoundEndSystem.cs +++ b/Content.Server/_DV/RoundEnd/RoundEndSystem.cs @@ -25,7 +25,7 @@ public sealed partial class RoundEndSystem : EntitySystem vote.OnFinished += (_, args) => { if (args.Winner == null || (bool)args.Winner) - RequestRoundEnd(null, false, "round-end-system-vote-shuttle-called-announcement"); + RequestRoundEnd(checkCooldown: false, text: "round-end-system-vote-shuttle-called-announcement"); }; } } diff --git a/Content.Server/_DV/StationEvents/Components/NoosphericFryRuleComponent.cs b/Content.Server/_DV/StationEvents/Components/NoosphericFryRuleComponent.cs index 4c8d13701b1..5c968d6ebb1 100644 --- a/Content.Server/_DV/StationEvents/Components/NoosphericFryRuleComponent.cs +++ b/Content.Server/_DV/StationEvents/Components/NoosphericFryRuleComponent.cs @@ -1,6 +1,8 @@ using Content.Server._DV.StationEvents.GameRules; using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; namespace Content.Server._DV.StationEvents.Components; @@ -13,7 +15,7 @@ public sealed partial class NoosphericFryRuleComponent : Component [DataField] public DamageSpecifier Damage = new() { - DamageDict = new Dictionary + DamageDict = new Dictionary, FixedPoint2> { {"Heat", 10}, {"Shock", 10}, diff --git a/Content.Server/_DV/StationEvents/GameRules/FugitiveRule.cs b/Content.Server/_DV/StationEvents/GameRules/FugitiveRule.cs index 200f8c8f337..1dc3f6c90a5 100644 --- a/Content.Server/_DV/StationEvents/GameRules/FugitiveRule.cs +++ b/Content.Server/_DV/StationEvents/GameRules/FugitiveRule.cs @@ -112,7 +112,7 @@ public sealed class FugitiveRule : StationEventSystem report.AddMarkupOrThrow(Loc.GetString("fugitive-report-first-line")); report.PushNewline(); - if (!TryComp(uid, out var humanoid)) + if (!TryComp(uid, out var humanoid)) { report.AddMarkupOrThrow(Loc.GetString("fugitive-report-inhuman", ("name", uid))); return report; @@ -122,7 +122,7 @@ public sealed class FugitiveRule : StationEventSystem report.AddMarkupOrThrow(Loc.GetString("fugitive-report-morphotype", ("species", Loc.GetString(species.Name)))); report.AddMarkupOrThrow(Loc.GetString("fugitive-report-age", ("age", humanoid.Age))); - report.AddMarkupOrThrow(Loc.GetString("fugitive-report-sex", ("sex", humanoid.Sex.ToString()))); + report.AddMarkupOrThrow(Loc.GetString("fugitive-report-sex", ("sex", humanoid.Sex))); if (TryComp(uid, out var physics)) report.AddMarkupOrThrow(Loc.GetString("fugitive-report-weight", ("weight", Math.Round(physics.FixturesMass)))); diff --git a/Content.Server/_DV/StationEvents/GameRules/GlimmerRestyleRule.cs b/Content.Server/_DV/StationEvents/GameRules/GlimmerRestyleRule.cs index 73a48d47e6a..7bac3f1a3ac 100644 --- a/Content.Server/_DV/StationEvents/GameRules/GlimmerRestyleRule.cs +++ b/Content.Server/_DV/StationEvents/GameRules/GlimmerRestyleRule.cs @@ -1,11 +1,13 @@ using System.Linq; using Content.Server._DV.StationEvents.Components; +using Content.Server.Body; using Content.Server.Psionics; using Content.Server.StationEvents.Events; using Content.Shared._DV.Psionics.Components; using Content.Shared._DV.Psionics.Events; using Content.Shared._DV.Psionics.Systems; using Content.Shared.Abilities.Psionics; +using Content.Shared.Body; using Content.Shared.GameTicking.Components; using Content.Shared.Humanoid; using Content.Shared.Humanoid.Markings; @@ -13,6 +15,7 @@ using Content.Shared.Mobs.Components; using Content.Shared.SSDIndicator; using Content.Shared.Mobs.Systems; using Content.Shared.Popups; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server._DV.StationEvents.Events; @@ -24,13 +27,14 @@ public sealed class GlimmerRestyleRule : StationEventSystem(); - List<(EntityUid, HumanoidAppearanceComponent)> potentialTargets = new(); + var query = EntityQueryEnumerator(); + List<(EntityUid, HumanoidProfileComponent)> potentialTargets = new(); while (query.MoveNext(out var entity, out var humanoid, out var mobState)) { @@ -52,31 +56,36 @@ public sealed class GlimmerRestyleRule : StationEventSystem ent, MarkingCategories category, float noMarkingsChance) + private bool TryApplyRestyle(Entity ent, HumanoidVisualLayers visualLayer, float noMarkingsChance) { var newMarkingColor = new Color(_random.NextFloat(), _random.NextFloat(), _random.NextFloat()); - var availableMarkings = _markingManager.MarkingsByCategoryAndSpecies(category, ent.Comp.Species); + var availableMarkings = + _markingManager.MarkingsByLayerAndGroupAndSex(visualLayer, ent.Comp.Species.Id, ent.Comp.Sex); if (availableMarkings.Count == 0) return false; - var hadCategoryBefore = ent.Comp.MarkingSet.TryGetCategory(category, out _); - ent.Comp.MarkingSet.RemoveCategory(category); if (_random.Prob(noMarkingsChance)) - return hadCategoryBefore; //Do not show the popup if you go from no markings to no markings. + return false; //Do not show the popup if you go from no markings to no markings. var newMarking = _random.Pick(availableMarkings.Values.ToList()).AsMarking(); - newMarking.SetColor(newMarkingColor); + newMarking.WithColor(newMarkingColor); - ent.Comp.MarkingSet.AddCategory(category); - ent.Comp.MarkingSet.AddFront(category, newMarking); + // TODO: God has seen this and feels the same pain as I. There must be a better way. + var markings = new Dictionary, Dictionary>>(); + var markingsToApply = new Dictionary>(); + markingsToApply.Add(visualLayer, new List { newMarking }); + ProtoId category = "Head"; + markings.Add(category, markingsToApply); + + _visualBodySystem.ApplyMarkings(ent.Owner, markings); return true; } } diff --git a/Content.Server/_DV/StationEvents/GameRules/MeteorSwarmRule.cs b/Content.Server/_DV/StationEvents/GameRules/MeteorSwarmRule.cs index e1cadbba5b6..da7f40f2568 100644 --- a/Content.Server/_DV/StationEvents/GameRules/MeteorSwarmRule.cs +++ b/Content.Server/_DV/StationEvents/GameRules/MeteorSwarmRule.cs @@ -1,9 +1,9 @@ using System.Linq; using System.Numerics; using Content.Server._DV.StationEvents.Components; -using Content.Server.Atmos.Components; using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Events; +using Content.Shared.Atmos.Components; using Content.Shared.GameTicking.Components; using Robust.Shared.Map; using Robust.Shared.Map.Components; diff --git a/Content.Server/_DV/Traits/Assorted/AmputeeComponent.cs b/Content.Server/_DV/Traits/Assorted/AmputeeComponent.cs deleted file mode 100644 index 2f0979829ed..00000000000 --- a/Content.Server/_DV/Traits/Assorted/AmputeeComponent.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Content.Shared.Body.Part; -using Robust.Shared.Prototypes; - -namespace Content.Server._DV.Traits.Assorted; - -[RegisterComponent] -public sealed partial class AmputeeComponent : Component -{ - [DataField] - public BodyPartType RemoveBodyPart { get; private set; } = BodyPartType.Arm; - - [DataField] - public BodyPartSymmetry PartSymmetry { get; private set; } = BodyPartSymmetry.Left; - - /// - /// Body part prototype to use as a replacement limb, if applicable. - /// - [DataField] - public EntProtoId? ProtoId { get; private set; } - - [DataField] - public string? SlotId { get; private set; } = "left arm"; -} diff --git a/Content.Server/_DV/Traits/Assorted/AmputeeSystem.cs b/Content.Server/_DV/Traits/Assorted/AmputeeSystem.cs deleted file mode 100644 index 965addb227b..00000000000 --- a/Content.Server/_DV/Traits/Assorted/AmputeeSystem.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Content.Server.Body.Systems; -using Content.Shared.Body.Components; -using Content.Shared.Body.Part; -using Robust.Server.GameObjects; - -namespace Content.Server._DV.Traits.Assorted; - -public sealed class AmputeeSystem : EntitySystem -{ - [Dependency] private readonly BodySystem _body = default!; - [Dependency] private readonly TransformSystem _transform = default!; - [Dependency] private readonly BloodstreamSystem _bloodstream = default!; - - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnMapInit); - } - - // Logic here taken from Den at https://github.com/TheDenSS14/TheDen/blob/d6f85a10fccf0f282981438e55b808d7ece73ad9/Content.Server/Traits/TraitSystem.Functions.cs - private void OnMapInit(Entity ent, ref MapInitEvent args) - { - if (!TryComp(ent, out BodyComponent? body) || !TryComp(ent, out TransformComponent? xform)) - return; - - var root = _body.GetRootPartOrNull(ent, body); - if (root is null) - return; - - var parts = _body.GetBodyChildrenOfType(ent, ent.Comp.RemoveBodyPart, body); - foreach (var part in parts) - { - var partComp = part.Component; - if (partComp.Symmetry != ent.Comp.PartSymmetry) - continue; - - foreach (var child in _body.GetBodyPartChildren(part.Id, part.Component)) - { - QueueDel(child.Id); - } - - _transform.AttachToGridOrMap(part.Id); - QueueDel(part.Id); - - // apparently chopping off limbs makes people bleed a lot. Who would have guessed? - _bloodstream.TryModifyBleedAmount(ent.Owner, -10f); - - // goes unused for the purposes of the arm amputee traits, but might as well keep it in - if (ent.Comp.ProtoId is null || ent.Comp.SlotId == null) - continue; - - var newLimb = SpawnAtPosition(ent.Comp.ProtoId, xform.Coordinates); - if (TryComp(newLimb, out var limbComp) && limbComp.Symmetry == ent.Comp.PartSymmetry) - _body.AttachPart(root.Value.Entity, ent.Comp.SlotId, newLimb, root.Value.BodyPart, limbComp); - } - } -} diff --git a/Content.Server/_DV/Traits/TraitSystem.cs b/Content.Server/_DV/Traits/TraitSystem.cs index 91e0c48fbb3..c792be28eba 100644 --- a/Content.Server/_DV/Traits/TraitSystem.cs +++ b/Content.Server/_DV/Traits/TraitSystem.cs @@ -52,7 +52,7 @@ public sealed class TraitSystem : EntitySystem // Use the species ID from the profile if for some reason we can't get the humanoid appearance ProtoId? speciesId = args.Profile.Species; - if (TryComp(args.Mob, out var humanoid)) + if (TryComp(args.Mob, out var humanoid)) speciesId = humanoid.Species; // Track disabled traits and reasons diff --git a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/NuclearReactorSystem.cs b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/NuclearReactorSystem.cs index 244b962b3f9..13569550ebc 100644 --- a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/NuclearReactorSystem.cs +++ b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/NuclearReactorSystem.cs @@ -1,7 +1,6 @@ using Content.Server.Administration.Logs; using Content.Server.AlertLevel; using Content.Server.Atmos.EntitySystems; -using Content.Server.Atmos.Piping.Components; using Content.Server.Audio; using Content.Server.Chat.Systems; using Content.Server.Explosion.EntitySystems; @@ -35,6 +34,7 @@ using Content.Shared.Random.Helpers; using Content.Shared.Throwing; using Content.Shared.Damage.Systems; using System.Diagnostics.CodeAnalysis; +using Content.Shared.Atmos.Components; using Robust.Shared.Timing; namespace Content.Server._FarHorizons.Power.Generation.FissionGenerator; diff --git a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/ReactorPartSystem.cs b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/ReactorPartSystem.cs index 88f24edf72e..6794ee57f7e 100644 --- a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/ReactorPartSystem.cs +++ b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/ReactorPartSystem.cs @@ -3,10 +3,14 @@ using Content.Shared._FarHorizons.Power.Generation.FissionGenerator; using Content.Shared.Atmos; using Robust.Shared.Random; using Content.Shared._FarHorizons.Materials.Systems; +using Content.Shared.Damage; using Content.Shared.Examine; using Content.Shared.Nutrition; using Content.Shared.Radiation.Components; using Content.Shared.Damage.Components; +using Content.Shared.Damage.Prototypes; +using Content.Shared.Damage.Systems; +using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; namespace Content.Server._FarHorizons.Power.Generation.FissionGenerator; @@ -22,6 +26,7 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem [Dependency] private readonly EntityManager _entityManager = default!; [Dependency] private readonly SharedPointLightSystem _lightSystem = default!; [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly DamageableSystem _damageableSystem = default!; /// /// Changes the overall rate of events @@ -152,20 +157,14 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem var properties = comp.Properties; - if (!_entityManager.TryGetComponent(args.Target, out var damageable) || damageable.Damage.DamageDict == null) + if (!_entityManager.TryGetComponent(args.Target, out var damageable)) return; - var dict = damageable.Damage.DamageDict; - var dmgKey = "Radiation"; var dmg = (properties.NeutronRadioactivity * 20) + (properties.Radioactivity * 10) + (properties.FissileIsotopes * 5); + var dmgToApply = new DamageSpecifier() { DamageDict = new Dictionary, FixedPoint2>{{ dmgKey, dmg }} }; - if (!dict.TryAdd(dmgKey, dmg)) - { - var prev = dict[dmgKey]; - dict.Remove(dmgKey); - dict.Add(dmgKey, prev + dmg); - } + _damageableSystem.TryChangeDamage((args.Target, damageable), dmgToApply); } public override void Update(float frameTime) @@ -346,7 +345,7 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem reactorPart.MeltHealth -= _random.Next(10, 50 + 1); if (reactorPart.MeltHealth <= 0) Melt(reactorPart, reactorEnt, reactorSystem); - + return; // I would really like for these to be defined by the MaterialPrototype, like GasReactionPrototype, but it caused the client and server to fight when I tried @@ -370,7 +369,7 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem return; var molesPerUnit = 100f; // Arbitrary value for how much gaseous plasma is in each unit of active plasma - + var payload = new GasMixture(); payload.SetMoles(Gas.Plasma, (float)Math.Min(part.Properties.ActivePlasma * molesPerUnit, Math.Log(((part.Temperature - temperatureThreshold) / 100) + 1))); payload.Temperature = part.Temperature; @@ -380,7 +379,7 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem _atmosphereSystem.Merge(reactor.AirContents, payload); } } - + /// /// Melts the related ReactorPart. /// @@ -611,4 +610,4 @@ public sealed class ReactorPartSystem : SharedReactorPartSystem /// The chance percentage between 0 and 100. private bool Prob(double chance) => _random.NextDouble() <= chance / 100; #endregion -} \ No newline at end of file +} diff --git a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/TurbineSystem.cs b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/TurbineSystem.cs index 3d65cd6c17b..56a4e2fa6e0 100644 --- a/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/TurbineSystem.cs +++ b/Content.Server/_FarHorizons/Power/Generation/FissionGenerator/TurbineSystem.cs @@ -1,5 +1,4 @@ using Content.Server.Atmos.EntitySystems; -using Content.Server.Atmos.Piping.Components; using Content.Server.Explosion.EntitySystems; using Content.Server.NodeContainer.EntitySystems; using Content.Server.Popups; @@ -27,6 +26,7 @@ using Content.Server.Audio; using Content.Shared.Audio; using Robust.Shared.Timing; using System.Linq; +using Content.Shared.Atmos.Components; namespace Content.Server._FarHorizons.Power.Generation.FissionGenerator; @@ -407,7 +407,7 @@ public sealed class TurbineSystem : SharedTurbineSystem else value.SetFlowRate = turbine.FlowRate; } - + UpdateUI(uid, turbine); return; @@ -420,7 +420,7 @@ public sealed class TurbineSystem : SharedTurbineSystem turbine.FlowRate = newSet; return true; } - return false; + return false; } } @@ -452,7 +452,7 @@ public sealed class TurbineSystem : SharedTurbineSystem turbine.StatorLoad = newSet; return true; } - return false; + return false; } } @@ -496,7 +496,7 @@ public sealed class TurbineSystem : SharedTurbineSystem { var state = SignalState.Momentary; args.Data?.TryGetValue(DeviceNetworkConstants.LogicState, out state); - + if (args.Port == comp.StatorLoadIncreasePort) comp.IncreasePortState = state; else if (args.Port == comp.StatorLoadDecreasePort) @@ -620,7 +620,7 @@ public sealed class TurbineSystem : SharedTurbineSystem { if (args.Cancelled) return; - + if (comp.RPM < 1) return; @@ -676,4 +676,4 @@ public sealed class TurbineSystem : SharedTurbineSystem comp.PowerMultiplier = (float)Math.Max(0.2, 0.2 * statorComp.Properties.ElectricalConductivity); } } -} \ No newline at end of file +} diff --git a/Content.Server/_Goobstation/Devil/CheatDeath/CheatDeathSystem.cs b/Content.Server/_Goobstation/Devil/CheatDeath/CheatDeathSystem.cs index 720878f4f68..375b9702488 100644 --- a/Content.Server/_Goobstation/Devil/CheatDeath/CheatDeathSystem.cs +++ b/Content.Server/_Goobstation/Devil/CheatDeath/CheatDeathSystem.cs @@ -19,6 +19,7 @@ using Content.Shared.Popups; using Content.Shared.Traits.Assorted; using Robust.Shared.Network; using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; namespace Content.Server._Goobstation.Devil.CheatDeath; @@ -30,6 +31,7 @@ public sealed partial class CheatDeathSystem : EntitySystem [Dependency] private readonly ActionsSystem _actionsSystem = default!; [Dependency] private readonly JitteringSystem _jitter = default!; [Dependency] private readonly MobThresholdSystem _thresholdSystem = default!; + [Dependency] private readonly DamageableSystem _damageableSystem = default!; public override void Initialize() { @@ -108,7 +110,7 @@ public sealed partial class CheatDeathSystem : EntitySystem // If the holy damage exceeds the crit state, do not allow revives. if (!TryComp(ent, out var damageable) || !_thresholdSystem.TryGetIncapThreshold(ent, out var incapThreshold) - || damageable.Damage.DamageDict["Holy"] >= incapThreshold) + || _damageableSystem.GetPositiveDamage((ent, damageable)).DamageDict["Holy"] >= incapThreshold) { var failPopup = Loc.GetString("action-cheat-death-holy-damage"); _popupSystem.PopupEntity(failPopup, ent, ent, PopupType.LargeCaution); diff --git a/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.ContractEvents.cs b/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.ContractEvents.cs index 7225fc18f0a..de14e39df05 100644 --- a/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.ContractEvents.cs +++ b/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.ContractEvents.cs @@ -8,20 +8,21 @@ using System.Linq; using Content.Shared._Goobstation.Devil; -using Content.Server.Body.Components; +using Content.Shared.Body; // Delta V - Nubody using Content.Shared.Body.Components; -using Content.Shared.Body.Part; +using Robust.Shared.Containers; // Delta V - Nubody using Robust.Shared.Random; namespace Content.Server._Goobstation.Devil.Contract; public sealed partial class DevilContractSystem { + [Dependency] private readonly SharedContainerSystem _containerSystem = default!; + private void InitializeSpecialActions() { SubscribeLocalEvent(OnSoulOwnership); - // SubscribeLocalEvent(OnLoseHand); // Delta V - Comment out for ShitMed Removal - // SubscribeLocalEvent(OnLoseLeg); // Delta V - Comment out for ShitMed Removal + SubscribeLocalEvent(OnLoseHand); SubscribeLocalEvent(OnLoseOrgan); SubscribeLocalEvent(OnChance); } @@ -33,59 +34,29 @@ public sealed partial class DevilContractSystem TryTransferSouls(contractOwner, args.Target, 1); } - // Delta V - ShitMed Removal, Prep for Nubody - // private void OnLoseHand(DevilContractLoseHandEvent args) - // { - // if (!TryComp(args.Target, out var body)) - // return; + private void OnLoseHand(DevilContractLoseHandEvent args) + { + if (_hands.GetHandCount(args.Target) <= 0) + return; - // var hands = _bodySystem.GetBodyChildrenOfType(args.Target, BodyPartType.Hand, body).ToList(); + var pick = _random.Pick(_hands.EnumerateHands(args.Target).ToList()); - // if (hands.Count <= 0) - // return; + _hands.RemoveHand(args.Target, pick); - // var pick = _random.Pick(hands); - - // if (!TryComp(pick.Id, out var woundable) - // || !woundable.CanSever) - // return; - - // _bodySystem.RemovePart(new(args.Target, body), pick, _bodySystem.GetSlotFromBodyPart(pick.Component)); - // QueueDel(pick.Id); - - // Dirty(args.Target, body); - // Log.Debug($"Removed part {ToPrettyString(pick.Id)} from {ToPrettyString(args.Target)}"); // DeltaV - Use EntitySystem Logger intead of _sawmill - // QueueDel(pick.Id); - // } - - // private void OnLoseLeg(DevilContractLoseLegEvent args) - // { - // if (!TryComp(args.Target, out var body)) - // return; - - // var legs = _bodySystem.GetBodyChildrenOfType(args.Target, BodyPartType.Leg, body).ToList(); - - // if (legs.Count <= 0) - // return; - - // var pick = _random.Pick(legs); - - // if (!TryComp(pick.Id, out var woundable) - // || !woundable.CanSever) - // return; - - // _bodySystem.RemovePart(new(args.Target, body), pick, _bodySystem.GetSlotFromBodyPart(pick.Component)); - - // Dirty(args.Target, body); - // Log.Debug($"Removed part {ToPrettyString(pick.Id)} from {ToPrettyString(args.Target)}"); // DeltaV - Use EntitySystem Logger intead of _sawmill - // QueueDel(pick.Id); - // } + Log.Debug($"Removed part {pick} from {ToPrettyString(args.Target)}"); // DeltaV - Use EntitySystem Logger intead of _sawmill + } private void OnLoseOrgan(DevilContractLoseOrganEvent args) { + if (!TryComp(args.Target, out var body)) + return; + + if (body.Organs == null) + return; + // don't remove the brain, as funny as that is. - var eligibleOrgans = _bodySystem.GetBodyOrgans(args.Target) - .Where(o => !HasComp(o.Id)) + var eligibleOrgans = body.Organs.ContainedEntities + .Where(o => !HasComp(o)) .ToList(); if (eligibleOrgans.Count <= 0) @@ -93,9 +64,8 @@ public sealed partial class DevilContractSystem var pick = _random.Pick(eligibleOrgans); - _bodySystem.RemoveOrgan(pick.Id, pick.Component); - Log.Debug($"Removed part {ToPrettyString(pick.Id)} from {ToPrettyString(args.Target)}"); // DeltaV - Use EntitySystem Logger intead of _sawmill - QueueDel(pick.Id); + _containerSystem.Remove(pick, body.Organs ); + Log.Debug($"Removed {pick.Id} from {ToPrettyString(args.Target)}"); // DeltaV - Use EntitySystem Logger intead of _sawmill } // LETS GO GAMBLING!!!!! diff --git a/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.cs b/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.cs index 1f294956192..5d60d13d04a 100644 --- a/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.cs +++ b/Content.Server/_Goobstation/Devil/Contract/DevilContractSystem.cs @@ -15,7 +15,6 @@ using Content.Server._Goobstation.Possession; using Content.Shared._Goobstation.Devil; using Content.Shared._Goobstation.Devil.Condemned; using Content.Shared._Goobstation.Devil.Contract; -using Content.Server.Body.Systems; using Content.Server.Explosion.EntitySystems; using Content.Server.Hands.Systems; using Content.Server.Implants; @@ -45,7 +44,6 @@ public sealed partial class DevilContractSystem : EntitySystem [Dependency] private readonly HandsSystem _hands = null!; [Dependency] private readonly SharedAudioSystem _audio = null!; [Dependency] private readonly IPrototypeManager _prototypeManager = null!; - [Dependency] private readonly BodySystem _bodySystem = null!; [Dependency] private readonly IRobustRandom _random = null!; [Dependency] private readonly SubdermalImplantSystem _implant = null!; [Dependency] private readonly PolymorphSystem _polymorph = null!; diff --git a/Content.Server/_Goobstation/Devil/DevilSystem.Handshake.cs b/Content.Server/_Goobstation/Devil/DevilSystem.Handshake.cs index 13bbaafd9d4..2c7b379aed4 100644 --- a/Content.Server/_Goobstation/Devil/DevilSystem.Handshake.cs +++ b/Content.Server/_Goobstation/Devil/DevilSystem.Handshake.cs @@ -8,9 +8,7 @@ using Content.Shared._Goobstation.CheatDeath; using Content.Shared._Goobstation.Devil; using Content.Shared._Goobstation.Devil.Condemned; -using Content.Shared.Body.Part; using Content.Shared.Mobs.Components; -using Content.Shared.Popups; using Content.Shared.Verbs; using Robust.Shared.Utility; @@ -23,6 +21,7 @@ public sealed partial class DevilSystem SubscribeLocalEvent>(OnGetVerbs); SubscribeLocalEvent>(OnGetVerbsPending); } + private void OnGetVerbs(EntityUid uid, DevilComponent comp, GetVerbsEvent args) { // Can't shake your own hand, and you can't shake from a distance @@ -32,8 +31,8 @@ public sealed partial class DevilSystem || !HasComp(args.Target) || HasComp(args.Target) || args.Target == args.User - || !_body.BodyHasPartType(uid, BodyPartType.Hand) // cant shake if you have no hands - || !_body.BodyHasPartType(args.Target, BodyPartType.Hand) // or if they have none + || _hands.GetHandCount(uid) == 0 // Delta V - Nubody Replacement, just count hands + || _hands.GetHandCount(args.Target) == 0 // Delta V - Nubody Replacement, just count hands || !_contract.IsUserValid(args.Target, out _)) return; diff --git a/Content.Server/_Goobstation/Devil/DevilSystem.cs b/Content.Server/_Goobstation/Devil/DevilSystem.cs index 91140f47305..fb86d2f485d 100644 --- a/Content.Server/_Goobstation/Devil/DevilSystem.cs +++ b/Content.Server/_Goobstation/Devil/DevilSystem.cs @@ -19,7 +19,6 @@ using Content.Server.Actions; using Content.Shared.Administration.Systems; using Content.Server.Antag.Components; using Content.Server.Atmos.Components; -using Content.Server.Body.Systems; using Content.Server.Destructible; using Content.Server.Hands.Systems; using Content.Server.Jittering; @@ -51,8 +50,9 @@ using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; -using Content.Shared.Body.Part; using Content.Server.Bible.Components; +using Content.Server.Body.Components; // Delta V - Nubody Merge +using Content.Shared.Body; // Delta V - Nubody Merge namespace Content.Server._Goobstation.Devil; @@ -108,6 +108,7 @@ public sealed partial class DevilSystem : EntitySystem RemComp(devil); RemComp(devil); RemComp(devil); + RemComp(devil); // Delta V - Remove Respirator since no more BreathingImmunity // Adjust stats EnsureComp(devil); @@ -127,15 +128,6 @@ public sealed partial class DevilSystem : EntitySystem // Change damage modifier _damageable.SetDamageModifierSetId(devil.Owner, devil.Comp.DevilDamageModifierSet); - // No decapitating the devil - foreach (var part in _body.GetBodyChildren(devil)) - { - if (!TryComp(part.Id, out BodyPartComponent? woundable)) // DeltaV - Use Bodypart instead of woundable. - continue; - - Dirty(part.Id, woundable); - } - // Add base actions foreach (var actionId in devil.Comp.BaseDevilActions) _actions.AddAction(devil, actionId); diff --git a/Content.Server/_Goobstation/Religion/WeakToHolySystem.cs b/Content.Server/_Goobstation/Religion/WeakToHolySystem.cs index 0cfd485abfc..088452a7837 100644 --- a/Content.Server/_Goobstation/Religion/WeakToHolySystem.cs +++ b/Content.Server/_Goobstation/Religion/WeakToHolySystem.cs @@ -17,11 +17,13 @@ using Content.Shared.Interaction; using Content.Shared.Inventory; using Robust.Shared.Physics.Events; using Robust.Shared.Timing; -using Content.Shared.Body.Components; -using Content.Shared.Body.Systems; using Content.Shared.Timing; using Content.Server.Bible.Components; +using Content.Shared.Body; +using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; namespace Content.Server._Goobstation.Religion; @@ -31,7 +33,7 @@ public sealed class WeakToHolySystem : EntitySystem [Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly GoobBibleSystem _goobBible = default!; - [Dependency] private readonly SharedBodySystem _body = default!; + [Dependency] private readonly BodySystem _body = default!; [Dependency] private readonly UseDelaySystem _useDelay = default!; public override void Initialize() { @@ -49,7 +51,7 @@ public sealed class WeakToHolySystem : EntitySystem if (!TryComp(ent, out var damageable)) return; - var dmg = damageable.Damage; + var dmg = _damageableSystem.GetPositiveDamage((ent, damageable)); if (dmg.DamageDict.ContainsKey("Holy")) { ent.Comp.HadHolyWeakness = true; @@ -65,8 +67,10 @@ public sealed class WeakToHolySystem : EntitySystem if (!ent.Comp.HadHolyWeakness) { - var dmg = damageable.Damage; - dmg.DamageDict.Remove("Holy"); + var dmg = _damageableSystem.GetPositiveDamage((ent, damageable)); + dmg.DamageDict.TryGetValue("Holy", out var holyDmg); + DamageSpecifier heal = new() {DamageDict = new Dictionary, FixedPoint2>() {{ "Holy", -holyDmg }}}; + _damageableSystem.TryChangeDamage((ent, damageable), heal, ignoreResistances: true); } } // End DeltaV additions @@ -100,9 +104,10 @@ public sealed class WeakToHolySystem : EntitySystem if (!TryComp(uid, out var damageable)) continue; + var dmg = _damageableSystem.GetPositiveDamage((uid, damageable)); + if (TerminatingOrDeleted(uid) - || _body.GetRootPartOrNull(uid, body: body) is not { } - || !damageable.Damage.DamageDict.TryGetValue("Holy", out _)) + || !dmg.DamageDict.TryGetValue("Holy", out _)) continue; // Rune healing. diff --git a/Content.Server/_Mono/CorticalBorer/CorticalBorerInfestedSystem.cs b/Content.Server/_Mono/CorticalBorer/CorticalBorerInfestedSystem.cs index 9f3f6c4ad9f..76296d6527a 100644 --- a/Content.Server/_Mono/CorticalBorer/CorticalBorerInfestedSystem.cs +++ b/Content.Server/_Mono/CorticalBorer/CorticalBorerInfestedSystem.cs @@ -4,7 +4,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later using Content.Shared._Mono.CorticalBorer; -using Content.Shared.Body.Part; +using Content.Shared.Body; using Content.Shared.Examine; using Content.Shared.Mind.Components; using Content.Shared.Mobs; @@ -26,7 +26,7 @@ public sealed class CorticalBorerInfestedSystem : EntitySystem SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnExaminedInfested); - SubscribeLocalEvent(OnBodyPartRemoved); + SubscribeLocalEvent(OnBodyPartRemoved); SubscribeLocalEvent(OnStateChange); SubscribeLocalEvent(OnMindRemoved); } @@ -64,14 +64,10 @@ public sealed class CorticalBorerInfestedSystem : EntitySystem _borer.EndControl(infected.Comp.Borer); } - private void OnBodyPartRemoved(Entity infected, ref BodyPartRemovedEvent args) + private void OnBodyPartRemoved(Entity infected, ref OrganGotRemovedEvent args) { - if (TryComp(args.Part, out var part) && - part.PartType == BodyPartType.Head) - { - _borer.EndControl(infected.Comp.Borer); - _borer.TryEjectBorer(infected.Comp.Borer); - } + _borer.EndControl(infected.Comp.Borer); + _borer.TryEjectBorer(infected.Comp.Borer); } private void OnMindRemoved(Entity infected, ref MindRemovedMessage args) diff --git a/Content.Shared/EntityEffects/Effects/Damage/EvenHealthChangeEntityEffectSystem.cs b/Content.Shared/EntityEffects/Effects/Damage/EvenHealthChangeEntityEffectSystem.cs index c4fb0c07e49..c1b81f4b017 100644 --- a/Content.Shared/EntityEffects/Effects/Damage/EvenHealthChangeEntityEffectSystem.cs +++ b/Content.Shared/EntityEffects/Effects/Damage/EvenHealthChangeEntityEffectSystem.cs @@ -1,5 +1,6 @@ // DeltaV Start - Fix EvenHealing with Limbs. -using Content.Shared.Body.Systems; + +using Content.Shared.Body; // DeltaV End - Fix EvenHealing with Limbs. using Content.Shared.Damage.Components; using Content.Shared.Damage.Prototypes; @@ -18,7 +19,7 @@ namespace Content.Shared.EntityEffects.Effects.Damage; public sealed partial class EvenHealthChangeEntityEffectSystem : EntityEffectSystem { [Dependency] private readonly DamageableSystem _damageable = default!; - [Dependency] private readonly SharedBodySystem _body = default!; // DeltaV + [Dependency] private readonly BodySystem _body = default!; // DeltaV protected override void Effect(Entity entity, ref EntityEffectEvent args) { diff --git a/Content.Shared/Humanoid/HumanoidProfileExportV1.cs b/Content.Shared/Humanoid/HumanoidProfileExportV1.cs index 59b48ab5e84..843e6e5279a 100644 --- a/Content.Shared/Humanoid/HumanoidProfileExportV1.cs +++ b/Content.Shared/Humanoid/HumanoidProfileExportV1.cs @@ -1,10 +1,11 @@ using System.Numerics; +using Content.Shared._CD.Records; +using Content.Shared._DV.Traits; using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Prototypes; using Content.Shared.Preferences; using Content.Shared.Preferences.Loadouts; using Content.Shared.Roles; -using Content.Shared.Traits; using Robust.Shared.Enums; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -79,9 +80,18 @@ public sealed partial class HumanoidCharacterProfileV1 [DataField] public PreferenceUnavailableMode PreferenceUnavailable; + // Begin CD - Character Records + [DataField("cosmaticDriftCharacterHeight")] + public float Height; + + [DataField("cosmaticDriftCharacterRecords")] + public PlayerProvidedCharacterRecords PlayerProvidedCharacterRecords; + // End CD - Character Records + + public HumanoidCharacterProfile ToV2() { - return new(Name, FlavorText, Species, Age, Sex, Gender, Appearance.ToV2(Species), SpawnPriority, JobPriorities, PreferenceUnavailable, AntagPreferences, TraitPreferences, Loadouts); + return new(Name, FlavorText, Species, Age, Sex, Gender, Appearance.ToV2(Species), SpawnPriority, JobPriorities, PreferenceUnavailable, AntagPreferences, TraitPreferences, Loadouts, Height, PlayerProvidedCharacterRecords); } } diff --git a/Content.Shared/KillTome/KillTomeComponent.cs b/Content.Shared/KillTome/KillTomeComponent.cs index 266ff1a8f84..4af861617e2 100644 --- a/Content.Shared/KillTome/KillTomeComponent.cs +++ b/Content.Shared/KillTome/KillTomeComponent.cs @@ -24,7 +24,7 @@ public sealed partial class KillTomeComponent : Component [DataField, AutoNetworkedField] public DamageSpecifier Damage = new() { - DamageDict = new Dictionary + DamageDict = new Dictionary, FixedPoint2> { { "Blunt", 200 } } diff --git a/Content.Shared/KillTome/KillTomeSystem.cs b/Content.Shared/KillTome/KillTomeSystem.cs index 73701691eec..d6c463c37bc 100644 --- a/Content.Shared/KillTome/KillTomeSystem.cs +++ b/Content.Shared/KillTome/KillTomeSystem.cs @@ -128,7 +128,7 @@ public sealed class KillTomeSystem : EntitySystem // A person to be killed by KillTome must: // 1. be with the name - // 2. have HumanoidAppearanceComponent (so it targets only humanoids, obv) + // 2. have HumanoidProfileComponent (so it targets only humanoids, obv) // 3. not be already dead // 4. not be already killed by Kill Tome @@ -166,7 +166,7 @@ public sealed class KillTomeSystem : EntitySystem private bool TryFindEntityByName(string name, [NotNullWhen(true)] out EntityUid? entityUid) { - var query = EntityQueryEnumerator(); + var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out _)) { diff --git a/Content.Shared/KillTome/KillTomeTargetComponent.cs b/Content.Shared/KillTome/KillTomeTargetComponent.cs index 14a573b75f5..955e2dff6c6 100644 --- a/Content.Shared/KillTome/KillTomeTargetComponent.cs +++ b/Content.Shared/KillTome/KillTomeTargetComponent.cs @@ -1,6 +1,8 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.FixedPoint; using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.KillTome; @@ -17,7 +19,7 @@ public sealed partial class KillTomeTargetComponent : Component [DataField, AutoNetworkedField] public DamageSpecifier Damage = new() { - DamageDict = new Dictionary + DamageDict = new Dictionary, FixedPoint2> { { "Blunt", 200 } } diff --git a/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs b/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs index 5a49cd4ab11..9078d0daafb 100644 --- a/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs +++ b/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs @@ -239,7 +239,7 @@ public sealed class SharedKitchenSpikeSystem : EntitySystem args.Target.Value, ent); - // var logSeverity = HasComp(args.Target) ? LogImpact.Extreme : LogImpact.High; // DeltaV - replaced below + // var logSeverity = HasComp(args.Target) ? LogImpact.Extreme : LogImpact.High; // DeltaV - replaced below var (logSeverity, hasMind) = LogValuesForTarget(args.Target.Value); // DeltaV _logger.Add(LogType.Action, @@ -317,7 +317,7 @@ public sealed class SharedKitchenSpikeSystem : EntitySystem { _gibbing.Gib(args.Target.Value); - // var logSeverity = HasComp(args.Target) ? LogImpact.Extreme : LogImpact.High; // DeltaV - replaced below + // var logSeverity = HasComp(args.Target) ? LogImpact.Extreme : LogImpact.High; // DeltaV - replaced below var (logSeverity, hasMind) = LogValuesForTarget(args.Target.Value); // DeltaV _logger.Add(LogType.Gib, diff --git a/Content.Shared/Whistle/WhistleComponent.cs b/Content.Shared/Whistle/WhistleComponent.cs index 5004711514f..3223390ea20 100644 --- a/Content.Shared/Whistle/WhistleComponent.cs +++ b/Content.Shared/Whistle/WhistleComponent.cs @@ -6,7 +6,7 @@ using Robust.Shared.Prototypes; namespace Content.Shared.Whistle; /// -/// Spawn attached entity for entities in range with . +/// Spawn attached entity for entities in range with . /// [RegisterComponent, NetworkedComponent] public sealed partial class WhistleComponent : Component diff --git a/Content.Shared/_DV/Abilities/Kitsune/SharedKitsuneSystem.cs b/Content.Shared/_DV/Abilities/Kitsune/SharedKitsuneSystem.cs index 8e5aeefc942..6f975b115e9 100644 --- a/Content.Shared/_DV/Abilities/Kitsune/SharedKitsuneSystem.cs +++ b/Content.Shared/_DV/Abilities/Kitsune/SharedKitsuneSystem.cs @@ -31,9 +31,9 @@ public abstract class SharedKitsuneSystem : EntitySystem private void OnProfileLoadFinished(Entity ent, ref AppearanceLoadedEvent args) { // Eye color is stored on component to be used for fox fire/fox form color. - if (TryComp(ent, out var humanComp)) + if (TryComp(ent, out var humanComp)) { - ent.Comp.Color = humanComp.EyeColor; + ent.Comp.Color = Color.White; // TODO: Nubody Color var lightColor = ent.Comp.Color.Value; var max = MathF.Max(lightColor.R, MathF.Max(lightColor.G, lightColor.B)); diff --git a/Content.Shared/_DV/Body/Systems/PreenableSystem.cs b/Content.Shared/_DV/Body/Systems/PreenableSystem.cs index 2565dea4bdf..485460d39ca 100644 --- a/Content.Shared/_DV/Body/Systems/PreenableSystem.cs +++ b/Content.Shared/_DV/Body/Systems/PreenableSystem.cs @@ -181,9 +181,9 @@ public sealed class PreenableSystem : EntitySystem { var feather = PredictedSpawnAtPosition(ent.Comp.FeatherPrototype.Id, Transform(ent).Coordinates); - if (TryComp(ent, out var appearance)) + if (TryComp(ent, out var appearance)) { - _appearance.SetData(feather, FeatherVisuals.FeatherColor, appearance.SkinColor); + _appearance.SetData(feather, FeatherVisuals.FeatherColor, Color.White); // TODO: Nubody Colors } // best be careful, no cleaning this diff --git a/Content.Shared/_DV/Body/Systems/SharedBodySystem.MapInit.cs b/Content.Shared/_DV/Body/Systems/SharedBodySystem.MapInit.cs deleted file mode 100644 index 8159eb4e40d..00000000000 --- a/Content.Shared/_DV/Body/Systems/SharedBodySystem.MapInit.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Linq; -using Content.Shared.Body.Components; -using Content.Shared.Body.Part; -using Content.Shared.Humanoid; - -namespace Content.Shared.Body.Systems; - -public partial class SharedBodySystem -{ - private static readonly BodyPartType[] _asymmetric = - [ - BodyPartType.Other, - BodyPartType.Torso, - BodyPartType.Tail, - BodyPartType.Head, - ]; - - private static readonly BodyPartType[] _symmetric = - [ - BodyPartType.Arm, - BodyPartType.Hand, - BodyPartType.Leg, - BodyPartType.Foot, - ]; - - // [Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidAppearance = default!; // Shitmed Change - Declared in SharedBodySystem.cs - - // private void MapInitAppearance(Entity ent) - // { - // var symmetries = Enum.GetValues(); - - // foreach (var part in _asymmetric) - // { - // if (part.ToHumanoidLayers(BodyPartSymmetry.None) is not {} layer) - // continue; - - // var layers = HumanoidVisualLayersExtension.Sublayers(layer); - // var visible = GetBodyChildrenOfType(ent, part).Any(); - - // _humanoidAppearance.SetLayersVisibility(ent.Owner, layers, visible: visible); - // } - - // foreach (var part in _symmetric) - // { - // foreach (var side in symmetries) - // { - // if (part.ToHumanoidLayers(side) is not {} layer) - // continue; - - // var layers = HumanoidVisualLayersExtension.Sublayers(layer); - // var visible = GetBodyChildrenOfType(ent, part).Any(); - - // _humanoidAppearance.SetLayersVisibility(ent.Owner, layers, visible: visible); - // } - // } - // } -} diff --git a/Content.Shared/_DV/Body/Systems/SharedRessurectWhenAbleSystem.cs b/Content.Shared/_DV/Body/Systems/SharedRessurectWhenAbleSystem.cs index 9d6cdbd1332..2af1572db97 100644 --- a/Content.Shared/_DV/Body/Systems/SharedRessurectWhenAbleSystem.cs +++ b/Content.Shared/_DV/Body/Systems/SharedRessurectWhenAbleSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.Damage; using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.Examine; using Content.Shared.Mobs.Systems; using Robust.Shared.Timing; @@ -11,6 +12,7 @@ public sealed partial class SharedResurrectWhenAbleSystem : EntitySystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly MobThresholdSystem _mobThreshold = default!; + [Dependency] private readonly DamageableSystem _damageableSystem = default!; public override void Initialize() { @@ -40,7 +42,8 @@ public sealed partial class SharedResurrectWhenAbleSystem : EntitySystem continue; // We're dead, and must stay dead. - if (damageable.TotalDamage >= threshold) + var dmg = _damageableSystem.GetPositiveDamage((uid,damageable)); + if (dmg.GetTotal() >= threshold) { comp.ResurrectAt = null; continue; diff --git a/Content.Shared/_DV/Containers/ContentContainerSystem.cs b/Content.Shared/_DV/Containers/ContentContainerSystem.cs index d61eda059ac..1fa5ef373e6 100644 --- a/Content.Shared/_DV/Containers/ContentContainerSystem.cs +++ b/Content.Shared/_DV/Containers/ContentContainerSystem.cs @@ -1,6 +1,6 @@ using System.Linq; using Content.Shared._DV.Polymorph; -using Content.Shared.Body.Organ; +using Content.Shared.Body; using Content.Shared.Intellicard; using Content.Shared.Mind.Components; using Robust.Shared.Containers; diff --git a/Content.Shared/_DV/EntityConditions/Conditions/HasComponentsConditionSystem.cs b/Content.Shared/_DV/EntityConditions/Conditions/HasComponentsConditionSystem.cs index 83941841bf8..16b5d7669b7 100644 --- a/Content.Shared/_DV/EntityConditions/Conditions/HasComponentsConditionSystem.cs +++ b/Content.Shared/_DV/EntityConditions/Conditions/HasComponentsConditionSystem.cs @@ -1,14 +1,6 @@ using System.Linq; -using Content.Shared.EntityEffects; -using Content.Shared.Body.Part; -using Content.Shared.Body.Systems; -using Content.Shared.Nutrition.Components; -using Content.Shared.Nutrition.EntitySystems; using Content.Shared.EntityConditions; -using Content.Shared.Mobs; -using Content.Shared.Mobs.Components; using Robust.Shared.Prototypes; -using Robust.Shared.Localization; namespace Content.Shared._DV.EntityConditions.Conditions; @@ -19,13 +11,10 @@ namespace Content.Shared._DV.EntityConditions.Conditions; public sealed partial class HasComponentsConditionSystem : EntityConditionSystem { [Dependency] private readonly EntityManager _ent = default!; - [Dependency] private readonly SharedBodySystem _body = default!; protected override void Condition(Entity entity, ref EntityConditionEvent args) { - var targetEntity = args.Condition.BodyPart is { } bodyPart - ? _body.GetBodyChildrenOfType(entity.Owner, bodyPart).Select(it => it.Id).FirstOrDefault() - : entity.Owner; + var targetEntity = entity.Owner; if (!targetEntity.IsValid()) { @@ -69,17 +58,5 @@ public sealed partial class HasComponentCondition : EntityConditionBase - /// The body part of the entity to test for the components - /// - [DataField] - public BodyPartType? BodyPart; - - /// - /// The side of the entity's body to test for the components - /// - [DataField] - public BodyPartSymmetry? BodyPartSymmetry; - public override string EntityConditionGuidebookText(IPrototypeManager prototype) => Loc.GetString(Explanation); } diff --git a/Content.Shared/_DV/Harpy/HarpyVisualsSystem.cs b/Content.Shared/_DV/Harpy/HarpyVisualsSystem.cs index 574c26c0715..3de16d5d00e 100644 --- a/Content.Shared/_DV/Harpy/HarpyVisualsSystem.cs +++ b/Content.Shared/_DV/Harpy/HarpyVisualsSystem.cs @@ -8,7 +8,7 @@ namespace Content.Shared._DV.Harpy; public sealed class HarpyVisualsSystem : EntitySystem { [Dependency] private readonly TagSystem _tagSystem = default!; - [Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidSystem = default!; + [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; private readonly ProtoId HarpyWingsTag = "HidesHarpyWings"; @@ -24,8 +24,8 @@ public sealed class HarpyVisualsSystem : EntitySystem { if (args.Slot == "outerClothing" && _tagSystem.HasTag(args.Equipment, HarpyWingsTag)) { - _humanoidSystem.SetLayerVisibility(uid, HumanoidVisualLayers.RArmExtension, false); // Frontier: RArm public sealed class UnborgableSystem : EntitySystem { - [Dependency] private readonly SharedBodySystem _body = default!; + [Dependency] private readonly BodySystem _body = default!; public override void Initialize() { @@ -28,7 +26,7 @@ public sealed class UnborgableSystem : EntitySystem public bool IsUnborgable(Entity ent) { // technically this will apply for any organ not just brain, but assume nobody will be evil and do that - return _body.GetBodyOrganEntityComps(ent).Count > 0; + return _body.TryGetOrgansWithComponent(ent, out var organs) && organs.Count != 0; } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -36,7 +34,7 @@ public sealed class UnborgableSystem : EntitySystem if (!TryComp(ent, out var body)) return; - var brains = _body.GetBodyOrganEntityComps((ent.Owner, body)); + _body.TryGetOrgansWithComponent(ent.Owner, out var brains); foreach (var brain in brains) { EnsureComp(brain); diff --git a/Content.Shared/_Goobstation/Devil/DevilComponent.cs b/Content.Shared/_Goobstation/Devil/DevilComponent.cs index 751827e20b0..2225365b839 100644 --- a/Content.Shared/_Goobstation/Devil/DevilComponent.cs +++ b/Content.Shared/_Goobstation/Devil/DevilComponent.cs @@ -79,7 +79,7 @@ public sealed partial class DevilComponent : Component /// How much damage taken when a true name is spoken. Doubled if spoken by the chaplain. /// [DataField] - public DamageSpecifier DamageOnTrueName = new() {DamageDict = new Dictionary() {{ "Holy", 15 }}}; + public DamageSpecifier DamageOnTrueName = new() {DamageDict = new Dictionary, FixedPoint2>() {{ "Holy", 15 }}}; /// /// Holy action damage multiplier if done by the chaplain. Also effects stums. diff --git a/Content.Shared/_Goobstation/Trigger/Systems/DeleteParentOnTriggerSystem.cs b/Content.Shared/_Goobstation/Trigger/Systems/DeleteParentOnTriggerSystem.cs index fadc3f2e623..f405ca616bc 100644 --- a/Content.Shared/_Goobstation/Trigger/Systems/DeleteParentOnTriggerSystem.cs +++ b/Content.Shared/_Goobstation/Trigger/Systems/DeleteParentOnTriggerSystem.cs @@ -1,15 +1,15 @@ -using Content.Shared.Body.Systems; using Content.Shared.Inventory; using Content.Shared.Trigger; using Content.Shared.Trigger.Systems; using Content.Shared.Trigger.Components.Effects; using Content.Shared._Goobstation.Trigger.Components.Effects; +using Content.Shared.Body; namespace Content.Shared._Goobstation.Trigger.Systems; public sealed class DeleteParentOnTriggerSystem : EntitySystem { - [Dependency] private readonly SharedBodySystem _body = default!; + [Dependency] private readonly BodySystem _body = default!; [Dependency] private readonly InventorySystem _inventory = default!; public override void Initialize() diff --git a/Content.Shared/_Mono/CorticalBorer/SharedCorticalBorerSystem.cs b/Content.Shared/_Mono/CorticalBorer/SharedCorticalBorerSystem.cs index eaadf21af09..371a11772a9 100644 --- a/Content.Shared/_Mono/CorticalBorer/SharedCorticalBorerSystem.cs +++ b/Content.Shared/_Mono/CorticalBorer/SharedCorticalBorerSystem.cs @@ -6,7 +6,7 @@ using System.Linq; using Content.Shared.Actions; using Content.Shared.Body.Components; -using Content.Shared.Body.Part; +using Content.Shared.Body; using Content.Shared.Body.Systems; using Content.Shared.Containers.ItemSlots; using Content.Shared.Examine; @@ -27,7 +27,7 @@ namespace Content.Shared._Mono.CorticalBorer; public partial class SharedCorticalBorerSystem : EntitySystem { - [Dependency] private readonly SharedBodySystem _bodySystem = default!; + [Dependency] private readonly BodySystem _bodySystem = default!; [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ISerializationManager _serManager = default!; diff --git a/Resources/Prototypes/_DV/Entities/Mobs/Player/kitsunefox.yml b/Resources/Prototypes/_DV/Entities/Mobs/Player/kitsunefox.yml index 55d5a9ca3a7..b0c008b13e3 100644 --- a/Resources/Prototypes/_DV/Entities/Mobs/Player/kitsunefox.yml +++ b/Resources/Prototypes/_DV/Entities/Mobs/Player/kitsunefox.yml @@ -25,6 +25,22 @@ - type: Inventory speciesId: fox templateId: pet + - type: InteractionPopup + interactSuccessString: petting-success-soft-floofy-kitsune + interactSuccessSpawn: EffectHearts + interactSuccessSound: + path: /Audio/Animals/fox_squeak.ogg + - type: Emoting + - type: BodyEmotes + soundsId: GeneralBodyEmotes + - type: Speech + speechSounds: Alto + allowedEmotes: ['Growl', 'Squeak'] + - type: Vocal + sounds: + Male: MaleKitsune + Female: FemaleKitsune + Unsexed: MaleKitsune - type: DamageStateVisuals states: Alive: diff --git a/Resources/Prototypes/_Goobstation/Devil/clauses.yml b/Resources/Prototypes/_Goobstation/Devil/clauses.yml index db2d5cfaaa4..0d66f6ecab2 100644 --- a/Resources/Prototypes/_Goobstation/Devil/clauses.yml +++ b/Resources/Prototypes/_Goobstation/Devil/clauses.yml @@ -173,10 +173,12 @@ addedComponents: - type: Muted -- type: clause - id: aleg - clauseWeight: 20 - event: !type:DevilContractLoseLegEvent +# Delta V Begin - Nubody, doesn't work currently +# - type: clause +# id: aleg +# clauseWeight: 20 +# event: !type:DevilContractLoseLegEvent +# Delta V End - Nubody, doesn't work currently - type: clause id: ahand @@ -224,12 +226,12 @@ - type: CheatDeath infiniteRevives: true -# Delta V - ShitMed Removal, needs rewrite -# - type: clause -# id: time -# clauseWeight: 150 -# addedComponents: -# - type: DelayedDeath -# preventAllRevives: true # :trol: -# deathTime: 300 -# deathMessageId: devil-deal-time-ran-out +# Delta V - Nubody, No shitmed +#- type: clause +# id: time +# clauseWeight: 150 +# addedComponents: +# - type: DelayedDeath +# preventAllRevives: true # :trol: +# deathTime: 300 +# deathMessageId: devil-deal-time-ran-out