-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Station AI ability to electricute doors #32012
Open
Fildrance
wants to merge
27
commits into
space-wizards:master
Choose a base branch
from
Fildrance:feature/ai-door-electricute-for-real
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+370
−109
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bc88447
Boom! Emergency access!
ScarKy0 60bd34f
Emergency access sound
ScarKy0 130a3ea
locale
ScarKy0 8d33a04
Updated sounds
ScarKy0 136f19b
bleh
ScarKy0 265fd07
Door electrify base
ScarKy0 a08fffc
feat: popups on attempt to activate AI action when wires cut
a5967bb
refactor: use SharedApcPowerReceiverComponent to check if AI can inte…
9050743
refactor: added icon and sound for door overcharge
846cf95
meta.json should use tabs not spaces
ac19543
refactor: extracted sounds for airlock overcharge to static field in …
fc889c4
refactor: cleanup, ScarKy0 mentions for resources
43261a5
refactor: removed unused textures
d899a5a
feat: now notification is displayed when AI attempting to interact wi…
36ff0ee
StationAiWhitelistComponent is properly gating BUI OnMessageAttempt,…
28f27fb
Merge remote-tracking branch 'origin/master' into feature/ai-door-ele…
9b2f203
Merge remote-tracking branch 'origin/master' into feature/ai-door-ele…
9d8d5d4
refactor: use PlayLocal to play electrify sound only for AI player
67e6875
refactor: SetBoltsDown now uses TrySetBoltDown, checks for power.
5dc4dfc
bolts now check for power using SharedPowerReceiverSystem
7483434
electrify localization and louder electrify sounds
0b81947
extracted ShowDeviceNotRespondingPopup, reverted airlocks not opening…
96c46fc
refactor: cleanup
1a7eac5
New sprites and fixes
ScarKy0 fdc01d3
Copyright
ScarKy0 64094f9
even more sprite changes
ScarKy0 c1f9f60
refactore: cleanup, rename overcharge => electrify
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 56 additions & 11 deletions
67
Content.Client/Silicons/StationAi/StationAiSystem.Airlock.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 |
---|---|---|
@@ -1,30 +1,75 @@ | ||
using Content.Shared.Doors.Components; | ||
using Content.Shared.Electrocution; | ||
using Content.Shared.Silicons.StationAi; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Silicons.StationAi; | ||
|
||
public sealed partial class StationAiSystem | ||
{ | ||
private readonly ResPath _aiActionsRsi = new ResPath("/Textures/Interface/Actions/actions_ai.rsi"); | ||
|
||
private void InitializeAirlock() | ||
{ | ||
SubscribeLocalEvent<DoorBoltComponent, GetStationAiRadialEvent>(OnDoorBoltGetRadial); | ||
SubscribeLocalEvent<AirlockComponent, GetStationAiRadialEvent>(OnEmergencyAccessGetRadial); | ||
SubscribeLocalEvent<ElectrifiedComponent, GetStationAiRadialEvent>(OnDoorElectrifiedGetRadial); | ||
} | ||
|
||
private void OnDoorBoltGetRadial(Entity<DoorBoltComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add(new StationAiRadial() | ||
{ | ||
Sprite = ent.Comp.BoltsDown ? | ||
new SpriteSpecifier.Rsi( | ||
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "open") : | ||
new SpriteSpecifier.Rsi( | ||
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "closed"), | ||
Tooltip = ent.Comp.BoltsDown ? Loc.GetString("bolt-open") : Loc.GetString("bolt-close"), | ||
Event = new StationAiBoltEvent() | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Sprite = ent.Comp.BoltsDown | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "unbolt_door") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "bolt_door"), | ||
Tooltip = ent.Comp.BoltsDown | ||
? Loc.GetString("bolt-open") | ||
: Loc.GetString("bolt-close"), | ||
Event = new StationAiBoltEvent | ||
{ | ||
Bolted = !ent.Comp.BoltsDown, | ||
} | ||
} | ||
); | ||
} | ||
|
||
private void OnEmergencyAccessGetRadial(Entity<AirlockComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Sprite = ent.Comp.EmergencyAccess | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_off") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_on"), | ||
Tooltip = ent.Comp.EmergencyAccess | ||
? Loc.GetString("emergency-access-off") | ||
: Loc.GetString("emergency-access-on"), | ||
Event = new StationAiEmergencyAccessEvent | ||
{ | ||
EmergencyAccess = !ent.Comp.EmergencyAccess, | ||
} | ||
} | ||
); | ||
} | ||
|
||
private void OnDoorElectrifiedGetRadial(Entity<ElectrifiedComponent> ent, ref GetStationAiRadialEvent args) | ||
{ | ||
args.Actions.Add( | ||
new StationAiRadial | ||
{ | ||
Bolted = !ent.Comp.BoltsDown, | ||
Sprite = ent.Comp.Enabled | ||
? new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_off") | ||
: new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_on"), | ||
Tooltip = ent.Comp.Enabled | ||
? Loc.GetString("electrify-door-off") | ||
: Loc.GetString("electrify-door-on"), | ||
Event = new StationAiElectrifiedEvent | ||
{ | ||
Electrified = !ent.Comp.Enabled, | ||
} | ||
} | ||
}); | ||
); | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of the callers even need this? This method is new...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AdminVerbSystem uses non-predicted version. is that wrong?