Split decal cleaner into Broom + Max Gab papers and hair (#470)

* add broom

* water fix

* new hair

* paper added

* feather pen

* some unfinished inkwell

* inkstorage

* Update meta.json

* fixes
This commit is contained in:
Ed
2024-09-29 11:02:39 +03:00
committed by GitHub
parent 9f93931057
commit 4d9e657f6f
41 changed files with 361 additions and 54 deletions

View File

@@ -57,6 +57,13 @@ public sealed partial class StencilOverlay : Overlay
_blep = _clyde.CreateRenderTarget(args.Viewport.Size, new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "weather-stencil");
}
//CP14 Overlays
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
{
DrawWorldEdge(args, worldEdge, invMatrix);
}
//CP14 Overlays end
if (_entManager.TryGetComponent<WeatherComponent>(mapUid, out var comp))
{
foreach (var (proto, weather) in comp.Weather)
@@ -79,11 +86,6 @@ public sealed partial class StencilOverlay : Overlay
{
DrawCloudShadows(args, shadows, invMatrix);
}
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
{
DrawWorldEdge(args, worldEdge, invMatrix);
}
//CP14 Overlays end
args.WorldHandle.UseShader(null);

View File

@@ -1,5 +1,8 @@
using System.Numerics;
using Content.Server._CP14.Footprints.Components;
using Content.Server.Decals;
using Content.Shared._CP14.Decals;
using Content.Shared.DoAfter;
using Content.Shared.Fluids;
using Content.Shared.Fluids.Components;
using Content.Shared.Interaction;
@@ -12,7 +15,7 @@ using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.FootStep;
namespace Content.Server._CP14.Footprints;
public sealed class CP14FootprintsSystem : EntitySystem
{
@@ -20,28 +23,28 @@ public sealed class CP14FootprintsSystem : EntitySystem
[Dependency] private readonly SharedMapSystem _maps = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14FootprintTrailerComponent, MoveEvent>(OnTrailerMove);
SubscribeLocalEvent<CP14FootprintTrailerComponent, StartCollideEvent>(OnTrailerCollide);
SubscribeLocalEvent<Components.CP14FootprintTrailerComponent, MoveEvent>(OnTrailerMove);
SubscribeLocalEvent<Components.CP14FootprintTrailerComponent, StartCollideEvent>(OnTrailerCollide);
SubscribeLocalEvent<CP14FootprintHolderComponent, GotEquippedEvent>(OnHolderEquipped);
SubscribeLocalEvent<CP14FootprintHolderComponent, GotUnequippedEvent>(OnHolderUnequipped);
SubscribeLocalEvent<CP14DecalCleanerComponent, BeforeRangedInteractEvent>(OnBeforeInteract);
SubscribeLocalEvent<CP14DecalCleanerComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<CP14DecalCleanerComponent, CP14DecalCleanerDoAfterEvent>(OnCleanDoAfter);
}
private void OnBeforeInteract(Entity<CP14DecalCleanerComponent> ent, ref BeforeRangedInteractEvent args)
private void OnCleanDoAfter(Entity<CP14DecalCleanerComponent> ent, ref CP14DecalCleanerDoAfterEvent args)
{
if (!args.CanReach)
if (args.Cancelled || args.Handled)
return;
// Remove old decals
var gridUid = Transform(ent).GridUid;
if (gridUid is null)
return;
@@ -49,27 +52,43 @@ public sealed class CP14FootprintsSystem : EntitySystem
if (!TryComp<MapGridComponent>(gridUid, out var map))
return;
var vec = _transform.GetGridOrMapTilePosition(ent);
var tileCenterVec = vec + map.TileSizeHalfVector;
var oldDecals = _decal.GetDecalsInRange(gridUid.Value, tileCenterVec, ent.Comp.Range);
if (oldDecals.Count > 0)
{
_audio.PlayPvs(ent.Comp.Sound, args.ClickLocation);
SpawnAtPosition(ent.Comp.SpawnEffect, args.ClickLocation);
}
var coord = EntityManager.GetCoordinates(args.ClickLocation);
_audio.PlayPvs(ent.Comp.Sound, coord);
SpawnAtPosition(ent.Comp.SpawnEffect, coord);
var oldDecals = _decal.GetDecalsInRange(gridUid.Value, args.ClickLocation.Position, ent.Comp.Range);
foreach (var (id, decal) in oldDecals)
{
if (decal.Cleanable)
_decal.RemoveDecal(gridUid.Value, id);
}
args.Handled = true;
}
private void OnAfterInteract(Entity<CP14DecalCleanerComponent> ent, ref AfterInteractEvent args)
{
if (!args.CanReach && !args.Handled)
return;
var doAfter = new DoAfterArgs(EntityManager,
args.User,
ent.Comp.Delay,
new CP14DecalCleanerDoAfterEvent(EntityManager.GetNetCoordinates(args.ClickLocation)),
ent)
{
BreakOnMove = true,
BreakOnDamage = true,
NeedHand = true,
};
_doAfter.TryStartDoAfter(doAfter);
args.Handled = true;
}
private void OnHolderUnequipped(Entity<CP14FootprintHolderComponent> ent, ref GotUnequippedEvent args)
{
if (!TryComp<CP14FootprintTrailerComponent>(args.Equipee, out var trailer))
if (!TryComp<Components.CP14FootprintTrailerComponent>(args.Equipee, out var trailer))
return;
trailer.holder = null;
@@ -82,13 +101,13 @@ public sealed class CP14FootprintsSystem : EntitySystem
private void OnHolderEquipped(Entity<CP14FootprintHolderComponent> ent, ref GotEquippedEvent args)
{
if (!TryComp<CP14FootprintTrailerComponent>(args.Equipee, out var trailer))
if (!TryComp<Components.CP14FootprintTrailerComponent>(args.Equipee, out var trailer))
return;
trailer.holder = ent.Comp;
}
private void OnTrailerCollide(Entity<CP14FootprintTrailerComponent> ent, ref StartCollideEvent args)
private void OnTrailerCollide(Entity<Components.CP14FootprintTrailerComponent> ent, ref StartCollideEvent args)
{
if (ent.Comp.holder is null)
return;
@@ -114,7 +133,7 @@ public sealed class CP14FootprintsSystem : EntitySystem
comp.Intensity = 1f;
}
private void OnTrailerMove(Entity<CP14FootprintTrailerComponent> ent, ref MoveEvent args)
private void OnTrailerMove(Entity<Components.CP14FootprintTrailerComponent> ent, ref MoveEvent args)
{
if (ent.Comp.holder is null)
return;

View File

@@ -1,20 +1,26 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.FootStep;
namespace Content.Server._CP14.Footprints.Components;
/// <summary>
///
/// allows you to remove cleanable decals from tiles with a short delay.
/// </summary>
[RegisterComponent, Access(typeof(CP14FootprintsSystem))]
public sealed partial class CP14DecalCleanerComponent : Component
{
[DataField]
public SoundSpecifier Sound = new SoundCollectionSpecifier("CP14Broom");
public SoundSpecifier Sound = new SoundCollectionSpecifier("CP14Broom")
{
Params = AudioParams.Default.WithVariation(0.2f),
};
[DataField]
public EntProtoId? SpawnEffect = "CP14DustEffect";
[DataField]
public float Range = 1.5f;
public float Range = 1.2f;
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(0.75f);
}

View File

@@ -2,7 +2,7 @@ using Content.Shared.Decals;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
namespace Content.Server._CP14.FootStep;
namespace Content.Server._CP14.Footprints.Components;
/// <summary>
/// stores the type of footprints and their settings.

View File

@@ -1,5 +1,4 @@
namespace Content.Server._CP14.FootStep;
namespace Content.Server._CP14.Footprints.Components;
/// <summary>
/// allows an entity to leave footprints on the tiles

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Fluids;
public abstract partial class SharedPuddleSystem
{
[ValidatePrototypeId<ReagentPrototype>]
private const string Water = "CP14Water"; //CP14 Water
private const string Water = "Water";
public static readonly string[] EvaporationReagents = [Water];

View File

@@ -0,0 +1,18 @@
using Content.Shared.DoAfter;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.Decals;
[Serializable, NetSerializable]
public sealed partial class CP14DecalCleanerDoAfterEvent : DoAfterEvent
{
public NetCoordinates ClickLocation;
public CP14DecalCleanerDoAfterEvent(NetCoordinates click)
{
ClickLocation = click;
}
public override DoAfterEvent Clone() => this;
}

View File

@@ -16,4 +16,5 @@ marking-CP14HumanHairSwept2 = Swept
marking-CP14HumanHairUpdo = Updo
marking-CP14HumanHairVLongFringe = Straight bangs
marking-CP14HumanHairVolaju = Volaju
marking-CP14HumanHairWisp = Wisp
marking-CP14HumanHairWisp = Wisp
marking-CP14HumanHairMaxyShagy = Maximum Shagginess

View File

@@ -16,4 +16,5 @@ marking-CP14HumanHairSwept2 = Суровый взгляд
marking-CP14HumanHairUpdo = Пучок
marking-CP14HumanHairVLongFringe = Прямая челка
marking-CP14HumanHairVolaju = Вояж
marking-CP14HumanHairWisp = Огонек
marking-CP14HumanHairWisp = Огонек
marking-CP14HumanHairMaxyShagy = Максимальная лохматость

View File

@@ -148,4 +148,12 @@
markingCategory: Hair
sprites:
- sprite: _CP14/Mobs/Customization/human_hair.rsi
state: wisp
state: wisp
- type: marking
id: CP14HumanHairMaxyShagy
bodyPart: Hair
markingCategory: Hair
sprites:
- sprite: _CP14/Mobs/Customization/human_hair.rsi
state: maxy_shagy

View File

@@ -0,0 +1,74 @@
- type: entity
parent: BaseItem
id: CP14BasePaper
abstract: true
components:
- type: Paper
- type: PaperLabelType
- type: ActivatableUI
key: enum.PaperUiKey.Key
requiresComplex: false
- type: UserInterface
interfaces:
enum.PaperUiKey.Key:
type: PaperBoundUserInterface
- type: Item
size: Tiny
- type: Appearance
- type: PaperVisuals
- type: Flammable
fireSpread: true
alwaysCombustible: true
damage:
types:
Heat: 1
- type: FireVisuals
sprite: Effects/fire.rsi
normalState: fire
- type: Damageable
damageModifierSet: Wood
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 15
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
Ash:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Food
solution: food
delay: 7
forceFeedDelay: 7
- type: FlavorProfile
flavors:
- paper
- type: BadFood
- type: SolutionContainerManager
solutions:
food:
maxVol: 1
reagents:
- ReagentId: Fiber
Quantity: 1
- type: entity
parent: CP14BasePaper
id: CP14Paper
name: paper
description: A piece of white paper
components:
- type: Sprite
sprite: _CP14/Objects/Bureaucracy/paper.rsi
layers:
- state: paper
- state: paper_filled
map: ["enum.PaperVisualLayers.Writing"]
visible: false
#- state: paper_stamp-generic
# map: ["enum.PaperVisualLayers.Stamp"]
# visible: false

View File

@@ -0,0 +1,54 @@
- type: entity
parent: Pen
id: CP14PenFeather
name: fountain pen
description: A sharp clipped feather of a bird, adapted as a writing implement.
components:
- type: Sprite
sprite: _CP14/Objects/Bureaucracy/pens.rsi
state: feather
- type: Item
sprite: _CP14/Objects/Bureaucracy/pens.rsi
heldPrefix: feather
size: Tiny
- type: Tag
tags:
- Write
- Pen
- CP14InkwellFittable
# TODO: Чернильницу нужно доделать. Перо должно быть видно, пока оно внутри чернильницы. Предмет должен быть через ItemSlots, чтобы перо вставлять забирать можно было кликом. Нужно добавить прикольные звуки вставляния, выставляния. И добавить механ, который будет требовать периодически макать перо в чернильницу.
- type: entity
parent: BaseItem
id: CP14Inkwell
name: inkwell
description: An endless (for now) source of ink for your letters
components:
- type: Sprite
sprite: _CP14/Objects/Bureaucracy/inkwell.rsi
drawdepth: SmallObjects
layers:
- state: icon
- state: feather
map: ["enum.StorageFillLayers.Fill"]
visible: false
#- type: Appearance
#- type: StorageFillVisualizer
# maxFillLevels: 1
# fillBaseName: fill
- type: Pullable
- type: Storage
grid:
- 0,0,0,0
maxItemSize: Tiny
whitelist:
tags:
- CP14InkwellFittable
- type: UserInterface
interfaces:
enum.StorageUiKey.Key:
type: StorageBoundUserInterface
- type: InteractionOutline
- type: ContainerContainer
containers:
storagebase: !type:Container

View File

@@ -210,7 +210,7 @@
Quantity: 4
- ReagentId: Vitamin
Quantity: 2
- ReagentId: CP14Water
- ReagentId: Water
Quantity: 3
- type: FoodSequenceElement
entries:

View File

@@ -31,4 +31,27 @@
solutions:
absorbed:
maxVol: 100
- type: CP14DecalCleaner
- type: entity
id: CP14BaseBroom
parent:
- BaseItem
- CP14BaseWeaponDestructible
name: wooden broom
description: Sweeps up dried footprints and other stains from the floor
components:
- type: Item
size: Large
sprite: _CP14/Objects/Tools/broom.rsi
- type: Sprite
sprite: _CP14/Objects/Tools/broom.rsi
state: icon
- type: MeleeWeapon
wideAnimationRotation: 10
damage:
types:
Blunt: 2
soundHit:
collection: MetalThud
- type: CP14DecalCleaner
delay: 0.75

View File

@@ -52,7 +52,7 @@
pool:
maxVol: 9999999 #.inf seems to break the whole yaml file, but would definitely be preferable.
reagents:
- ReagentId: CP14Water
- ReagentId: Water
Quantity: 9999999
- type: DrainableSolution
solution: pool

View File

@@ -101,7 +101,7 @@
solutions:
barrel:
reagents:
- ReagentId: CP14Water
- ReagentId: Water
Quantity: 300
- type: entity

View File

@@ -1,6 +1,6 @@
- type: CP14PlantMetabolizer
id: Base
metabolization:
CP14Water:
Water:
- !type:AffectPlantValues
resource: 1

View File

@@ -1,7 +0,0 @@
- type: reagent
parent: Water
id: CP14Water
name: cp14-reagent-name-water
desc: cp14-reagent-desc-water
flavor: CP14Water
color: "#75b1f0"

View File

@@ -41,4 +41,14 @@
stacks:
CP14WoodenPlanks: 2
CP14Cloth: 1
result: CP14BaseMop
result: CP14BaseMop
- type: CP14Recipe
id: CP14BaseBroom
tag: CP14RecipeWorkbench
craftTime: 3
entities:
CP14Wheat: 2
stacks:
CP14WoodenPlanks: 2
result: CP14BaseBroom

View File

@@ -31,6 +31,9 @@
- type: Tag
id: CP14Plate
- type: Tag
id: CP14InkwellFittable
- type: Tag
id: CP14RecipeSewing

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

View File

@@ -4,7 +4,7 @@
"x": 48,
"y": 48
},
"copyright": "Taken from https://github.com/tgstation/tgstation/blob/05ec94e46349c35e29ca91e5e97d0c88ae26ad44/icons/mob/species/human/human_face.dmi ,resprited by Alekshhh, a modified by potato1234x, uneven and tailed is drawn by Ubaser, adapted to CrystallPunk by TheShuEd. Crazybald by TheShuEd",
"copyright": "Taken from https://github.com/tgstation/tgstation/blob/05ec94e46349c35e29ca91e5e97d0c88ae26ad44/icons/mob/species/human/human_face.dmi ,resprited by Alekshhh, a modified by potato1234x, uneven and tailed is drawn by Ubaser, adapted to CrystallPunk by TheShuEd. Crazybald by TheShuEd, maxy_shagy by Max Gab",
"license": "CC-BY-SA-3.0",
"states": [
{
@@ -55,6 +55,10 @@
"name": "doublebun",
"directions": 4
},
{
"name": "maxy_shagy",
"directions": 4
},
{
"name": "ponytail7",
"directions": 4

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

View File

@@ -0,0 +1,23 @@
{
"version": 1,
"license": "CLA",
"copyright": "Created by Max Gab for CrystallPunk",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "feather"
},
{
"name": "ink_storage_big"
},
{
"name": "ink_storage_small"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

View File

@@ -0,0 +1,25 @@
{
"version": 1,
"license": "CLA",
"copyright": "Created by Max Gab for CrystallPunk",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "paper"
},
{
"name": "paper_filled"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CLA",
"copyright": "Created by Max Gab for CrystallPunk",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "feather"
},
{
"name": "feather-inhand-left",
"directions": 4
},
{
"name": "feather-inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CLA",
"copyright": "Created by TheShuEd (Discord)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

View File

@@ -18,11 +18,11 @@
"name": "inhand-right",
"directions": 4
},
{
{
"name": "wielded-inhand-left",
"directions": 4
},
{
{
"name": "wielded-inhand-right",
"directions": 4
}