-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Simple-Food-PR-Cheese-Sandwich
- Loading branch information
Showing
100 changed files
with
3,060 additions
and
1,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Content.Shared/_NF/Clothing/Components/NFMoonBootsComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Content.Shared.Alert; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared._NF.Clothing.EntitySystems; | ||
|
||
namespace Content.Shared._NF.Clothing.Components; | ||
|
||
/// <summary> | ||
/// This is used for clothing that makes an entity weightless when worn. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
[Access(typeof(SharedNFMoonBootsSystem))] | ||
public sealed partial class NFMoonBootsComponent : Component | ||
{ | ||
[DataField] | ||
public ProtoId<AlertPrototype> MoonBootsAlert = "MoonBoots"; | ||
|
||
/// <summary> | ||
/// Slot the clothing has to be worn in to work. | ||
/// </summary> | ||
[DataField] | ||
public string Slot = "shoes"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Content.Shared/_NF/Clothing/EntitySystems/NFMoonBootsSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using Content.Shared.Gravity; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Item.ItemToggle.Components; | ||
using Content.Shared.Alert; | ||
using Content.Shared.Item; | ||
using Content.Shared.Item.ItemToggle; | ||
using Robust.Shared.Containers; | ||
using Content.Shared.Clothing.EntitySystems; | ||
using Content.Shared._NF.Clothing.Components; | ||
using Content.Shared.Clothing; | ||
|
||
namespace Content.Shared._NF.Clothing.EntitySystems; | ||
|
||
public sealed class SharedNFMoonBootsSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly AlertsSystem _alerts = default!; | ||
[Dependency] private readonly ClothingSystem _clothing = default!; | ||
[Dependency] private readonly InventorySystem _inventory = default!; | ||
[Dependency] private readonly ItemToggleSystem _toggle = default!; | ||
[Dependency] private readonly SharedContainerSystem _container = default!; | ||
[Dependency] private readonly SharedItemSystem _item = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<NFMoonBootsComponent, ItemToggledEvent>(OnToggled); | ||
SubscribeLocalEvent<NFMoonBootsComponent, ClothingGotEquippedEvent>(OnGotEquipped); | ||
SubscribeLocalEvent<NFMoonBootsComponent, ClothingGotUnequippedEvent>(OnGotUnequipped); | ||
SubscribeLocalEvent<NFMoonBootsComponent, IsWeightlessEvent>(OnIsWeightless); | ||
SubscribeLocalEvent<NFMoonBootsComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless); | ||
} | ||
|
||
private void OnToggled(Entity<NFMoonBootsComponent> ent, ref ItemToggledEvent args) | ||
{ | ||
var (uid, comp) = ent; | ||
// only works if being worn in the correct slot | ||
if (_container.TryGetContainingContainer((uid, null, null), out var container) && | ||
_inventory.TryGetSlotEntity(container.Owner, comp.Slot, out var worn) | ||
&& uid == worn) | ||
{ | ||
UpdateMoonbootEffects(container.Owner, ent, args.Activated); | ||
} | ||
|
||
var prefix = args.Activated ? "on" : null; | ||
_item.SetHeldPrefix(ent, prefix); | ||
_clothing.SetEquippedPrefix(ent, prefix); | ||
} | ||
|
||
private void OnGotUnequipped(Entity<NFMoonBootsComponent> ent, ref ClothingGotUnequippedEvent args) | ||
{ | ||
UpdateMoonbootEffects(args.Wearer, ent, false); | ||
} | ||
|
||
private void OnGotEquipped(Entity<NFMoonBootsComponent> ent, ref ClothingGotEquippedEvent args) | ||
{ | ||
UpdateMoonbootEffects(args.Wearer, ent, _toggle.IsActivated(ent.Owner)); | ||
} | ||
|
||
public void UpdateMoonbootEffects(EntityUid user, Entity<NFMoonBootsComponent> ent, bool state) | ||
{ | ||
if (state) | ||
_alerts.ShowAlert(user, ent.Comp.MoonBootsAlert); | ||
else | ||
_alerts.ClearAlert(user, ent.Comp.MoonBootsAlert); | ||
} | ||
|
||
private void OnIsWeightless(Entity<NFMoonBootsComponent> ent, ref IsWeightlessEvent args) | ||
{ | ||
if (args.Handled || !_toggle.IsActivated(ent.Owner)) | ||
return; | ||
|
||
args.Handled = true; | ||
args.IsWeightless = true; | ||
} | ||
|
||
private void OnIsWeightless(Entity<NFMoonBootsComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args) | ||
{ | ||
OnIsWeightless(ent, ref args.Args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared._NF.Containers.Components; | ||
/// <summary> | ||
/// CondimentCup empty component | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class CondimentCupComponent : Component | ||
{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
Content.Shared/_NF/Containers/CondimentKetchupComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared._NF.Containers.Components; | ||
/// <summary> | ||
/// CondimentKetchup empty component | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class CondimentKetchupComponent : Component | ||
{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
Content.Shared/_NF/Containers/CondimentMustardComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared._NF.Containers.Components; | ||
/// <summary> | ||
/// CondimentMustard empty component | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class CondimentMustardComponent : Component | ||
{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
Content.Shared/_NF/Containers/CondimentSqueezeBottleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared._NF.Containers.Components; | ||
/// <summary> | ||
/// CondimentSqueezeBottle empty component | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class CondimentSqueezeBottleComponent : Component | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
alerts-pacified-zone-name = [color=royalblue]Pacified Zone[/color] | ||
alerts-pacified-zone-desc = You're in a pacified zone, you need to leave before harming living things. | ||
alerts-moon-boots-name = Moon Boots | ||
alerts-moon-boots-desc = Gravity? What's that? |
2 changes: 2 additions & 0 deletions
2
Resources/Locale/en-US/_NF/clothing/components/moonboots-component.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Toggle Moon Boots Verb | ||
toggle-moon-boots-verb-get-data-text = Toggle Moon Boots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Resources/Locale/en-US/_NF/reagents/meta/consumable/food/condiments.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
reagent-name-coldsauce = coldsauce | ||
reagent-desc-coldsauce = Coldsauce. Leaves the tongue numb in its passage. |
Oops, something went wrong.