From 8eddfc235a06ec28b47318c74e9714b3098626f5 Mon Sep 17 00:00:00 2001 From: Vonsant Date: Fri, 20 Dec 2024 17:59:57 +0300 Subject: [PATCH 1/2] SmartCringe --- .../SmartFridgeBoundUserInterface.cs | 55 +++++ .../Medical/SmartFridge/SmartFridgeSystem.cs | 24 +++ .../SmartFridge/UI/SmartFridgeMenu.xaml | 39 ++++ .../SmartFridge/UI/SmartFridgeMenu.xaml.cs | 86 ++++++++ .../Medical/SmartFridge/SmartFridgeSystem.cs | 203 ++++++++++++++++++ .../SmartFridge/SharedSmartFridgeSystem.cs | 58 +++++ .../SmartFridge/SmartFridgeComponent.cs | 96 +++++++++ .../ru-RU/_corvaxnext/reagents/biological.ftl | 4 - .../_corvaxnext/smartfridge/smartfridge.ftl | 2 + .../Structures/Machines/smartfridge.yml | 40 ++-- 10 files changed, 585 insertions(+), 22 deletions(-) create mode 100644 Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeBoundUserInterface.cs create mode 100644 Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs create mode 100644 Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml create mode 100644 Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml.cs create mode 100644 Content.Server/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs create mode 100644 Content.Shared/_CorvaxNext/Medical/SmartFridge/SharedSmartFridgeSystem.cs create mode 100644 Content.Shared/_CorvaxNext/Medical/SmartFridge/SmartFridgeComponent.cs delete mode 100644 Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl create mode 100644 Resources/Locale/ru-RU/_corvaxnext/smartfridge/smartfridge.ftl diff --git a/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeBoundUserInterface.cs b/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeBoundUserInterface.cs new file mode 100644 index 00000000000..fa75dec559f --- /dev/null +++ b/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeBoundUserInterface.cs @@ -0,0 +1,55 @@ +using Content.Client.UserInterface.Controls; +using Robust.Client.UserInterface; +using Robust.Shared.Input; +using System.Linq; +using Content.Shared._CorvaxNext.Medical.SmartFridge; +using SmartFridgeMenu = Content.Client._CorvaxNext.Medical.SmartFridge.UI.SmartFridgeMenu; + +namespace Content.Client._CorvaxNext.Medical.SmartFridge; + +public sealed class SmartFridgeBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) +{ + [ViewVariables] + private SmartFridgeMenu? _menu; + + [ViewVariables] + private List _cachedInventory = []; + + protected override void Open() + { + base.Open(); + + _menu = this.CreateWindow(); + _menu.OpenCenteredLeft(); + _menu.Title = EntMan.GetComponent(Owner).EntityName; + _menu.OnItemSelected += OnItemSelected; + Refresh(); + } + + public void Refresh() + { + var system = EntMan.System(); + _cachedInventory = system.GetInventoryClient(Owner); + + _menu?.Populate(_cachedInventory); + } + + private void OnItemSelected(GUIBoundKeyEventArgs args, ListData data) + { + if (args.Function != EngineKeyFunctions.UIClick) + return; + + if (data is not VendorItemsListData { ItemIndex: var itemIndex }) + return; + + if (_cachedInventory.Count == 0) + return; + + var selectedItem = _cachedInventory.ElementAtOrDefault(itemIndex); + + if (selectedItem == null) + return; + + SendMessage(new SmartFridgeEjectMessage(selectedItem.StorageSlotId)); + } +} diff --git a/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs b/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs new file mode 100644 index 00000000000..d5296c1b763 --- /dev/null +++ b/Content.Client/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs @@ -0,0 +1,24 @@ +using Content.Shared._CorvaxNext.Medical.SmartFridge; +using SmartFridgeComponent = Content.Shared._CorvaxNext.Medical.SmartFridge.SmartFridgeComponent; + +namespace Content.Client._CorvaxNext.Medical.SmartFridge; + +public sealed class SmartFridgeSystem : SharedSmartFridgeSystem +{ + [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnVendingAfterState); + } + + private void OnVendingAfterState(EntityUid uid, SmartFridgeComponent component, ref AfterAutoHandleStateEvent args) + { + if (_uiSystem.TryGetOpenUi(uid, SmartFridgeUiKey.Key, out var bui)) + { + bui.Refresh(); + } + } +} diff --git a/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml b/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml new file mode 100644 index 00000000000..0fd1f95f2f6 --- /dev/null +++ b/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml.cs b/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml.cs new file mode 100644 index 00000000000..fd0963c7a0b --- /dev/null +++ b/Content.Client/_CorvaxNext/Medical/SmartFridge/UI/SmartFridgeMenu.xaml.cs @@ -0,0 +1,86 @@ +using System.Numerics; +using Content.Client.UserInterface.Controls; +using Content.Client.VendingMachines.UI; +using Content.Shared._CorvaxNext.Medical.SmartFridge; +using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Robust.Client.UserInterface; +using Robust.Shared.Prototypes; + +namespace Content.Client._CorvaxNext.Medical.SmartFridge.UI; + +[GenerateTypedNameReferences] +public sealed partial class SmartFridgeMenu : FancyWindow +{ + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + + private readonly Dictionary _dummies = []; + + public event Action? OnItemSelected; + + public SmartFridgeMenu() + { + RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); + + VendingContents.SearchBar = SearchBar; + VendingContents.DataFilterCondition += DataFilterCondition; + VendingContents.GenerateItem += GenerateButton; + VendingContents.ItemKeyBindDown += (args, data) => OnItemSelected?.Invoke(args, data); + } + + private static bool DataFilterCondition(string filter, ListData data) + { + if (data is not VendorItemsListData { ItemText: var text }) + return false; + + return string.IsNullOrEmpty(filter) || text.Contains(filter, StringComparison.CurrentCultureIgnoreCase); + } + + private void GenerateButton(ListData data, ListContainerButton button) + { + if (data is not VendorItemsListData { ItemProtoID: var protoId, ItemText: var text }) + return; + + button.AddChild(new VendingMachineItem(protoId, text)); + button.ToolTip = text; + } + + public void Populate(List inventory) + { + if (inventory.Count == 0) + { + SearchBar.Visible = false; + VendingContents.Visible = false; + OutOfStockLabel.Visible = true; + return; + } + + SearchBar.Visible = true; + VendingContents.Visible = true; + OutOfStockLabel.Visible = false; + + var listData = new List(); + + for (var i = 0; i < inventory.Count; i++) + { + var entry = inventory[i]; + + if (!_prototypeManager.TryIndex(entry.Id, out var prototype)) + continue; + + if (!_dummies.TryGetValue(entry.Id, out var dummy)) + { + dummy = _entityManager.Spawn(entry.Id); + _dummies.Add(entry.Id, dummy); + } + + var itemText = $"{entry.ItemName} [{entry.Quantity}]"; + listData.Add(new VendorItemsListData(prototype.ID, itemText, i)); + } + + VendingContents.PopulateList(listData); + } +} diff --git a/Content.Server/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs b/Content.Server/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs new file mode 100644 index 00000000000..4d772d9c449 --- /dev/null +++ b/Content.Server/_CorvaxNext/Medical/SmartFridge/SmartFridgeSystem.cs @@ -0,0 +1,203 @@ +using Content.Server.Interaction; +using Content.Server.Power.EntitySystems; +using Content.Shared._CorvaxNext.Medical.SmartFridge; +using Content.Shared.Construction.EntitySystems; +using Content.Shared.Containers.ItemSlots; +using Content.Shared.Interaction; +using Content.Shared.Tag; +using Robust.Server.Audio; +using Robust.Shared.Containers; +using Robust.Shared.Prototypes; +using Content.Server.Labels; +using Content.Shared.Chemistry.Components.SolutionManager; +using Content.Server.Chemistry.Containers.EntitySystems; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.Reagent; +using Content.Shared.Verbs; + +namespace Content.Server._CorvaxNext.Medical.SmartFridge; + +public sealed class SmartFridgeSystem : SharedSmartFridgeSystem +{ + [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; + [Dependency] private readonly AnchorableSystem _anchorable = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly TagSystem _tags = default!; + [Dependency] private readonly AudioSystem _audio = default!; + + [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; + [Dependency] private readonly LabelSystem _label = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + + public override void Initialize() + { + base.Initialize(); + + Subs.BuiEvents(SmartFridgeUiKey.Key, + subs => + { + subs.Event(OnSmartFridgeEjectMessage); + }); + + SubscribeLocalEvent(MapInit, before: [typeof(ItemSlotsSystem)]); + SubscribeLocalEvent(OnItemEjectEvent); + SubscribeLocalEvent(OnInteractEvent); + } + + private void OnInteractEvent(EntityUid entity, SmartFridgeComponent component, ref InteractUsingEvent ev) + { + if (_tags.HasTag(ev.Used, "Wrench")) + { + _anchorable.TryToggleAnchor(entity, ev.User, ev.Used); + ev.Handled = true; + } + + if (!_anchorable.IsPowered(entity, _entityManager)) + { + ev.Handled = true; + return; + } + + if (component.StorageWhitelist != null) + { + if (!_tags.HasAnyTag(ev.Used, component.StorageWhitelist.Tags!.ToArray())) + { + ev.Handled = true; + return; + } + } + + if (!_itemSlotsSystem.TryInsertEmpty(ev.Target, ev.Used, ev.User, true)) + return; + + if (_solutionContainerSystem.TryGetDrainableSolution(ev.Used, out _, out var sol)) + { + ReagentId? reagentId = sol.GetPrimaryReagentId(); + if (reagentId is not null && _prototypeManager.TryIndex(reagentId.Value.Prototype, out var reagent)) + { + var reagentQuantity = sol.GetReagentQuantity(reagentId.Value); + var totalQuantity = sol.Volume; + + if (reagentQuantity == totalQuantity) + _label.Label(ev.Used, reagent.LocalizedName); + else + { + _label.Label(ev.Used, Loc.GetString("reagent-dispenser-component-impure-auto-label", + ("reagent", reagent.LocalizedName), + ("purity", 100.0f * reagentQuantity / totalQuantity))); + } + } + } + + component.Inventory = GetInventory(entity); + Dirty(entity, component); + + ev.Handled = true; + } + + private void OnItemEjectEvent(EntityUid entity, SmartFridgeComponent component, ref ItemSlotEjectAttemptEvent ev) + { + if (component.SlotToEjectFrom == ev.Slot) + { + Dirty(entity, component); + return; + } + + ev.Cancelled = !component.Ejecting; + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var comp)) + { + if (!comp.Ejecting) + continue; + + comp.EjectAccumulator += frameTime; + if (!(comp.EjectAccumulator >= comp.EjectDelay)) + continue; + + comp.EjectAccumulator = 0f; + comp.Ejecting = false; + + EjectItem(uid, comp); + } + } + + private void MapInit(EntityUid uid, SmartFridgeComponent component, MapInitEvent _) + { + SetupSmartFridge(uid, component); + } + + private void OnSmartFridgeEjectMessage(EntityUid uid, SmartFridgeComponent component, SmartFridgeEjectMessage args) + { + if (!this.IsPowered(uid, EntityManager)) + return; + + if (args.Actor is not { Valid: true } entity || Deleted(entity)) + return; + + VendFromSlot(uid, args.Id); + Dirty(uid, component); + } + + private void VendFromSlot(EntityUid uid, string itemSlotToEject, SmartFridgeComponent? component = null) + { + if (!Resolve(uid, ref component)) + return; + + if (!this.IsPowered(uid, EntityManager)) + { + return; + } + + var item = _itemSlotsSystem.GetItemOrNull(uid, itemSlotToEject); + + if (item == null) + return; + + if (!_itemSlotsSystem.TryGetSlot(uid, itemSlotToEject, out var itemSlot) && itemSlot == null) + return; + + component.Ejecting = true; + component.SlotToEjectFrom = itemSlot; + + _audio.PlayPvs(component.SoundVend, uid); + } + + private void EjectItem(EntityUid uid, SmartFridgeComponent component) + { + if (component.SlotToEjectFrom == null || + !_itemSlotsSystem.TryEject(uid, component.SlotToEjectFrom, null, out _)) + return; + + component.Inventory = GetInventory(uid); + component.SlotToEjectFrom = null; + + Dirty(uid, component); + } + + private void SetupSmartFridge(EntityUid uid, SmartFridgeComponent component) + { + for (var i = 0; i < component.NumSlots; i++) + { + var storageSlotId = SmartFridgeComponent.BaseStorageSlotId + i; + ItemSlot storageComponent = new() + { + Whitelist = component.StorageWhitelist, + Swap = false, + EjectOnBreak = true, + }; + + component.StorageSlotIds.Add(storageSlotId); + component.StorageSlots.Add(storageComponent); + component.StorageSlots[i].Name = "Storage Slot " + (i+1); + _itemSlotsSystem.AddItemSlot(uid, component.StorageSlotIds[i], component.StorageSlots[i]); + } + + _itemSlotsSystem.AddItemSlot(uid, "itemSlot", component.FridgeSlots); + } +} diff --git a/Content.Shared/_CorvaxNext/Medical/SmartFridge/SharedSmartFridgeSystem.cs b/Content.Shared/_CorvaxNext/Medical/SmartFridge/SharedSmartFridgeSystem.cs new file mode 100644 index 00000000000..4e3c1d3b944 --- /dev/null +++ b/Content.Shared/_CorvaxNext/Medical/SmartFridge/SharedSmartFridgeSystem.cs @@ -0,0 +1,58 @@ +using System.Linq; +using Content.Shared.Containers.ItemSlots; +using Content.Shared.Labels.Components; + +namespace Content.Shared._CorvaxNext.Medical.SmartFridge; + +public abstract class SharedSmartFridgeSystem : EntitySystem +{ + [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; + + public List GetInventoryClient(EntityUid uid, + SmartFridgeComponent? smartFridgeComponent = null) + { + if (!Resolve(uid, ref smartFridgeComponent)) + return []; + + var inventory = new List(); + + inventory.AddRange(smartFridgeComponent.Inventory); + + return inventory; + } + + protected List GetInventory(EntityUid uid, SmartFridgeComponent? smartFridgeComponent = null) + { + if (!Resolve(uid, ref smartFridgeComponent)) + return []; + + var repeatedItems = new Dictionary(); + for (var i = 0; i < smartFridgeComponent.NumSlots; i++) + { + var storageSlotId = SmartFridgeComponent.BaseStorageSlotId + i; + + var storedItem = _itemSlotsSystem.GetItemOrNull(uid, storageSlotId); + + if (storedItem == null) + continue; + + string itemLabel; + if (TryComp(storedItem, out var label) && !string.IsNullOrEmpty(label.CurrentLabel)) + itemLabel = label.CurrentLabel; + else + itemLabel = Name(storedItem.Value); + + if (repeatedItems.TryGetValue(itemLabel, out var item)) + { + item.Quantity += 1; + continue; + } + + var meta = MetaData(storedItem.Value); + + repeatedItems.Add(itemLabel, new SmartFridgeInventoryItem(meta.EntityPrototype!, storageSlotId, itemLabel, 1)); + } + + return repeatedItems.Values.ToList(); + } +} diff --git a/Content.Shared/_CorvaxNext/Medical/SmartFridge/SmartFridgeComponent.cs b/Content.Shared/_CorvaxNext/Medical/SmartFridge/SmartFridgeComponent.cs new file mode 100644 index 00000000000..f9440e3e25e --- /dev/null +++ b/Content.Shared/_CorvaxNext/Medical/SmartFridge/SmartFridgeComponent.cs @@ -0,0 +1,96 @@ +using Content.Shared.Containers.ItemSlots; +using Content.Shared.FixedPoint; +using Content.Shared.Whitelist; +using Robust.Shared.Audio; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; +using Component = Robust.Shared.GameObjects.Component; + +namespace Content.Shared._CorvaxNext.Medical.SmartFridge; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] +public sealed partial class SmartFridgeComponent : Component +{ + /// + /// max slots in the SmartFridge, means they can store n items + /// + [DataField("numStorageSlots")] + public int NumSlots = 100; + + [DataField, AutoNetworkedField] + public ItemSlot FridgeSlots = new(); + + [DataField] + public List StorageSlotIds = []; + + [DataField] + public List StorageSlots = []; + + /// + /// latest available inventory + /// + [DataField, AutoNetworkedField] + public List Inventory = []; + + /// + /// Prefix for automatically-generated slot name for storage, up to NumSlots. + /// + public static readonly string BaseStorageSlotId = "SmartFridge-storageSlot"; + + /// + /// what types of things can people store in here + /// pill bottles, bottles, and food + /// + [DataField] + public EntityWhitelist? StorageWhitelist; + + /// + /// How long should the SmartFridge take to dispense something. In Seconds. + /// + [DataField] + public float EjectDelay = 1.2f; + + /// + /// If the SmartFridge is currently vending anything. + /// + [DataField] + public bool Ejecting; + + [DataField] + public float EjectAccumulator; + public ItemSlot? SlotToEjectFrom; + + [DataField] + // Grabbed from: https://github.com/tgstation/tgstation/blob/d34047a5ae911735e35cd44a210953c9563caa22/sound/machines/machine_vend.ogg + public SoundSpecifier SoundVend = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg") + { + Params = new AudioParams + { + Volume = -4f, + Variation = 0.15f, + }, + }; +} + +[Serializable, NetSerializable] +public sealed class SmartFridgeInventoryItem(EntProtoId id, string storageSlotId, string itemName, FixedPoint2 quantity) +{ + public EntProtoId Id = id; + public string StorageSlotId = storageSlotId; + public string ItemName = itemName; + public FixedPoint2 Quantity = quantity; +} + +[Serializable, NetSerializable] +public enum SmartFridgeUiKey +{ + Key +} + +// doing it here cuz idgaf +[Serializable, NetSerializable] +public sealed class SmartFridgeEjectMessage(string id) : BoundUserInterfaceMessage +{ + public readonly string Id = id; +} diff --git a/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl b/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl deleted file mode 100644 index 09a5f4ebf3a..00000000000 --- a/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl +++ /dev/null @@ -1,4 +0,0 @@ -reagent-name-resomi-blood = Фиолетовая кровь -reagent-desc-resomi-blood = Густая жидкость с резким аммиачным запахом - - diff --git a/Resources/Locale/ru-RU/_corvaxnext/smartfridge/smartfridge.ftl b/Resources/Locale/ru-RU/_corvaxnext/smartfridge/smartfridge.ftl new file mode 100644 index 00000000000..e6406bd2e36 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/smartfridge/smartfridge.ftl @@ -0,0 +1,2 @@ +smart-fridge-title = умный холодильник +smart-fridge-search = умный фильтр diff --git a/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml b/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml index 5a8eb69b41e..7b91e429a9c 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml @@ -4,6 +4,22 @@ name: SmartFridge description: A refrigerated storage unit for keeping items cold and fresh. components: + - type: SmartFridge + storageWhitelist: + tags: + - PillCanister + - Meat + - Cooked + - ChemDispensable + - Bottle + - Syringe + - type: ActivatableUI + key: enum.SmartFridgeUiKey.Key + - type: ActivatableUIRequiresPower + - type: UserInterface + interfaces: + enum.SmartFridgeUiKey.Key: + type: SmartFridgeBoundUserInterface - type: StationAiWhitelist - type: Advertise pack: SmartFridgeAds @@ -18,6 +34,11 @@ - state: smartfridge_door map: ["enum.StorageVisualLayers.Door"] shader: unshaded + - type: ApcPowerReceiver + powerLoad: 100 + - type: ExtensionCableReceiver + - type: LightningTarget + priority: 1 - type: EntityStorageVisuals stateBaseClosed: smartfridge stateDoorOpen: smartfridge_open @@ -26,28 +47,11 @@ radius: 1.5 energy: 1.6 color: "#9dc5c9" - - type: EntityStorage - isCollidableWhenOpen: true - closeSound: - path: /Audio/Machines/windoor_open.ogg - params: - volume: -3 - openSound: - path: /Audio/Machines/windoor_open.ogg - params: - volume: -3 - - type: ContainerContainer - containers: - entity_storage: !type:Container - - type: UseDelay - delay: 1 - - type: AntiRottingContainer - - type: ResistLocker - type: Physics bodyType: Static - type: Transform noRot: true - anchored: True + anchored: true - type: Fixtures fixtures: fix1: From 509d13d9324f43956544374d423fc01569106244 Mon Sep 17 00:00:00 2001 From: Vonsant Date: Fri, 20 Dec 2024 18:06:59 +0300 Subject: [PATCH 2/2] JustCringe --- .../ru-RU/_corvaxnext/reagents/biological.ftl | 2 ++ .../Structures/Machines/smartfridge.yml | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl diff --git a/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl b/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl new file mode 100644 index 00000000000..87c05a76ab2 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/reagents/biological.ftl @@ -0,0 +1,2 @@ +reagent-name-resomi-blood = Фиолетовая кровь +reagent-desc-resomi-blood = Густая жидкость с резким аммиачным запахом diff --git a/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml b/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml index 7b91e429a9c..20aaf657dda 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/smartfridge.yml @@ -4,6 +4,7 @@ name: SmartFridge description: A refrigerated storage unit for keeping items cold and fresh. components: + # Corvax-Next-SmartFridge-Start - type: SmartFridge storageWhitelist: tags: @@ -20,6 +21,7 @@ interfaces: enum.SmartFridgeUiKey.Key: type: SmartFridgeBoundUserInterface + # Corvax-Next-SmartFridge-End - type: StationAiWhitelist - type: Advertise pack: SmartFridgeAds @@ -34,11 +36,13 @@ - state: smartfridge_door map: ["enum.StorageVisualLayers.Door"] shader: unshaded + # Corvax-Next-SmartFridge-Start - type: ApcPowerReceiver powerLoad: 100 - type: ExtensionCableReceiver - type: LightningTarget priority: 1 + # Corvax-Next-SmartFridge-End - type: EntityStorageVisuals stateBaseClosed: smartfridge stateDoorOpen: smartfridge_open @@ -47,6 +51,25 @@ radius: 1.5 energy: 1.6 color: "#9dc5c9" + # Corvax-Next-SmartFridge-Start + # - type: EntityStorage + # isCollidableWhenOpen: true + # closeSound: + # path: /Audio/Machines/windoor_open.ogg + # params: + # volume: -3 + # openSound: + # path: /Audio/Machines/windoor_open.ogg + # params: + # volume: -3 + # - type: ContainerContainer + # containers: + # entity_storage: !type:Container + # - type: UseDelay + # delay: 1 + # - type: AntiRottingContainer + # - type: ResistLocker + # Corvax-Next-SmartFridge-End - type: Physics bodyType: Static - type: Transform