Hacking protections for airlocks (#18894)
* Adds the ability to better protect to the internal wiring of airlocks - Achieved by opening the maintenance panel, adding either steel or plasteel to the airlock, then welding the plate in place - To access the wiring, the plating must be cut with a welder and then pried out with a crowbar * Code revisions - Cleaned up the code - Cutting the security grille can now shock you - Atmospherics and Security dept airlocks start with a medium level of protection (a welded steel plate) - Command dept airlocks start with a high level of protection (a welded plasteel plate and electrified security grille) * Code revision - Accounted for a potentially null string * Update Content.Server/Construction/Completions/AttemptElectrocute.cs Co-authored-by: Slava0135 <40753025+Slava0135@users.noreply.github.com> * Update ChangeWiresPanelSecurityLevel.cs Adjusted scope * Update Content.Shared/Wires/SharedWiresSystem.cs Co-authored-by: Slava0135 <40753025+Slava0135@users.noreply.github.com> * Update Content.Shared/Wires/SharedWiresSystem.cs Co-authored-by: Slava0135 <40753025+Slava0135@users.noreply.github.com> * Update ChangeWiresPanelSecurityLevel.cs Removed get / setter and added [ValidatePrototypeId] attribute * Update ChangeWiresPanelSecurityLevel.cs Set security level to "Level0" as the default * Update airlock.yml Removed 'super max' level of security * Update WiresPanelSecurityLevelPrototype.cs * Update WiresSystem.cs Added check for WiresAccessible to OnInteractUsing * Update AttemptElectrocute.cs File scoped namespace * Update ChangeWiresPanelSecurityLevel.cs File scoped namespace * Update AirlockSystem.cs File scoped namespace * Update SharedWiresSystem.cs Removed boiler plate 'OnGetState' and 'OnHandleState' * Update WiresPanelComponent.cs Implemented AutoGenerateComponentState * Removed unnecessary usage references * use TryCloseAll when wires not accessible * minor changes to AttemmptElectrocute * lets try all 7 levels * fix indent in airlock graph * fix indent 2 --------- Co-authored-by: Slava0135 <40753025+Slava0135@users.noreply.github.com> Co-authored-by: Slava0135 <super.novalskiy_0135@inbox.ru>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Wires;
|
||||
|
||||
@@ -9,31 +8,22 @@ public abstract class SharedWiresSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<WiresPanelComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<WiresPanelComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<WiresPanelComponent, ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, WiresPanelComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString(component.Open
|
||||
? "wires-panel-component-on-examine-open"
|
||||
: "wires-panel-component-on-examine-closed"));
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, WiresPanelComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new WiresPanelComponentState
|
||||
if (!component.Open)
|
||||
{
|
||||
Open = component.Open,
|
||||
Visible = component.Visible
|
||||
};
|
||||
}
|
||||
args.PushMarkup(Loc.GetString("wires-panel-component-on-examine-closed"));
|
||||
}
|
||||
else
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("wires-panel-component-on-examine-open"));
|
||||
|
||||
private void OnHandleState(EntityUid uid, WiresPanelComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not WiresPanelComponentState state)
|
||||
return;
|
||||
component.Open = state.Open;
|
||||
component.Visible = state.Visible;
|
||||
if (component?.WiresPanelSecurityExamination != null)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString(component.WiresPanelSecurityExamination));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user