diff --git a/Content.Shared/_CP14/LockKey/Components/CP14KeyUniversalComponent.cs b/Content.Shared/_CP14/LockKey/Components/CP14KeyUniversalComponent.cs new file mode 100644 index 0000000000..8740db9d28 --- /dev/null +++ b/Content.Shared/_CP14/LockKey/Components/CP14KeyUniversalComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Shared._CP14.LockKey.Components; + +/// +/// Makes key universal, so it changes his form to required by lock on use +/// +[RegisterComponent] +public sealed partial class CP14KeyUniversalComponent : Component +{ +} diff --git a/Content.Shared/_CP14/LockKey/SharedCP14LockKeySystem.cs b/Content.Shared/_CP14/LockKey/SharedCP14LockKeySystem.cs index 3739e49862..ddcdefce47 100644 --- a/Content.Shared/_CP14/LockKey/SharedCP14LockKeySystem.cs +++ b/Content.Shared/_CP14/LockKey/SharedCP14LockKeySystem.cs @@ -481,7 +481,18 @@ public sealed class SharedCP14LockKeySystem : EntitySystem if (keyShape == null || lockShape == null) return; - if (keyShape.SequenceEqual(lockShape)) + var isEqual = keyShape.SequenceEqual(lockShape); + + if (HasComp(key) && !isEqual) + { + // Make new shape for key and force equality for this use + _popup.PopupClient(Loc.GetString("cp14-lock-key-transforming"), key, user); + key.Comp.LockShape = new List(lockShape); + DirtyField(key, key.Comp, nameof(CP14KeyComponent.LockShape)); + isEqual = true; + } + + if (isEqual) { if (lockComp.Locked) { diff --git a/Resources/Locale/en-US/_CP14/lockKey/keyring.ftl b/Resources/Locale/en-US/_CP14/lockKey/keyring.ftl index 864bde11b2..dec14e7380 100644 --- a/Resources/Locale/en-US/_CP14/lockKey/keyring.ftl +++ b/Resources/Locale/en-US/_CP14/lockKey/keyring.ftl @@ -18,7 +18,7 @@ cp14-lock-verb-use-key-message = Use {$item} to lock or unlock the lock. cp14-lock-examine-lock-slot = {$lock} is hanging here. cp14-lock-examine-lock-lockpicked = {$lock} looks shabby. -cp14-lock-examine-key = The {$item} has prongs of the following shape: +cp14-lock-examine-key = The {$item} has prongs of the following shape: cp14-lock-key-file-use-hint = Grind tooth: {$num} cp14-lock-key-file-updated = New key shape: @@ -28,4 +28,6 @@ cp14-lock-editor-updated = New lock shape: cp14-lock-insert-start = {$player} starts installing a lock on {$name}. cp14-lock-insert-fail-have-lock = {$name} already has a lock installed! -cp14-lock-insert-success = The new lock has been successfully installed in {$name}! \ No newline at end of file +cp14-lock-insert-success = The new lock has been successfully installed in {$name}! + +cp14-lock-key-transforming = The key changing its shape! diff --git a/Resources/Locale/ru-RU/_CP14/lockKey/keyring.ftl b/Resources/Locale/ru-RU/_CP14/lockKey/keyring.ftl index 8894336330..e981d48e3e 100644 --- a/Resources/Locale/ru-RU/_CP14/lockKey/keyring.ftl +++ b/Resources/Locale/ru-RU/_CP14/lockKey/keyring.ftl @@ -18,7 +18,7 @@ cp14-lock-verb-use-key-message = Использовать {$item} чтобы з cp14-lock-examine-lock-slot = Здесь висит {$lock} cp14-lock-examine-lock-lockpicked = {$lock} выглядит потрепанным. -cp14-lock-examine-key = {$item} имеет зубцы следующей формы: +cp14-lock-examine-key = {$item} имеет зубцы следующей формы: cp14-lock-key-file-use-hint = Сточить зубец: {$num} cp14-lock-key-file-updated = Новая форма ключа: @@ -28,4 +28,6 @@ cp14-lock-editor-updated = Новая форма замка: cp14-lock-insert-start = {$player} начинает устанавливать замок в {$name}. cp14-lock-insert-fail-have-lock = В {$name} уже установлен замок! -cp14-lock-insert-success = Новый замок успешно установлен в {$name}! \ No newline at end of file +cp14-lock-insert-success = Новый замок успешно установлен в {$name}! + +cp14-lock-key-transforming = Ключ изменяет свою форму! diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Keys/key.yml b/Resources/Prototypes/_CP14/Entities/Objects/Keys/key.yml index 5e31ec6d23..8454f48647 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Keys/key.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Keys/key.yml @@ -89,3 +89,12 @@ materialComposition: CP14Mithril: 10 +- type: entity + parent: CP14KeyMithrilBlank + id: CP14KeyUniversal + name: omni key + suffix: Universal + categories: [ ForkFiltered, DoNotMap ] + components: + - type: CP14Key + - type: CP14KeyUniversal