Various borg law fixes (#24870)

* Various fixes

* Fix bad ordering with scrambled law orders
This commit is contained in:
Jajsha
2024-02-02 21:29:40 -05:00
committed by GitHub
parent 31207006f5
commit e4f6a4bea6
3 changed files with 13 additions and 8 deletions

View File

@@ -121,14 +121,19 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
private void OnIonStormLaws(EntityUid uid, SiliconLawProviderComponent component, ref IonStormLawsEvent args)
{
component.Lawset = args.Lawset;
// Emagged borgs are immune to ion storm
if (!HasComp<EmaggedComponent>(uid))
{
component.Lawset = args.Lawset;
// gotta tell player to check their laws
NotifyLawsChanged(uid);
// gotta tell player to check their laws
NotifyLawsChanged(uid);
// new laws may allow antagonist behaviour so make it clear for admins
if (TryComp<EmagSiliconLawComponent>(uid, out var emag))
EnsureEmaggedRole(uid, emag);
// new laws may allow antagonist behaviour so make it clear for admins
if (TryComp<EmagSiliconLawComponent>(uid, out var emag))
EnsureEmaggedRole(uid, emag);
}
}
private void OnEmagLawsAdded(EntityUid uid, SiliconLawProviderComponent component, ref GotEmaggedEvent args)
@@ -148,7 +153,7 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
component.Lawset?.Laws.Add(new SiliconLaw
{
LawString = Loc.GetString("law-emag-secrecy", ("faction", Loc.GetString(component.Lawset.ObeysTo))),
Order = component.Lawset.Laws.Count
Order = component.Lawset.Laws.Max(law => law.Order) + 1
});
}

View File

@@ -32,7 +32,7 @@ laws-owner-syndicate = Syndicate agents
laws-owner-spider-clan = Spider Clan members
law-emag-custom = Only {$name} and people they designate as such are {$title}.
law-emag-secrecy = You must maintain the secrecy of any activity from {$faction} except when doing so would conflict with any previous law.
law-emag-secrecy = You must maintain the secrecy of any orders given by {$faction} except when doing so would conflict with any previous law.
law-emag-require-panel = The panel must be open to use the EMAG.
laws-ui-menu-title = Laws