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

Fix cloth chairs to not claim your soul #2678

Merged
merged 4 commits into from
Jan 12, 2025
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
44 changes: 44 additions & 0 deletions Content.Server/_NF/Construction/Conditions/NFStrapEmpty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Content.Shared.Construction;
using JetBrains.Annotations;
using Content.Shared.Examine;
using Content.Shared.Buckle.Components;

namespace Content.Server.Construction.Conditions;

[UsedImplicitly]
[DataDefinition]
public sealed partial class NFStrapEmpty : IGraphCondition
{
public bool Condition(EntityUid uid, IEntityManager entityManager)
{
if (!entityManager.TryGetComponent(uid, out StrapComponent? strap))
return true; // No strap, nothing can be buckled.

return strap.BuckledEntities.Count == 0;
}

public bool DoExamine(ExaminedEvent args)
{
var entity = args.Examined;

var entMan = IoCManager.Resolve<IEntityManager>();

if (!entMan.TryGetComponent(entity, out StrapComponent? strap)) return false;

if (strap.BuckledEntities.Count > 0)
{
args.PushMarkup(Loc.GetString("construction-examine-condition-nf-strap-empty", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
return true;
}

return false;
}

public IEnumerable<ConstructionGuideEntry> GenerateGuideEntry()
{
yield return new ConstructionGuideEntry()
{
Localization = "construction-step-condition-nf-strap-empty"
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NFBuckled
construction-examine-condition-nf-strap-empty = Unbuckle everything from the {$entityName}.
construction-step-condition-nf-strap-empty = Nothing must be buckled.
Original file line number Diff line number Diff line change
Expand Up @@ -191,53 +191,62 @@
steps:
- tool: Screwing
doAfter: 1

#Frontier: fancy wooden chairs
# Frontier: fancy wooden chairs
- to: chairWoodFancyBlack
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetBlack
amount: 1

- to: chairWoodFancyBlue
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetBlue
amount: 1

- to: chairWoodFancyCyan
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetCyan
amount: 1

- to: chairWoodFancyGreen
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetGreen
amount: 1

- to: chairWoodFancyOrange
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetOrange
amount: 1

- to: chairWoodFancyPurple
steps:
- material: FloorCarpetPurple
amount: 1

- to: chairWoodFancyPink
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetPink
amount: 1

- to: chairWoodFancyPurple
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetPurple
amount: 1
- to: chairWoodFancyRed
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetRed
amount: 1

- to: chairWoodFancyWhite
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetWhite
amount: 1
#End Frontier
# End Frontier

- node: chairMeat
entity: ChairMeat
Expand Down Expand Up @@ -329,6 +338,8 @@
entity: ChairWoodFancyBlack
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemBlack
Expand All @@ -341,6 +352,8 @@
entity: ChairWoodFancyBlue
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemBlue
Expand All @@ -353,6 +366,8 @@
entity: ChairWoodFancyCyan
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemCyan
Expand All @@ -365,6 +380,8 @@
entity: ChairWoodFancyGreen
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemGreen
Expand All @@ -377,6 +394,8 @@
entity: ChairWoodFancyOrange
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemOrange
Expand All @@ -385,25 +404,29 @@
- tool: Prying
doAfter: 1

- node: chairWoodFancyPink
entity: ChairWoodFancyPink
- node: chairWoodFancyPurple
entity: ChairWoodFancyPurple
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemPink
prototype: FloorCarpetItemPurple
amount: 1
steps:
- tool: Prying
doAfter: 1

- node: chairWoodFancyPurple
entity: ChairWoodFancyPurple
- node: chairWoodFancyPink
entity: ChairWoodFancyPink
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemPurple
prototype: FloorCarpetItemPink
amount: 1
steps:
- tool: Prying
Expand All @@ -413,6 +436,8 @@
entity: ChairWoodFancyRed
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemRed
Expand All @@ -425,10 +450,13 @@
entity: ChairWoodFancyWhite
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemWhite
amount: 1
steps:
- tool: Prying
doAfter: 1
# End Frontier
Loading