Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

[Tweak] Legacy Puddles #3

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Content.Client/Fluids/PuddleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
using Content.Shared.Fluids.Components;
using Robust.Client.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Maths; // Everwood
using Robust.Shared.Random; // Everwood

namespace Content.Client.Fluids;

public sealed class PuddleSystem : SharedPuddleSystem
{
[Dependency] private readonly IconSmoothSystem _smooth = default!;
[Dependency] private readonly IRobustRandom _random = default!; // Everwood

public override void Initialize()
{
Expand All @@ -22,14 +25,16 @@ private void OnPuddleAppearance(EntityUid uid, PuddleComponent component, ref Ap
{
if (args.Sprite == null)
return;

/* Everwood REMOVE | Legacy Puddle
var volume = 1f;

if (args.AppearanceData.TryGetValue(PuddleVisuals.CurrentVolume, out var volumeObj))
{
volume = (float) volumeObj;
}
*/

/* Everwood REMOVE | Legacy Puddle
// Update smoothing and sprite based on volume.
if (TryComp<IconSmoothComponent>(uid, out var smooth))
{
Expand All @@ -53,6 +58,13 @@ private void OnPuddleAppearance(EntityUid uid, PuddleComponent component, ref Ap
}
}
}
*/

// Everwood
if (TryComp<SpriteComponent>(uid, out var sprite))
{
RandomizeRotation(sprite);
}

var baseColor = Color.White;

Expand Down Expand Up @@ -100,4 +112,12 @@ public override bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUi
}

#endregion Spill

// Everwood Start
private void RandomizeRotation(SpriteComponent sprite)
{
float rotationDegrees = _random.Next(0, 359); // Randomly select a rotation for puddle sprite.
sprite.Rotation = Angle.FromDegrees(rotationDegrees); // Sets the sprite rotation to the one we randomly selected.
}
// Everwood End
}
28 changes: 21 additions & 7 deletions Resources/Prototypes/Entities/Effects/puddle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,26 @@
- type: Transform
noRot: true
anchored: true
- type: Sprite
- type: Sprite # Everwood-EDIT Start
sprite: _Everwood/Fluids/puddle.rsi
layers:
- sprite: Fluids/puddle.rsi
state: splat0
- state: puddle-0
drawdepth: FloorObjects
color: "#FFFFFF80"
- type: RandomSprite
available:
- 0:
puddle-0: ""
puddle-1: ""
puddle-2: ""
puddle-3: ""
puddle-4: ""
puddle-5: ""
puddle-6: ""
puddle-7: ""
puddle-8: ""
puddle-9: ""
puddle-10: "" # Everwood-EDIT End
- type: Physics
bodyType: Static
- type: Fixtures
Expand All @@ -136,10 +150,10 @@
layer:
- SlipLayer
hard: false
- type: IconSmooth
key: puddles
base: splat
mode: CardinalFlags
# - type: IconSmooth # Everwood - Legacy Puddles
# key: puddles
# base: splat
# mode: CardinalFlags
- type: SolutionContainerManager
solutions:
puddle:
Expand Down
44 changes: 44 additions & 0 deletions Resources/Textures/_Everwood/Fluids/puddle.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "https://github.com/discordia-space/CEV-Eris/raw/aff0d780742ca3902d8b05f854c212c8cda32c4f/icons/effects/blood.dmi",
"states": [
{
"name": "puddle-0"
},
{
"name": "puddle-1"
},
{
"name": "puddle-2"
},
{
"name": "puddle-3"
},
{
"name": "puddle-4"
},
{
"name": "puddle-5"
},
{
"name": "puddle-6"
},
{
"name": "puddle-7"
},
{
"name": "puddle-8"
},
{
"name": "puddle-9"
},
{
"name": "puddle-10"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading