Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing map stuff part 1 #64

Merged
merged 9 commits into from
Sep 29, 2023
Merged
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
11 changes: 11 additions & 0 deletions Content.Client/Nyanotrasen/Laundry/LaundryVisuals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Client.Laundry;

public enum WashingMachineVisualLayers : byte
{
Normal,
Broken,
Contents,
NormalDoor,
BrokenDoor,
}

45 changes: 45 additions & 0 deletions Content.Server/Nyanotrasen/Laundry/LaundrySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Robust.Shared.Containers;
using Content.Shared.Destructible;
using Content.Shared.Laundry;
using Content.Shared.Storage;

namespace Content.Server.Laundry;

// I just wanted the sprite to change states when it broke.

public sealed class LaundrySystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SharedWashingMachineComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<SharedWashingMachineComponent, BreakageEventArgs>(OnBreak);
SubscribeLocalEvent<SharedWashingMachineComponent, EntInsertedIntoContainerMessage>(OnContainerModified);
SubscribeLocalEvent<SharedWashingMachineComponent, EntRemovedFromContainerMessage>(OnContainerModified);

}

private void OnMapInit(EntityUid uid, SharedWashingMachineComponent component, MapInitEvent args)
{
if (!_containerSystem.TryGetContainer(uid, "storagebase", out var container))
return;

_appearanceSystem.SetData(uid, StorageVisuals.HasContents, container.ContainedEntities.Count > 0);
}

private void OnBreak(EntityUid uid, SharedWashingMachineComponent component, BreakageEventArgs args)
{
_appearanceSystem.SetData(uid, WashingMachineVisualState.Broken, true);
}

private void OnContainerModified(EntityUid uid, SharedWashingMachineComponent component, ContainerModifiedMessage args)
{
if (args.Container.ID == "storagebase")
_appearanceSystem.SetData(uid, StorageVisuals.HasContents, args.Container.ContainedEntities.Count > 0);
}
}

12 changes: 12 additions & 0 deletions Content.Shared/Nyanotrasen/Laundry/SharedLaundry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Robust.Shared.Serialization;

namespace Content.Shared.Laundry;

[RegisterComponent]
public partial class SharedWashingMachineComponent : Component { } //Hi, I'm no coder but the word "partial" used to be "sealed" o3o

[Serializable, NetSerializable]
public enum WashingMachineVisualState : byte
{
Broken,
}
7 changes: 7 additions & 0 deletions Resources/Audio/Nyanotrasen/Machines/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- files:
- "washer_open.ogg"
- "washer_close.ogg"
license: "CC-BY-4.0"
copyright: "https://freesound.org/people/soundmary/"
source: "https://freesound.org/people/soundmary/sounds/194994/"

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@
proto: ShellShotgun
soundInsert:
path: /Audio/Weapons/Guns/MagIn/shotgun_insert.ogg


- type: entity
name: Kammerer
parent: BaseWeaponShotgun
id: WeaponShotgunKammererNonLethal #Legacy name
description: When an old Remington design meets modern materials, this is the result. A favourite weapon of militia forces throughout many worlds. Uses .50 shotgun shells.
suffix: Beanbag
components:
- type: Sprite
sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
- type: Clothing
sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
- type: BallisticAmmoProvider
capacity: 4
proto: ShellShotgunBeanbag
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- type: entity
parent: Holoprojector
id: HoloprojectorEngineering
name: engineering holoprojector
description: Displays a warning sign.
components:
- type: HolosignProjector
signProto: HolosignEng
- type: Sprite
sprite: Nyanotrasen/Objects/Devices/Holoprojectors/eng.rsi
state: icon
- type: ItemSlots
slots:
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMedium
locked: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- type: entity
id: HolosignEng
name: engineering warning sign
description: What's the worst that could lie beyond?
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Holo/eng.rsi
state: icon
- type: TimedDespawn
lifetime: 180
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
- type: entity
id: WashingMachine
parent: BaseStructureDynamic
name: washing machine
description: A machine that washes clothes with a spinning steel drum in a shiny frame.
components:
- type: Sprite
noRot: true
sprite: Nyanotrasen/Structures/Machines/washer.rsi
layers:
# GenericVisualizer doesn't have a way to deal with multiple conditions at
# once. So have all the layers ready to go, but don't show them unless
# they're relevant.
#
# If we actually get more complex interactions with washing machines later,
# we can take a look at making this cleaner.
- map: ["enum.WashingMachineVisualLayers.Normal"]
state: "normal-base"
- map: ["enum.WashingMachineVisualLayers.Broken"]
state: "broken-base"
visible: false
- map: ["enum.WashingMachineVisualLayers.Contents"]
state: "stuff"
visible: false
- map: ["enum.WashingMachineVisualLayers.NormalDoor"]
state: "normal-closed"
- map: ["enum.WashingMachineVisualLayers.BrokenDoor"]
state: "broken-closed"
visible: false
- type: Appearance
- type: GenericVisualizer
visuals:
enum.WashingMachineVisualState.Broken:
enum.WashingMachineVisualLayers.Normal:
True: { visible: false }
False: { visible: true }
enum.WashingMachineVisualLayers.NormalDoor:
True: { visible: false }
False: { visible: true }
enum.WashingMachineVisualLayers.Broken:
True: { visible: true }
False: { visible: false }
enum.WashingMachineVisualLayers.BrokenDoor:
True: { visible: true }
False: { visible: false }
enum.StorageVisuals.HasContents:
enum.WashingMachineVisualLayers.Contents:
True: { visible: true }
False: { visible: false }
enum.StorageVisuals.Open:
enum.WashingMachineVisualLayers.NormalDoor:
True: { state: "normal-open" }
False: { state: "normal-closed" }
enum.WashingMachineVisualLayers.BrokenDoor:
True: { state: "broken-open" }
False: { state: "broken-closed" }
- type: WashingMachine
- type: InteractionOutline
- type: Physics
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.35,-0.25,0.35,0.49"
density: 600
mask:
- MachineMask
layer:
- MachineLayer
- type: Climbable
delay: 1.6
- type: Storage
capacity: 240
storageOpenSound:
path: /Audio/Nyanotrasen/Machines/washer_open.ogg
storageCloseSound:
path: /Audio/Nyanotrasen/Machines/washer_close.ogg
- type: ContainerContainer
containers:
storagebase: !type:Container
ents: []
- type: UserInterface
interfaces:
- key: enum.StorageUiKey.Key
type: StorageBoundUserInterface
- type: UseDelay
delay: 0.5
- type: Repairable
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 200
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Destruction"]
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
- !type:EmptyAllContainersBehaviour
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Breakage"]

