From f3a3cf196a17923049f53e2bb49d19c3bec0f534 Mon Sep 17 00:00:00 2001 From: FN Date: Mon, 2 Dec 2024 10:52:31 +0700 Subject: [PATCH 01/11] Revert "footsteps 2 electric boogaloo (#67)" This reverts commit d88b13e296886238ca041ee5cb03cce00c4ef7c7. --- .../_CorvaxNext/Entities/Effects/footstep.yml | 83 ++++++++----------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml index 8369a040070..207b838bc2b 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml @@ -1,54 +1,37 @@ - type: entity - name: footstep + name: Footstep id: Footstep save: false - description: Trace of liquid. + description: Trace of liquid components: - - type: Clickable - - type: FootstepModifier - footstepSoundCollection: - collection: FootstepWater - params: - volume: 3 - - type: Transform - noRot: false - - type: Sprite - drawdepth: FloorObjects - color: "#FFFFFF80" - - type: Physics - bodyType: Static - - type: Fixtures - fixtures: - slipFixture: - shape: - !type:PhysShapeAabb - bounds: "-0.4,-0.4,0.4,0.4" - mask: - - ItemMask - layer: - - SlipLayer - hard: false - - type: SolutionContainerManager - solutions: - step: { maxVol: 2 } - - type: Footprint - - type: Puddle - solution: step - viscosityAffectsMovement: false - - type: Appearance - - type: ExaminableSolution - solution: step - - type: MixableSolution - solution: step - - type: DrawableSolution - solution: step - - type: BadDrink - - type: IgnoresFingerprints - - type: Drink - delay: 3 - transferAmount: 0.5 - solution: step - examinable: false - - type: Tag - tags: - - DNASolutionScannable + - type: Clickable + - type: FootstepModifier + footstepSoundCollection: + collection: FootstepWater + params: + volume: 3 + - type: Transform + noRot: false + - type: Sprite + drawdepth: FloorObjects + color: "#FFFFFF80" + - type: Physics + bodyType: Static + - type: Fixtures + fixtures: + slipFixture: + shape: + !type:PhysShapeAabb + bounds: "-0.4,-0.4,0.4,0.4" + mask: + - ItemMask + layer: + - SlipLayer + hard: false + - type: SolutionContainerManager + solutions: + step: { maxVol: 2 } + - type: Footprint + - type: Puddle + solution: step + - type: Appearance From 330fd457f8dd5be54309ad1c9cb576173cada367 Mon Sep 17 00:00:00 2001 From: FN Date: Mon, 2 Dec 2024 10:52:51 +0700 Subject: [PATCH 02/11] =?UTF-8?q?Revert=20"=D0=A4=D0=B8=D0=BA=D1=81=20?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B4=D0=BE=D0=B2=20(#59)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cdba530a7f26a1952b42b5f816c90518927e2b54. --- .../Fluids/EntitySystems/AbsorbentSystem.cs | 88 ++----------------- .../entities/objects/effects/footstep.ftl | 2 - 2 files changed, 6 insertions(+), 84 deletions(-) delete mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/effects/footstep.ftl diff --git a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs index 5f47baa7cc2..56e039a7004 100644 --- a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs +++ b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs @@ -13,7 +13,6 @@ using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; using Robust.Shared.Utility; -using Content.Shared._CorvaxNext.Footprints.Components; namespace Content.Server.Fluids.EntitySystems; @@ -29,9 +28,6 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly UseDelaySystem _useDelay = default!; [Dependency] private readonly MapSystem _mapSystem = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - - public const float FootprintAbsorptionRange = 0.25f; // Corvax-Next-Footprints public override void Initialize() { @@ -115,18 +111,13 @@ public void Mop(EntityUid user, EntityUid target, EntityUid used, AbsorbentCompo && _useDelay.IsDelayed((used, useDelay))) return; - // Corvax-Next-Footprints-Start - // Footsteps cleaning logic, try to grab from - if (TryFootprintInteract(user, used, target, component, useDelay, absorberSoln.Value)) - return; - // If it's a puddle try to grab from - if (TryPuddleInteract(user, used, target, component, useDelay, absorberSoln.Value)) - return; - - // If it's refillable try to transfer - TryRefillableInteract(user, used, target, component, useDelay, absorberSoln.Value); - // Corvax-Next-Footprints-End + if (!TryPuddleInteract(user, used, target, component, useDelay, absorberSoln.Value)) + { + // If it's refillable try to transfer + if (!TryRefillableInteract(user, used, target, component, useDelay, absorberSoln.Value)) + return; + } } /// @@ -333,71 +324,4 @@ private bool TryPuddleInteract(EntityUid user, EntityUid used, EntityUid target, return true; } - - // Corvax-Next-Footprints-Start - private bool TryFootprintInteract(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent absorber, UseDelayComponent? useDelay, Entity absorberSoln) - { - if (!HasComp(target)) // Perform a check if it was a footprint that was clicked on - return false; - - var soundPlayed = false; - - var footPrints = new HashSet>(); - _lookup.GetEntitiesInRange(Transform(target).Coordinates, FootprintAbsorptionRange, footPrints, LookupFlags.Dynamic | LookupFlags.Uncontained); - - foreach (var (footstepUid, comp) in footPrints) - { - if (!_solutionContainerSystem.ResolveSolution(footstepUid, comp.SolutionName, ref comp.Solution, out var targetStepSolution) || targetStepSolution.Volume <= 0) - continue; - - if (_puddleSystem.CanFullyEvaporate(targetStepSolution)) - continue; // no spam - - var absorberSolution = absorberSoln.Comp.Solution; - var available = absorberSolution.GetTotalPrototypeQuantity(SharedPuddleSystem.EvaporationReagents); - - // No material - if (available == FixedPoint2.Zero) - { - _popups.PopupEntity(Loc.GetString("mopping-system-no-water", ("used", used)), user, user); - return true; - } - - var transferMax = absorber.PickupAmount; - var transferAmount = FixedPoint2.Min(transferMax, available); - - var puddleSplit = targetStepSolution.SplitSolutionWithout(transferAmount, SharedPuddleSystem.EvaporationReagents); - var absorberSplit = absorberSolution.SplitSolutionWithOnly(puddleSplit.Volume, SharedPuddleSystem.EvaporationReagents); - - var transform = Transform(target); - var gridUid = transform.GridUid; - if (TryComp(gridUid, out var mapGrid)) - { - var tileRef = _mapSystem.GetTileRef(gridUid.Value, mapGrid, transform.Coordinates); - _puddleSystem.DoTileReactions(tileRef, absorberSplit); - } - - _solutionContainerSystem.AddSolution(comp.Solution.Value, absorberSplit); - _solutionContainerSystem.AddSolution(absorberSoln, puddleSplit); - - if (!soundPlayed) - { - soundPlayed = true; // to prevent sound spam - _audio.PlayPvs(absorber.PickupSound, target); - } - - if (useDelay is not null) - _useDelay.TryResetDelay((used, useDelay)); - } - - var userXform = Transform(user); - var targetPos = _transform.GetWorldPosition(target); - var localPos = Vector2.Transform(targetPos, _transform.GetInvWorldMatrix(userXform)); - localPos = userXform.LocalRotation.RotateVec(localPos); - - _melee.DoLunge(user, used, Angle.Zero, localPos, null, false); - - return true; - } - // Corvax-Next-Footprints-End } diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/effects/footstep.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/effects/footstep.ftl deleted file mode 100644 index 23636484792..00000000000 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/effects/footstep.ftl +++ /dev/null @@ -1,2 +0,0 @@ -ent-Footstep = след - .desc = След из жидкости. From 88611fa88b17f4706ccb0eb7e901ee23abe24f74 Mon Sep 17 00:00:00 2001 From: FN Date: Mon, 2 Dec 2024 10:57:21 +0700 Subject: [PATCH 03/11] Revert "Footprints (#28)" This reverts commit 9031a52416614a1f78721ac46eb1969fae9b339d. --- .../Footprints/FootprintsVisualizerSystem.cs | 75 ---------- .../EntitySystems/FootprintsSystem.cs | 128 ------------------ .../EntitySystems/PuddleFootprintsSystem.cs | 58 -------- .../Components/FootprintComponent.cs | 23 ---- .../FootprintVisualizerComponent.cs | 88 ------------ .../Components/PuddleFootprintsComponent.cs | 11 -- .../Footprints/FootprintVisuals.cs | 25 ---- .../Prototypes/Entities/Effects/puddle.yml | 1 - .../Entities/Mobs/Player/arachnid.yml | 2 +- .../Entities/Mobs/Species/arachnid.yml | 4 +- .../Entities/Mobs/Species/diona.yml | 3 - .../Entities/Mobs/Species/dwarf.yml | 3 - .../Entities/Mobs/Species/human.yml | 3 +- .../Prototypes/Entities/Mobs/Species/moth.yml | 2 +- .../Entities/Mobs/Species/reptilian.yml | 3 - .../Entities/Mobs/Species/skeleton.yml | 1 - .../Entities/Mobs/Species/slime.yml | 3 - .../Prototypes/Entities/Mobs/Species/vox.yml | 3 - .../_CorvaxNext/Entities/Effects/footstep.yml | 37 ----- .../Effects/footprints.rsi/dragging-1.png | Bin 591 -> 0 bytes .../Effects/footprints.rsi/dragging-2.png | Bin 563 -> 0 bytes .../Effects/footprints.rsi/dragging-3.png | Bin 615 -> 0 bytes .../Effects/footprints.rsi/dragging-4.png | Bin 504 -> 0 bytes .../Effects/footprints.rsi/dragging-5.png | Bin 558 -> 0 bytes .../Effects/footprints.rsi/dragging-test.png | Bin 414 -> 0 bytes .../footprint-left-bare-diona.png | Bin 255 -> 0 bytes .../footprint-left-bare-dwarf.png | Bin 209 -> 0 bytes .../footprint-left-bare-human.png | Bin 168 -> 0 bytes .../footprint-left-bare-lizard.png | Bin 195 -> 0 bytes .../footprint-left-bare-slime.png | Bin 199 -> 0 bytes .../footprint-left-bare-spider.png | Bin 175 -> 0 bytes .../footprint-right-bare-diona.png | Bin 250 -> 0 bytes .../footprint-right-bare-dwarf.png | Bin 213 -> 0 bytes .../footprint-right-bare-human.png | Bin 166 -> 0 bytes .../footprint-right-bare-lizard.png | Bin 195 -> 0 bytes .../footprint-right-bare-slime.png | Bin 200 -> 0 bytes .../footprint-right-bare-spider.png | Bin 172 -> 0 bytes .../footprints.rsi/footprint-shoes.png | Bin 146 -> 0 bytes .../Effects/footprints.rsi/footprint-suit.png | Bin 219 -> 0 bytes .../Effects/footprints.rsi/meta.json | 71 ---------- 40 files changed, 4 insertions(+), 540 deletions(-) delete mode 100644 Content.Client/_CorvaxNext/Footprints/FootprintsVisualizerSystem.cs delete mode 100644 Content.Server/_CorvaxNext/Footprints/EntitySystems/FootprintsSystem.cs delete mode 100644 Content.Server/_CorvaxNext/Footprints/EntitySystems/PuddleFootprintsSystem.cs delete mode 100644 Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs delete mode 100644 Content.Shared/_CorvaxNext/Footprints/Components/FootprintVisualizerComponent.cs delete mode 100644 Content.Shared/_CorvaxNext/Footprints/Components/PuddleFootprintsComponent.cs delete mode 100644 Content.Shared/_CorvaxNext/Footprints/FootprintVisuals.cs delete mode 100644 Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-1.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-2.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-3.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-4.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-5.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-test.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-diona.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-dwarf.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-human.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-lizard.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-slime.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-spider.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-diona.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-dwarf.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-human.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-lizard.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-slime.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-spider.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-shoes.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-suit.png delete mode 100644 Resources/Textures/_CorvaxNext/Effects/footprints.rsi/meta.json diff --git a/Content.Client/_CorvaxNext/Footprints/FootprintsVisualizerSystem.cs b/Content.Client/_CorvaxNext/Footprints/FootprintsVisualizerSystem.cs deleted file mode 100644 index 2eed78b04ae..00000000000 --- a/Content.Client/_CorvaxNext/Footprints/FootprintsVisualizerSystem.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Content.Shared._CorvaxNext.Footprints; -using Content.Shared._CorvaxNext.Footprints.Components; -using Robust.Client.GameObjects; -using Robust.Shared.Random; - -namespace Content.Client._CorvaxNext.Footprints; - -public sealed class FootprintsVisualizerSystem : VisualizerSystem -{ - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly IRobustRandom _random = default!; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnInitialized); - SubscribeLocalEvent(OnShutdown); - } - - private void OnInitialized(EntityUid uid, FootprintComponent comp, ComponentInit args) - { - if (!TryComp(uid, out var sprite)) - return; - - sprite.LayerMapReserveBlank(FootprintVisualLayers.Print); - UpdateAppearance(uid, comp, sprite); - } - - private void OnShutdown(EntityUid uid, FootprintComponent comp, ComponentShutdown args) - { - if (!TryComp(uid, out var sprite)) - return; - - if (!sprite.LayerMapTryGet(FootprintVisualLayers.Print, out var layer)) - return; - - sprite.RemoveLayer(layer); - } - - private void UpdateAppearance(EntityUid uid, FootprintComponent component, SpriteComponent sprite) - { - if (!sprite.LayerMapTryGet(FootprintVisualLayers.Print, out var layer)) - return; - - if (!TryComp(component.FootprintsVisualizer, out var printsComponent)) - return; - - if (!TryComp(uid, out var appearance)) - return; - - if (!_appearance.TryGetData(uid, FootprintVisualState.State, out var printVisuals, appearance)) - return; - - sprite.LayerSetState(layer, new(printVisuals switch - { - FootprintVisuals.BareFootprint => printsComponent.RightStep ? printsComponent.RightBarePrint : printsComponent.LeftBarePrint, - FootprintVisuals.ShoesPrint => printsComponent.ShoesPrint, - FootprintVisuals.SuitPrint => printsComponent.SuitPrint, - FootprintVisuals.Dragging => _random.Pick(printsComponent.DraggingPrint), - _ => throw new ArgumentOutOfRangeException($"Unknown {printVisuals} parameter.") - }), printsComponent.RsiPath); - - if (_appearance.TryGetData(uid, FootprintVisualState.Color, out var printColor, appearance)) - sprite.LayerSetColor(layer, printColor); - } - - protected override void OnAppearanceChange(EntityUid uid, FootprintComponent component, ref AppearanceChangeEvent args) - { - if (args.Sprite is null) - return; - - UpdateAppearance(uid, component, args.Sprite); - } -} diff --git a/Content.Server/_CorvaxNext/Footprints/EntitySystems/FootprintsSystem.cs b/Content.Server/_CorvaxNext/Footprints/EntitySystems/FootprintsSystem.cs deleted file mode 100644 index 7a28fbb3bba..00000000000 --- a/Content.Server/_CorvaxNext/Footprints/EntitySystems/FootprintsSystem.cs +++ /dev/null @@ -1,128 +0,0 @@ -using Content.Server.Atmos.Components; -using Content.Shared.Inventory; -using Content.Shared.Mobs; -using Content.Shared.Mobs.Components; -using Content.Shared.Chemistry.Components.SolutionManager; -using Content.Shared.Chemistry.EntitySystems; -using Robust.Shared.Map; -using Robust.Shared.Random; -using Content.Shared._CorvaxNext.Footprints; -using Content.Shared._CorvaxNext.Footprints.Components; -using Content.Shared._CorvaxNext.Standing; - -namespace Content.Server._CorvaxNext.Footprints.EntitySystems; - -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 SharedSolutionContainerSystem _solution = default!; - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - - private EntityQuery _transformQuery; - private EntityQuery _mobThresholdQuery; - private EntityQuery _appearanceQuery; - private EntityQuery _layingQuery; - - public override void Initialize() - { - _transformQuery = GetEntityQuery(); - _mobThresholdQuery = GetEntityQuery(); - _appearanceQuery = GetEntityQuery(); - _layingQuery = GetEntityQuery(); - - SubscribeLocalEvent(OnStartupComponent); - SubscribeLocalEvent(OnMove); - } - - private void OnStartupComponent(EntityUid uid, FootprintVisualizerComponent component, ComponentStartup args) - { - component.StepSize = Math.Max(0f, component.StepSize + _random.NextFloat(-0.05f, 0.05f)); - } - - private void OnMove(EntityUid uid, FootprintVisualizerComponent component, ref MoveEvent args) - { - if (component.PrintsColor.A <= 0f) - return; - - if (!_transformQuery.TryComp(uid, out var transform)) - return; - - if (!_mobThresholdQuery.TryComp(uid, out var mobThreshHolds)) - return; - - if (!_map.TryFindGridAt(_transform.GetMapCoordinates((uid, transform)), out var gridUid, out _)) - return; - - var dragging = mobThreshHolds.CurrentThresholdState is MobState.Critical or MobState.Dead || _layingQuery.TryComp(uid, out var laying) && laying.DrawDowned; - var distance = (transform.LocalPosition - component.StepPos).Length(); - var stepSize = dragging ? component.DragSize : component.StepSize; - - if (distance <= stepSize) - return; - - component.RightStep = !component.RightStep; - - var entity = Spawn(component.StepProtoId, CalcCoords(gridUid, component, transform, dragging)); - var footPrintComponent = EnsureComp(entity); - - footPrintComponent.FootprintsVisualizer = uid; - Dirty(entity, footPrintComponent); - - if (_appearanceQuery.TryComp(entity, out var appearance)) - { - _appearance.SetData(entity, FootprintVisualState.State, PickState(uid, dragging), appearance); - _appearance.SetData(entity, FootprintVisualState.Color, component.PrintsColor, appearance); - } - - if (!_transformQuery.TryComp(entity, out var stepTransform)) - return; - - stepTransform.LocalRotation = dragging - ? (transform.LocalPosition - component.StepPos).ToAngle() + Angle.FromDegrees(-90f) - : transform.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)) - return; - - if (!_solution.ResolveSolution((entity, solutionContainer), footPrintComponent.SolutionName, ref footPrintComponent.Solution, out var solution)) - return; - - if (string.IsNullOrWhiteSpace(component.ReagentToTransfer) || solution.Volume >= 1) - return; - - _solution.TryAddReagent(footPrintComponent.Solution.Value, component.ReagentToTransfer, 1, out _); - } - - private EntityCoordinates CalcCoords(EntityUid uid, FootprintVisualizerComponent component, TransformComponent transform, bool state) - { - if (state) - return new EntityCoordinates(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); - } - - private FootprintVisuals PickState(EntityUid uid, bool dragging) - { - var state = FootprintVisuals.BareFootprint; - - if (dragging) - state = FootprintVisuals.Dragging; - else if (_inventory.TryGetSlotEntity(uid, "outerClothing", out var suit) && TryComp(suit, out _)) - state = FootprintVisuals.SuitPrint; - else if (_inventory.TryGetSlotEntity(uid, "shoes", out _)) - state = FootprintVisuals.ShoesPrint; - - return state; - } -} diff --git a/Content.Server/_CorvaxNext/Footprints/EntitySystems/PuddleFootprintsSystem.cs b/Content.Server/_CorvaxNext/Footprints/EntitySystems/PuddleFootprintsSystem.cs deleted file mode 100644 index 03a57312b29..00000000000 --- a/Content.Server/_CorvaxNext/Footprints/EntitySystems/PuddleFootprintsSystem.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Linq; -using Content.Shared._CorvaxNext.Footprints.Components; -using Content.Shared.Chemistry.Components.SolutionManager; -using Content.Shared.Chemistry.EntitySystems; -using Content.Shared.Fluids; -using Content.Shared.Fluids.Components; -using Robust.Shared.Physics.Events; - -namespace Content.Server._CorvaxNext.Footprints.EntitySystems; - -public sealed class PuddleFootprintsSystem : EntitySystem -{ - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; - - public override void Initialize() - { - SubscribeLocalEvent(OnStepTrigger); - } - - private void OnStepTrigger(EntityUid uid, PuddleFootprintsComponent component, ref EndCollideEvent args) - { - if (!TryComp(uid, out var appearance)) - return; - - if (!TryComp(uid, out var puddle)) - return; - - if (!TryComp(args.OtherEntity, out var tripper)) - return; - - if (!TryComp(uid, out var solutionManager)) - return; - - if (!_solutionContainer.ResolveSolution((uid, solutionManager), puddle.SolutionName, ref puddle.Solution, out var solutions)) - return; - - var totalSolutionQuantity = solutions.Contents.Sum(sol => (float)sol.Quantity); - var waterQuantity = (float)solutions.Contents.Where(solution => solution.Reagent.Prototype == "Water").FirstOrDefault().Quantity; - - if (waterQuantity / (totalSolutionQuantity / 100f) > component.OffPercent || solutions.Contents.Count <= 0) - return; - - tripper.ReagentToTransfer = solutions.Contents.Aggregate((l, r) => l.Quantity > r.Quantity ? l : r).Reagent.Prototype; - - 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); - - _solutionContainer.RemoveEachReagent(puddle.Solution.Value, 1); - } - - private void AddColor(Color col, float quantity, FootprintVisualizerComponent component) - { - component.PrintsColor = component.ColorQuantity == 0 ? col : Color.InterpolateBetween(component.PrintsColor, col, component.ColorInterpolationFactor); - component.ColorQuantity += quantity; - } -} diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs deleted file mode 100644 index 72aff01cd81..00000000000 --- a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Content.Shared.Chemistry.Components; -using Robust.Shared.GameStates; - -namespace Content.Shared._CorvaxNext.Footprints.Components; - -/// -/// This is used for marking footsteps, handling footprint drawing. -/// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] -public sealed partial class FootprintComponent : Component -{ - /// - /// Owner (with ) of a print (this component). - /// - [AutoNetworkedField] - public EntityUid FootprintsVisualizer; - - [DataField] - public string SolutionName = "step"; - - [DataField] - public Entity? Solution; -} diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintVisualizerComponent.cs b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintVisualizerComponent.cs deleted file mode 100644 index 966e0d75cd6..00000000000 --- a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintVisualizerComponent.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Numerics; -using Robust.Shared.Prototypes; -using Robust.Shared.Utility; - -namespace Content.Shared._CorvaxNext.Footprints.Components; - -[RegisterComponent] -public sealed partial class FootprintVisualizerComponent : Component -{ - [ViewVariables(VVAccess.ReadOnly), DataField] - public ResPath RsiPath = new("/Textures/_CorvaxNext/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"; - - [ViewVariables(VVAccess.ReadOnly), DataField] - public string[] DraggingPrint = - [ - "dragging-1", - "dragging-2", - "dragging-3", - "dragging-4", - "dragging-5", - ]; - // yea, those - - [ViewVariables(VVAccess.ReadOnly), 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. - /// - [DataField] - public float StepSize = 0.7f; - - /// - /// The size scaling factor for drag marks. Must be positive. - /// - [DataField] - 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. - /// - [DataField] - public float ColorReduceAlpha = 0.1f; - - [DataField] - public string? ReagentToTransfer; - - [DataField] - public Vector2 OffsetPrint = new(0.1f, 0f); - - /// - /// Tracks which foot should make the next print. True for right foot, false for left. - /// - public bool RightStep = true; - - /// - /// The position of the last footprint in world coordinates. - /// - public Vector2 StepPos = Vector2.Zero; - - /// - /// Controls how quickly the footprint color transitions between steps. - /// Value between 0 and 1, where higher values mean faster color changes. - /// - public float ColorInterpolationFactor = 0.2f; -} diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/PuddleFootprintsComponent.cs b/Content.Shared/_CorvaxNext/Footprints/Components/PuddleFootprintsComponent.cs deleted file mode 100644 index b61ad1dc9fb..00000000000 --- a/Content.Shared/_CorvaxNext/Footprints/Components/PuddleFootprintsComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Content.Shared._CorvaxNext.Footprints.Components; - -[RegisterComponent] -public sealed partial class PuddleFootprintsComponent : Component -{ - [ViewVariables(VVAccess.ReadWrite)] - public float SizeRatio = 0.2f; - - [ViewVariables(VVAccess.ReadWrite)] - public float OffPercent = 80f; -} diff --git a/Content.Shared/_CorvaxNext/Footprints/FootprintVisuals.cs b/Content.Shared/_CorvaxNext/Footprints/FootprintVisuals.cs deleted file mode 100644 index 91ff0bc643e..00000000000 --- a/Content.Shared/_CorvaxNext/Footprints/FootprintVisuals.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Robust.Shared.Serialization; - -namespace Content.Shared._CorvaxNext.Footprints; - -[Serializable, NetSerializable] -public enum FootprintVisuals : byte -{ - BareFootprint, - ShoesPrint, - SuitPrint, - Dragging -} - -[Serializable, NetSerializable] -public enum FootprintVisualState : byte -{ - State, - Color -} - -[Serializable, NetSerializable] -public enum FootprintVisualLayers : byte -{ - Print -} diff --git a/Resources/Prototypes/Entities/Effects/puddle.yml b/Resources/Prototypes/Entities/Effects/puddle.yml index c8c130d3ccc..36f0faa1df1 100644 --- a/Resources/Prototypes/Entities/Effects/puddle.yml +++ b/Resources/Prototypes/Entities/Effects/puddle.yml @@ -165,4 +165,3 @@ - type: Tag tags: - DNASolutionScannable - - type: PuddleFootprints # Corvax-Next-Footprints diff --git a/Resources/Prototypes/Entities/Mobs/Player/arachnid.yml b/Resources/Prototypes/Entities/Mobs/Player/arachnid.yml index 2cb3a3da3e5..d9dea3c18d9 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/arachnid.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/arachnid.yml @@ -10,4 +10,4 @@ Asphyxiation: 1.5 # This makes space and crit more lethal to arachnids. damageRecovery: types: - Asphyxiation: -0.5 \ No newline at end of file + Asphyxiation: -0.5 diff --git a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml index 2bdcde14fa9..0d7f7717586 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml @@ -115,9 +115,7 @@ visible: false - type: Inventory templateId: arachnid - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-spider" - rightBarePrint: "footprint-right-bare-spider" + - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/diona.yml b/Resources/Prototypes/Entities/Mobs/Species/diona.yml index 0bea1ad6b86..abbce8995c0 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/diona.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/diona.yml @@ -110,9 +110,6 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-diona" - rightBarePrint: "footprint-right-bare-diona" - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml index 64262958c34..6ce9c80a250 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml @@ -63,9 +63,6 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-dwarf" - rightBarePrint: "footprint-right-bare-dwarf" - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index cf7fd51dde3..bf357e1f102 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -27,7 +27,6 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints - type: entity @@ -41,4 +40,4 @@ sizeMaps: 32: sprite: Mobs/Species/Human/displacement.rsi - state: jumpsuit-female + state: jumpsuit-female \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Mobs/Species/moth.yml b/Resources/Prototypes/Entities/Mobs/Species/moth.yml index 2a790fd5660..ad09fd57578 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -122,7 +122,7 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints + - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml b/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml index a213c7c7e3e..b7163da6eec 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml @@ -90,9 +90,6 @@ sprite: Corvax/Mobs/Species/displacement.rsi state: shoes # Corvax-Digitigrade-End - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-lizard" - rightBarePrint: "footprint-right-bare-lizard" - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml b/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml index 5434f8de086..b5a625aa66e 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml @@ -110,7 +110,6 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/slime.yml b/Resources/Prototypes/Entities/Mobs/Species/slime.yml index abd5f5308af..6566b1fac34 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/slime.yml @@ -118,9 +118,6 @@ 32: sprite: Mobs/Species/Human/displacement.rsi state: jumpsuit-female - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-slime" - rightBarePrint: "footprint-right-bare-slime" - type: entity parent: MobHumanDummy diff --git a/Resources/Prototypes/Entities/Mobs/Species/vox.yml b/Resources/Prototypes/Entities/Mobs/Species/vox.yml index 7e06e2062b0..899673d59e9 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/vox.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/vox.yml @@ -130,9 +130,6 @@ 32: sprite: Mobs/Species/Vox/displacement.rsi state: shoes - - type: FootprintVisualizer # Corvax-Next-Footprints - leftBarePrint: "footprint-left-bare-lizard" - rightBarePrint: "footprint-right-bare-lizard" - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml deleted file mode 100644 index 207b838bc2b..00000000000 --- a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footstep.yml +++ /dev/null @@ -1,37 +0,0 @@ -- type: entity - name: Footstep - id: Footstep - save: false - description: Trace of liquid - components: - - type: Clickable - - type: FootstepModifier - footstepSoundCollection: - collection: FootstepWater - params: - volume: 3 - - type: Transform - noRot: false - - type: Sprite - drawdepth: FloorObjects - color: "#FFFFFF80" - - type: Physics - bodyType: Static - - type: Fixtures - fixtures: - slipFixture: - shape: - !type:PhysShapeAabb - bounds: "-0.4,-0.4,0.4,0.4" - mask: - - ItemMask - layer: - - SlipLayer - hard: false - - type: SolutionContainerManager - solutions: - step: { maxVol: 2 } - - type: Footprint - - type: Puddle - solution: step - - type: Appearance diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-1.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-1.png deleted file mode 100644 index 74d2aeb0743125350069ff66773c5083326555ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 591 zcmV-V0Px%2}wjjR9J=0SG#fJFc5v~@mQ(>i8v~O${Dx-M`RJch@~j9iV&kKz=0GCC1`*| zHHfFt-~tmqXoVjwd3-P75DQ}8?!E;;;Dzuz^hoNt8B9K7M2OKhWE{Pxk7UdhaYpp}k*Nn{92ypNPXR}$* z+2L@=T{errRjLPcuH6@LP8LRKz%DqHgcJLGKOT=)W1|QdW7dPSiaX$Xu<7Q{TzCmM zJ-lIyUPQFt@2%5hq@xH}@ETf&KJx(Ed;&;k0ApQHO3edvd08DpU<-i1T)~)ZZes8`#V&U0bNy9 z$s;*cf@BS2ST2`eKMesuDfI#Xr_;+&+)hylvYR5jC+J@;%z{rdCag5co)c%vP4AeI0!-NNPYS^%A+;b(RDtx!G)@ zr(iY#4(rHQ`Px$?MXyIR9J=OmpzWcFc5`bwjoG#NVX*;a+2g0sn~vVq@~YRz6G3wNJzHpNZ=}4 zAfsUXM}oH5SE0e4`R0usCBT1IHfOUCqBXx6W1nvYD9h3rKO7DN07xl+0Dw}u1AwZk zG63M5w{>0LVUEY+6s|{*vMeElXa`GnObF4MnAsQ8N33{Aru#Vx0{C<~ot$w>>CT3V zH8Bam1=RQbLyU9YdX~Qqz&USycKh7WTJKUIya2X!zCv>qbs*HeZTnc;?e;wYK1nH` zVoE8eQ=x+x1Tfv7&*uqxHzI^2+aCn5W!&%;_GuV~#xyep;Ng|l1Qg4WGy*AQ1IrB`%or$EJQ=_zQ*6!{q5wrvWaCbK(1reEG+?~fpvp9=s0002ovPDHLkV1i%0 B_D=u+ diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-3.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-3.png deleted file mode 100644 index d0f7274dd3c0ed0a8aaf2d10114e96917e78a3f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 615 zcmV-t0+{`YP)Px%AxT6*R9J=Wm(7Z+Fcim+!+;9nreLInx|+wZZ{fVK z$K$cnc3rmxg1{yhtN;ihIa;i$u4^dEvUkjKxwLX^5CF-2-_K8{Q|G%7qSIHFWy_r) z2!Jt0$6Oe7fKn>;3ZR|7IcsV@<;JWTs?~9_SskEOdQ9% z&1U1Mm(nZ%9YzJggxHs5*$&{(KO#bi)1Bc5>Nk`70ue$P*4O|5002ovPDHLkV1k|! B8~6YK diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-4.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/dragging-4.png deleted file mode 100644 index 5eb34b5d5708e656752f60d2fa245aaf270f5925..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmVPx$vPnciR9J=WRxxhFFbupF1T<*$;xS9VkR|X3vTJho=1K9MOxp7Sqkr*|EgAyD zK!=8f;#w9Zd+Y&0B#S1GM^P5=k3@7`cb*#O;(e)ur9|Fh231wP%&oP4upNLeo|I*I zNF_kApw`;6G3GD|{s90)v;nYT+pg;X0LGYu|6bd+K?33uaBw23iD*kiTYp_C^~ZKR z&L+T4wAS_geuq*D<9`4chN1Re+ev({vI!Y|--C$ixMcb8!!T@CAprbHD_P4?Axc0Z|CoqU>g8O>CXm`v zIS3Mvv``F^{WGh8R7M|MibW-`)_(HAQxrvZi%Is+szUjjQ)`@+pPeMrBm$uu%#uJ!1f~M-_xs@eF{IXN1SD|I9dpVOBv6)R<2(1q z<9RAsAJI1SrFYI6{R%?BN0J9|+*PXA~Pcoc&>&;u= uX39qrfjO`e#+ZhG{+e^{5)1wh0Qd$W5WavLR`q-U0000Px$=t)FDR9J=WS38dCFcdwB9v@4{1&t{XJ8^cAD$_Gd$}Hej?1JnhmEBN8P#{Cz z6vK@i<9y7(lSY~&Malhe@8N#(0eO$kjT?Q#->i~c>O+TcRO(G#g zPKn8f{7FapU;>2QZnyQxl$_44-&k}KumifmIp;ZDmt|?o(nqAP3WF8!kz$Os^o%hg zQS|-pI|QV4&dajAb6||Y7<1Q-q1FUdfH0fQg8b7o{dfui##q*8uj{%s52P;&Z)d^? zaL)6|WHRV?I-Q#9F`Lm#zz)C|YliQ9J~uv##RB$B#Btor0&Z1!XbbGVU9VSf>9y7{ z#x(L~v$4&E8z+ds4HAI7TrRy%?oh7RYwt!pLIBh0G>c=un-IdQKO7Ep**$$@3C!p7 zA(wBV_g2g~&x|ps>pD2Fvy$Ni0HCTWR8`f|*&6_Kw_z;$2;{)mKXIn}PIgHV+-F88 zfu~@o4ZQ>&Dev)kY{^4acu578%jIa_m$ks2ll^}G@4pimi(mro2E3fWvlF_Ax(rIG zExqvqfY$mi00<#6S4XgIcZs6No9j;qTYNoSvRm?Z*Qm8FY|>*e>U|)JqG+{Ry#YXy wBvFziot4vCztdssLP&L@>(k5qMEgPx$SV=@dR9J=8mqBiXFbqXMRd;hAmXYQJT&4S7qF3Prm9m`s%$jZz6j`?O9bnY? zn;9VB$B$!&35K?9`vR~ur{?neP=?RqxQR|rr(+ZP$cKwgaYt=CcvIdr1e@t9s;0( zkLHC7Q1d`qoOAwlZmW(h&KM3rlNLPZ`~*}Nx)7g%z|ZoRo#T}Opd4s|9~u(^Xo?Xv zm!nbvoaW)$uesngA`{@1asiB!2Zi-xD%~lGg8%>k07*qo IM6N<$f?hzfr~m)} diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-diona.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-diona.png deleted file mode 100644 index fa40e0f2977b3ee9794d3a2fcb228476c62b3247..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}J3U<-Ln2z= zPTt6S$Uwk#zaV$O2FC0;)?o<@*I!1qSTU#Yn7^FC(AmT&@i6!agLY`mG^GjeLdCs* zet+_Zq3^N9x&2O?w9^F*pXTW3zue?fbm6DX^eC?l94{6{$UOB=;FvyZ&01FnONJMW zDz$cP0%g3Frv(Kkyz#K}u=9-bbAybW(a9Q~MWWss9J2xE{pVzhjchF2_ z^3Y_QKmWzutGV~fJtysct<89b$8*)zQ)k-l^DDM|kiK{Kr$zVqOv4_avlu*G{an^L HB{Ts55bjZ* diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-human.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-human.png deleted file mode 100644 index f7ab3257c583dbeb76012e533a90e386b13dc8ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}NuDl_ArY-_ zFBoziFyLW!*v)_X|Ne(JD^80w?b;G>X{DJ-ciwgt9VZu;5QAe33^|&|mwx9n{$1a) z`?2Qi#WxRc4G9g7bT2!Qdv2zlK5xd_OqY%mzop}sOkaO=s=k1rU~VZ>&{WH*w}S)U Q0BvLNboFyt=akR{0LZL8O#lD@ diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-lizard.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-lizard.png deleted file mode 100644 index e53ba99227e429913d603028577ba1464040bb23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}wVp1HArY-_ zFKy&yR^(}Y_}_@R=do|ZJSM4NXGWpxs$P|DUQ+dQxuegs6`Zqt&i8cAchCQ)Z>?Ar z?ZO}+_-xKHh3lRS4FXJSO&OAU`k&9#zfjG-;M%Xy|5H}wh2C8{<$JMB>OO{=ZE@K% s(`8saG-H!_g1nyXe=?`|+~2#rw1j)78&qol`;+07#lh)&Kwi diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-slime.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-slime.png deleted file mode 100644 index 87561cb16196846accc1779665c29c31d6a8a06d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}jh-%!ArY-_ zFYo0&tRUic(ffo_UO&dw=)D4|@R z^Cae<-DiHr%MaHl-&rfj?|q=8f+b^Z?ls>qCO^ZLfcHERpSl~kCIp=dXMf}HcCULw x(5X_!&)MJa&3-TcVCSY8kAHV|bgZdhUOhu{+EOWH9-w0wJYD@<);T3K0RTmdPk#Ua diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-spider.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-left-bare-spider.png deleted file mode 100644 index 4939e72c4b55171a84c2f8b6c9130f99d9bc75e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}nVv3=ArY-_ zFDUXIFyLW!$o}j4f71Eynyi5VnU12BB^J(?YmR746LoNLd2-t0(@fFuuLbXY%h?%r zSSu|uS!9#2w)LL1$EP{XXV!#Wogw*bj>^f71v95sosws0xOR)7;fzdvm5YnZzqf3S X(~VtjTgTe~DWM4fM$6~(uewe_Ycdt`&+u^S=^B`gdZoR$k53aO4OW#4pCclP|o zDcAo_*y2&;@ynyiTPoW9!e_R$2dsA*7oL>0xF*&jpys)u?*WTV^x1_AnP(n6qqkon_}w(1{$rfFzQ^s!whwA5>3XN=14tZ9;&;&Y16{oOsgbi;SO zhSJzh!&(1#)(i0!$gofP^6u|-?mbb{T5Ip0{rrr{GM(YsoECv~x&dC5?`nDy`OL*D z-q!oR&GtRbJ!fEy|>&mXzkZeHP7c1?|;gY*lF6mI>W95=rjgT LS3j3^P6yZVy@Cw?UlFq_Q`JW$yQQQlJ+n%{&}*{IN7D3(w0I0 z&R!V?YsS3phD+-fOEEA!n{)N!Uxw9?&t;ucLK6TVI6R90 diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-lizard.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-lizard.png deleted file mode 100644 index e53ba99227e429913d603028577ba1464040bb23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}wVp1HArY-_ zFKy&yR^(}Y_}_@R=do|ZJSM4NXGWpxs$P|DUQ+dQxuegs6`Zqt&i8cAchCQ)Z>?Ar z?ZO}+_-xKHh3lRS4FXJSO&OAU`k&9#zfjG-;M%Xy|5H}wh2C8{<$JMB>OO{=ZE@K% s(`8saG-H!_g1nyXe=?`|+~2#rw1j)78&qol`;+07#lh)&Kwi diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-slime.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-right-bare-slime.png deleted file mode 100644 index c10fe24f0b0c139e4615a2c66410f41b393af1df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}O`a}}ArY-_ zFYo4UP!MT-*lfX`9C68dYL2V_ONlp*8+Jzopr0M}kaO8@`> diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-shoes.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-shoes.png deleted file mode 100644 index 6cf329a9b6fe8ddc5af18ec0b463c3a621a252a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJNKY5Xkcv5PFKy&HV8Fq0Vafmh zlXrQUZRfbId0}1DtD^kt)<+CGIy$%*65jVtD-dkl{rJaT2Dvjju?b;Zd&JJpyf;-$ v@agCHn+JvWT$5UL>vKmgzlV#bP0l+XkKYGOFD diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-suit.png b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/footprint-suit.png deleted file mode 100644 index 6bc32d343c7b4989d76804ca145da19dd67736d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Q$1ZALn2z= zPI2UNR^)M6ED}@2%)0*RUDmHGd7Edx^LiWqr9A4E>*oV!9~@Df(IL^6_{X}>l<7d& z3CmStsjv1Xuicty=yuX_e@s8n(zRQCwU-9O?l539+;OXk;vd$@?2>=|MRyF_t diff --git a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/meta.json b/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/meta.json deleted file mode 100644 index 0ce2e096ac5..00000000000 --- a/Resources/Textures/_CorvaxNext/Effects/footprints.rsi/meta.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "version": 1, - "size": { - "x": 32, - "y": 32 - }, - "license": "CC-BY-SA-3.0", - "copyright": "IMPERIAL SPACE", - "states": [ - { - "name": "footprint-left-bare-diona" - }, - { - "name": "footprint-left-bare-dwarf" - }, - { - "name": "footprint-left-bare-human" - }, - { - "name": "footprint-left-bare-lizard" - }, - { - "name": "footprint-left-bare-slime" - }, - { - "name": "footprint-left-bare-spider" - }, - { - "name": "footprint-right-bare-diona" - }, - { - "name": "footprint-right-bare-dwarf" - }, - { - "name": "footprint-right-bare-human" - }, - { - "name": "footprint-right-bare-lizard" - }, - { - "name": "footprint-right-bare-slime" - }, - { - "name": "footprint-right-bare-spider" - }, - { - "name": "footprint-shoes" - }, - { - "name": "footprint-suit" - }, - { - "name": "dragging-1" - }, - { - "name": "dragging-2" - }, - { - "name": "dragging-3" - }, - { - "name": "dragging-4" - }, - { - "name": "dragging-5" - }, - { - "name": "dragging-test" - } - ] -} From f26f42cfccdffb296ac89048c28c8bc883ee8556 Mon Sep 17 00:00:00 2001 From: FN Date: Wed, 4 Dec 2024 05:20:18 +0700 Subject: [PATCH 04/11] Start --- .../_CorvaxNext/Footprints/FootprintSystem.cs | 47 ++++++ .../Movement/Events/FootstepEvent.cs | 3 + .../Movement/Systems/SharedMoverController.cs | 2 + .../Components/FootprintComponent.cs | 14 ++ .../Components/FootprintOwnerComponent.cs | 13 ++ .../Footprints/FootprintChangedEvent.cs | 9 ++ .../Footprints/SharedFootprintSystem.cs | 142 ++++++++++++++++++ .../Entities/Mobs/Species/vulpkanin.yml | 1 + .../Entities/Effects/footprint.yml | 48 ++++++ .../_CorvaxNext/Entities/Species/resomi.yml | 1 - 10 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs create mode 100644 Content.Shared/Movement/Events/FootstepEvent.cs create mode 100644 Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs create mode 100644 Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs create mode 100644 Content.Shared/_CorvaxNext/Footprints/FootprintChangedEvent.cs create mode 100644 Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs create mode 100644 Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml diff --git a/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs new file mode 100644 index 00000000000..ad4f25fd670 --- /dev/null +++ b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs @@ -0,0 +1,47 @@ +using Content.Shared._CorvaxNext.Footprints; +using Content.Shared._CorvaxNext.Footprints.Components; +using Robust.Client.GameObjects; + +namespace Content.Client._CorvaxNext.Footprints; + +public sealed class FootprintSystem : EntitySystem +{ + public override void Initialize() + { + SubscribeLocalEvent(OnComponentStartup); + SubscribeNetworkEvent(OnFootprintChanged); + } + + private void OnComponentStartup(Entity entity, ref ComponentStartup e) + { + if (!TryComp(entity, out var sprite)) + return; + + foreach (var footprint in entity.Comp.Footprints) + sprite.AddLayer(new PrototypeLayerData() + { + RsiPath = "/Textures/Clothing/Shoes/color.rsi", + Color = footprint.Color + }); + } + + private void OnFootprintChanged(FootprintChangedEvent e) + { + var entity = GetEntity(e.Entity); + + if (!TryComp(entity, out var footprint)) + return; + + if (!TryComp(entity, out var sprite)) + return; + + if (footprint.Footprints.Count < 1) + return; + + sprite.AddLayer(new PrototypeLayerData() + { + RsiPath = "/Textures/Clothing/Shoes/color.rsi", + Color = footprint.Footprints[^1].Color + }); + } +} diff --git a/Content.Shared/Movement/Events/FootstepEvent.cs b/Content.Shared/Movement/Events/FootstepEvent.cs new file mode 100644 index 00000000000..640a2b50c17 --- /dev/null +++ b/Content.Shared/Movement/Events/FootstepEvent.cs @@ -0,0 +1,3 @@ +namespace Content.Shared.Movement.Events; + +public readonly record struct FootstepEvent; // Corvax-Next-Footprints diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 472d56b1d69..c20bf81c5a2 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -255,6 +255,8 @@ protected void HandleMobMovement( if (!weightless && MobMoverQuery.TryGetComponent(uid, out var mobMover) && TryGetSound(weightless, uid, mover, mobMover, xform, out var sound, tileDef: tileDef)) { + RaiseLocalEvent(uid, new FootstepEvent()); // Corvax-Next-Footprints + var soundModifier = mover.Sprinting ? 3.5f : 1.5f; var audioParams = sound.Params diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs new file mode 100644 index 00000000000..aa48c008515 --- /dev/null +++ b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs @@ -0,0 +1,14 @@ +using Robust.Shared.GameStates; +using Robust.Shared.Serialization; + +namespace Content.Shared._CorvaxNext.Footprints.Components; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class FootprintComponent : Component +{ + [AutoNetworkedField, ViewVariables] + public List Footprints = []; +} + +[Serializable, NetSerializable] +public readonly record struct Footprint(Color Color); diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs new file mode 100644 index 00000000000..ae4d60a51b4 --- /dev/null +++ b/Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs @@ -0,0 +1,13 @@ +using Content.Shared.FixedPoint; + +namespace Content.Shared._CorvaxNext.Footprints.Components; + +[RegisterComponent] +public sealed partial class FootprintOwnerComponent : Component +{ + [DataField] + public FixedPoint2 MaxFootVolume = 10; + + [DataField] + public FixedPoint2 MaxBodyVolume = 20; +} diff --git a/Content.Shared/_CorvaxNext/Footprints/FootprintChangedEvent.cs b/Content.Shared/_CorvaxNext/Footprints/FootprintChangedEvent.cs new file mode 100644 index 00000000000..98a39a22d64 --- /dev/null +++ b/Content.Shared/_CorvaxNext/Footprints/FootprintChangedEvent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared._CorvaxNext.Footprints; + +[Serializable, NetSerializable] +public sealed class FootprintChangedEvent(NetEntity entity) : EntityEventArgs +{ + public NetEntity Entity = entity; +} diff --git a/Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs b/Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs new file mode 100644 index 00000000000..663d858730c --- /dev/null +++ b/Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs @@ -0,0 +1,142 @@ +using System.Diagnostics.CodeAnalysis; +using Content.Shared._CorvaxNext.Footprints.Components; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.FixedPoint; +using Content.Shared.Fluids.Components; +using Content.Shared.Movement.Events; +using Robust.Shared.Map; +using Robust.Shared.Map.Components; +using Robust.Shared.Network; +using Robust.Shared.Prototypes; + +namespace Content.Shared._CorvaxNext.Footprints; + +public sealed class SharedFootprintSystem : EntitySystem +{ + [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly INetManager _net = default!; + + public static readonly FixedPoint2 MinFootprintVolume = 1; + + public static readonly FixedPoint2 MaxFootprintVolume = 2; + + public static readonly FixedPoint2 MaxFootprintVolumeOnTile = 50; + + public static readonly EntProtoId FootprintPrototypeId = "Footprint"; + + public const string FootprintOwnerSolution = "print"; + + public const string FootprintSolution = "print"; + + public const string PuddleSolution = "puddle"; + + public override void Initialize() + { + SubscribeLocalEvent(OnAnchorStateChanged); + + SubscribeLocalEvent(OnFootstep); + } + + private void OnAnchorStateChanged(Entity entity, ref AnchorStateChangedEvent e) + { + //if (!e.Anchored) + // QueueDel(entity); + } + + private void OnFootstep(Entity entity, ref FootstepEvent e) + { + if (_net.IsClient) + return; + + var transform = Transform(entity); + + if (transform.GridUid is null) + return; + + if (!TryComp(transform.GridUid.Value, out var gridComponent)) + return; + + var tile = _map.GetTileRef(transform.GridUid.Value, gridComponent, transform.Coordinates); + + if (TryPuddleInteraction(entity, (transform.GridUid.Value, gridComponent), tile)) + return; + + FootprintInteraction(entity, (transform.GridUid.Value, gridComponent), tile); + } + + private bool TryPuddleInteraction(Entity entity, Entity grid, TileRef tile) + { + if (!TryGetAnchoredEntity(grid, tile.GridIndices, out var puddle)) + return false; + + if (!_solution.EnsureSolutionEntity(entity.Owner, FootprintOwnerSolution, out _, out var solution, FixedPoint2.Max(entity.Comp.MaxFootVolume, entity.Comp.MaxBodyVolume))) + return false; + + if (!_solution.TryGetSolution(puddle.Value.Owner, PuddleSolution, out var puddleSolution, out _)) + return false; + + _solution.TryTransferSolution(puddleSolution.Value, solution.Value.Comp.Solution, GetFootprintVolume(entity, solution.Value)); + + _solution.TryTransferSolution(solution.Value, puddleSolution.Value.Comp.Solution, entity.Comp.MaxFootVolume - solution.Value.Comp.Solution.Volume); + + Dirty(puddle.Value); + + return true; + } + + private void FootprintInteraction(Entity entity, Entity grid, TileRef tile) + { + if (!_solution.TryGetSolution(entity.Owner, FootprintOwnerSolution, out var solution, out _)) + return; + + var volume = GetFootprintVolume(entity, solution.Value); + + if (volume < MinFootprintVolume) + return; + + if (!TryGetAnchoredEntity(grid, tile.GridIndices, out var footprint)) + { + var footprintEntity = SpawnAtPosition(FootprintPrototypeId, Transform(entity.Owner).Coordinates); + + footprint = (footprintEntity, Comp(footprintEntity)); + } + + if (!_solution.EnsureSolutionEntity(footprint.Value.Owner, PuddleSolution, out _, out var footprintSolution, MaxFootprintVolumeOnTile)) + return; + + footprint.Value.Comp.Footprints.Add(new(footprintSolution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)MaxFootprintVolume))); + + Dirty(footprint.Value); + + _solution.TryTransferSolution(footprintSolution.Value, solution.Value.Comp.Solution, volume); + + if (!TryGetNetEntity(footprint, out var netFootprint)) + return; + + RaiseNetworkEvent(new FootprintChangedEvent(netFootprint.Value)); + } + + private static FixedPoint2 GetFootprintVolume(Entity entity, Entity solution) + { + return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxFootprintVolume - MinFootprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxFootVolume) + MinFootprintVolume); + } + + private bool TryGetAnchoredEntity(Entity grid, Vector2i pos, [NotNullWhen(true)] out Entity? entity) where T : IComponent + { + var anchoredEnumerator = _map.GetAnchoredEntitiesEnumerator(grid, grid, pos); + var entityQuery = GetEntityQuery(); + + while (anchoredEnumerator.MoveNext(out var ent)) + if (entityQuery.TryComp(ent, out var comp)) + { + entity = (ent.Value, comp); + return true; + } + + entity = null; + return false; + } +} diff --git a/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml b/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml index cf247699f67..a2aaee60ead 100644 --- a/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml +++ b/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml @@ -71,6 +71,7 @@ types: Asphyxiation: -2.0 - type: Wagging + - type: FootprintOwner # Corvax-Next-Footprints - type: entity save: false diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml new file mode 100644 index 00000000000..f9bfa0e5be4 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml @@ -0,0 +1,48 @@ +- type: entity + name: footprint + id: Footprint + save: false + description: Trace of liquid. + placement: + mode: SnapgridCenter + components: + - type: Clickable + - type: Transform + noRot: false + anchored: true + - type: Sprite + drawdepth: FloorObjects + - type: Physics + bodyType: Static + - type: Fixtures + fixtures: + slipFixture: + shape: + !type:PhysShapeAabb + bounds: "-0.4,-0.4,0.4,0.4" + mask: + - ItemMask + layer: + - SlipLayer + hard: false + - type: SolutionContainerManager + - type: Footprint + - type: Puddle + solution: print + - type: Appearance + - type: ExaminableSolution + solution: print + - type: MixableSolution + solution: print + - type: DrawableSolution + solution: print + - type: BadDrink + - type: IgnoresFingerprints + - type: Drink + delay: 3 + transferAmount: 0.5 + solution: print + examinable: false + - type: Tag + tags: + - DNASolutionScannable diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Species/resomi.yml b/Resources/Prototypes/_CorvaxNext/Entities/Species/resomi.yml index a6298b7a76d..e5cede3edb7 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Species/resomi.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Species/resomi.yml @@ -10,7 +10,6 @@ - type: ChatModifier whisperListeningRange: 4 - type: ResomiAccent - - type: FootprintVisualizer - type: DamageVisuals thresholds: [ 10, 30, 50, 70] targetLayers: From 6eb08bac9030a8561fcf609c29367029c1e47027 Mon Sep 17 00:00:00 2001 From: FN Date: Mon, 9 Dec 2024 12:37:29 +0700 Subject: [PATCH 05/11] Something ready --- .../_CorvaxNext/Footprints/FootprintSystem.cs | 36 ++--- .../Chemistry/EntitySystems/VaporSystem.cs | 3 + .../Fluids/EntitySystems/AbsorbentSystem.cs | 3 + .../Fluids/EntitySystems/PuddleSystem.cs | 7 + .../Footprints/FootprintCleanEvent.cs | 3 + .../Footprints}/FootprintOwnerComponent.cs | 2 +- .../_CorvaxNext/Footprints/FootprintSystem.cs | 123 ++++++++++++++---- .../{Components => }/FootprintComponent.cs | 5 +- .../Entities/Effects/footprint.yml | 1 - 9 files changed, 138 insertions(+), 45 deletions(-) create mode 100644 Content.Server/_CorvaxNext/Footprints/FootprintCleanEvent.cs rename {Content.Shared/_CorvaxNext/Footprints/Components => Content.Server/_CorvaxNext/Footprints}/FootprintOwnerComponent.cs (80%) rename Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs => Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs (54%) rename Content.Shared/_CorvaxNext/Footprints/{Components => }/FootprintComponent.cs (66%) diff --git a/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs index ad4f25fd670..25389f21171 100644 --- a/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs +++ b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs @@ -1,6 +1,6 @@ using Content.Shared._CorvaxNext.Footprints; -using Content.Shared._CorvaxNext.Footprints.Components; using Robust.Client.GameObjects; +using Robust.Shared.Utility; namespace Content.Client._CorvaxNext.Footprints; @@ -14,34 +14,34 @@ public override void Initialize() private void OnComponentStartup(Entity entity, ref ComponentStartup e) { - if (!TryComp(entity, out var sprite)) - return; - - foreach (var footprint in entity.Comp.Footprints) - sprite.AddLayer(new PrototypeLayerData() - { - RsiPath = "/Textures/Clothing/Shoes/color.rsi", - Color = footprint.Color - }); + UpdateSprite(entity, entity); } private void OnFootprintChanged(FootprintChangedEvent e) { - var entity = GetEntity(e.Entity); + if (!TryGetEntity(e.Entity, out var entity)) + return; if (!TryComp(entity, out var footprint)) return; - if (!TryComp(entity, out var sprite)) - return; + UpdateSprite(entity.Value, footprint); + } - if (footprint.Footprints.Count < 1) + private void UpdateSprite(EntityUid entity, FootprintComponent footprint) + { + if (!TryComp(entity, out var sprite)) return; - sprite.AddLayer(new PrototypeLayerData() + for (var i = 0; i < footprint.Footprints.Count; i++) { - RsiPath = "/Textures/Clothing/Shoes/color.rsi", - Color = footprint.Footprints[^1].Color - }); + if (!sprite.LayerExists(i, false)) + sprite.AddBlankLayer(i); + + sprite.LayerSetOffset(i, footprint.Footprints[i].Offset); + sprite.LayerSetRotation(i, footprint.Footprints[i].Rotation); + sprite.LayerSetColor(i, footprint.Footprints[i].Color); + sprite.LayerSetSprite(i, new SpriteSpecifier.Rsi(new("/Textures/Clothing/Shoes/color.rsi"), "icon")); + } } } diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index c9b64e649e5..590e4df7cf9 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -16,6 +16,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Spawners; using System.Numerics; +using Content.Server._CorvaxNext.Footprints; namespace Content.Server.Chemistry.EntitySystems { @@ -49,6 +50,8 @@ private void HandleCollide(Entity entity, ref StartCollideEvent _reactive.DoEntityReaction(args.OtherEntity, solution, ReactionMethod.Touch); } + RaiseLocalEvent(args.OtherEntity, new FootprintCleanEvent()); // Corvax-Next-Footprints + // Check for collision with a impassable object (e.g. wall) and stop if ((args.OtherFixture.CollisionLayer & (int) CollisionGroup.Impassable) != 0 && args.OtherFixture.Hard) { diff --git a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs index 56e039a7004..6b34b390d3d 100644 --- a/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs +++ b/Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Server._CorvaxNext.Footprints; using Content.Server.Popups; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; @@ -322,6 +323,8 @@ private bool TryPuddleInteract(EntityUid user, EntityUid used, EntityUid target, _melee.DoLunge(user, used, Angle.Zero, localPos, null, false); + RaiseLocalEvent(target, new FootprintCleanEvent()); // Corvax-Next-Footprints + return true; } } diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index ef06b9f2d99..c371b8340f9 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -2,6 +2,7 @@ using Content.Server.DoAfter; using Content.Server.Fluids.Components; using Content.Server.Spreader; +using Content.Shared._CorvaxNext.Footprints; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components.SolutionManager; @@ -674,6 +675,7 @@ public override bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUi var anchored = _map.GetAnchoredEntitiesEnumerator(gridId, mapGrid, tileRef.GridIndices); var puddleQuery = GetEntityQuery(); var sparklesQuery = GetEntityQuery(); + var footprintQuery = GetEntityQuery(); // Corvax-Next-Footprints while (anchored.MoveNext(out var ent)) { @@ -687,6 +689,11 @@ public override bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUi if (!puddleQuery.TryGetComponent(ent, out var puddle)) continue; + // Corvax-Next-Footprints-Start + if (footprintQuery.HasComp(ent)) + continue; + // Corvax-Next-Footprints-End + if (TryAddSolution(ent.Value, solution, sound, puddleComponent: puddle)) { EnsureComp(ent.Value); diff --git a/Content.Server/_CorvaxNext/Footprints/FootprintCleanEvent.cs b/Content.Server/_CorvaxNext/Footprints/FootprintCleanEvent.cs new file mode 100644 index 00000000000..59ce41ee6c9 --- /dev/null +++ b/Content.Server/_CorvaxNext/Footprints/FootprintCleanEvent.cs @@ -0,0 +1,3 @@ +namespace Content.Server._CorvaxNext.Footprints; + +public readonly struct FootprintCleanEvent; diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs similarity index 80% rename from Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs rename to Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs index ae4d60a51b4..1d3cfcf106d 100644 --- a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintOwnerComponent.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs @@ -1,6 +1,6 @@ using Content.Shared.FixedPoint; -namespace Content.Shared._CorvaxNext.Footprints.Components; +namespace Content.Server._CorvaxNext.Footprints; [RegisterComponent] public sealed partial class FootprintOwnerComponent : Component diff --git a/Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs similarity index 54% rename from Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs rename to Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs index 663d858730c..d4ba9a0b10a 100644 --- a/Content.Shared/_CorvaxNext/Footprints/SharedFootprintSystem.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs @@ -1,23 +1,24 @@ using System.Diagnostics.CodeAnalysis; -using Content.Shared._CorvaxNext.Footprints.Components; +using Content.Server.Fluids; +using Content.Shared._CorvaxNext.Footprints; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.FixedPoint; +using Content.Shared.Fluids; using Content.Shared.Fluids.Components; using Content.Shared.Movement.Events; using Robust.Shared.Map; using Robust.Shared.Map.Components; -using Robust.Shared.Network; using Robust.Shared.Prototypes; -namespace Content.Shared._CorvaxNext.Footprints; +namespace Content.Server._CorvaxNext.Footprints; -public sealed class SharedFootprintSystem : EntitySystem +public sealed class FootprintSystem : EntitySystem { [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; + [Dependency] private readonly SharedPuddleSystem _puddle = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly INetManager _net = default!; public static readonly FixedPoint2 MinFootprintVolume = 1; @@ -36,21 +37,42 @@ public sealed class SharedFootprintSystem : EntitySystem public override void Initialize() { SubscribeLocalEvent(OnAnchorStateChanged); + SubscribeLocalEvent(OnAbsorbentPuddleInteract); SubscribeLocalEvent(OnFootstep); + + SubscribeLocalEvent(OnMapInit); } private void OnAnchorStateChanged(Entity entity, ref AnchorStateChangedEvent e) { - //if (!e.Anchored) - // QueueDel(entity); + if (!e.Anchored) + QueueDel(entity); } - private void OnFootstep(Entity entity, ref FootstepEvent e) + private void OnAbsorbentPuddleInteract(Entity entity, ref FootprintCleanEvent e) { - if (_net.IsClient) + if (!_solution.TryGetSolution(entity.Owner, FootprintSolution, out _, out var puddleSolution)) + return; + + var color = puddleSolution.GetColor(_prototype); + + for (var i = 0; i < entity.Comp.Footprints.Count; i++) + entity.Comp.Footprints[i] = entity.Comp.Footprints[i] with + { + Color = color + }; + + Dirty(entity); + + if (!TryGetNetEntity(entity, out var netFootprint)) return; + RaiseNetworkEvent(new FootprintChangedEvent(netFootprint.Value)); + } + + private void OnFootstep(Entity entity, ref FootstepEvent e) + { var transform = Transform(entity); if (transform.GridUid is null) @@ -59,35 +81,39 @@ private void OnFootstep(Entity entity, ref FootstepEven if (!TryComp(transform.GridUid.Value, out var gridComponent)) return; - var tile = _map.GetTileRef(transform.GridUid.Value, gridComponent, transform.Coordinates); + var coordinates = Transform(entity).Coordinates; + + coordinates = Transform(entity).Coordinates.WithPosition(new(coordinates.X, coordinates.Y - 0.5f)); + + var tile = _map.CoordinatesToTile(transform.GridUid.Value, gridComponent, coordinates); if (TryPuddleInteraction(entity, (transform.GridUid.Value, gridComponent), tile)) return; - FootprintInteraction(entity, (transform.GridUid.Value, gridComponent), tile); + FootprintInteraction(entity, (transform.GridUid.Value, gridComponent), tile, coordinates, transform.LocalRotation); } - private bool TryPuddleInteraction(Entity entity, Entity grid, TileRef tile) + private bool TryPuddleInteraction(Entity entity, Entity grid, Vector2i tile) { - if (!TryGetAnchoredEntity(grid, tile.GridIndices, out var puddle)) + if (!TryGetAnchoredEntity(grid, tile, out var puddle)) return false; - if (!_solution.EnsureSolutionEntity(entity.Owner, FootprintOwnerSolution, out _, out var solution, FixedPoint2.Max(entity.Comp.MaxFootVolume, entity.Comp.MaxBodyVolume))) + if (!_solution.TryGetSolution(puddle.Value.Owner, PuddleSolution, out var puddleSolution, out _)) return false; - if (!_solution.TryGetSolution(puddle.Value.Owner, PuddleSolution, out var puddleSolution, out _)) + if (!_solution.EnsureSolutionEntity(entity.Owner, FootprintOwnerSolution, out _, out var solution, FixedPoint2.Max(entity.Comp.MaxFootVolume, entity.Comp.MaxBodyVolume))) return false; _solution.TryTransferSolution(puddleSolution.Value, solution.Value.Comp.Solution, GetFootprintVolume(entity, solution.Value)); _solution.TryTransferSolution(solution.Value, puddleSolution.Value.Comp.Solution, entity.Comp.MaxFootVolume - solution.Value.Comp.Solution.Volume); - Dirty(puddle.Value); + _solution.UpdateChemicals(puddleSolution.Value, false); return true; } - private void FootprintInteraction(Entity entity, Entity grid, TileRef tile) + private void FootprintInteraction(Entity entity, Entity grid, Vector2i tile, EntityCoordinates coordinates, Angle rotation) { if (!_solution.TryGetSolution(entity.Owner, FootprintOwnerSolution, out var solution, out _)) return; @@ -97,21 +123,44 @@ private void FootprintInteraction(Entity entity, Entity if (volume < MinFootprintVolume) return; - if (!TryGetAnchoredEntity(grid, tile.GridIndices, out var footprint)) + if (!TryGetAnchoredEntity(grid, tile, out var footprint)) { - var footprintEntity = SpawnAtPosition(FootprintPrototypeId, Transform(entity.Owner).Coordinates); + var footprintEntity = SpawnAtPosition(FootprintPrototypeId, coordinates); footprint = (footprintEntity, Comp(footprintEntity)); } - if (!_solution.EnsureSolutionEntity(footprint.Value.Owner, PuddleSolution, out _, out var footprintSolution, MaxFootprintVolumeOnTile)) + if (!_solution.EnsureSolutionEntity(footprint.Value.Owner, FootprintSolution, out _, out var footprintSolution, MaxFootprintVolumeOnTile)) return; - footprint.Value.Comp.Footprints.Add(new(footprintSolution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)MaxFootprintVolume))); + _solution.TryTransferSolution(footprintSolution.Value, solution.Value.Comp.Solution, volume); - Dirty(footprint.Value); + if (footprintSolution.Value.Comp.Solution.Volume >= MaxFootprintVolumeOnTile) + { + var footprintSolutionClone = footprintSolution.Value.Comp.Solution.Clone(); - _solution.TryTransferSolution(footprintSolution.Value, solution.Value.Comp.Solution, volume); + Del(footprint); + + _puddle.TrySpillAt(coordinates, footprintSolutionClone, out _, false); + + return; + } + + var gridCoords = _map.LocalToGrid(grid, grid, coordinates); + + var x = gridCoords.X / grid.Comp.TileSize; + var y = gridCoords.Y / grid.Comp.TileSize; + + var halfTileSize = grid.Comp.TileSize / 2f; + + x -= MathF.Floor(x) + halfTileSize; + y -= MathF.Floor(y) + halfTileSize; + + var color = solution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)MaxFootprintVolume); + + footprint.Value.Comp.Footprints.Add(new(new(x, y), rotation, color)); + + Dirty(footprint.Value); if (!TryGetNetEntity(footprint, out var netFootprint)) return; @@ -119,6 +168,34 @@ private void FootprintInteraction(Entity entity, Entity RaiseNetworkEvent(new FootprintChangedEvent(netFootprint.Value)); } + private void OnMapInit(Entity entity, ref MapInitEvent e) + { + if (HasComp(entity)) + return; + + var transform = Transform(entity); + + if (transform.GridUid is null) + return; + + if (!TryComp(transform.GridUid.Value, out var gridComponent)) + return; + + var tile = _map.CoordinatesToTile(transform.GridUid.Value, gridComponent, transform.Coordinates); + + if (!TryGetAnchoredEntity((transform.GridUid.Value, gridComponent), tile, out var footprint)) + return; + + if (!_solution.TryGetSolution(footprint.Value.Owner, FootprintSolution, out _, out var footprintSolution)) + return; + + footprintSolution = footprintSolution.Clone(); + + Del(footprint); + + _puddle.TrySpillAt(transform.Coordinates, footprintSolution, out _, false); + } + private static FixedPoint2 GetFootprintVolume(Entity entity, Entity solution) { return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxFootprintVolume - MinFootprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxFootVolume) + MinFootprintVolume); diff --git a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs b/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs similarity index 66% rename from Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs rename to Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs index aa48c008515..b9fcdf2b6ac 100644 --- a/Content.Shared/_CorvaxNext/Footprints/Components/FootprintComponent.cs +++ b/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs @@ -1,7 +1,8 @@ +using System.Numerics; using Robust.Shared.GameStates; using Robust.Shared.Serialization; -namespace Content.Shared._CorvaxNext.Footprints.Components; +namespace Content.Shared._CorvaxNext.Footprints; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class FootprintComponent : Component @@ -11,4 +12,4 @@ public sealed partial class FootprintComponent : Component } [Serializable, NetSerializable] -public readonly record struct Footprint(Color Color); +public readonly record struct Footprint(Vector2 Offset, Angle Rotation, Color Color); diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml index f9bfa0e5be4..dd4642e0fb5 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml @@ -29,7 +29,6 @@ - type: Footprint - type: Puddle solution: print - - type: Appearance - type: ExaminableSolution solution: print - type: MixableSolution From 41143d269c8658ce8c2b69ed320b1ad85d98b7a1 Mon Sep 17 00:00:00 2001 From: FN Date: Thu, 12 Dec 2024 13:03:58 +0700 Subject: [PATCH 06/11] Fix mop --- Content.Server/Fluids/EntitySystems/PuddleSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index c371b8340f9..b59010c4c47 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -742,12 +742,18 @@ public bool TryGetPuddle(TileRef tile, out EntityUid puddleUid) var anc = _map.GetAnchoredEntitiesEnumerator(tile.GridUid, grid, tile.GridIndices); var puddleQuery = GetEntityQuery(); + var footprintQuery = GetEntityQuery(); // Corvax-Next-Footprints while (anc.MoveNext(out var ent)) { if (!puddleQuery.HasComponent(ent.Value)) continue; + // Corvax-Next-Footprints-Start + if (footprintQuery.HasComponent(ent.Value)) + continue; + // Corvax-Next-Footprints-End + puddleUid = ent.Value; return true; } From 8798351d6ae752fe055a3bd398e4bd1256cf6b33 Mon Sep 17 00:00:00 2001 From: FN Date: Wed, 18 Dec 2024 05:58:34 +0700 Subject: [PATCH 07/11] Almost ready --- .../_CorvaxNext/Footprints/FootprintSystem.cs | 2 +- .../Footprints/FootprintOwnerComponent.cs | 12 +++ .../_CorvaxNext/Footprints/FootprintSystem.cs | 78 ++++++++++++------ .../Movement/Events/FootstepEvent.cs | 3 - .../Movement/Systems/SharedMoverController.cs | 2 - .../Footprints/FootprintComponent.cs | 2 +- .../Entities/Mobs/Species/vulpkanin.yml | 1 - .../Prototypes/Entities/Mobs/Species/base.yml | 1 + .../Entities/Effects/footprint.yml | 1 + .../Effects/footprint.rsi/body.png | Bin 0 -> 591 bytes .../Effects/footprint.rsi/foot.png | Bin 0 -> 146 bytes .../Effects/footprint.rsi/meta.json | 17 ++++ 12 files changed, 87 insertions(+), 32 deletions(-) delete mode 100644 Content.Shared/Movement/Events/FootstepEvent.cs create mode 100644 Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png create mode 100644 Resources/Textures/_CorvaxNext/Effects/footprint.rsi/foot.png create mode 100644 Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json diff --git a/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs index 25389f21171..7355370779d 100644 --- a/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs +++ b/Content.Client/_CorvaxNext/Footprints/FootprintSystem.cs @@ -41,7 +41,7 @@ private void UpdateSprite(EntityUid entity, FootprintComponent footprint) sprite.LayerSetOffset(i, footprint.Footprints[i].Offset); sprite.LayerSetRotation(i, footprint.Footprints[i].Rotation); sprite.LayerSetColor(i, footprint.Footprints[i].Color); - sprite.LayerSetSprite(i, new SpriteSpecifier.Rsi(new("/Textures/Clothing/Shoes/color.rsi"), "icon")); + sprite.LayerSetSprite(i, new SpriteSpecifier.Rsi(new("/Textures/_CorvaxNext/Effects/footprint.rsi"), footprint.Footprints[i].State)); } } } diff --git a/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs index 1d3cfcf106d..a7132a1bb7a 100644 --- a/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs @@ -10,4 +10,16 @@ public sealed partial class FootprintOwnerComponent : Component [DataField] public FixedPoint2 MaxBodyVolume = 20; + + [DataField] + public float FootDistance = 0.5f; + + [DataField] + public float BodyDistance = 1; + + [ViewVariables(VVAccess.ReadWrite)] + public float Distance; + + [DataField] + public float NextFootOffset = 0.0625f; } diff --git a/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs index d4ba9a0b10a..71adadc5b43 100644 --- a/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs @@ -1,12 +1,13 @@ using System.Diagnostics.CodeAnalysis; -using Content.Server.Fluids; +using System.Numerics; using Content.Shared._CorvaxNext.Footprints; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.FixedPoint; using Content.Shared.Fluids; using Content.Shared.Fluids.Components; -using Content.Shared.Movement.Events; +using Content.Shared.Standing; +using Robust.Server.GameObjects; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; @@ -15,14 +16,19 @@ namespace Content.Server._CorvaxNext.Footprints; public sealed class FootprintSystem : EntitySystem { + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; [Dependency] private readonly SharedPuddleSystem _puddle = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; - public static readonly FixedPoint2 MinFootprintVolume = 1; + public static readonly FixedPoint2 MinFootprintVolume = 0.5; - public static readonly FixedPoint2 MaxFootprintVolume = 2; + public static readonly FixedPoint2 MaxFootprintVolume = 1; + + public static readonly FixedPoint2 MinBodyprintVolume = 2; + + public static readonly FixedPoint2 MaxBodyprintVolume = 5; public static readonly FixedPoint2 MaxFootprintVolumeOnTile = 50; @@ -36,20 +42,13 @@ public sealed class FootprintSystem : EntitySystem public override void Initialize() { - SubscribeLocalEvent(OnAnchorStateChanged); SubscribeLocalEvent(OnAbsorbentPuddleInteract); - SubscribeLocalEvent(OnFootstep); + SubscribeLocalEvent(OnMove); SubscribeLocalEvent(OnMapInit); } - private void OnAnchorStateChanged(Entity entity, ref AnchorStateChangedEvent e) - { - if (!e.Anchored) - QueueDel(entity); - } - private void OnAbsorbentPuddleInteract(Entity entity, ref FootprintCleanEvent e) { if (!_solution.TryGetSolution(entity.Owner, FootprintSolution, out _, out var puddleSolution)) @@ -71,8 +70,22 @@ private void OnAbsorbentPuddleInteract(Entity entity, ref Fo RaiseNetworkEvent(new FootprintChangedEvent(netFootprint.Value)); } - private void OnFootstep(Entity entity, ref FootstepEvent e) + private void OnMove(Entity entity, ref MoveEvent e) { + var oldPosition = _transform.ToMapCoordinates(e.OldPosition).Position; + var newPosition = _transform.ToMapCoordinates(e.NewPosition).Position; + + entity.Comp.Distance += Vector2.Distance(newPosition, oldPosition); + + var standing = TryComp(entity, out var standingState) && standingState.Standing; + + var requiredDistance = standing ? entity.Comp.FootDistance : entity.Comp.BodyDistance; + + if (entity.Comp.Distance < requiredDistance) + return; + + entity.Comp.Distance -= requiredDistance; + var transform = Transform(entity); if (transform.GridUid is null) @@ -81,19 +94,31 @@ private void OnFootstep(Entity entity, ref FootstepEven if (!TryComp(transform.GridUid.Value, out var gridComponent)) return; - var coordinates = Transform(entity).Coordinates; + EntityCoordinates coordinates = new(entity, standing ? entity.Comp.NextFootOffset : 0, 0); - coordinates = Transform(entity).Coordinates.WithPosition(new(coordinates.X, coordinates.Y - 0.5f)); + entity.Comp.NextFootOffset = -entity.Comp.NextFootOffset; var tile = _map.CoordinatesToTile(transform.GridUid.Value, gridComponent, coordinates); - if (TryPuddleInteraction(entity, (transform.GridUid.Value, gridComponent), tile)) + if (TryPuddleInteraction(entity, (transform.GridUid.Value, gridComponent), tile, standing)) return; - FootprintInteraction(entity, (transform.GridUid.Value, gridComponent), tile, coordinates, transform.LocalRotation); + Angle rotation; + + if (!standing) + { + var oldLocalPosition = _map.WorldToLocal(transform.GridUid.Value, gridComponent, oldPosition); + var newLocalPosition = _map.WorldToLocal(transform.GridUid.Value, gridComponent, newPosition); + + rotation = (newLocalPosition - oldLocalPosition).ToAngle(); + } + else + rotation = transform.LocalRotation; + + FootprintInteraction(entity, (transform.GridUid.Value, gridComponent), tile, coordinates, rotation, standing); } - private bool TryPuddleInteraction(Entity entity, Entity grid, Vector2i tile) + private bool TryPuddleInteraction(Entity entity, Entity grid, Vector2i tile, bool standing) { if (!TryGetAnchoredEntity(grid, tile, out var puddle)) return false; @@ -106,19 +131,19 @@ private bool TryPuddleInteraction(Entity entity, Entity _solution.TryTransferSolution(puddleSolution.Value, solution.Value.Comp.Solution, GetFootprintVolume(entity, solution.Value)); - _solution.TryTransferSolution(solution.Value, puddleSolution.Value.Comp.Solution, entity.Comp.MaxFootVolume - solution.Value.Comp.Solution.Volume); + _solution.TryTransferSolution(solution.Value, puddleSolution.Value.Comp.Solution, (standing ? entity.Comp.MaxFootVolume : entity.Comp.MaxBodyVolume) - solution.Value.Comp.Solution.Volume); _solution.UpdateChemicals(puddleSolution.Value, false); return true; } - private void FootprintInteraction(Entity entity, Entity grid, Vector2i tile, EntityCoordinates coordinates, Angle rotation) + private void FootprintInteraction(Entity entity, Entity grid, Vector2i tile, EntityCoordinates coordinates, Angle rotation, bool standing) { if (!_solution.TryGetSolution(entity.Owner, FootprintOwnerSolution, out var solution, out _)) return; - var volume = GetFootprintVolume(entity, solution.Value); + var volume = standing ? GetFootprintVolume(entity, solution.Value) : GetBodyprintVolume(entity, solution.Value); if (volume < MinFootprintVolume) return; @@ -133,6 +158,8 @@ private void FootprintInteraction(Entity entity, Entity if (!_solution.EnsureSolutionEntity(footprint.Value.Owner, FootprintSolution, out _, out var footprintSolution, MaxFootprintVolumeOnTile)) return; + var color = solution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)(standing ? MaxFootprintVolume : MaxBodyprintVolume) / 2f); + _solution.TryTransferSolution(footprintSolution.Value, solution.Value.Comp.Solution, volume); if (footprintSolution.Value.Comp.Solution.Volume >= MaxFootprintVolumeOnTile) @@ -156,9 +183,7 @@ private void FootprintInteraction(Entity entity, Entity x -= MathF.Floor(x) + halfTileSize; y -= MathF.Floor(y) + halfTileSize; - var color = solution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)MaxFootprintVolume); - - footprint.Value.Comp.Footprints.Add(new(new(x, y), rotation, color)); + footprint.Value.Comp.Footprints.Add(new(new(x, y), rotation, color, standing ? "foot" : "body")); Dirty(footprint.Value); @@ -201,6 +226,11 @@ private static FixedPoint2 GetFootprintVolume(Entity en return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxFootprintVolume - MinFootprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxFootVolume) + MinFootprintVolume); } + private static FixedPoint2 GetBodyprintVolume(Entity entity, Entity solution) + { + return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxBodyprintVolume - MinBodyprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxBodyVolume) + MinBodyprintVolume); + } + private bool TryGetAnchoredEntity(Entity grid, Vector2i pos, [NotNullWhen(true)] out Entity? entity) where T : IComponent { var anchoredEnumerator = _map.GetAnchoredEntitiesEnumerator(grid, grid, pos); diff --git a/Content.Shared/Movement/Events/FootstepEvent.cs b/Content.Shared/Movement/Events/FootstepEvent.cs deleted file mode 100644 index 640a2b50c17..00000000000 --- a/Content.Shared/Movement/Events/FootstepEvent.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Content.Shared.Movement.Events; - -public readonly record struct FootstepEvent; // Corvax-Next-Footprints diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index c20bf81c5a2..472d56b1d69 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -255,8 +255,6 @@ protected void HandleMobMovement( if (!weightless && MobMoverQuery.TryGetComponent(uid, out var mobMover) && TryGetSound(weightless, uid, mover, mobMover, xform, out var sound, tileDef: tileDef)) { - RaiseLocalEvent(uid, new FootstepEvent()); // Corvax-Next-Footprints - var soundModifier = mover.Sprinting ? 3.5f : 1.5f; var audioParams = sound.Params diff --git a/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs b/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs index b9fcdf2b6ac..59ffdf20d69 100644 --- a/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs +++ b/Content.Shared/_CorvaxNext/Footprints/FootprintComponent.cs @@ -12,4 +12,4 @@ public sealed partial class FootprintComponent : Component } [Serializable, NetSerializable] -public readonly record struct Footprint(Vector2 Offset, Angle Rotation, Color Color); +public readonly record struct Footprint(Vector2 Offset, Angle Rotation, Color Color, string State); diff --git a/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml b/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml index a2aaee60ead..cf247699f67 100644 --- a/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml +++ b/Resources/Prototypes/Corvax/Entities/Mobs/Species/vulpkanin.yml @@ -71,7 +71,6 @@ types: Asphyxiation: -2.0 - type: Wagging - - type: FootprintOwner # Corvax-Next-Footprints - type: entity save: false diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 7bcdf52088f..8feb0eee057 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -286,6 +286,7 @@ Asphyxiation: -1.0 - type: FireVisuals alternateState: Standing + - type: FootprintOwner # Corvax-Next-Footprints - type: entity save: false diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml index dd4642e0fb5..01f4dba7f5b 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml @@ -29,6 +29,7 @@ - type: Footprint - type: Puddle solution: print + viscosityAffectsMovement: false - type: ExaminableSolution solution: print - type: MixableSolution diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png new file mode 100644 index 0000000000000000000000000000000000000000..74d2aeb0743125350069ff66773c5083326555ff GIT binary patch literal 591 zcmV-V0Px%2}wjjR9J=0SG#fJFc5v~@mQ(>i8v~O${Dx-M`RJch@~j9iV&kKz=0GCC1`*| zHHfFt-~tmqXoVjwd3-P75DQ}8?!E;;;Dzuz^hoNt8B9K7M2OKhWE{Pxk7UdhaYpp}k*Nn{92ypNPXR}$* z+2L@=T{errRjLPcuH6@LP8LRKz%DqHgcJLGKOT=)W1|QdW7dPSiaX$Xu<7Q{TzCmM zJ-lIyUPQFt@2%5hq@xH}@ETf&KJx(Ed;&;k0ApQHO3edvd08DpU<-i1T)~)ZZes8`#V&U0bNy9 z$s;*cf@BS2ST2`eKMesuDfI#Xr_;+&+)hylvYR5jC+J@;%z{rdCag5co)c%vP4AeI0!-NNPYS^%A+;b(RDtx!G)@ zr(iY#4(rHQ`vKmgzlV#bP0l+XkKYGOFD literal 0 HcmV?d00001 diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json new file mode 100644 index 00000000000..b8c2277db9c --- /dev/null +++ b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "IMPERIAL SPACE", + "states": [ + { + "name": "foot" + }, + { + "name": "body" + } + ] +} From 426b3257e1ea825009e91341b34c635238df57d7 Mon Sep 17 00:00:00 2001 From: FN Date: Thu, 19 Dec 2024 07:18:33 +0700 Subject: [PATCH 08/11] Moved things to component --- .../Footprints/FootprintOwnerComponent.cs | 12 ++++++++++++ .../_CorvaxNext/Footprints/FootprintSystem.cs | 16 ++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs index a7132a1bb7a..f54ce6fca50 100644 --- a/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintOwnerComponent.cs @@ -11,6 +11,18 @@ public sealed partial class FootprintOwnerComponent : Component [DataField] public FixedPoint2 MaxBodyVolume = 20; + [DataField] + public FixedPoint2 MinFootprintVolume = 0.5; + + [DataField] + public FixedPoint2 MaxFootprintVolume = 1; + + [DataField] + public FixedPoint2 MinBodyprintVolume = 2; + + [DataField] + public FixedPoint2 MaxBodyprintVolume = 5; + [DataField] public float FootDistance = 0.5f; diff --git a/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs index 71adadc5b43..e45ec5ca9c0 100644 --- a/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs +++ b/Content.Server/_CorvaxNext/Footprints/FootprintSystem.cs @@ -22,14 +22,6 @@ public sealed class FootprintSystem : EntitySystem [Dependency] private readonly SharedPuddleSystem _puddle = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; - public static readonly FixedPoint2 MinFootprintVolume = 0.5; - - public static readonly FixedPoint2 MaxFootprintVolume = 1; - - public static readonly FixedPoint2 MinBodyprintVolume = 2; - - public static readonly FixedPoint2 MaxBodyprintVolume = 5; - public static readonly FixedPoint2 MaxFootprintVolumeOnTile = 50; public static readonly EntProtoId FootprintPrototypeId = "Footprint"; @@ -145,7 +137,7 @@ private void FootprintInteraction(Entity entity, Entity var volume = standing ? GetFootprintVolume(entity, solution.Value) : GetBodyprintVolume(entity, solution.Value); - if (volume < MinFootprintVolume) + if (volume < entity.Comp.MinFootprintVolume) return; if (!TryGetAnchoredEntity(grid, tile, out var footprint)) @@ -158,7 +150,7 @@ private void FootprintInteraction(Entity entity, Entity if (!_solution.EnsureSolutionEntity(footprint.Value.Owner, FootprintSolution, out _, out var footprintSolution, MaxFootprintVolumeOnTile)) return; - var color = solution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)(standing ? MaxFootprintVolume : MaxBodyprintVolume) / 2f); + var color = solution.Value.Comp.Solution.GetColor(_prototype).WithAlpha((float)volume / (float)(standing ? entity.Comp.MaxFootprintVolume : entity.Comp.MaxBodyprintVolume) / 2f); _solution.TryTransferSolution(footprintSolution.Value, solution.Value.Comp.Solution, volume); @@ -223,12 +215,12 @@ private void OnMapInit(Entity entity, ref MapInitEvent e) private static FixedPoint2 GetFootprintVolume(Entity entity, Entity solution) { - return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxFootprintVolume - MinFootprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxFootVolume) + MinFootprintVolume); + return FixedPoint2.Min(solution.Comp.Solution.Volume, (entity.Comp.MaxFootprintVolume - entity.Comp.MinFootprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxFootVolume) + entity.Comp.MinFootprintVolume); } private static FixedPoint2 GetBodyprintVolume(Entity entity, Entity solution) { - return FixedPoint2.Min(solution.Comp.Solution.Volume, (MaxBodyprintVolume - MinBodyprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxBodyVolume) + MinBodyprintVolume); + return FixedPoint2.Min(solution.Comp.Solution.Volume, (entity.Comp.MaxBodyprintVolume - entity.Comp.MinBodyprintVolume) * (solution.Comp.Solution.Volume / entity.Comp.MaxBodyVolume) + entity.Comp.MinBodyprintVolume); } private bool TryGetAnchoredEntity(Entity grid, Vector2i pos, [NotNullWhen(true)] out Entity? entity) where T : IComponent From f36751fd7852498783db30f3f1161ad44fb56453 Mon Sep 17 00:00:00 2001 From: FN Date: Thu, 26 Dec 2024 06:59:23 +0700 Subject: [PATCH 09/11] Some sprites --- .../_CorvaxNext/Effects/footprint.rsi/body.png | Bin 591 -> 779 bytes .../_CorvaxNext/Effects/footprint.rsi/foot.png | Bin 146 -> 659 bytes .../_CorvaxNext/Effects/footprint.rsi/meta.json | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png index 74d2aeb0743125350069ff66773c5083326555ff..9dda6bc78e419976c8696c37b37dea8742f3811b 100644 GIT binary patch delta 755 zcmV zF`eiV9EgaB1DBu^-I&gF4dTRpCvZY_yuOx(=DmRhmn4-`>Z{+}lwS1mzyl8q27}v! zt>0mza5Ng-AV#z>{x*;nicr#Sx6@=Y$=3Dz{mhrxpUq~Gb$>VSbULZq?S7HFJJi5< zmv_BhQ?J)c$Kx>_4u=~cPN!1|!^g)*YW*QRbUvTURq&;__bix})_ci(K2Mj+B}I#B zr45EWWPJ++09eXL%=z#DpTu5VM?QN}EeGGbA0aF`uv)G1nZ;s}NArO>-oVv_hcLwu zV4)#n%)$-C9e+^mk&*+-Y&M%T9*@&{y-v(gMo1(;cp0F~6Rh!we)QD0}t~ z=Zy4`I{xru0<$hvzyh)w@PwWbglFUnL;zS;ha&DN&uAFlBJ*F&@5)dR^nNR$_5`^i z*&mE+T@92ZrE1GI1n}@e24JG;e%*+R1rfs#`#d7R@Sd7GO-<(5Nx;GQidFg<>$Wu z0JTizv4O#>D9}Ne0%|YA=!)Z_G}#Q`hW@8bQo{M zI**q}rOzlXz-vW%0zQe!y6*k8Of0K<@5gI_)H(9w3txi&s|P*-gw7LTWFO2z0000E lWmrjOO-%qQ00008000000002eQd@tb;3u52yz6C(whe4?c z#+Wq`HM`yJ)s8I|i9-&mCXijlgs|^^OZ6LiX-z@+}0u1CJpC5jDmb z6SBtyIiJt72?R6X)^0MHc>6n4k^x;+RmmecRf1#VC0H@RGQ)n)P z5a|0pwEKNe8~R|$2_d{hV+e}SLMio!h@Jp+LWml;6n~)AM?w!lWM#m&@kAVU?0Gu@ z0FY9?ODTVa>^${u2gG*6AORw3ilTTbisCmeqv_l}kJY?w+Z7Qtu^aL|+VG}UO^Ois zNPo;$mZg0ieJ@CAKq>VSx!ZM?1Sh%KY@(-NHUSRn$XENANJGf_H3R;s+HS9IR$Rpo zk=IpK5ibC2x7+CYNe%D=rES~Q;3(_I<42IX1^rj}3qgS4V{~>P#sB~S07*qoM6N<$ Eg8Zcbt^fc4 diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/foot.png b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/foot.png index 6cf329a9b6fe8ddc5af18ec0b463c3a621a252a4..80051d9bd47ba87f3a0adc3d74b45bf7f331f9dd 100644 GIT binary patch delta 635 zcmV->0)+jN0h0xgBYy#eX+uL$Nkc;*aB^>EX>4Tx04R}tkv&MmKpe$iQ$>-AU^|F7 z1gTEeK}8%(6^me@v=v%)FuC*#nlvOSE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JW zDYS_3;J6>}?mh0_0Yam~RI@7zsG4P@;xRFsTNQg=5kL@wn195m#7sSrUd+IAeBHyx z*SiSM@;>+H=vVS41AHQJl<9^=yg@v>Y3ZEzi9@U;Da7Z*69!$7_>t?f%Ws^E4huXp zWMoqF#35p_*uioKvy!0_&k%$1Xmi?dp(vDQ8L3j=v=CCzo3BZy-O2_zvx zMh#_DU?D=QMt_Ql6z#`6{KJkvNiLaOWiWCqpb8a|;|KqP-`$#p=_xlU5CghjZ2Myj z=-CCDb=&?vw(aH#;C}|Lw6?$60OmePueY`E5iqa~TwJ#`c@MbU0fwG*$&eh$Pg5uq zfcG={rW_Ew1^U+9-dg)OeE>4l)$$E+a0rYSDSO@H-G9BEz5RQp)!z>QK62j+lKeRU z000JJOGiWi-2mMH-Srg+od5s;32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Rj3=7MJ0GJEgi*}EIs32&>aR8{x~0Dz7M!}~vup<~nC0000EWmrjOO-%qQ0000800000 V0002eQX delta 118 zcmV-+0Ez#T1(E@fBX0m%Nkln+a diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json index b8c2277db9c..30a355ea35c 100644 --- a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json +++ b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json @@ -4,8 +4,8 @@ "x": 32, "y": 32 }, - "license": "CC-BY-SA-3.0", - "copyright": "IMPERIAL SPACE", + "license": "CC-BY-4.0", + "copyright": "Created by evgen99 (673243657935257617).", "states": [ { "name": "foot" From 881f8a81d20d04012e557940b3f6ffa22e595e19 Mon Sep 17 00:00:00 2001 From: FN Date: Sat, 28 Dec 2024 07:31:36 +0700 Subject: [PATCH 10/11] CleanTileReaction, sounds, localization, and sprite --- .../Chemistry/EntitySystems/VaporSystem.cs | 3 --- .../TileReactions/CleanTileReaction.cs | 7 +++++++ .../Fluids/EntitySystems/PuddleSystem.cs | 2 +- .../Fluids/Components/PuddleComponent.cs | 5 ++++- Content.Shared/Fluids/SharedPuddleSystem.cs | 5 +++++ .../_corvaxnext/entities/effects/footprint.ftl | 2 ++ .../_CorvaxNext/Entities/Effects/footprint.yml | 3 ++- .../_CorvaxNext/Effects/footprint.rsi/body.png | Bin 779 -> 810 bytes 8 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/effects/footprint.ftl diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 590e4df7cf9..c9b64e649e5 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -16,7 +16,6 @@ using Robust.Shared.Prototypes; using Robust.Shared.Spawners; using System.Numerics; -using Content.Server._CorvaxNext.Footprints; namespace Content.Server.Chemistry.EntitySystems { @@ -50,8 +49,6 @@ private void HandleCollide(Entity entity, ref StartCollideEvent _reactive.DoEntityReaction(args.OtherEntity, solution, ReactionMethod.Touch); } - RaiseLocalEvent(args.OtherEntity, new FootprintCleanEvent()); // Corvax-Next-Footprints - // Check for collision with a impassable object (e.g. wall) and stop if ((args.OtherFixture.CollisionLayer & (int) CollisionGroup.Impassable) != 0 && args.OtherFixture.Hard) { diff --git a/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs b/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs index f2d1bcebe1c..3dfe7ac1242 100644 --- a/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs @@ -7,6 +7,8 @@ using Robust.Shared.Map; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using System.Linq; +using Content.Shared._CorvaxNext.Footprints; +using Content.Server._CorvaxNext.Footprints; namespace Content.Server.Chemistry.TileReactions; @@ -57,6 +59,11 @@ IEntityManager entityManager solutionContainerSystem.TryAddSolution(puddleSolution.Value, new Solution(ReplacementReagent, purgeable.Volume)); + // Corvax-Next-Footprints-Start + if (entityManager.HasComponent(entity)) + entityManager.EventBus.RaiseLocalEvent(entity, new FootprintCleanEvent()); + // Corvax-Next-Footprints-End + if (purgeable.Volume <= FixedPoint2.Zero) break; } diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index b59010c4c47..cc1f66aa0ab 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -425,7 +425,7 @@ private void UpdateSlip(EntityUid entityUid, PuddleComponent component, Solution private void UpdateSlow(EntityUid uid, Solution solution, PuddleComponent component) // Corvax-Next-Footprints { // Corvax-Next-Footprints-Start - if (!component.ViscosityAffectsMovement) + if (!component.AffectsMovement) return; // Corvax-Next-Footprints-End diff --git a/Content.Shared/Fluids/Components/PuddleComponent.cs b/Content.Shared/Fluids/Components/PuddleComponent.cs index 3e08a725841..50fc86c3b5c 100644 --- a/Content.Shared/Fluids/Components/PuddleComponent.cs +++ b/Content.Shared/Fluids/Components/PuddleComponent.cs @@ -24,7 +24,10 @@ public sealed partial class PuddleComponent : Component // Corvax-Next-Footprints-Start [DataField] - public bool ViscosityAffectsMovement = true; + public bool AffectsMovement = true; + + [DataField] + public bool AffectsSound = true; // Corvax-Next-Footprints-End } } diff --git a/Content.Shared/Fluids/SharedPuddleSystem.cs b/Content.Shared/Fluids/SharedPuddleSystem.cs index f573c042c55..2b54c961589 100644 --- a/Content.Shared/Fluids/SharedPuddleSystem.cs +++ b/Content.Shared/Fluids/SharedPuddleSystem.cs @@ -73,6 +73,11 @@ private void OnRefillableCanDropDragged(Entity enti private void OnGetFootstepSound(Entity entity, ref GetFootstepSoundEvent args) { + // Corvax-Next-Footprints + if (!entity.Comp.AffectsSound) + return; + // Corvax-Next-Footprints + if (!_solutionContainerSystem.ResolveSolution(entity.Owner, entity.Comp.SolutionName, ref entity.Comp.Solution, out var solution)) return; diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/effects/footprint.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/effects/footprint.ftl new file mode 100644 index 00000000000..52168cf7aaf --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/effects/footprint.ftl @@ -0,0 +1,2 @@ +ent-Footprint = след + .desc = Дорожка из жидкости. diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml index 01f4dba7f5b..a9e12f8a8f3 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Effects/footprint.yml @@ -29,7 +29,8 @@ - type: Footprint - type: Puddle solution: print - viscosityAffectsMovement: false + affectsMovement: false + affectsSound: false - type: ExaminableSolution solution: print - type: MixableSolution diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png index 9dda6bc78e419976c8696c37b37dea8742f3811b..6c2163ba662587128cc5e63bdc6bd291f015d31f 100644 GIT binary patch delta 736 zcmV<60w4X02C4>-G=IlQL_t(oN9~p|uIfMxMFT>JH9!X&g9esBfe=E7f-TU%#-M{W zAR0br^iSjrN%Vj5iYGBrG!xrn-)lRQDT?p-W}qPh)9Lipp!yjx0q67ii@{73=6?Zl zyWL(qZOEGZbl8Nl-|rX81gelG(ek3(Iak=1HdK+;SIq!Uwv!Dh259*;)> zD_P`0Kj>zH929E6TUy960MTVZU*nta5-DtDAow5d^?!o;YI1;}~!}GBy~&^DN*e?gxA~rXGX3Iz<2mbjBg9 zdH&nx-J!!KottJ^#|AaH zXGYZ3WvM&~Wkzs<<=?VQWD%ViBr=PcLJw&Bg4C1UG6OP45S?NRH#?H#)m-TTJ+XFIYlbOiV9)ZX*%3Rwsyc^ucuk=7$ z6V^FylYg1L*=$zUI}Z-oS^zjcolfO(8=2dLZNckw);vGxK7K|R@Fjq}Zg{-rvj-D$ z*UWxR_7}4c{u6+F91e#h(wY6>=j0I^XY6C&=#%~d2%QhPn1S>=&i@4>^)QOTamwE> zGDOC^b_C=y!-LF{S%3V;TTyvE@>+%gD7l!#VO1)T#je)IPc8NfI)HG)^6#p>Aj%S$ z8t2>*L1Aa`Iz7(wCiQxUPT#c|5SiB|-jBy)La(lAj;AL!`K7jLU#naod5^Si`YL~8 S2L1ruzD*6cD^%E%R|5x delta 705 zcmV;y0zUn!28#xeG=Hc`L_t(oN9~qPifSF`eiV9EgaB1DBu^-I&gF z4dTRpCvZY_yuOx(=DmRhmn4-`>Z{+}lwS1mzyl8q27}v!t>0mza5Ng-AV#z>{x*;n zicr#Sx6@=Y$=3Dz{mhrxpUq~GbvN&HI;q?3ev!L7)WCR`cYnQJQ?J)c$Kx>_4u=~c zPN!1|!^g)*YW*QRbUvTURq&;__bix})_ci(K2Mj+B}I#Br45EWWPJ++09eXL%=z#D zpTu5VM?QN}EeGGbA0aF`uv)G1nZ;s}NArO>-oVv_hcLwuV4)#n%)$-C9Z>C&k^{}YUJbzlP`?*993F>d7R@Sd7GO-<(5Nx;GQidFg<>$Wu0JTizv4O#>D Date: Tue, 14 Jan 2025 19:20:02 +0700 Subject: [PATCH 11/11] Sprites --- .../_CorvaxNext/Effects/footprint.rsi/body.png | Bin 810 -> 3287 bytes .../Effects/footprint.rsi/meta.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/body.png index 6c2163ba662587128cc5e63bdc6bd291f015d31f..b6af8f1b598f0292b14a431a740c94688bfe75f6 100644 GIT binary patch literal 3287 zcmc&%Yg7|w8lDtEN-2u28tN?$;+B>qGZPY$2wos6U;{J|fhg!?WmsXLwwL+_6s;G!!-H9UGv#0HP&i>drXXg86 z=J}rY^1RUK;5?89+r9 z699r<(PZVAa-?sFF;d4taZ*WeEII>?27vhK76XcD2@^|66lnAbps&6GWNGjOFqM zaHiiND@U5aN+OK}OT>ZL7zDwrI1vYf5GYoO#IO(u;c+2^3yIi}K#T~)a4c)!0BLhZ zTqTxCW)B#n?-D?@$z%|7xn{GOW9D&4V*wWyi9~)51Yy$%HnmJ|LM?1P75R)oLQt4d zV=!q*JK0!X|1GzOhvkXBC(TG6Xc$F11`nDts7Vt^ zsmb4nWAOE0GzM{!kw8tPF^eP%pDC5`jD>~7as;eb{n|i$damOju#nG!h&Y%h!lPNN zSF<&GoHSF>erE@`2nlK;5bDHE#4h!jZzNIS*RXmBxsV=A1-=K0q}$>ytIgdL}f#c2vmz=o7C4iOlFh;TYvI3`w+Mjc9* zkVc0V5L|=40A&5!nq$L|QOv&$ z5A3D|EcnmcfaUw&){^^^iK!dHGMPK@CiLlZKT`z zf`<9=^j9J!MKUuh=k4x!ZtwV%@PwAUOS}a0P4~~!E~?F+&B7;TXm2(%rXKhX>+U?zYUg}ue z8`0@jJs$0edl7JRfzZprml?Ji#$vLi(4P6eir>{PZvpNP+jk8E;y~nXN0;JyhPGO< z@0+rh!uL}9ExtaJIGUH~yVO;6rdD^S^GxMBdtuX!#wBk|T7!h1Xl(k>{%Q7YwX?`8 znkwBC@IK?!k>?_TxYi2?T>^`5Jg`}2E&a@Sz2dNL-^JP`sU`EZ%ZI5ertr@8WcS2B z)Kmod+(c)pB-~S!j=b<^S?aO;nx%Pdx2*1scEB@s<)a68lYk9&^}UXIlnI5tW%X6| z=AZ52b!W8?b8`!vt`^0d@LO*4w~8ypA(VGzUR!OL*0fv8LU zQP;iWLnoGhxH`tS^ICl}fRudR0GQ-_w>c8bXbAxt%ax^?#`4{c3&k}~7YK#{x!OvX zAXht6;&9ZqE}k1*K^>DuFY(rORuwz>y&W~660p1GG5R-IecJ<=R$uMr)v~oWzPk=I zE9P&@J=%NC&23dMG8Ed4ls>w8G*%d0-Jv)L*tdz+T;8qOI6M(m*^^7)d#A4+$mfh1 zRTc?E$saL28-V!s)0S1!3IN^qY`G5H>8OzNN1kh8MoK;g{_1MgIzMrx`rO0I5UM~m z32au-Qs#VcGUoK(K;#8xgl9Vt3f_LJwW7u)^VXeYMmK(K^v;rm@b(N}UD;LF)Kk^C zq;#rq*o^sFeeUSG`ug)kZd0wU$UG0C62^sfn#6BcR*rpq=g0HMMR5RA-SB>Ynq=j< z;^~K5KiRx7Gc~H~XlK=2t#j{Uq|xrGjlkC0?AArbewG4<4=A zQ*|)B>=OsSda~0M1i0pvz!%&be{gr@t;tqR1MK}@{Be8#2u~&!I)1|`%e3u%x2~L; zw&owbBW440wd}1jg;QSa8{$!DySuxcRv&SAet?Hz5EYEY4teV)Bz_8Pq|y?DlY)=) zsK6N?I~s=m#5+1QQ1f_(!Q;}~EpCLh{nNxOt*(B5EF%DHxxgT6zCriEEv587^x^}@q zz-;T?Yb^_b{v62>cuM%2uGZOI3zVJu(jUREmX4|{%FFX^WBepsf725G)h&x8cn6QV zv_hHLa)#Nn#Z@~N8;v#9o-g+C0&KG#4_*fvf_~cc=xWGiwoSLN$&p(9hY}d9{ysH& zD7cymn>2*C9*cNqhp+fpOm#n&*H**XdYZ^<%TJB4|1dl;c+dGSXnj7_eiztax%C|e zBuXyEN^cs3%SR{Pe+Y%H`nqiA=G&FBFWZY(B}*n+eG{2j6&2Pr?mald6XAYcIA-EWv+WA)Xm7Qc6Djr3!a6(_kM7njO$eV%(gvV2s{oH+T!OS nLzoft|3w&)lcJJJf!FAHu>XgHKEBG_JH9!X& zg9esBfe=E7f-TU%#-M{WAR0br^iSjrN%Vj5iYGBrG!xrn-)lRQDT?p-W}qPh)9Lip zp!yjx0q67ii@{73=6?ZlyWL(qZOEGZbl8Nl-|rX81gelG(ek3(Iak=1Hd zK+;SIq!Uwv!Dh259*;)>D_P`0Kj>zH929E6TUy960MTVZU*nta5-DtDAow5d^?!o;YI1;}~!}GBy~&^DN*e z?gxA~rXGX3Iz<2mbjBg9dH&nx-J!!KottJ^#|AaHXGYZ3WvM&~Wkzs<<=?VQWD%ViBr=PcLJw&Bg4C1UG6OP4 z5S?NRH#?H#)m-TTJ+XFIYlbOiV z9)ZX*%70wjGrSwz#;^21TNBnfZj+h4*=$zUI}Z-oS^zjcolfO(8=2dLZNckw);vGx zK7K|R@Fjq}Zg{-rvj-D$*UWxR_7}4c{u6+F91e#h(wY6>=j0I^XY6C&=#%~d2%QhP zn1S>=&i@4>^)QOTamwE>GDOC^b_C=y!-LF{S!I9x$6HZ(J@Q(H0Vuhc#9=Ct#je)I zPc8NfI)HG)^6#p>Aj%S$8t2>*L1Aa`Iz7(wCiQxUPT#c|5SiB|-jBy)La(lAj;AL! i`K7jLU#naod5^Si`YL~82L1ruzD*6cD^%E%u?!{$>|_i8 diff --git a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json index 30a355ea35c..86a4d9981b8 100644 --- a/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json +++ b/Resources/Textures/_CorvaxNext/Effects/footprint.rsi/meta.json @@ -5,7 +5,7 @@ "y": 32 }, "license": "CC-BY-4.0", - "copyright": "Created by evgen99 (673243657935257617).", + "copyright": "foot.png created by evgen99 (673243657935257617). body.png created by ko4erga (266899933632659456).", "states": [ { "name": "foot"