Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Smugman committed Feb 21, 2025
1 parent 058fab2 commit 0e3245a
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Content.Shared/Lock/LockComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed partial class LockComponent : Component
/// </summary>
[DataField("locked"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool Locked = true;
public bool Locked = true;

/// <summary>
/// Whether or not the lock is locked by simply clicking.
Expand Down
19 changes: 0 additions & 19 deletions Content.Shared/Lock/LockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Content.Shared.UserInterface;
using Content.Shared.Item.ItemToggle; ///DeltaV -start for ItemToggleRequiresLock
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared._DV.Lock; ///DeltaV -end for ItemToggleRequiresLock
using Content.Shared.Verbs;
using Content.Shared.Wires;
using JetBrains.Annotations;
Expand Down Expand Up @@ -58,8 +55,6 @@ public override void Initialize()

SubscribeLocalEvent<ActivatableUIRequiresLockComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
SubscribeLocalEvent<ActivatableUIRequiresLockComponent, LockToggledEvent>(LockToggled);

SubscribeLocalEvent<ItemToggleRequiresLockComponent, ItemToggleActivateAttemptEvent>(OnActivateAttempt);
}

private void OnStartup(EntityUid uid, LockComponent lockComp, ComponentStartup args)
Expand Down Expand Up @@ -410,18 +405,4 @@ private void LockToggled(EntityUid uid, ActivatableUIRequiresLockComponent compo

_activatableUI.CloseAll(uid);
}
/// DeltaV - Start ItemToggleRequiresLockComponent logic
private void OnActivateAttempt(EntityUid uid, ItemToggleRequiresLockComponent component, ref ItemToggleActivateAttemptEvent args)
{
if (args.Cancelled)
return;

if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked != component.RequireLocked)
{
args.Cancelled = true;
if (lockComp.Locked)
args.Popup = Loc.GetString("lock-comp-has-user-access-fail");
}
}
/// DeltaV - End of ItemToggleRequiresLockComponent logic
}
38 changes: 38 additions & 0 deletions Content.Shared/_DV/Lock/ItemToggleRequiresLockSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Lock;
using Content.Shared.ActionBlocker;
using Content.Shared.Popups;
using JetBrains.Annotations;

namespace Content.Shared._DV.Lock;

/// <summary>
/// Handles (un)locking and examining of Lock components
/// </summary>
[UsedImplicitly]
public sealed class ItemToggleRequiresLockSystem : EntitySystem
{
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly SharedPopupSystem _sharedPopupSystem = default!;

/// <inheritdoc />
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ItemToggleRequiresLockComponent, ItemToggleActivateAttemptEvent>(OnActivateAttempt);
}

private void OnActivateAttempt(EntityUid uid, ItemToggleRequiresLockComponent component, ref ItemToggleActivateAttemptEvent args)
{
if (args.Cancelled)
return;

if (TryComp<LockComponent>(uid, out var lockComp) && lockComp.Locked != component.RequireLocked)
{
args.Cancelled = true;
if (lockComp.Locked)
args.Popup = Loc.GetString("lock-comp-has-user-access-fail");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Lighter: 2
FlippoLighter: 2
contrabandInventory:
MysteryLighterBox: 2
MysteryLighterBox: 2 # DeltaV - branded lighters addition
GroundTobacco: 3
CigarGold: 2
Igniter: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- type: vendingMachineInventory
- type: vendingMachineInventory
id: DiscountDansInventory
startingInventory:
FoodSnackCheesie: 3
Expand All @@ -8,7 +8,7 @@
FoodSnackPopcorn: 3
FoodSnackEnergy: 3
CigPackMixed: 2
DiscountDanLighter: 2 #DeltaV - branded lighter addition
DiscountDanLighter: 2 # DeltaV - branded lighter addition
contrabandInventory:
FoodSnackDanDanNoodles: 3
FoodBakedBunHoney: 3
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
contents:
- id: FoodDonkpocket
amount: 6
- id: DonkcoLighter
- id: DonkcoLighter # DeltaV - Branded lighter addition
amount: 1
prob: 0.10

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- type: entityTable
id: BrandedFlippoTable
table: !type:GroupSelector
children:
- id: CybersunFlippo
- id: InterdyneFlippo
- id: WaffleCoFlippo
- id: HonkCoFlippo
- id: DiscountDanLighter
- id: GorlexMatchbox
weight: 0.5
- id: DonkcoLighter
weight: 0.5
- id: NanotrasenFlippo
weight: 0.25
- id: SpiderclanFlippo
weight: 0.25
32 changes: 4 additions & 28 deletions Resources/Prototypes/_DV/Entities/Objects/Fun/figurine_boxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,10 @@
- type: Sprite
sprite: Objects/Fun/figurines.rsi
layers:
- state: fig_box
state: fig_box
- type: SpawnItemsOnUse
items:
- id: MysteryFigureBoxTrash
- id: CybersunFlippo
prob: 0.10
orGroup: LighterOption
- id: InterdyneFlippo
prob: 0.10
orGroup: LighterOption
- id: NanotrasenFlippo
prob: 0.05
orGroup: LighterOption
- id: SpiderclanFlippo
prob: 0.05
orGroup: LighterOption
- id: WaffleCoFlippo
prob: 0.15
orGroup: LighterOption
- id: HonkCoFlippo
prob: 0.10
orGroup: LighterOption
- id: GorlexMatchbox
prob: 0.05
orGroup: LighterOption
- id: DiscountDanLighter
prob: 0.20
orGroup: LighterOption
- id: DonkcoLighter
prob: 0.05
orGroup: LighterOption
- type: SpawnTableOnUse
table: BrandedFlippoTable

0 comments on commit 0e3245a

Please sign in to comment.