Nuke anchor fixes + cargo sell blacklist (#10286)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace Content.Server.Cargo.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Marks an entity as unable to be sold through the cargo shuttle.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class CargoSellBlacklistComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -317,10 +317,15 @@ public sealed partial class CargoSystem
|
||||
// Don't re-sell anything, sell anything anchored (e.g. light fixtures), or anything blacklisted
|
||||
// (e.g. players).
|
||||
if (toSell.Contains(ent) ||
|
||||
(xformQuery.TryGetComponent(ent, out var xform) && xform.Anchored)) continue;
|
||||
(xformQuery.TryGetComponent(ent, out var xform) && xform.Anchored))
|
||||
continue;
|
||||
|
||||
if (HasComp<CargoSellBlacklistComponent>(ent))
|
||||
continue;
|
||||
|
||||
var price = _pricing.GetPrice(ent);
|
||||
if (price == 0) continue;
|
||||
if (price == 0)
|
||||
continue;
|
||||
toSell.Add(ent);
|
||||
amount += price;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,13 @@ namespace Content.Server.Nuke
|
||||
private void OnAnchorChanged(EntityUid uid, NukeComponent component, ref AnchorStateChangedEvent args)
|
||||
{
|
||||
UpdateUserInterface(uid, component);
|
||||
|
||||
if (args.Anchored == false && component.Status == NukeStatus.ARMED && component.RemainingTime > component.DisarmDoafterLength)
|
||||
{
|
||||
// yes, this means technically if you can find a way to unanchor the nuke, you can disarm it
|
||||
// without the doafter. but that takes some effort, and it won't allow you to disarm a nuke that can't be disarmed by the doafter.
|
||||
DisarmBomb(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- type: entity
|
||||
parent: BaseStructureDynamic
|
||||
parent: BaseStructure
|
||||
id: NuclearBomb
|
||||
name: nuclear fission explosive
|
||||
description: You probably shouldn't stick around to see if this is armed.
|
||||
@@ -45,8 +45,9 @@
|
||||
interfaces:
|
||||
- key: enum.NukeUiKey.Key
|
||||
type: NukeBoundUserInterface
|
||||
- type: StaticPrice # TODO: Make absolutely certain cargo cannot sell this, that'd be horrible. Presumably, add an export ban component so only the yarrs get a deal here.
|
||||
- type: StaticPrice
|
||||
price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
|
||||
- type: CargoSellBlacklist
|
||||
|
||||
- type: entity
|
||||
parent: NuclearBomb
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
state: icon
|
||||
- type: StaticPrice
|
||||
price: 2000
|
||||
- type: CargoSellBlacklist
|
||||
- type: WarpPoint
|
||||
location: nuke disk
|
||||
|
||||
|
||||
Reference in New Issue
Block a user