Skip to content

Commit

Permalink
feat: closet skeleton locker clothing
Browse files Browse the repository at this point in the history
* split skeletons loadouts to be on the locker

* add closet skeleton gear
  • Loading branch information
Doctor-Cpu authored Jan 16, 2025
1 parent 828556b commit 0ca6e7a
Show file tree
Hide file tree
Showing 12 changed files with 447 additions and 4 deletions.
11 changes: 11 additions & 0 deletions Content.Server/ClosetSkeleton/ClosetSkeletonComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.Roles;
using Robust.Shared.Prototypes;

namespace Content.Server.ClosetSkeleton;

[RegisterComponent]
public sealed partial class ClosetSkeletonComponent : Component
{
[DataField]
public ProtoId<StartingGearPrototype>? FallbackEquipment;
}
11 changes: 11 additions & 0 deletions Content.Server/ClosetSkeleton/ClosetSkeletonLockerComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.Roles;
using Robust.Shared.Prototypes;

namespace Content.Server.ClosetSkeleton;

[RegisterComponent]
public sealed partial class ClosetSkeletonLockerComponent : Component
{
[DataField]
public ProtoId<StartingGearPrototype> Equipment;
}
26 changes: 26 additions & 0 deletions Content.Server/ClosetSkeleton/ClosetSkeletonSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Content.Shared.Station;
using Content.Server.StationEvents.Components;

namespace Content.Server.ClosetSkeleton;

public sealed partial class ClosetSkeletonSystem : EntitySystem
{
[Dependency] private readonly SharedStationSpawningSystem _station = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ClosetSkeletonComponent, RandomEntityStorageSpawnedEvent>(OnSpawned);
}

private void OnSpawned(EntityUid uid, ClosetSkeletonComponent component, RandomEntityStorageSpawnedEvent args)
{
if (!TryComp<ClosetSkeletonLockerComponent>(args.Storage, out var lockerComp))
{
_station.EquipStartingGear(uid, component.FallbackEquipment);
return;
}

_station.EquipStartingGear(uid, lockerComp.Equipment);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.StationEvents.Events;
using Content.Server.StationEvents.Events;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

Expand All @@ -16,3 +16,13 @@ public sealed partial class RandomEntityStorageSpawnRuleComponent : Component
[DataField(required: true)]
public EntProtoId Prototype;
}

public sealed partial class RandomEntityStorageSpawnedEvent : EntityEventArgs
{
public EntityUid Storage;

public RandomEntityStorageSpawnedEvent(EntityUid storage)
{
Storage = storage;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ protected override void Started(EntityUid uid, RandomEntityStorageSpawnRuleCompo
if (!_entityStorage.Insert(spawn, locker, storageComp))
{
Del(spawn);
return;
}

var ev = new RandomEntityStorageSpawnedEvent(locker);
RaiseLocalEvent(spawn, ev);
}
}
20 changes: 20 additions & 0 deletions Resources/Prototypes/Catalog/Fills/Lockers/suit_storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
- id: ClothingMaskBreath
- type: AccessReader
access: [["Engineering"]]
- type: ClosetSkeletonLocker
equipment: SkeletonEngineerGear

#Atmospherics hardsuit
- type: entity
Expand All @@ -129,6 +131,8 @@
- id: ClothingMaskBreath
- type: AccessReader
access: [["Atmospherics"]]
- type: ClosetSkeletonLocker
equipment: SkeletonAtmosGear

#Security hardsuit
- type: entity
Expand All @@ -143,6 +147,8 @@
- id: ClothingMaskBreath
- type: AccessReader
access: [["Security"]]
- type: ClosetSkeletonLocker
equipment: SkeletonSecurityOfficerGear

#CE's hardsuit
- type: entity
Expand All @@ -156,6 +162,8 @@
tableId: FillChiefEngineerHardsuit
- type: AccessReader
access: [["ChiefEngineer"]]
- type: ClosetSkeletonLocker
equipment: SkeletonCEGear

#CMO's hardsuit
- type: entity
Expand All @@ -169,6 +177,8 @@
tableId: FillChiefMedicalOfficerHardsuit
- type: AccessReader
access: [ [ "ChiefMedicalOfficer" ] ]
- type: ClosetSkeletonLocker
equipment: SkeletonCMOGear

#RD's hardsuit
- type: entity
Expand All @@ -182,6 +192,8 @@
tableId: FillResearchDirectorHardsuit
- type: AccessReader
access: [ [ "ResearchDirector" ] ]
- type: ClosetSkeletonLocker
equipment: SkeletonRDGear

#HOS's hardsuit
- type: entity
Expand All @@ -195,6 +207,8 @@
tableId: FillHeadOfSecurityHardsuit
- type: AccessReader
access: [["HeadOfSecurity"]]
- type: ClosetSkeletonLocker
equipment: SkeletonHoSGear

#Warden's hardsuit
- type: entity
Expand All @@ -209,6 +223,8 @@
- id: ClothingMaskBreath
- type: AccessReader
access: [["Armory"]]
- type: ClosetSkeletonLocker
equipment: SkeletonWardenGear

#Captain's hardsuit
- type: entity
Expand All @@ -222,6 +238,8 @@
tableId: FillCaptainHardsuit
- type: AccessReader
access: [["Captain"]]
- type: ClosetSkeletonLocker
equipment: SkeletonCaptainGear

#Salvage hardsuit
- type: entity
Expand All @@ -235,6 +253,8 @@
tableId: FillSalvageSpecialistHardsuitSpatio
- type: AccessReader
access: [["Salvage"]]
- type: ClosetSkeletonLocker
equipment: SkeletonSalvageGear

#Blood-red hardsuit
- type: entity
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Mobs/Player/skeleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
raffle:
settings: default
- type: GhostTakeoverAvailable
- type: Loadout
prototypes: [LimitedPassengerGear]
- type: ClosetSkeleton
fallbackEquipment: LimitedPassengerGear
- type: RandomHumanoidAppearance
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
node: done
containers:
- entity_storage
- type: ClosetSkeletonLocker
equipment: LimitedPassengerGear

- type: entity
id: LockerBaseSecure
Expand Down
Loading

0 comments on commit 0ca6e7a

Please sign in to comment.