-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- ЭТО ШАБЛОН ВАШЕГО PULL REQUEST. Текст между стрелками - это комментарии - они не будут видны в PR. --> ## Описание PR <!-- Ниже опишите ваш Pull Request. Что он изменяет? На что еще это может повлиять? Постарайтесь описать все внесённые вами изменения! --> добавлена плашка для кастомных законов ИИ у боргов синхронизация с законами ИИ **Проверки** <!-- Выполнение всех следующих действий, если это приемлемо для вида изменений сильно ускорит разбор вашего PR --> - [X] PR полностью завершён и мне не нужна помощь чтобы его закончить. - [X] Я внимательно просмотрел все свои изменения и багов в них не нашёл. - [X] Я запускал локальный сервер со своими изменениями и всё протестировал. - [X] Я добавил скриншот/видео демонстрации PR в игре, **или** этот PR этого не требует. **Изменения** <!-- Здесь вы можете написать список изменений, который будет автоматически добавлен в игру, когда ваш PR будет принят. В журнал изменений следует помещать только то, что действительно важно игрокам. В списке изменений тип значка не является часть предложения, поэтому явно указывайте - Добавлен, Удалён, Изменён. плохо: - add: Новый инструмент для инженеров хорошо: - add: Добавлен новый инструмент для инженеров Вы можете указать своё имя после символа 🆑 именно оно будет отображаться в журнале изменений (иначе будет использоваться ваше имя на GitHub) Например: 🆑 Ian --> 🆑 - add: ЦК приняли решение о введении на станцию плат для создания собственных наборов законов ИИ! - add: Ядра ИИ научились передавать свои законы боргам сразу после обновления законов! --------- Co-authored-by: Schrödinger <[email protected]> Co-authored-by: Filo <[email protected]>
- Loading branch information
1 parent
751caec
commit 0d1eef0
Showing
9 changed files
with
99 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Content.Server.ADT.CustomAiLawBoard; | ||
|
||
[RegisterComponent] | ||
public sealed partial class CustomAiLawBoardComponent : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Content.Shared.Interaction; | ||
using Content.Shared.Tools.Systems; | ||
using Content.Server.Silicons.Laws; | ||
using Content.Shared.Silicons.Laws.Components; | ||
using Content.Server.Administration.Managers; | ||
using Content.Server.EUI; | ||
using Robust.Server.Player; | ||
|
||
namespace Content.Server.ADT.CustomAiLawBoard; | ||
|
||
public sealed class CustomAiLawBoardSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedToolSystem _toolSystem = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
[Dependency] private readonly SiliconLawSystem _siliconLawSystem = default!; | ||
[Dependency] private readonly IAdminManager _adminManager = default!; | ||
[Dependency] private readonly EuiManager _euiManager = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<CustomAiLawBoardComponent, InteractUsingEvent>(OnInteractUsing); | ||
} | ||
private void OnInteractUsing(EntityUid uid, CustomAiLawBoardComponent comp, InteractUsingEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
if (!_toolSystem.HasQuality(args.Used, SharedToolSystem.PulseQuality)) | ||
return; | ||
|
||
if (!TryComp<SiliconLawBoundComponent>(uid, out var lawBoundComponent)) | ||
return; | ||
var ui = new SiliconLawEui(_siliconLawSystem, EntityManager, _adminManager); | ||
if (!_playerManager.TryGetSessionByEntity(args.User, out var session)) | ||
{ | ||
return; | ||
} | ||
_euiManager.OpenEui(ui, session); | ||
ui.UpdateLaws(lawBoundComponent, args.Target); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
Resources/Locale/ru-RU/ADT/prototypes/Entities/Objects/Device/Circuitboards/aicustomlaw.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 @@ | ||
ent-ADTCustomLawCircuitBoard = плата смены законов ИИ | ||
.desc = Модификация обычный платы законов, позволяющая полностью переписать их при помощи мультитула. |
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
13 changes: 13 additions & 0 deletions
13
Resources/Prototypes/ADT/Entities/Objects/Devices/Circuitboards/aicustomlaw.yml
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,13 @@ | ||
- type: entity | ||
id: ADTCustomLawCircuitBoard | ||
parent: BaseElectronics | ||
name: custom ai law circuit board | ||
description: An electronics board containing a lawset. | ||
components: | ||
- type: Sprite | ||
sprite: Objects/Misc/module.rsi | ||
state: cpuboard_adv | ||
- type: SiliconLawBound | ||
- type: CustomAiLawBoard | ||
- type: SiliconLawProvider | ||
laws: NTDefault |
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