diff --git a/Content.Client/Effects/ColorFlashEffectSystem.cs b/Content.Client/Effects/ColorFlashEffectSystem.cs index af0bd4b600d..3a66cb72e9b 100644 --- a/Content.Client/Effects/ColorFlashEffectSystem.cs +++ b/Content.Client/Effects/ColorFlashEffectSystem.cs @@ -45,7 +45,9 @@ private void OnEffectAnimationCompleted(EntityUid uid, ColorFlashEffectComponent sprite.Color = component.Color; } - RemCompDeferred(uid); + // Floof - commented this out due to a race condition. It's quite complicated to explain; + // in short terms, don't do deferred component removal when dealing with concurrent tasks concerning the same component. + // RemCompDeferred(uid); } private Animation? GetDamageAnimation(EntityUid uid, Color color, SpriteComponent? sprite = null) @@ -107,10 +109,11 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev) continue; } - if (TryComp(ent, out var effect)) - { - sprite.Color = effect.Color; - } + // Floof - commented out. This is handled by the animation complete event. + // if (TryComp(ent, out var effect)) + // { + // sprite.Color = effect.Color; + // } var animation = GetDamageAnimation(ent, color, sprite); diff --git a/Content.Server/Carrying/CarryingSystem.cs b/Content.Server/Carrying/CarryingSystem.cs index ed5bb36ea5b..9c1a72c7d47 100644 --- a/Content.Server/Carrying/CarryingSystem.cs +++ b/Content.Server/Carrying/CarryingSystem.cs @@ -273,6 +273,7 @@ private void Carry(EntityUid carrier, EntityUid carried) if (TryComp(carried, out var pullable)) _pullingSystem.TryStopPull(carried, pullable); + EnsureComp(carried); // Floof - moved this statement up because some systems can break carrying in response to knockdown _transform.AttachToGridOrMap(carrier); _transform.AttachToGridOrMap(carried); _transform.SetCoordinates(carried, Transform(carrier).Coordinates); @@ -282,7 +283,6 @@ private void Carry(EntityUid carrier, EntityUid carried) var carryingComp = EnsureComp(carrier); ApplyCarrySlowdown(carrier, carried); var carriedComp = EnsureComp(carried); - EnsureComp(carried); carryingComp.Carried = carried; carriedComp.Carrier = carrier; diff --git a/Content.Server/FootPrint/FootPrintsSystem.cs b/Content.Server/FootPrint/FootPrintsSystem.cs index 0929ef63f39..6762659fbff 100644 --- a/Content.Server/FootPrint/FootPrintsSystem.cs +++ b/Content.Server/FootPrint/FootPrintsSystem.cs @@ -11,34 +11,33 @@ using Content.Shared.Forensics; using Robust.Shared.Map; using Robust.Shared.Physics.Components; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server.FootPrint; +// Floof: this system has been effectively rewritten. DO NOT MERGE UPSTREAM CHANGES. public sealed class FootPrintsSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly IMapManager _map = default!; + [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; // Floof + [Dependency] private readonly EntityLookupSystem _lookup = default!; - private EntityQuery _transformQuery; - private EntityQuery _mobThresholdQuery; private EntityQuery _appearanceQuery; - private EntityQuery _layingQuery; + private EntityQuery _standingStateQuery; public override void Initialize() { base.Initialize(); - _transformQuery = GetEntityQuery(); - _mobThresholdQuery = GetEntityQuery(); _appearanceQuery = GetEntityQuery(); - _layingQuery = GetEntityQuery(); + _standingStateQuery = GetEntityQuery(); SubscribeLocalEvent(OnStartupComponent); SubscribeLocalEvent(OnMove); @@ -51,81 +50,72 @@ private void OnStartupComponent(EntityUid uid, FootPrintsComponent component, Co private void OnMove(EntityUid uid, FootPrintsComponent component, ref MoveEvent args) { - // Floof: clear stored DNAs if footprints are now invisible - if (component.PrintsColor.A <= .3f) - component.DNAs.Clear(); - - if (component.PrintsColor.A <= .3f // avoid creating footsteps that are invisible + if (component.ContainedSolution.Volume <= 0 || TryComp(uid, out var physics) && physics.BodyStatus != BodyStatus.OnGround // Floof: do not create footprints if the entity is flying - || !_transformQuery.TryComp(uid, out var transform) - || !_mobThresholdQuery.TryComp(uid, out var mobThreshHolds) - || !_map.TryFindGridAt(_transform.GetMapCoordinates((uid, transform)), out var gridUid, out _)) + || args.Entity.Comp1.GridUid is not {} gridUid) return; - // Floof - this is dumb - // var dragging = mobThreshHolds.CurrentThresholdState is MobState.Critical or MobState.Dead - // || _layingQuery.TryComp(uid, out var laying) && laying.IsCrawlingUnder; - var dragging = TryComp(uid, out var standing) && standing.CurrentState == StandingState.Lying; // Floof - replaced the above - var distance = (transform.LocalPosition - component.StepPos).Length(); + var newPos = _transform.ToMapCoordinates(args.NewPosition).Position; + var dragging = _standingStateQuery.TryComp(uid, out var standing) && standing.CurrentState == StandingState.Lying; + var distance = (newPos - component.LastStepPos).Length(); var stepSize = dragging ? component.DragSize : component.StepSize; - if (!(distance > stepSize)) + if (distance < stepSize) return; - // Floof section + // are we on a puddle? we exit, ideally we would exchange liquid and DNA with the puddle but meh, too lazy to do that now. var entities = _lookup.GetEntitiesIntersecting(uid, LookupFlags.All); - foreach (var entityUid in entities.Where(entityUid => HasComp(entityUid))) - return; // are we on a puddle? we exit, ideally we would exchange liquid and DNA with the puddle but meh, too lazy to do that now. - // Floof section end - - component.RightStep = !component.RightStep; + if (entities.Any(HasComp)) + return; - var entity = Spawn(component.StepProtoId, CalcCoords(gridUid, component, transform, dragging)); - var footPrintComponent = EnsureComp(entity); + // Spawn the footprint + var footprintUid = Spawn(component.StepProtoId, CalcCoords(gridUid, component, args.Component, dragging)); + var stepTransform = Transform(footprintUid); + var footPrintComponent = EnsureComp(footprintUid); - // Floof section - var forensics = EntityManager.EnsureComponent(entity); - if (TryComp(uid, out var ownerForensics)) // transfer owner DNA into the footsteps + // transfer owner DNA into the footsteps + var forensics = EntityManager.EnsureComponent(footprintUid); + if (TryComp(uid, out var ownerForensics)) forensics.DNAs.UnionWith(ownerForensics.DNAs); - // Floof section end footPrintComponent.PrintOwner = uid; - Dirty(entity, footPrintComponent); + Dirty(footprintUid, footPrintComponent); - if (_appearanceQuery.TryComp(entity, out var appearance)) + if (_appearanceQuery.TryComp(footprintUid, out var appearance)) { - _appearance.SetData(entity, FootPrintVisualState.State, PickState(uid, dragging), appearance); - _appearance.SetData(entity, FootPrintVisualState.Color, component.PrintsColor, appearance); - } + var color = component.ContainedSolution.GetColor(_protoMan); + color.A = Math.Max(0.3f, component.ContainedSolution.FillFraction); - if (!_transformQuery.TryComp(entity, out var stepTransform)) - return; + _appearance.SetData(footprintUid, FootPrintVisualState.State, PickState(uid, dragging), appearance); + _appearance.SetData(footprintUid, FootPrintVisualState.Color, color, appearance); + } stepTransform.LocalRotation = dragging - ? (transform.LocalPosition - component.StepPos).ToAngle() + Angle.FromDegrees(-90f) - : transform.LocalRotation + Angle.FromDegrees(180f); + ? (newPos - component.LastStepPos).ToAngle() + Angle.FromDegrees(-90f) + : args.Component.LocalRotation + Angle.FromDegrees(180f); - component.PrintsColor = component.PrintsColor.WithAlpha(Math.Max(0f, component.PrintsColor.A - component.ColorReduceAlpha)); - component.StepPos = transform.LocalPosition; - - if (!TryComp(entity, out var solutionContainer) - || !_solution.ResolveSolution((entity, solutionContainer), footPrintComponent.SolutionName, ref footPrintComponent.Solution, out var solution) - || string.IsNullOrWhiteSpace(component.ReagentToTransfer) || solution.Volume >= 1) + if (!TryComp(footprintUid, out var solutionContainer) + || !_solution.ResolveSolution((footprintUid, solutionContainer), footPrintComponent.SolutionName, ref footPrintComponent.Solution, out var solution)) return; - _solution.TryAddReagent(footPrintComponent.Solution.Value, component.ReagentToTransfer, 1, out _); + // Transfer from the component to the footprint + var removedReagents = component.ContainedSolution.SplitSolution(component.FootprintVolume); + _solution.ForceAddSolution(footPrintComponent.Solution.Value, removedReagents); + + component.RightStep = !component.RightStep; + component.LastStepPos = newPos; } private EntityCoordinates CalcCoords(EntityUid uid, FootPrintsComponent component, TransformComponent transform, bool state) { if (state) - return new EntityCoordinates(uid, transform.LocalPosition); + return new(uid, transform.LocalPosition); var offset = component.RightStep ? new Angle(Angle.FromDegrees(180f) + transform.LocalRotation).RotateVec(component.OffsetPrint) : new Angle(transform.LocalRotation).RotateVec(component.OffsetPrint); - return new EntityCoordinates(uid, transform.LocalPosition + offset); + return new(uid, transform.LocalPosition + offset); } private FootPrintVisuals PickState(EntityUid uid, bool dragging) diff --git a/Content.Server/FootPrint/PuddleFootPrintsSystem.cs b/Content.Server/FootPrint/PuddleFootPrintsSystem.cs index 362c83963c5..60c899add08 100644 --- a/Content.Server/FootPrint/PuddleFootPrintsSystem.cs +++ b/Content.Server/FootPrint/PuddleFootPrintsSystem.cs @@ -2,16 +2,20 @@ using Content.Shared.FootPrint; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.FixedPoint; using Content.Shared.Fluids; using Content.Shared.Fluids.Components; using Content.Shared.Forensics; using Robust.Shared.Physics.Events; +using Robust.Shared.Prototypes; + namespace Content.Server.FootPrint; +// Floof: this system has been effectively rewritten. DO NOT MERGE UPSTREAM CHANGES. public sealed class PuddleFootPrintsSystem : EntitySystem { - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly IPrototypeManager _protoMan = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; public override void Initialize() @@ -22,22 +26,10 @@ public override void Initialize() private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent component, ref EndCollideEvent args) { - if (!TryComp(uid, out var appearance) - || !TryComp(uid, out var puddle) - || !TryComp(args.OtherEntity, out var tripper) - || !TryComp(uid, out var solutionManager) - || !_solutionContainer.ResolveSolution((uid, solutionManager), puddle.SolutionName, ref puddle.Solution, out var solutions)) - return; - - var totalSolutionQuantity = solutions.Contents.Sum(sol => (float) sol.Quantity); - var waterQuantity = (from sol in solutions.Contents where sol.Reagent.Prototype == "Water" select (float) sol.Quantity).FirstOrDefault(); - - if (waterQuantity / (totalSolutionQuantity / 100f) > component.OffPercent || solutions.Contents.Count <= 0) + if (!TryComp(uid, out var puddle) || !TryComp(args.OtherEntity, out var tripper)) return; - tripper.ReagentToTransfer = - solutions.Contents.Aggregate((l, r) => l.Quantity > r.Quantity ? l : r).Reagent.Prototype; - + // Transfer DNAs from the puddle to the tripper if (TryComp(uid, out var puddleForensics)) { tripper.DNAs.UnionWith(puddleForensics.DNAs); @@ -45,16 +37,16 @@ private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent component, r tripperForensics.DNAs.UnionWith(puddleForensics.DNAs); } - if (_appearance.TryGetData(uid, PuddleVisuals.SolutionColor, out var color, appearance) - && _appearance.TryGetData(uid, PuddleVisuals.CurrentVolume, out var volume, appearance)) - AddColor((Color) color, (float) volume * component.SizeRatio, tripper); + // Transfer reagents from the puddle to the tripper. + // Ideally it should be a two-way process, but that is too hard to simulate and will have very little effect outside of potassium-water spills. + var quantity = puddle.Solution?.Comp?.Solution?.Volume ?? 0; + var footprintsCapacity = tripper.ContainedSolution.AvailableVolume; - _solutionContainer.RemoveEachReagent(puddle.Solution.Value, 1); - } + if (quantity <= 0 || footprintsCapacity <= 0) + return; - private void AddColor(Color col, float quantity, FootPrintsComponent component) - { - component.PrintsColor = component.ColorQuantity == 0f ? col : Color.InterpolateBetween(component.PrintsColor, col, component.ColorInterpolationFactor); - component.ColorQuantity += quantity; + var transferAmount = FixedPoint2.Min(footprintsCapacity, quantity * component.SizeRatio); + var transferred = _solutionContainer.SplitSolution(puddle.Solution!.Value, transferAmount); + tripper.ContainedSolution.AddSolution(transferred, _protoMan); } } diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index f5a6713886d..d45fdd11f2d 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -252,7 +252,8 @@ private void OnBoundUIRequestBands(EntityUid uid, InstrumentComponent component, // Maybe a bit expensive but oh well GetBands is queued and has a timer anyway. // Make sure the instrument is visible, uses the Opaque collision group so this works across windows etc. if (!_interactions.InRangeUnobstructed(uid, entity, MaxInstrumentBandRange, - CollisionGroup.Opaque, e => e == playerUid || e == originPlayer)) + CollisionGroup.Opaque, + e => e == playerUid || e == originPlayer || !HasComp(e))) // Floof - added the occluder check. continue; if (!metadataQuery.TryGetComponent(playerUid, out var playerMetadata) diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs index a9a07c287b4..000f6318aa9 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.Storage.cs @@ -80,7 +80,7 @@ private void OnInteractUsing(EntityUid uid, DeepFryerComponent component, Intera private void OnInsertItem(EntityUid uid, DeepFryerComponent component, DeepFryerInsertItemMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryComp(user, out var handsComponent) || handsComponent.ActiveHandEntity == null) diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs index dc182c1edfa..f41b2567863 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs @@ -524,7 +524,7 @@ private void OnRemoveItem(EntityUid uid, DeepFryerComponent component, DeepFryer if (!_containerSystem.Remove(removedItem, component.Storage)) return; - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix; _handsSystem.TryPickupAnyHand(user, removedItem); @@ -577,7 +577,7 @@ private bool TryGetActiveHandSolutionContainer( private void OnScoopVat(EntityUid uid, DeepFryerComponent component, DeepFryerScoopVatMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryGetActiveHandSolutionContainer(uid, user, out var heldItem, out var heldSolution, out var transferAmount)) @@ -598,7 +598,7 @@ private void OnScoopVat(EntityUid uid, DeepFryerComponent component, DeepFryerSc private void OnClearSlagStart(EntityUid uid, DeepFryerComponent component, DeepFryerClearSlagMessage args) { - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix if (!TryGetActiveHandSolutionContainer(uid, user, out var heldItem, out var heldSolution, out var transferAmount)) @@ -639,7 +639,7 @@ private void OnRemoveAllItems(EntityUid uid, DeepFryerComponent component, DeepF _containerSystem.EmptyContainer(component.Storage); - var user = EntityManager.GetEntity(args.Entity); + var user = args.Actor; // Floof - fix _adminLogManager.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} removed all items from {ToPrettyString(uid)}."); diff --git a/Content.Shared/Floofstation/Leash/LeashSystem.cs b/Content.Shared/Floofstation/Leash/LeashSystem.cs index 411fee0116d..87a58410d87 100644 --- a/Content.Shared/Floofstation/Leash/LeashSystem.cs +++ b/Content.Shared/Floofstation/Leash/LeashSystem.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Shared.Clothing.Components; using Content.Shared.DoAfter; +using Content.Shared.Examine; using Content.Shared.Floofstation.Leash.Components; using Content.Shared.Hands.Components; using Content.Shared.Input; @@ -50,6 +51,7 @@ public override void Initialize() SubscribeLocalEvent(OnJointRemoved, after: [typeof(SharedJointSystem)]); SubscribeLocalEvent>(OnGetLeashedVerbs); + SubscribeLocalEvent(OnLeashExamined); SubscribeLocalEvent(OnLeashInserted); SubscribeLocalEvent(OnLeashRemoved); SubscribeLocalEvent>(OnGetLeashVerbs); @@ -185,7 +187,7 @@ private void OnGetLeashedVerbs(Entity ent, ref GetVerbsEvent ent, ref GetVerbsEvent args) { - if (ent.Comp.LengthConfigs is not { } configurations) + if (!args.CanAccess || !args.CanInteract || ent.Comp.LengthConfigs is not { } configurations) return; // Add a menu listing each length configuration @@ -229,6 +231,12 @@ private void OnJointRemoved(Entity ent, ref JointRemovedEvent }); } + private void OnLeashExamined(Entity ent, ref ExaminedEvent args) + { + var length = ent.Comp.Length; + args.PushMarkup(Loc.GetString("leash-length-examine-text", ("length", length))); + } + private void OnLeashInserted(Entity ent, ref EntGotInsertedIntoContainerMessage args) { if (!_net.IsClient) @@ -261,7 +269,8 @@ private void OnDetachDoAfter(Entity ent, ref LeashDetachDoAfte private bool OnRequestPullLeash(ICommonSession? session, EntityCoordinates targetCoords, EntityUid uid) { - if (session?.AttachedEntity is not { } player + if (_net.IsClient + || session?.AttachedEntity is not { } player || !player.IsValid() || !TryComp(player, out var hands) || hands.ActiveHandEntity is not {} leash @@ -373,14 +382,6 @@ public bool TryLeash(Entity anchor, Entity if (!CanLeash(anchor, leash) || !TryGetLeashTarget(anchor!, out var leashTarget)) return false; - // We reuse pulling attempt here because eugh it already exists - var attempt = new PullAttemptEvent(leash, anchor); - RaiseLocalEvent(anchor, attempt); - RaiseLocalEvent(leash, attempt); - - if (attempt.Cancelled) - return false; - var doAfter = new DoAfterArgs(EntityManager, user, leash.Comp.AttachDelay, new LeashAttachDoAfterEvent(), anchor, leashTarget, leash) { BreakOnDamage = true, @@ -511,6 +512,7 @@ public void SetLeashLength(Entity leash, float length) { leash.Comp.Length = length; RefreshJoints(leash); + _popups.PopupPredicted(Loc.GetString("leash-set-length-popup", ("length", length)), leash.Owner, null); } /// diff --git a/Content.Shared/Footprint/FootPrintsComponent.cs b/Content.Shared/Footprint/FootPrintsComponent.cs index ccdacff68cb..2a8a5be03f1 100644 --- a/Content.Shared/Footprint/FootPrintsComponent.cs +++ b/Content.Shared/Footprint/FootPrintsComponent.cs @@ -1,29 +1,26 @@ using System.Numerics; +using Content.Shared.Chemistry.Components; +using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; using Robust.Shared.Utility; namespace Content.Shared.FootPrint; +// Floof: this system has been effectively rewriteen. DO NOT MERGE UPSTREAM CHANGES. [RegisterComponent] public sealed partial class FootPrintsComponent : Component { - [ViewVariables(VVAccess.ReadOnly), DataField] + [DataField] public ResPath RsiPath = new("/Textures/Effects/footprints.rsi"); - // all of those are set as a layer - [ViewVariables(VVAccess.ReadOnly), DataField] - public string LeftBarePrint = "footprint-left-bare-human"; - - [ViewVariables(VVAccess.ReadOnly), DataField] - public string RightBarePrint = "footprint-right-bare-human"; - - [ViewVariables(VVAccess.ReadOnly), DataField] - public string ShoesPrint = "footprint-shoes"; - - [ViewVariables(VVAccess.ReadOnly), DataField] - public string SuitPrint = "footprint-suit"; + [DataField] + public string + LeftBarePrint = "footprint-left-bare-human", + RightBarePrint = "footprint-right-bare-human", + ShoesPrint = "footprint-shoes", + SuitPrint = "footprint-suit"; - [ViewVariables(VVAccess.ReadOnly), DataField] + [DataField] public string[] DraggingPrint = [ "dragging-1", @@ -32,14 +29,10 @@ public sealed partial class FootPrintsComponent : Component "dragging-4", "dragging-5", ]; - // yea, those - [ViewVariables(VVAccess.ReadOnly), DataField] + [DataField] public EntProtoId StepProtoId = "Footstep"; - [ViewVariables(VVAccess.ReadOnly), DataField] - public Color PrintsColor = Color.FromHex("#00000000"); - /// /// The size scaling factor for footprint steps. Must be positive. /// @@ -53,20 +46,8 @@ public sealed partial class FootPrintsComponent : Component public float DragSize = 0.5f; /// - /// The amount of color to transfer from the source (e.g., puddle) to the footprint. - /// - [DataField] - public float ColorQuantity; - - /// - /// The factor by which the alpha channel is reduced in subsequent footprints. + /// Horizontal offset of the created footprints relative to the center. /// - [DataField] - public float ColorReduceAlpha = 0.1f; - - [DataField] - public string? ReagentToTransfer; - [DataField] public Vector2 OffsetPrint = new(0.1f, 0f); @@ -78,15 +59,21 @@ public sealed partial class FootPrintsComponent : Component /// /// The position of the last footprint in world coordinates. /// - public Vector2 StepPos = Vector2.Zero; + public Vector2 LastStepPos = Vector2.Zero; + + // Floof + [DataField] + public HashSet DNAs = new(); /// - /// Controls how quickly the footprint color transitions between steps. - /// Value between 0 and 1, where higher values mean faster color changes. + /// Reagent volume used for footprints. /// - public float ColorInterpolationFactor = 0.2f; + [DataField] + public Solution ContainedSolution = new(3) { CanReact = true, MaxVolume = 5f, }; - // Floof + /// + /// Amount of reagents used per footprint. + /// [DataField] - public HashSet DNAs = new(); + public FixedPoint2 FootprintVolume = 1f; } diff --git a/Content.Shared/Footprint/PuddleFootPrintsComponent.cs b/Content.Shared/Footprint/PuddleFootPrintsComponent.cs index 0e2ddfe3836..52307e76899 100644 --- a/Content.Shared/Footprint/PuddleFootPrintsComponent.cs +++ b/Content.Shared/Footprint/PuddleFootPrintsComponent.cs @@ -1,11 +1,15 @@ +using Content.Shared.FixedPoint; + + namespace Content.Shared.FootPrint; +// Floof: this system has been effectively rewriteen. DO NOT MERGE UPSTREAM CHANGES. [RegisterComponent] public sealed partial class PuddleFootPrintsComponent : Component { + /// + /// Ratio between puddle volume and the amount of reagents that can be transferred from it. + /// [ViewVariables(VVAccess.ReadWrite)] - public float SizeRatio = 0.2f; - - [ViewVariables(VVAccess.ReadWrite)] - public float OffPercent = 80f; + public FixedPoint2 SizeRatio = 0.15f; } diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index 5abbf53f1b2..356fb25a281 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -154,7 +154,7 @@ private void Climb(EntityUid uid) var entityDistances = new Dictionary(); - foreach (var entity in _lookup.GetEntitiesInRange(uid, 0.3f)) + foreach (var entity in _lookup.GetEntitiesIntersecting(uid)) // Floof - changed to GetEntitiesIntersecting to avoid climbing through walls if (HasComp(entity)) entityDistances[entity] = (Transform(uid).Coordinates.Position - Transform(entity).Coordinates.Position).LengthSquared(); diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs index e790b59cd12..bd09343e7e2 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs @@ -17,6 +17,7 @@ public void InitializeWelder() SubscribeLocalEvent(OnWelderExamine); SubscribeLocalEvent(OnWelderAfterInteract); SubscribeLocalEvent>(OnWelderToolUseAttempt); + SubscribeLocalEvent(OnWelderUseAttempt); SubscribeLocalEvent(OnWelderDoAfter); SubscribeLocalEvent(OnToggle); SubscribeLocalEvent(OnActivateAttempt); @@ -140,6 +141,16 @@ private void OnWelderToolUseAttempt(Entity entity, ref DoAfterA } } + // Floof - for some reason, wizden impl lacked this. + private void OnWelderUseAttempt(Entity entity, ref ToolUseAttemptEvent args) + { + if (ItemToggle.IsActivated(entity.Owner)) + return; + + _popup.PopupPredicted(Loc.GetString("welder-component-welder-not-lit-message"), entity, args.User); + args.Cancel(); + } + private void OnWelderDoAfter(Entity ent, ref ToolDoAfterEvent args) { if (args.Cancelled) diff --git a/Resources/Locale/en-US/Floof/leash/leash.ftl b/Resources/Locale/en-US/Floof/leash/leash.ftl index 4d1a0a7f509..9456107942e 100644 --- a/Resources/Locale/en-US/Floof/leash/leash.ftl +++ b/Resources/Locale/en-US/Floof/leash/leash.ftl @@ -18,3 +18,6 @@ leash-detaching-popup-others = {THE($user)} is trying to remove the leash {$isSe }... leash-snap-popup = {THE($leash)} snaps off! +leash-set-length-popup = Length set to {$length}m. + +leash-length-examine-text = Its current length is {$length}m. diff --git a/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml b/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml index 61554d0621b..ad5f6efca88 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/ashtray.yml @@ -1,6 +1,6 @@ - type: entity id: Ashtray - parent: BaseItem + parent: BaseStorageItem # Floof - reparented name: ashtray description: Proven by scientists to improve the smoking experience by 37%! components: @@ -22,9 +22,6 @@ maxItemSize: Tiny grid: - 0,0,9,0 - - type: ContainerContainer - containers: - storagebase: !type:Container - type: StorageFillVisualizer fillBaseName: icon maxFillLevels: 10 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml index da67b5a5928..24c88902179 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml @@ -116,6 +116,7 @@ - type: Tag tags: - Trash + - Burnt # Floof - type: SolutionContainerManager solutions: food: diff --git a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml index 2a546bc5cf2..3674bf2f6c9 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/Tables/tables.yml @@ -54,6 +54,7 @@ - type: Construction graph: Table node: TableFrame + - type: Climbable # Floof - making table frames climbable - type: entity id: CounterWoodFrame @@ -109,6 +110,7 @@ - type: Construction graph: Table node: CounterWoodFrame + - type: Climbable # Floof - making table frames climbable - type: entity id: CounterMetalFrame