- type: entity
id: WashingMachineBroken
parent: WashingMachine
name: washing machine
suffix: broken
description: A shattered mess of glass and steel that won't be washing anything anytime soon. It looks dusty.
components:
- type: Sprite
layers:
- map: ["enum.WashingMachineVisualLayers.Broken"]
state: "broken-base"
- map: ["enum.WashingMachineVisualLayers.Contents"]
state: "stuff"
visible: false
- map: ["enum.WashingMachineVisualLayers.BrokenDoor"]
state: "broken-closed"
- type: Appearance
- type: GenericVisualizer
visuals:
enum.StorageVisuals.HasContents:
enum.WashingMachineVisualLayers.Contents:
True: { visible: true }
False: { visible: false }
enum.StorageVisuals.Open:
enum.WashingMachineVisualLayers.BrokenDoor:
True: { state: "broken-open" }
False: { state: "broken-closed" }
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 150
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Destruction"]

- type: entity
id: WashingMachineFilledClothes
parent: WashingMachine
name: washing machine
suffix: random clothes
components:
- type: StorageFill
contents:
- id: Soap
prob: 0.3
- id: ClothingOuterWinterCoatPlaid
prob: 0.5
- id: ClothingUniformMNKTracksuitBlack
prob: 0.3
- id: ClothingCostumeNaota
prob: 0.2
- id: ClothingHeadBandSkull
prob: 0.2
- id: ClothingNeckScarfStripedBlue
prob: 0.3

Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,67 @@
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/Hyenh.rsi
state: northwaymap

# SAFETY MOTH
# Actual original art credit to AspEv
# Some posters are in the upstream posters.yml

- type: entity
parent: PosterBase
id: PosterContrabandSafetyMothSyndie
name: Syndie Moth - Nuclear Operation
description: Syndie Moth™ tells the viewer to keep the nuclear authentication disk unsecured. "Peace was never an option!"
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_0

- type: entity
parent: PosterBase
id: PosterLegitSafetyMothPoisoning
name: Safety Moth - Poisoning
description: Safety Moth™ tells the viewer not to poison the station donuts.
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_1

- type: entity
parent: PosterBase
id: PosterLegitSafetyMothBoH
name: Safety Moth - Bag of Holding
description: Safety Moth™ informs the viewer of the dangers of Bags of Holding. "Remember! Bags of Holding may be pretty, but they're also pretty dangerous! Never put one inside another!"
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_2

- type: entity
parent: PosterBase
id: PosterLegitSafetyMothFires
name: Safety Moth - Fires
description: Safety Moth™ promotes safe handling of plasma and to keep firefighting equipment within hand reach.
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_4

- type: entity
parent: PosterBase
id: PosterLegitSafetyMothPills
name: Safety Moth - Pill Bottles
description: Safety Moth™ informs the viewer that leaving pills unsupervised on tables could lead to unforeseen consequences. "Hungry critters love to eat everything! Keep your pills safe in crates and pill bottles!"
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_9

- type: entity
parent: PosterBase
id: PosterLegitSafetyMothGlimmer
name: Safety Moth - Glimmer Safety Precautions
description: Safety Moth™ tells the viewer to wear insulative equipments and hide in lockers when the glimmer gets within critical levels. Evacuating might be a better strategy.
components:
- type: Sprite
sprite: Nyanotrasen/Structures/Wallmounts/Posters/safetymoth.rsi
state: safetymoth_11
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading