Tearable Deliveries V2 (#36815)

* Add new fields to DeliveryComponent for #36636

* Setting the baseSpesoPenalty for currently available deliveries

* Small fixes

* Basic delivery penalization

* Penalty and reward multiplier calculation in place

Also fixes an issue in SharedCargoSystem when opening a delivery in dev server due to trying to allocate cargo twice.

* Calling penalty no longer happens on opening

* Extract multiplier getting

* Removing unused include

* Changing method description. \n\n Not actually sure what I meant by the first one

* Localising default delivery messages

* Unused include removal

* init or smth

* minor tweaks

* I KEEP MERGE CONFLICTING MYSELF

* comments

* no icon

* slight increase

* slarti changes

* forgot

* stuffs

* yippee

* Locn't

* doc

* partial review

* message

* review

* pain

* stuff

---------

Co-authored-by: Lmorgan89 <billsmith116@gmail.com>
This commit is contained in:
ScarKy0
2025-04-24 21:47:46 +02:00
committed by GitHub
parent 6a567cbcb8
commit a16504fa42
7 changed files with 175 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ public sealed class FingerprintReaderSystem : EntitySystem
/// <param name="user">User trying to gain access.</param>
/// <returns>True if access was granted, otherwise false.</returns>
[PublicAPI]
public bool IsAllowed(Entity<FingerprintReaderComponent?> target, EntityUid user)
public bool IsAllowed(Entity<FingerprintReaderComponent?> target, EntityUid user, bool showPopup = true)
{
if (!Resolve(target, ref target.Comp, false))
return true;
@@ -30,7 +30,7 @@ public sealed class FingerprintReaderSystem : EntitySystem
// Check for gloves first
if (!target.Comp.IgnoreGloves && TryGetBlockingGloves(user, out var gloves))
{
if (target.Comp.FailGlovesPopup != null)
if (target.Comp.FailGlovesPopup != null && showPopup)
_popup.PopupClient(Loc.GetString(target.Comp.FailGlovesPopup, ("blocker", gloves)), target, user);
return false;
}
@@ -39,7 +39,7 @@ public sealed class FingerprintReaderSystem : EntitySystem
if (!TryComp<FingerprintComponent>(user, out var fingerprint) || fingerprint.Fingerprint == null ||
!target.Comp.AllowedFingerprints.Contains(fingerprint.Fingerprint))
{
if (target.Comp.FailPopup != null)
if (target.Comp.FailPopup != null && showPopup)
_popup.PopupClient(Loc.GetString(target.Comp.FailPopup), target, user);
return false;