Compare commits
4 Commits
8d66d0bc7c
...
f42c2ae11b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f42c2ae11b | ||
|
|
1c2f200762 | ||
|
|
3e33dc5936 | ||
|
|
da7cf45fa6 |
@@ -0,0 +1,5 @@
|
||||
using Content.Shared.DeltaV.Shuttles.Systems;
|
||||
|
||||
namespace Content.Client.DeltaV.Shuttles.Systems;
|
||||
|
||||
public sealed class DockingConsoleSystem : SharedDockingConsoleSystem;
|
||||
@@ -0,0 +1,38 @@
|
||||
using Content.Shared.DeltaV.Shuttles;
|
||||
|
||||
namespace Content.Client.DeltaV.Shuttles.UI;
|
||||
|
||||
public sealed class DockingConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private DockingConsoleWindow? _window;
|
||||
|
||||
public DockingConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new DockingConsoleWindow(Owner);
|
||||
_window.OnFTL += index => SendMessage(new DockingConsoleFTLMessage(index));
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
if (state is DockingConsoleState cast)
|
||||
_window?.UpdateState(cast);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
if (disposing)
|
||||
_window?.Orphan();
|
||||
}
|
||||
}
|
||||
17
Content.Client/DeltaV/Shuttles/UI/DockingConsoleWindow.xaml
Normal file
17
Content.Client/DeltaV/Shuttles/UI/DockingConsoleWindow.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
SetSize="500 500">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<ScrollContainer SetHeight="256" HorizontalExpand="True">
|
||||
<ItemList Name="Destinations"/> <!-- Populated from comp.Destinations -->
|
||||
</ScrollContainer>
|
||||
<controls:StripeBack MinSize="48 48">
|
||||
<Label Text="{Loc 'shuttle-console-ftl-label'}" VerticalExpand="True" HorizontalAlignment="Center"/>
|
||||
</controls:StripeBack>
|
||||
<Label Name="MapFTLState" Text="{Loc 'shuttle-console-ftl-state-Available'}" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
|
||||
<ProgressBar Name="FTLBar" HorizontalExpand="True" Margin="5" MinValue="0.0" MaxValue="1.0" Value="1.0" SetHeight="32"/>
|
||||
<controls:StripeBack HorizontalExpand="True">
|
||||
<Button Name="FTLButton" Text="{Loc 'docking-console-ftl'}" Disabled="True" SetSize="128 48" Margin="5"/>
|
||||
</controls:StripeBack>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
112
Content.Client/DeltaV/Shuttles/UI/DockingConsoleWindow.xaml.cs
Normal file
112
Content.Client/DeltaV/Shuttles/UI/DockingConsoleWindow.xaml.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.DeltaV.Shuttles;
|
||||
using Content.Shared.DeltaV.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Content.Shared.Timing;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.DeltaV.Shuttles.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class DockingConsoleWindow : FancyWindow
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
private readonly AccessReaderSystem _access;
|
||||
|
||||
public event Action<int>? OnFTL;
|
||||
|
||||
private readonly EntityUid _owner;
|
||||
private readonly StyleBoxFlat _ftlStyle;
|
||||
|
||||
private FTLState _state;
|
||||
private int? _selected;
|
||||
private StartEndTime _ftlTime;
|
||||
|
||||
public DockingConsoleWindow(EntityUid owner)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_access = _entMan.System<AccessReaderSystem>();
|
||||
|
||||
_owner = owner;
|
||||
|
||||
_ftlStyle = new StyleBoxFlat(Color.LimeGreen);
|
||||
FTLBar.ForegroundStyleBoxOverride = _ftlStyle;
|
||||
|
||||
if (!_entMan.TryGetComponent<DockingConsoleComponent>(owner, out var comp))
|
||||
return;
|
||||
|
||||
Title = Loc.GetString(comp.WindowTitle);
|
||||
|
||||
if (!comp.HasShuttle)
|
||||
{
|
||||
MapFTLState.Text = Loc.GetString("docking-console-no-shuttle");
|
||||
_ftlStyle.BackgroundColor = Color.FromHex("#B02E26");
|
||||
return;
|
||||
}
|
||||
|
||||
Destinations.OnItemSelected += args => _selected = args.ItemIndex;
|
||||
Destinations.OnItemDeselected += _ => _selected = null;
|
||||
|
||||
FTLButton.OnPressed += _ =>
|
||||
{
|
||||
if (_selected is {} index)
|
||||
OnFTL?.Invoke(index);
|
||||
};
|
||||
}
|
||||
|
||||
public void UpdateState(DockingConsoleState state)
|
||||
{
|
||||
_state = state.FTLState;
|
||||
_ftlTime = state.FTLTime;
|
||||
|
||||
MapFTLState.Text = Loc.GetString($"shuttle-console-ftl-state-{_state.ToString()}");
|
||||
_ftlStyle.BackgroundColor = Color.FromHex(_state switch
|
||||
{
|
||||
FTLState.Available => "#80C71F",
|
||||
FTLState.Starting => "#169C9C",
|
||||
FTLState.Travelling => "#8932B8",
|
||||
FTLState.Arriving => "#F9801D",
|
||||
_ => "#B02E26" // cooldown and fallback
|
||||
});
|
||||
|
||||
UpdateButton();
|
||||
|
||||
if (Destinations.Count == state.Destinations.Count)
|
||||
return;
|
||||
|
||||
Destinations.Clear();
|
||||
foreach (var dest in state.Destinations)
|
||||
{
|
||||
Destinations.AddItem(dest.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButton()
|
||||
{
|
||||
FTLButton.Disabled = _selected == null || _state != FTLState.Available || !HasAccess();
|
||||
}
|
||||
|
||||
private bool HasAccess()
|
||||
{
|
||||
return _player.LocalSession?.AttachedEntity is {} player && _access.IsAllowed(player, _owner);
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
UpdateButton();
|
||||
|
||||
var progress = _ftlTime.ProgressAt(_timing.CurTime);
|
||||
FTLBar.Value = float.IsFinite(progress) ? progress : 1;
|
||||
}
|
||||
}
|
||||
123
Content.Client/DeltaV/VendingMachines/ShopVendorSystem.cs
Normal file
123
Content.Client/DeltaV/VendingMachines/ShopVendorSystem.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using Content.Shared.DeltaV.VendingMachines;
|
||||
using Content.Shared.VendingMachines;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.DeltaV.VendingMachines;
|
||||
|
||||
public sealed class ShopVendorSystem : SharedShopVendorSystem
|
||||
{
|
||||
[Dependency] private readonly AnimationPlayerSystem _animationPlayer = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ShopVendorComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
||||
SubscribeLocalEvent<ShopVendorComponent, AnimationCompletedEvent>(OnAnimationCompleted);
|
||||
}
|
||||
|
||||
// copied from vending machines because its not reusable in other systems :)
|
||||
private void OnAnimationCompleted(Entity<ShopVendorComponent> ent, ref AnimationCompletedEvent args)
|
||||
{
|
||||
UpdateAppearance((ent, ent.Comp));
|
||||
}
|
||||
|
||||
private void OnAppearanceChange(Entity<ShopVendorComponent> ent, ref AppearanceChangeEvent args)
|
||||
{
|
||||
UpdateAppearance((ent, ent.Comp, args.Sprite));
|
||||
}
|
||||
|
||||
private void UpdateAppearance(Entity<ShopVendorComponent, SpriteComponent?> ent)
|
||||
{
|
||||
if (!Resolve(ent, ref ent.Comp2))
|
||||
return;
|
||||
|
||||
if (!_appearance.TryGetData<VendingMachineVisualState>(ent, VendingMachineVisuals.VisualState, out var state))
|
||||
state = VendingMachineVisualState.Normal;
|
||||
|
||||
var sprite = ent.Comp2;
|
||||
SetLayerState(VendingMachineVisualLayers.Base, ent.Comp1.OffState, sprite);
|
||||
SetLayerState(VendingMachineVisualLayers.Screen, ent.Comp1.ScreenState, sprite);
|
||||
switch (state)
|
||||
{
|
||||
case VendingMachineVisualState.Normal:
|
||||
SetLayerState(VendingMachineVisualLayers.BaseUnshaded, ent.Comp1.NormalState, sprite);
|
||||
break;
|
||||
|
||||
case VendingMachineVisualState.Deny:
|
||||
if (ent.Comp1.LoopDenyAnimation)
|
||||
SetLayerState(VendingMachineVisualLayers.BaseUnshaded, ent.Comp1.DenyState, sprite);
|
||||
else
|
||||
PlayAnimation(ent, VendingMachineVisualLayers.BaseUnshaded, ent.Comp1.DenyState, ent.Comp1.DenyDelay, sprite);
|
||||
break;
|
||||
|
||||
case VendingMachineVisualState.Eject:
|
||||
PlayAnimation(ent, VendingMachineVisualLayers.BaseUnshaded, ent.Comp1.EjectState, ent.Comp1.EjectDelay, sprite);
|
||||
break;
|
||||
|
||||
case VendingMachineVisualState.Broken:
|
||||
HideLayers(sprite);
|
||||
SetLayerState(VendingMachineVisualLayers.Base, ent.Comp1.BrokenState, sprite);
|
||||
break;
|
||||
|
||||
case VendingMachineVisualState.Off:
|
||||
HideLayers(sprite);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetLayerState(VendingMachineVisualLayers layer, string? state, SpriteComponent sprite)
|
||||
{
|
||||
if (state == null)
|
||||
return;
|
||||
|
||||
sprite.LayerSetVisible(layer, true);
|
||||
sprite.LayerSetAutoAnimated(layer, true);
|
||||
sprite.LayerSetState(layer, state);
|
||||
}
|
||||
|
||||
private void PlayAnimation(EntityUid uid, VendingMachineVisualLayers layer, string? state, TimeSpan time, SpriteComponent sprite)
|
||||
{
|
||||
if (state == null || _animationPlayer.HasRunningAnimation(uid, state))
|
||||
return;
|
||||
|
||||
var animation = GetAnimation(layer, state, time);
|
||||
sprite.LayerSetVisible(layer, true);
|
||||
_animationPlayer.Play(uid, animation, state);
|
||||
}
|
||||
|
||||
private static Animation GetAnimation(VendingMachineVisualLayers layer, string state, TimeSpan time)
|
||||
{
|
||||
return new Animation
|
||||
{
|
||||
Length = time,
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackSpriteFlick
|
||||
{
|
||||
LayerKey = layer,
|
||||
KeyFrames =
|
||||
{
|
||||
new AnimationTrackSpriteFlick.KeyFrame(state, 0f)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static void HideLayers(SpriteComponent sprite)
|
||||
{
|
||||
HideLayer(VendingMachineVisualLayers.BaseUnshaded, sprite);
|
||||
HideLayer(VendingMachineVisualLayers.Screen, sprite);
|
||||
}
|
||||
|
||||
private static void HideLayer(VendingMachineVisualLayers layer, SpriteComponent sprite)
|
||||
{
|
||||
if (!sprite.LayerMapTryGet(layer, out var actualLayer))
|
||||
return;
|
||||
|
||||
sprite.LayerSetVisible(actualLayer, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Content.Shared.DeltaV.VendingMachines;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
namespace Content.Client.DeltaV.VendingMachines.UI;
|
||||
|
||||
public sealed class ShopVendorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[ViewVariables]
|
||||
private ShopVendorWindow? _window;
|
||||
|
||||
public ShopVendorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = this.CreateWindow<ShopVendorWindow>();
|
||||
_window.SetEntity(Owner);
|
||||
_window.OpenCenteredLeft();
|
||||
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
|
||||
_window.OnItemSelected += index => SendMessage(new ShopVendorPurchaseMessage(index));
|
||||
}
|
||||
}
|
||||
13
Content.Client/DeltaV/VendingMachines/UI/ShopVendorItem.xaml
Normal file
13
Content.Client/DeltaV/VendingMachines/UI/ShopVendorItem.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<BoxContainer xmlns="https://spacestation14.io"
|
||||
Orientation="Horizontal"
|
||||
HorizontalExpand="True"
|
||||
SeparationOverride="4">
|
||||
<EntityPrototypeView
|
||||
Name="ItemPrototype"
|
||||
Margin="4 0 0 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
MinSize="32 32"/>
|
||||
<Label Name="NameLabel" SizeFlagsStretchRatio="3" HorizontalExpand="True" ClipText="True"/>
|
||||
<Label Name="CostLabel" SizeFlagsStretchRatio="3" HorizontalAlignment="Right" Margin="8 0"/>
|
||||
</BoxContainer>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.DeltaV.VendingMachines.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ShopVendorItem : BoxContainer
|
||||
{
|
||||
public ShopVendorItem(EntProtoId entProto, string text, uint cost)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
ItemPrototype.SetPrototype(entProto);
|
||||
|
||||
NameLabel.Text = text;
|
||||
|
||||
CostLabel.Text = cost.ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<controls:FancyWindow
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
MinHeight="210">
|
||||
<BoxContainer Name="MainContainer" Orientation="Vertical">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin="4 4"/>
|
||||
<Label Name="BalanceLabel" Margin="4 4"/>
|
||||
</BoxContainer>
|
||||
<controls:SearchListContainer Name="VendingContents" VerticalExpand="True" Margin="4 4"/>
|
||||
<!-- Footer -->
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<PanelContainer StyleClasses="LowDivider" />
|
||||
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
|
||||
<Label Text="{Loc 'shop-vendor-flavor-left'}" StyleClasses="WindowFooterText" />
|
||||
<Label Text="{Loc 'shop-vendor-flavor-right'}" StyleClasses="WindowFooterText"
|
||||
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
|
||||
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
@@ -0,0 +1,147 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared.DeltaV.VendingMachines;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Content.Client.DeltaV.VendingMachines.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ShopVendorWindow : FancyWindow
|
||||
{
|
||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
private readonly ShopVendorSystem _vendor;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired with the listing index to purchase.
|
||||
/// </summary>
|
||||
public event Action<int>? OnItemSelected;
|
||||
|
||||
private EntityUid _owner;
|
||||
private readonly StyleBoxFlat _style = new() { BackgroundColor = new Color(70, 73, 102) };
|
||||
private readonly StyleBoxFlat _styleBroke = new() { BackgroundColor = Color.FromHex("#303133") };
|
||||
private readonly List<ListContainerButton> _buttons = new();
|
||||
private uint _balance = 1;
|
||||
|
||||
public ShopVendorWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_vendor = _entMan.System<ShopVendorSystem>();
|
||||
|
||||
VendingContents.SearchBar = SearchBar;
|
||||
VendingContents.DataFilterCondition += DataFilterCondition;
|
||||
VendingContents.GenerateItem += GenerateButton;
|
||||
VendingContents.ItemKeyBindDown += (args, data) => OnItemSelected?.Invoke(((ShopVendorListingData) data).Index);
|
||||
}
|
||||
|
||||
public void SetEntity(EntityUid owner)
|
||||
{
|
||||
_owner = owner;
|
||||
|
||||
if (!_entMan.TryGetComponent<ShopVendorComponent>(owner, out var comp))
|
||||
return;
|
||||
|
||||
var pack = _proto.Index(comp.Pack);
|
||||
Populate(pack.Listings);
|
||||
|
||||
UpdateBalance();
|
||||
}
|
||||
|
||||
private void UpdateBalance(uint balance)
|
||||
{
|
||||
if (_balance == balance)
|
||||
return;
|
||||
|
||||
_balance = balance;
|
||||
|
||||
BalanceLabel.Text = Loc.GetString("shop-vendor-balance", ("points", balance));
|
||||
|
||||
// disable items that are too expensive to buy
|
||||
foreach (var button in _buttons)
|
||||
{
|
||||
if (button.Data is ShopVendorListingData data)
|
||||
button.Disabled = data.Cost > balance;
|
||||
|
||||
button.StyleBoxOverride = button.Disabled ? _styleBroke : _style;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateBalance()
|
||||
{
|
||||
if (_player.LocalEntity is {} user)
|
||||
UpdateBalance(_vendor.GetBalance(_owner, user));
|
||||
}
|
||||
|
||||
private bool DataFilterCondition(string filter, ListData data)
|
||||
{
|
||||
if (data is not ShopVendorListingData { Text: var text })
|
||||
return false;
|
||||
|
||||
if (string.IsNullOrEmpty(filter))
|
||||
return true;
|
||||
|
||||
return text.Contains(filter, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
|
||||
private void GenerateButton(ListData data, ListContainerButton button)
|
||||
{
|
||||
if (data is not ShopVendorListingData cast)
|
||||
return;
|
||||
|
||||
_buttons.Add(button);
|
||||
button.AddChild(new ShopVendorItem(cast.ItemId, cast.Text, cast.Cost));
|
||||
|
||||
button.ToolTip = cast.Text;
|
||||
button.Disabled = cast.Cost > _balance;
|
||||
button.StyleBoxOverride = button.Disabled ? _styleBroke : _style;
|
||||
}
|
||||
|
||||
public void Populate(List<ShopListing> listings)
|
||||
{
|
||||
var longestEntry = string.Empty;
|
||||
var listData = new List<ShopVendorListingData>();
|
||||
for (var i = 0; i < listings.Count; i++)
|
||||
{
|
||||
var listing = listings[i];
|
||||
var proto = _proto.Index(listing.Id);
|
||||
var text = proto.Name;
|
||||
if (proto.TryGetComponent<StackComponent>(out var stack, _factory) && stack.Count > 1)
|
||||
{
|
||||
text += " ";
|
||||
text += Loc.GetString("shop-vendor-stack-suffix", ("count", stack.Count));
|
||||
}
|
||||
listData.Add(new ShopVendorListingData(i, listing.Id, text, listing.Cost));
|
||||
}
|
||||
|
||||
_buttons.Clear();
|
||||
VendingContents.PopulateList(listData);
|
||||
SetSizeAfterUpdate(longestEntry.Length, listings.Count);
|
||||
}
|
||||
|
||||
private void SetSizeAfterUpdate(int longestEntryLength, int contentCount)
|
||||
{
|
||||
SetSize = new Vector2(Math.Clamp((longestEntryLength + 2) * 12, 250, 400),
|
||||
Math.Clamp(contentCount * 50, 150, 350));
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
UpdateBalance();
|
||||
}
|
||||
}
|
||||
|
||||
public record ShopVendorListingData(int Index, EntProtoId ItemId, string Text, uint Cost) : ListData;
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.DeltaV.Salvage; // DeltaV
|
||||
using Content.Shared.Lathe;
|
||||
using Content.Shared.Research.Components;
|
||||
using JetBrains.Annotations;
|
||||
@@ -34,6 +35,8 @@ namespace Content.Client.Lathe.UI
|
||||
_menu.QueueMoveUpAction += index => SendMessage(new LatheMoveRequestMessage(index, -1));
|
||||
_menu.QueueMoveDownAction += index => SendMessage(new LatheMoveRequestMessage(index, 1));
|
||||
_menu.DeleteFabricatingAction += () => SendMessage(new LatheAbortFabricationMessage());
|
||||
|
||||
_menu.OnClaimMiningPoints += () => SendMessage(new LatheClaimMiningPointsMessage()); // DeltaV
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
|
||||
@@ -151,6 +151,12 @@
|
||||
<ui:MaterialStorageControl Name="MaterialsList" SizeFlagsStretchRatio="8"/>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
<!-- Begin DeltaV Additions: Mining points -->
|
||||
<BoxContainer Orientation="Horizontal" Name="MiningPointsContainer" Visible="False">
|
||||
<Label Name="MiningPointsLabel" HorizontalExpand="True"/>
|
||||
<Button Name="MiningPointsClaimButton" Text="{Loc 'lathe-menu-mining-points-claim-button'}"/>
|
||||
</BoxContainer>
|
||||
<!-- End DeltaV Additions: Mining points -->
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Content.Client.Materials;
|
||||
using Content.Shared.DeltaV.Salvage.Components; // DeltaV
|
||||
using Content.Shared.DeltaV.Salvage.Systems; // DeltaV
|
||||
using Content.Shared.Lathe;
|
||||
using Content.Shared.Lathe.Prototypes;
|
||||
using Content.Shared.Research.Prototypes;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player; // DeltaV
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Timing; // DeltaV
|
||||
|
||||
namespace Content.Client.Lathe.UI;
|
||||
|
||||
@@ -19,11 +23,13 @@ namespace Content.Client.Lathe.UI;
|
||||
public sealed partial class LatheMenu : DefaultWindow
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _player = default!; // DeltaV
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private readonly SpriteSystem _spriteSystem;
|
||||
private readonly LatheSystem _lathe;
|
||||
private readonly MaterialStorageSystem _materialStorage;
|
||||
private readonly MiningPointsSystem _miningPoints; // DeltaV
|
||||
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnServerListButtonPressed;
|
||||
public event Action<string, int>? RecipeQueueAction;
|
||||
@@ -31,15 +37,16 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
public event Action<int>? QueueMoveUpAction;
|
||||
public event Action<int>? QueueMoveDownAction;
|
||||
public event Action? DeleteFabricatingAction;
|
||||
|
||||
public event Action? OnClaimMiningPoints; // DeltaV
|
||||
public List<ProtoId<LatheRecipePrototype>> Recipes = new();
|
||||
|
||||
public List<ProtoId<LatheCategoryPrototype>>? Categories;
|
||||
|
||||
public ProtoId<LatheCategoryPrototype>? CurrentCategory;
|
||||
|
||||
public EntityUid Entity;
|
||||
|
||||
private uint? _lastMiningPoints; // DeltaV: used to avoid Loc.GetString every frame
|
||||
|
||||
public LatheMenu()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
@@ -48,6 +55,7 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
_spriteSystem = _entityManager.System<SpriteSystem>();
|
||||
_lathe = _entityManager.System<LatheSystem>();
|
||||
_materialStorage = _entityManager.System<MaterialStorageSystem>();
|
||||
_miningPoints = _entityManager.System<MiningPointsSystem>(); // DeltaV
|
||||
|
||||
SearchBar.OnTextChanged += _ =>
|
||||
{
|
||||
@@ -86,9 +94,52 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
AmountLineEdit.SetText(latheComponent.DefaultProductionAmount.ToString());
|
||||
}
|
||||
|
||||
// Begin DeltaV Additions: Mining points UI
|
||||
MiningPointsContainer.Visible = _entityManager.TryGetComponent<MiningPointsComponent>(Entity, out var points);
|
||||
MiningPointsClaimButton.OnPressed += _ => OnClaimMiningPoints?.Invoke();
|
||||
if (points != null)
|
||||
UpdateMiningPoints(points.Points);
|
||||
// End DeltaV Additions
|
||||
|
||||
MaterialsList.SetOwner(Entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DeltaV: Updates the UI elements for mining points.
|
||||
/// </summary>
|
||||
private void UpdateMiningPoints(uint points)
|
||||
{
|
||||
MiningPointsClaimButton.Disabled = points == 0 ||
|
||||
_player.LocalSession?.AttachedEntity is not {} player ||
|
||||
_miningPoints.TryFindIdCard(player) == null;
|
||||
if (points == _lastMiningPoints)
|
||||
return;
|
||||
|
||||
_lastMiningPoints = points;
|
||||
MiningPointsLabel.Text = Loc.GetString("lathe-menu-mining-points", ("points", points));
|
||||
}
|
||||
|
||||
protected override void Opened()
|
||||
{
|
||||
base.Opened();
|
||||
|
||||
if (_entityManager.TryGetComponent<LatheComponent>(Entity, out var latheComp))
|
||||
{
|
||||
AmountLineEdit.SetText(latheComp.DefaultProductionAmount.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DeltaV: Update mining points UI whenever it changes.
|
||||
/// </summary>
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
if (_entityManager.TryGetComponent<MiningPointsComponent>(Entity, out var points))
|
||||
UpdateMiningPoints(points.Points);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the list of all the recipes
|
||||
/// </summary>
|
||||
|
||||
74
Content.Server/DeltaV/Planet/PlanetSystem.cs
Normal file
74
Content.Server/DeltaV/Planet/PlanetSystem.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Parallax;
|
||||
using Content.Shared.DeltaV.Planet;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.DeltaV.Planet;
|
||||
|
||||
public sealed class PlanetSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
||||
[Dependency] private readonly BiomeSystem _biome = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
|
||||
[Dependency] private readonly MetaDataSystem _meta = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
|
||||
private readonly List<(Vector2i, Tile)> _setTiles = new();
|
||||
|
||||
/// <summary>
|
||||
/// Spawn a planet map from a planet prototype.
|
||||
/// </summary>
|
||||
public EntityUid SpawnPlanet(ProtoId<PlanetPrototype> id, bool runMapInit = true)
|
||||
{
|
||||
var planet = _proto.Index(id);
|
||||
|
||||
var map = _map.CreateMap(out _, runMapInit: runMapInit);
|
||||
_biome.EnsurePlanet(map, _proto.Index(planet.Biome), mapLight: planet.MapLight);
|
||||
|
||||
// add each marker layer
|
||||
var biome = Comp<BiomeComponent>(map);
|
||||
foreach (var layer in planet.BiomeMarkerLayers)
|
||||
{
|
||||
_biome.AddMarkerLayer(map, biome, layer);
|
||||
}
|
||||
|
||||
if (planet.AddedComponents is {} added)
|
||||
EntityManager.AddComponents(map, added);
|
||||
|
||||
_atmos.SetMapAtmosphere(map, false, planet.Atmosphere);
|
||||
|
||||
_meta.SetEntityName(map, Loc.GetString(planet.MapName));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawns an initialized planet map from a planet prototype and loads a grid onto it.
|
||||
/// Returns the map entity if loading succeeded.
|
||||
/// </summary>
|
||||
public EntityUid? LoadPlanet(ProtoId<PlanetPrototype> id, ResPath path)
|
||||
{
|
||||
var map = SpawnPlanet(id, runMapInit: false);
|
||||
var mapId = Comp<MapComponent>(map).MapId;
|
||||
if (!_mapLoader.TryLoadGrid(mapId, path, out var grid))
|
||||
{
|
||||
Log.Error($"Failed to load planet grid {path} for planet {id}!");
|
||||
Del(map);
|
||||
return null;
|
||||
}
|
||||
|
||||
// don't want rocks spawning inside the base
|
||||
_setTiles.Clear();
|
||||
var aabb = Comp<MapGridComponent>(grid.Value).LocalAABB;
|
||||
_biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles);
|
||||
|
||||
_map.InitializeMap(map);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
164
Content.Server/DeltaV/Shuttles/Systems/DockingConsoleSystem.cs
Normal file
164
Content.Server/DeltaV/Shuttles/Systems/DockingConsoleSystem.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Shared.DeltaV.Shuttles;
|
||||
using Content.Shared.DeltaV.Shuttles.Components;
|
||||
using Content.Shared.DeltaV.Shuttles.Systems;
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Server.DeltaV.Shuttles.Systems;
|
||||
|
||||
public sealed class DockingConsoleSystem : SharedDockingConsoleSystem
|
||||
{
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
||||
[Dependency] private readonly ShuttleSystem _shuttle = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<DockEvent>(OnDock);
|
||||
SubscribeLocalEvent<UndockEvent>(OnUndock);
|
||||
|
||||
Subs.BuiEvents<DockingConsoleComponent>(DockingConsoleUiKey.Key, subs =>
|
||||
{
|
||||
subs.Event<BoundUIOpenedEvent>(OnOpened);
|
||||
subs.Event<DockingConsoleFTLMessage>(OnFTL);
|
||||
});
|
||||
}
|
||||
|
||||
private void OnDock(DockEvent args)
|
||||
{
|
||||
UpdateConsoles(args.GridAUid, args.GridBUid);
|
||||
}
|
||||
|
||||
private void OnUndock(UndockEvent args)
|
||||
{
|
||||
UpdateConsoles(args.GridAUid, args.GridBUid);
|
||||
}
|
||||
|
||||
private void OnOpened(Entity<DockingConsoleComponent> ent, ref BoundUIOpenedEvent args)
|
||||
{
|
||||
if (TerminatingOrDeleted(ent.Comp.Shuttle))
|
||||
UpdateShuttle(ent);
|
||||
|
||||
UpdateUI(ent);
|
||||
}
|
||||
|
||||
private void UpdateConsoles(EntityUid gridA, EntityUid gridB)
|
||||
{
|
||||
UpdateConsolesUsing(gridA);
|
||||
UpdateConsolesUsing(gridB);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the UI of every console that is using a certain shuttle.
|
||||
/// </summary>
|
||||
public void UpdateConsolesUsing(EntityUid shuttle)
|
||||
{
|
||||
if (!HasComp<DockingShuttleComponent>(shuttle))
|
||||
return;
|
||||
|
||||
var query = EntityQueryEnumerator<DockingConsoleComponent>();
|
||||
while (query.MoveNext(out var uid, out var comp))
|
||||
{
|
||||
if (comp.Shuttle == shuttle)
|
||||
UpdateUI((uid, comp));
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateUI(Entity<DockingConsoleComponent> ent)
|
||||
{
|
||||
if (ent.Comp.Shuttle is not {} shuttle)
|
||||
return;
|
||||
|
||||
var ftlState = FTLState.Available;
|
||||
StartEndTime ftlTime = default;
|
||||
List<DockingDestination> destinations = new();
|
||||
|
||||
if (TryComp<FTLComponent>(shuttle, out var ftl))
|
||||
{
|
||||
ftlState = ftl.State;
|
||||
ftlTime = _shuttle.GetStateTime(ftl);
|
||||
}
|
||||
|
||||
if (TryComp<DockingShuttleComponent>(shuttle, out var docking))
|
||||
{
|
||||
destinations = docking.Destinations;
|
||||
}
|
||||
|
||||
var state = new DockingConsoleState(ftlState, ftlTime, destinations);
|
||||
_ui.SetUiState(ent.Owner, DockingConsoleUiKey.Key, state);
|
||||
}
|
||||
|
||||
private void OnFTL(Entity<DockingConsoleComponent> ent, ref DockingConsoleFTLMessage args)
|
||||
{
|
||||
if (ent.Comp.Shuttle is not {} shuttle || !TryComp<DockingShuttleComponent>(shuttle, out var docking))
|
||||
return;
|
||||
|
||||
if (args.Index < 0 || args.Index > docking.Destinations.Count)
|
||||
return;
|
||||
|
||||
var dest = docking.Destinations[args.Index];
|
||||
var map = dest.Map;
|
||||
// can't FTL if its already there or somehow failed whitelist
|
||||
if (map == Transform(shuttle).MapID || !_shuttle.CanFTLTo(shuttle, map, ent))
|
||||
return;
|
||||
|
||||
if (FindLargestGrid(map) is not {} grid)
|
||||
return;
|
||||
|
||||
_shuttle.FTLToDock(shuttle, Comp<ShuttleComponent>(shuttle), grid, priorityTag: ent.Comp.DockTag);
|
||||
}
|
||||
|
||||
private EntityUid? FindLargestGrid(MapId map)
|
||||
{
|
||||
EntityUid? largestGrid = null;
|
||||
var largestSize = 0f;
|
||||
|
||||
var query = EntityQueryEnumerator<MapGridComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var gridUid, out var grid, out var xform))
|
||||
{
|
||||
if (xform.MapID != map)
|
||||
continue;
|
||||
|
||||
var size = grid.LocalAABB.Size.LengthSquared();
|
||||
if (size < largestSize)
|
||||
continue;
|
||||
|
||||
largestSize = size;
|
||||
largestGrid = gridUid;
|
||||
}
|
||||
|
||||
return largestGrid;
|
||||
}
|
||||
|
||||
private void UpdateShuttle(Entity<DockingConsoleComponent> ent)
|
||||
{
|
||||
var hadShuttle = ent.Comp.HasShuttle;
|
||||
// no error if it cant find one since it would fail every test as shuttle.grid_fill is false in dev
|
||||
ent.Comp.Shuttle = FindShuttle(ent.Comp.ShuttleWhitelist);
|
||||
ent.Comp.HasShuttle = ent.Comp.Shuttle != null;
|
||||
|
||||
if (ent.Comp.HasShuttle != hadShuttle)
|
||||
Dirty(ent);
|
||||
}
|
||||
|
||||
private EntityUid? FindShuttle(EntityWhitelist whitelist)
|
||||
{
|
||||
var query = EntityQueryEnumerator<DockingShuttleComponent>();
|
||||
while (query.MoveNext(out var uid, out _))
|
||||
{
|
||||
if (_whitelist.IsValid(whitelist, uid))
|
||||
return uid;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.DeltaV.Shuttles.Components;
|
||||
using Content.Shared.DeltaV.Shuttles.Systems;
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Station.Components;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Map.Components;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Server.DeltaV.Shuttles.Systems;
|
||||
|
||||
public sealed class DockingShuttleSystem : SharedDockingShuttleSystem
|
||||
{
|
||||
[Dependency] private readonly DockingConsoleSystem _console = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<DockingShuttleComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<DockingShuttleComponent, FTLStartedEvent>(OnFTLStarted);
|
||||
SubscribeLocalEvent<DockingShuttleComponent, FTLCompletedEvent>(OnFTLCompleted);
|
||||
|
||||
SubscribeLocalEvent<StationGridAddedEvent>(OnStationGridAdded);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<DockingShuttleComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
// add any whitelisted destinations that it can FTL to
|
||||
// since it needs a whitelist, this excludes the station
|
||||
var query = EntityQueryEnumerator<FTLDestinationComponent, MapComponent>();
|
||||
while (query.MoveNext(out var mapUid, out var dest, out var map))
|
||||
{
|
||||
if (!dest.Enabled || _whitelist.IsWhitelistFailOrNull(dest.Whitelist, ent))
|
||||
continue;
|
||||
|
||||
ent.Comp.Destinations.Add(new DockingDestination()
|
||||
{
|
||||
Name = Name(mapUid),
|
||||
Map = map.MapId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFTLStarted(Entity<DockingShuttleComponent> ent, ref FTLStartedEvent args)
|
||||
{
|
||||
_console.UpdateConsolesUsing(ent);
|
||||
}
|
||||
|
||||
private void OnFTLCompleted(Entity<DockingShuttleComponent> ent, ref FTLCompletedEvent args)
|
||||
{
|
||||
_console.UpdateConsolesUsing(ent);
|
||||
}
|
||||
|
||||
private void OnStationGridAdded(StationGridAddedEvent args)
|
||||
{
|
||||
var uid = args.GridId;
|
||||
if (!TryComp<DockingShuttleComponent>(uid, out var comp))
|
||||
return;
|
||||
|
||||
// only add the destination once
|
||||
if (comp.Station != null)
|
||||
return;
|
||||
|
||||
if (_station.GetOwningStation(uid) is not {} station || !TryComp<StationDataComponent>(station, out var data))
|
||||
return;
|
||||
|
||||
// add the source station as a destination
|
||||
comp.Station = station;
|
||||
comp.Destinations.Add(new DockingDestination()
|
||||
{
|
||||
Name = Name(station),
|
||||
Map = Transform(data.Grids.First()).MapID
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using Content.Server.DeltaV.Station.Systems;
|
||||
using Content.Shared.DeltaV.Planet;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.DeltaV.Station.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Loads a planet map on mapinit and spawns a grid on it (e.g. a mining base).
|
||||
/// The map can then be FTLd to by any shuttle matching its whitelist.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(StationPlanetSpawnerSystem))]
|
||||
public sealed partial class StationPlanetSpawnerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The planet to create.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ProtoId<PlanetPrototype> Planet;
|
||||
|
||||
/// <summary>
|
||||
/// Path to the grid to load onto the map.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ResPath? GridPath;
|
||||
|
||||
/// <summary>
|
||||
/// The map that was loaded.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid? Map;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Content.Server.DeltaV.Planet;
|
||||
using Content.Server.DeltaV.Station.Components;
|
||||
|
||||
namespace Content.Server.DeltaV.Station.Systems;
|
||||
|
||||
public sealed class StationPlanetSpawnerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly PlanetSystem _planet = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<StationPlanetSpawnerComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<StationPlanetSpawnerComponent, ComponentShutdown>(OnShutdown);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<StationPlanetSpawnerComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
if (ent.Comp.GridPath is not {} path)
|
||||
return;
|
||||
|
||||
ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path);
|
||||
}
|
||||
|
||||
private void OnShutdown(Entity<StationPlanetSpawnerComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
QueueDel(ent.Comp.Map);
|
||||
}
|
||||
}
|
||||
47
Content.Server/DeltaV/VendingMachines/ShopVendorSystem.cs
Normal file
47
Content.Server/DeltaV/VendingMachines/ShopVendorSystem.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Content.Server.Advertise.EntitySystems;
|
||||
using Content.Shared.Advertise.Components;
|
||||
using Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
namespace Content.Server.DeltaV.VendingMachines;
|
||||
|
||||
public sealed class ShopVendorSystem : SharedShopVendorSystem
|
||||
{
|
||||
[Dependency] private readonly SpeakOnUIClosedSystem _speakOnUIClosed = default!;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
var query = EntityQueryEnumerator<ShopVendorComponent, TransformComponent>();
|
||||
var now = Timing.CurTime;
|
||||
while (query.MoveNext(out var uid, out var comp, out var xform))
|
||||
{
|
||||
var ent = (uid, comp);
|
||||
var dirty = false;
|
||||
if (comp.Ejecting is {} ejecting && now > comp.NextEject)
|
||||
{
|
||||
Spawn(ejecting, xform.Coordinates);
|
||||
comp.Ejecting = null;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
if (comp.Denying && now > comp.NextDeny)
|
||||
{
|
||||
comp.Denying = false;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
if (dirty)
|
||||
{
|
||||
Dirty(uid, comp);
|
||||
UpdateVisuals(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AfterPurchase(Entity<ShopVendorComponent> ent)
|
||||
{
|
||||
if (TryComp<SpeakOnUIClosedComponent>(ent, out var speak))
|
||||
_speakOnUIClosed.TrySetFlag((ent.Owner, speak));
|
||||
}
|
||||
}
|
||||
49
Content.Shared/DeltaV/Planet/PlanetPrototype.cs
Normal file
49
Content.Shared/DeltaV/Planet/PlanetPrototype.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Content.Shared.Parallax.Biomes.Markers;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.DeltaV.Planet;
|
||||
|
||||
[Prototype]
|
||||
public sealed partial class PlanetPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The biome to create the planet with.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ProtoId<BiomeTemplatePrototype> Biome;
|
||||
|
||||
/// <summary>
|
||||
/// Name to give to the map.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public LocId MapName;
|
||||
|
||||
/// <summary>
|
||||
/// Ambient lighting for the map.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Color MapLight = Color.FromHex("#D8B059");
|
||||
|
||||
/// <summary>
|
||||
/// Components to add to the map.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ComponentRegistry? AddedComponents;
|
||||
|
||||
/// <summary>
|
||||
/// The gas mixture to use for the atmosphere.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public GasMixture Atmosphere = new();
|
||||
|
||||
/// <summary>
|
||||
/// Biome layers to add to the map, i.e. ores.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<ProtoId<BiomeMarkerLayerPrototype>> BiomeMarkerLayers = new();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Content.Shared.DeltaV.Salvage.Systems;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.DeltaV.Salvage.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Stores mining points for a holder, such as an ID card or ore processor.
|
||||
/// Mining points are gained by smelting ore and redeeming them to your ID card.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(MiningPointsSystem))]
|
||||
[AutoGenerateComponentState]
|
||||
public sealed partial class MiningPointsComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The number of points stored.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public uint Points;
|
||||
|
||||
/// <summary>
|
||||
/// Sound played when successfully transferring points to another holder.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier? TransferSound;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.DeltaV.Salvage.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Adds points to <see cref="MiningPointsComponent"/> when making a recipe that has miningPoints set.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class MiningPointsLatheComponent : Component;
|
||||
9
Content.Shared/DeltaV/Salvage/MiningPointsUI.cs
Normal file
9
Content.Shared/DeltaV/Salvage/MiningPointsUI.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.DeltaV.Salvage;
|
||||
|
||||
/// <summary>
|
||||
/// Message for a lathe to transfer its mining points to the user's id card.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class LatheClaimMiningPointsMessage : BoundUserInterfaceMessage;
|
||||
121
Content.Shared/DeltaV/Salvage/Systems/MiningPointsSystem.cs
Normal file
121
Content.Shared/DeltaV/Salvage/Systems/MiningPointsSystem.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.DeltaV.Salvage.Components;
|
||||
using Content.Shared.Lathe;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
|
||||
namespace Content.Shared.DeltaV.Salvage.Systems;
|
||||
|
||||
public sealed class MiningPointsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedIdCardSystem _idCard = default!;
|
||||
|
||||
private EntityQuery<MiningPointsComponent> _query;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_query = GetEntityQuery<MiningPointsComponent>();
|
||||
|
||||
SubscribeLocalEvent<MiningPointsLatheComponent, LatheStartPrintingEvent>(OnStartPrinting);
|
||||
Subs.BuiEvents<MiningPointsLatheComponent>(LatheUiKey.Key, subs =>
|
||||
{
|
||||
subs.Event<LatheClaimMiningPointsMessage>(OnClaimMiningPoints);
|
||||
});
|
||||
}
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
private void OnStartPrinting(Entity<MiningPointsLatheComponent> ent, ref LatheStartPrintingEvent args)
|
||||
{
|
||||
var points = args.Recipe.MiningPoints;
|
||||
if (points > 0)
|
||||
AddPoints(ent.Owner, points);
|
||||
}
|
||||
|
||||
private void OnClaimMiningPoints(Entity<MiningPointsLatheComponent> ent, ref LatheClaimMiningPointsMessage args)
|
||||
{
|
||||
var user = args.Actor;
|
||||
if (TryFindIdCard(user) is {} dest)
|
||||
TransferAll(ent.Owner, dest);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Public API
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find the user's id card and gets its <see cref="MiningPointsComponent"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Component is nullable for easy usage with the API due to Entity<T> not being usable for Entity<T?> arguments.
|
||||
/// </remarks>
|
||||
public Entity<MiningPointsComponent?>? TryFindIdCard(EntityUid user)
|
||||
{
|
||||
if (!_idCard.TryFindIdCard(user, out var idCard))
|
||||
return null;
|
||||
|
||||
if (!_query.TryComp(idCard, out var comp))
|
||||
return null;
|
||||
|
||||
return (idCard, comp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes points from a holder, returning true if it succeeded.
|
||||
/// </summary>
|
||||
public bool RemovePoints(Entity<MiningPointsComponent?> ent, uint amount)
|
||||
{
|
||||
if (!_query.Resolve(ent, ref ent.Comp) || amount > ent.Comp.Points)
|
||||
return false;
|
||||
|
||||
ent.Comp.Points -= amount;
|
||||
Dirty(ent);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add points to a holder.
|
||||
/// </summary>
|
||||
public bool AddPoints(Entity<MiningPointsComponent?> ent, uint amount)
|
||||
{
|
||||
if (!_query.Resolve(ent, ref ent.Comp))
|
||||
return false;
|
||||
|
||||
ent.Comp.Points += amount;
|
||||
Dirty(ent);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfer a number of points from source to destination.
|
||||
/// Returns true if the transfer succeeded.
|
||||
/// </summary>
|
||||
public bool Transfer(Entity<MiningPointsComponent?> src, Entity<MiningPointsComponent?> dest, uint amount)
|
||||
{
|
||||
// don't make a sound or anything
|
||||
if (amount == 0)
|
||||
return true;
|
||||
|
||||
if (!_query.Resolve(src, ref src.Comp) || !_query.Resolve(dest, ref dest.Comp))
|
||||
return false;
|
||||
|
||||
if (!RemovePoints(src, amount))
|
||||
return false;
|
||||
|
||||
AddPoints(dest, amount);
|
||||
_audio.PlayPvs(src.Comp.TransferSound, src);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfers all points from source to destination.
|
||||
/// Returns true if the transfer succeeded.
|
||||
/// </summary>
|
||||
public bool TransferAll(Entity<MiningPointsComponent?> src, Entity<MiningPointsComponent?> dest)
|
||||
{
|
||||
return _query.Resolve(src, ref src.Comp) && Transfer(src, dest, src.Comp.Points);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Content.Shared.DeltaV.Shuttles.Systems;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.DeltaV.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// A shuttle console that can only ftl-dock between 2 grids.
|
||||
/// The shuttle used must have <see cref="DockingShuttleComponent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedDockingConsoleSystem))]
|
||||
[AutoGenerateComponentState]
|
||||
public sealed partial class DockingConsoleComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Title of the window to use
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public LocId WindowTitle;
|
||||
|
||||
/// <summary>
|
||||
/// Airlock tag that it will prioritize docking to.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ProtoId<TagPrototype> DockTag;
|
||||
|
||||
/// <summary>
|
||||
/// A whitelist the shuttle has to match to be piloted.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public EntityWhitelist ShuttleWhitelist = new();
|
||||
|
||||
/// <summary>
|
||||
/// The shuttle that matches <see cref="ShuttleWhitelist"/>.
|
||||
/// If this is null a shuttle was not found and this console does nothing.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid? Shuttle;
|
||||
|
||||
/// <summary>
|
||||
/// Whether <see cref="Shuttle"/> is set on the server or not.
|
||||
/// Client can't use Shuttle outside of PVS range so that isn't networked.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool HasShuttle;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using Content.Shared.DeltaV.Shuttles.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.DeltaV.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Component that stores destinations a docking-only shuttle can use.
|
||||
/// Used by <see cref="DockingConsoleComponent"/> to access destinations.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedDockingShuttleSystem))]
|
||||
public sealed partial class DockingShuttleComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The station this shuttle belongs to.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public EntityUid? Station;
|
||||
|
||||
/// <summary>
|
||||
/// Every destination this console can FTL to.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<DockingDestination> Destinations = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A map a shuttle can FTL to.
|
||||
/// Created automatically on shuttle mapinit.
|
||||
/// </summary>
|
||||
[DataDefinition, Serializable, NetSerializable]
|
||||
public partial struct DockingDestination
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the destination to use in UI.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId Name;
|
||||
|
||||
/// <summary>
|
||||
/// The map ID.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public MapId Map;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.DeltaV.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Marker component for the mining shuttle grid.
|
||||
/// Used for lavaland's FTL whitelist.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class MiningShuttleComponent : Component;
|
||||
26
Content.Shared/DeltaV/Shuttles/DockingConsoleUI.cs
Normal file
26
Content.Shared/DeltaV/Shuttles/DockingConsoleUI.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Content.Shared.DeltaV.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Content.Shared.Timing;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.DeltaV.Shuttles;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum DockingConsoleUiKey : byte
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DockingConsoleState(FTLState ftlState, StartEndTime ftlTime, List<DockingDestination> destinations) : BoundUserInterfaceState
|
||||
{
|
||||
public FTLState FTLState = ftlState;
|
||||
public StartEndTime FTLTime = ftlTime;
|
||||
public List<DockingDestination> Destinations = destinations;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DockingConsoleFTLMessage(int index) : BoundUserInterfaceMessage
|
||||
{
|
||||
public int Index = index;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Content.Shared.DeltaV.Shuttles.Systems;
|
||||
|
||||
public abstract class SharedDockingConsoleSystem : EntitySystem;
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Content.Shared.DeltaV.Shuttles.Systems;
|
||||
|
||||
public abstract class SharedDockingShuttleSystem : EntitySystem;
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
/// <summary>
|
||||
/// Makes a <see cref="ShopVendorComponent"/> use mining points to buy items.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class PointsVendorComponent : Component;
|
||||
181
Content.Shared/DeltaV/VendingMachines/SharedShopVendorSystem.cs
Normal file
181
Content.Shared/DeltaV/VendingMachines/SharedShopVendorSystem.cs
Normal file
@@ -0,0 +1,181 @@
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.DeltaV.Salvage.Systems;
|
||||
using Content.Shared.Destructible;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.Power.EntitySystems;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Shared.VendingMachines;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
public abstract class SharedShopVendorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AccessReaderSystem _access = default!;
|
||||
[Dependency] private readonly MiningPointsSystem _points = default!;
|
||||
[Dependency] protected readonly IGameTiming Timing = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _light = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedPowerReceiverSystem _power = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PointsVendorComponent, ShopVendorBalanceEvent>(OnPointsBalance);
|
||||
SubscribeLocalEvent<PointsVendorComponent, ShopVendorPurchaseEvent>(OnPointsPurchase);
|
||||
|
||||
SubscribeLocalEvent<ShopVendorComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
SubscribeLocalEvent<ShopVendorComponent, BreakageEventArgs>(OnBreak);
|
||||
SubscribeLocalEvent<ShopVendorComponent, ActivatableUIOpenAttemptEvent>(OnOpenAttempt);
|
||||
Subs.BuiEvents<ShopVendorComponent>(VendingMachineUiKey.Key, subs =>
|
||||
{
|
||||
subs.Event<ShopVendorPurchaseMessage>(OnPurchase);
|
||||
});
|
||||
}
|
||||
|
||||
#region Public API
|
||||
|
||||
public uint GetBalance(EntityUid uid, EntityUid user)
|
||||
{
|
||||
var ev = new ShopVendorBalanceEvent(user);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
return ev.Balance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Balance adapters
|
||||
|
||||
private void OnPointsBalance(Entity<PointsVendorComponent> ent, ref ShopVendorBalanceEvent args)
|
||||
{
|
||||
args.Balance = _points.TryFindIdCard(args.User)?.Comp?.Points ?? 0;
|
||||
}
|
||||
|
||||
private void OnPointsPurchase(Entity<PointsVendorComponent> ent, ref ShopVendorPurchaseEvent args)
|
||||
{
|
||||
if (_points.TryFindIdCard(args.User) is {} idCard && _points.RemovePoints(idCard, args.Cost))
|
||||
args.Paid = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnPowerChanged(Entity<ShopVendorComponent> ent, ref PowerChangedEvent args)
|
||||
{
|
||||
UpdateVisuals(ent);
|
||||
}
|
||||
|
||||
private void OnBreak(Entity<ShopVendorComponent> ent, ref BreakageEventArgs args)
|
||||
{
|
||||
ent.Comp.Broken = true;
|
||||
UpdateVisuals(ent);
|
||||
}
|
||||
|
||||
private void OnOpenAttempt(Entity<ShopVendorComponent> ent, ref ActivatableUIOpenAttemptEvent args)
|
||||
{
|
||||
if (ent.Comp.Broken)
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnPurchase(Entity<ShopVendorComponent> ent, ref ShopVendorPurchaseMessage args)
|
||||
{
|
||||
if (ent.Comp.Ejecting != null || ent.Comp.Broken || !_power.IsPowered(ent.Owner))
|
||||
return;
|
||||
|
||||
var pack = _proto.Index(ent.Comp.Pack);
|
||||
if (args.Index < 0 || args.Index >= pack.Listings.Count)
|
||||
return;
|
||||
|
||||
var user = args.Actor;
|
||||
if (!_access.IsAllowed(user, ent))
|
||||
{
|
||||
Deny(ent, user);
|
||||
return;
|
||||
}
|
||||
|
||||
var listing = pack.Listings[args.Index];
|
||||
var ev = new ShopVendorPurchaseEvent(user, listing.Cost);
|
||||
RaiseLocalEvent(ent, ref ev);
|
||||
if (!ev.Paid)
|
||||
{
|
||||
Deny(ent, user);
|
||||
return;
|
||||
}
|
||||
|
||||
ent.Comp.Ejecting = listing.Id;
|
||||
ent.Comp.NextEject = Timing.CurTime + ent.Comp.EjectDelay;
|
||||
Dirty(ent);
|
||||
|
||||
_audio.PlayPvs(ent.Comp.PurchaseSound, ent);
|
||||
UpdateVisuals(ent);
|
||||
|
||||
Log.Debug($"Player {ToPrettyString(user):user} purchased {listing.Id} from {ToPrettyString(ent):vendor}");
|
||||
|
||||
AfterPurchase(ent);
|
||||
}
|
||||
|
||||
protected virtual void AfterPurchase(Entity<ShopVendorComponent> ent)
|
||||
{
|
||||
}
|
||||
|
||||
private void Deny(Entity<ShopVendorComponent> ent, EntityUid user)
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("vending-machine-component-try-eject-access-denied"), ent, user);
|
||||
if (ent.Comp.Denying)
|
||||
return;
|
||||
|
||||
ent.Comp.Denying = true;
|
||||
ent.Comp.NextDeny = Timing.CurTime + ent.Comp.DenyDelay;
|
||||
Dirty(ent);
|
||||
|
||||
_audio.PlayPvs(ent.Comp.DenySound, ent);
|
||||
UpdateVisuals(ent);
|
||||
}
|
||||
|
||||
protected void UpdateVisuals(Entity<ShopVendorComponent> ent)
|
||||
{
|
||||
var state = VendingMachineVisualState.Normal;
|
||||
var lit = true;
|
||||
if (ent.Comp.Broken)
|
||||
{
|
||||
state = VendingMachineVisualState.Broken;
|
||||
lit = false;
|
||||
}
|
||||
else if (ent.Comp.Ejecting != null)
|
||||
{
|
||||
state = VendingMachineVisualState.Eject;
|
||||
}
|
||||
else if (ent.Comp.Denying)
|
||||
{
|
||||
state = VendingMachineVisualState.Deny;
|
||||
}
|
||||
else if (!_power.IsPowered(ent.Owner))
|
||||
{
|
||||
state = VendingMachineVisualState.Off;
|
||||
lit = true;
|
||||
}
|
||||
|
||||
_light.SetEnabled(ent, lit);
|
||||
_appearance.SetData(ent, VendingMachineVisuals.VisualState, state);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised on a shop vendor to get its current balance.
|
||||
/// A currency component sets Balance to whatever it is.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct ShopVendorBalanceEvent(EntityUid User, uint Balance = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Raised on a shop vendor when trying to purchase an item.
|
||||
/// A currency component sets Paid to true if the user successfully paid for it.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct ShopVendorPurchaseEvent(EntityUid User, uint Cost, bool Paid = false);
|
||||
@@ -0,0 +1,23 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
/// <summary>
|
||||
/// Similar to <c>VendingMachineInventoryPrototype</c> but for <see cref="ShopVendorComponent"/>.
|
||||
/// </summary>
|
||||
[Prototype]
|
||||
public sealed class ShopInventoryPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The item listings for sale.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public List<ShopListing> Listings = new();
|
||||
}
|
||||
|
||||
[DataRecord, Serializable]
|
||||
public record struct ShopListing(EntProtoId Id, uint Cost);
|
||||
96
Content.Shared/DeltaV/VendingMachines/ShopVendorComponent.cs
Normal file
96
Content.Shared/DeltaV/VendingMachines/ShopVendorComponent.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
/// <summary>
|
||||
/// A vending machine that sells items for a currency controlled by events.
|
||||
/// Does not need restocking.
|
||||
/// Another component must handle <see cref="ShopVendorBalanceEvent"/> and <see cref="ShopVendorPurchaseEvent"/> to work.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedShopVendorSystem))]
|
||||
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class ShopVendorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The inventory prototype to sell.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ShopInventoryPrototype> Pack;
|
||||
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool Broken;
|
||||
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool Denying;
|
||||
|
||||
/// <summary>
|
||||
/// Item being ejected, or null if it isn't.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public EntProtoId? Ejecting;
|
||||
|
||||
/// <summary>
|
||||
/// How long to wait before flashing denied again.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public TimeSpan DenyDelay = TimeSpan.FromSeconds(2);
|
||||
|
||||
/// <summary>
|
||||
/// How long to wait before another item can be bought
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public TimeSpan EjectDelay = TimeSpan.FromSeconds(1.2);
|
||||
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextDeny;
|
||||
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextEject;
|
||||
|
||||
[DataField]
|
||||
public SoundSpecifier PurchaseSound = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg")
|
||||
{
|
||||
Params = new AudioParams
|
||||
{
|
||||
Volume = -4f,
|
||||
Variation = 0.15f
|
||||
}
|
||||
};
|
||||
|
||||
[DataField]
|
||||
public SoundSpecifier DenySound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg")
|
||||
{
|
||||
Params = new AudioParams
|
||||
{
|
||||
Volume = -2f
|
||||
}
|
||||
};
|
||||
|
||||
#region Visuals
|
||||
|
||||
[DataField]
|
||||
public bool LoopDenyAnimation = true;
|
||||
|
||||
[DataField]
|
||||
public string? OffState;
|
||||
|
||||
[DataField]
|
||||
public string? ScreenState;
|
||||
|
||||
[DataField]
|
||||
public string? NormalState;
|
||||
|
||||
[DataField]
|
||||
public string? DenyState;
|
||||
|
||||
[DataField]
|
||||
public string? EjectState;
|
||||
|
||||
[DataField]
|
||||
public string? BrokenState;
|
||||
|
||||
#endregion
|
||||
}
|
||||
9
Content.Shared/DeltaV/VendingMachines/ShopVendorUI.cs
Normal file
9
Content.Shared/DeltaV/VendingMachines/ShopVendorUI.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.DeltaV.VendingMachines;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ShopVendorPurchaseMessage(int index) : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly int Index = index;
|
||||
}
|
||||
@@ -69,5 +69,13 @@ namespace Content.Shared.Research.Prototypes
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<ProtoId<LatheCategoryPrototype>> Categories = new();
|
||||
public ProtoId<LatheCategoryPrototype>? Category;
|
||||
|
||||
/// <summary>
|
||||
/// DeltaV: Number of mining points this recipe adds to an oreproc when printed.
|
||||
/// Scales with stack count.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public uint MiningPoints;
|
||||
}
|
||||
}
|
||||
|
||||
2
Resources/Locale/en-US/deltav/lathe/ui/lathe-menu.ftl
Normal file
2
Resources/Locale/en-US/deltav/lathe/ui/lathe-menu.ftl
Normal file
@@ -0,0 +1,2 @@
|
||||
lathe-menu-mining-points = Mining Points: {$points}
|
||||
lathe-menu-mining-points-claim-button = Claim Points
|
||||
@@ -0,0 +1,7 @@
|
||||
docking-console-no-shuttle = No Shuttle Detected
|
||||
docking-console-ftl = FTL
|
||||
|
||||
mining-console-window-title = Mining Shuttle Console
|
||||
|
||||
shuttle-destination-lavaland = Lavaland
|
||||
shuttle-destination-glacier-surface = Glacier Surface
|
||||
@@ -0,0 +1,4 @@
|
||||
shop-vendor-balance = Balance: {$points}
|
||||
shop-vendor-stack-suffix = x{$count}
|
||||
shop-vendor-flavor-left = All payments are secure
|
||||
shop-vendor-flavor-right = v1.2
|
||||
3866
Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml
Normal file
3866
Resources/Maps/Nonstations/DeltaV/lavaland_mining_base.yml
Normal file
File diff suppressed because it is too large
Load Diff
495
Resources/Maps/Shuttles/DeltaV/mining.yml
Normal file
495
Resources/Maps/Shuttles/DeltaV/mining.yml
Normal file
@@ -0,0 +1,495 @@
|
||||
meta:
|
||||
format: 6
|
||||
postmapinit: false
|
||||
tilemap:
|
||||
0: Space
|
||||
74: FloorMono
|
||||
84: FloorReinforced
|
||||
89: FloorShuttleBlue
|
||||
98: FloorSteel
|
||||
130: Lattice
|
||||
131: Plating
|
||||
entities:
|
||||
- proto: ""
|
||||
entities:
|
||||
- uid: 1
|
||||
components:
|
||||
- type: MetaData
|
||||
name: Mining Shuttle
|
||||
- type: Transform
|
||||
- type: MapGrid
|
||||
chunks:
|
||||
0,0:
|
||||
ind: 0,0
|
||||
tiles: YgAAAAAAYgAAAAAASgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYgAAAAAAYgAAAAAAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWQAAAAAAWQAAAAAAgwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAAAAAAAgwAAAAAAggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
version: 6
|
||||
- type: Broadphase
|
||||
- type: Physics
|
||||
bodyStatus: InAir
|
||||
angularDamping: 0.05
|
||||
linearDamping: 0.05
|
||||
fixedRotation: False
|
||||
bodyType: Dynamic
|
||||
- type: Fixtures
|
||||
fixtures: {}
|
||||
- type: OccluderTree
|
||||
- type: SpreaderGrid
|
||||
- type: Shuttle
|
||||
- type: MiningShuttle
|
||||
- type: DockingShuttle
|
||||
destinations: []
|
||||
- type: ProtectedGrid
|
||||
- type: Gravity
|
||||
gravityShakeSound: !type:SoundPathSpecifier
|
||||
path: /Audio/Effects/alert.ogg
|
||||
- type: GridPathfinding
|
||||
- type: DecalGrid
|
||||
chunkCollection:
|
||||
version: 2
|
||||
nodes: []
|
||||
- type: GridAtmosphere
|
||||
version: 2
|
||||
data:
|
||||
tiles:
|
||||
0,0:
|
||||
0: 823
|
||||
1: 16384
|
||||
0,-1:
|
||||
0: 13072
|
||||
1: 64
|
||||
-1,0:
|
||||
0: 2184
|
||||
1: 16384
|
||||
-1,-1:
|
||||
0: 34816
|
||||
1: 64
|
||||
uniqueMixes:
|
||||
- volume: 2500
|
||||
temperature: 293.15
|
||||
moles:
|
||||
- 21.824879
|
||||
- 82.10312
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- volume: 2500
|
||||
immutable: True
|
||||
moles:
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
- 0
|
||||
chunkSize: 4
|
||||
- type: GasTileOverlay
|
||||
- type: RadiationGridResistance
|
||||
- proto: AirlockShuttle
|
||||
entities:
|
||||
- uid: 2
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: 2.5,0.5
|
||||
parent: 1
|
||||
- proto: APCBasic
|
||||
entities:
|
||||
- uid: 3
|
||||
components:
|
||||
- type: Transform
|
||||
rot: -1.5707963267948966 rad
|
||||
pos: 2.5,-1.5
|
||||
parent: 1
|
||||
- proto: AtmosDeviceFanDirectional
|
||||
entities:
|
||||
- uid: 4
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: 2.5,0.5
|
||||
parent: 1
|
||||
- proto: CableApcExtension
|
||||
entities:
|
||||
- uid: 5
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,-1.5
|
||||
parent: 1
|
||||
- uid: 6
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,-1.5
|
||||
parent: 1
|
||||
- uid: 7
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- uid: 8
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-0.5
|
||||
parent: 1
|
||||
- uid: 9
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,0.5
|
||||
parent: 1
|
||||
- uid: 10
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,1.5
|
||||
parent: 1
|
||||
- uid: 11
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,2.5
|
||||
parent: 1
|
||||
- proto: CableHV
|
||||
entities:
|
||||
- uid: 12
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-2.5
|
||||
parent: 1
|
||||
- uid: 13
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-1.5
|
||||
parent: 1
|
||||
- uid: 14
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,-1.5
|
||||
parent: 1
|
||||
- proto: CableMV
|
||||
entities:
|
||||
- uid: 15
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,-1.5
|
||||
parent: 1
|
||||
- uid: 16
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- uid: 17
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,-1.5
|
||||
parent: 1
|
||||
- uid: 18
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,-1.5
|
||||
parent: 1
|
||||
- uid: 19
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-1.5
|
||||
parent: 1
|
||||
- proto: ChairPilotSeat
|
||||
entities:
|
||||
- uid: 20
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 0.5,1.5
|
||||
parent: 1
|
||||
- uid: 21
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: -0.5,-0.5
|
||||
parent: 1
|
||||
- uid: 22
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 0.5,-0.5
|
||||
parent: 1
|
||||
- uid: 23
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 1.5,-0.5
|
||||
parent: 1
|
||||
- proto: ComputerShuttleMining
|
||||
entities:
|
||||
- uid: 24
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,2.5
|
||||
parent: 1
|
||||
- proto: CrateGenericSteel
|
||||
entities:
|
||||
- uid: 25
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-1.5
|
||||
parent: 1
|
||||
- proto: GasPassiveVent
|
||||
entities:
|
||||
- uid: 26
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 0.5,-2.5
|
||||
parent: 1
|
||||
- type: AtmosPipeColor
|
||||
color: '#990000FF'
|
||||
- proto: GasPipeStraight
|
||||
entities:
|
||||
- uid: 27
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-0.5
|
||||
parent: 1
|
||||
- type: AtmosPipeColor
|
||||
color: '#990000FF'
|
||||
- uid: 28
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- type: AtmosPipeColor
|
||||
color: '#990000FF'
|
||||
- proto: GasVentScrubber
|
||||
entities:
|
||||
- uid: 29
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,0.5
|
||||
parent: 1
|
||||
- type: AtmosPipeColor
|
||||
color: '#990000FF'
|
||||
- proto: GeneratorWallmountBasic
|
||||
entities:
|
||||
- uid: 30
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-2.5
|
||||
parent: 1
|
||||
- proto: GravityGeneratorMini
|
||||
entities:
|
||||
- uid: 63
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- proto: Grille
|
||||
entities:
|
||||
- uid: 31
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,-0.5
|
||||
parent: 1
|
||||
- uid: 32
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,1.5
|
||||
parent: 1
|
||||
- uid: 33
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,1.5
|
||||
parent: 1
|
||||
- uid: 34
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,-0.5
|
||||
parent: 1
|
||||
- uid: 35
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,3.5
|
||||
parent: 1
|
||||
- proto: OreBox
|
||||
entities:
|
||||
- uid: 36
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,-1.5
|
||||
parent: 1
|
||||
- proto: Poweredlight
|
||||
entities:
|
||||
- uid: 37
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: -0.5,0.5
|
||||
parent: 1
|
||||
- proto: ShuttleWindow
|
||||
entities:
|
||||
- uid: 38
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,1.5
|
||||
parent: 1
|
||||
- uid: 39
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 0.5,3.5
|
||||
parent: 1
|
||||
- uid: 40
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,1.5
|
||||
parent: 1
|
||||
- uid: 41
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,-0.5
|
||||
parent: 1
|
||||
- uid: 42
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,-0.5
|
||||
parent: 1
|
||||
- proto: SubstationWallBasic
|
||||
entities:
|
||||
- uid: 43
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: -1.5,-1.5
|
||||
parent: 1
|
||||
- proto: Table
|
||||
entities:
|
||||
- uid: 44
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,2.5
|
||||
parent: 1
|
||||
- uid: 45
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,2.5
|
||||
parent: 1
|
||||
- proto: Thruster
|
||||
entities:
|
||||
- uid: 46
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 0.5,-2.5
|
||||
parent: 1
|
||||
- proto: WallShuttle
|
||||
entities:
|
||||
- uid: 47
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,2.5
|
||||
parent: 1
|
||||
- uid: 48
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,3.5
|
||||
parent: 1
|
||||
- uid: 49
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,3.5
|
||||
parent: 1
|
||||
- uid: 50
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,2.5
|
||||
parent: 1
|
||||
- uid: 51
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,0.5
|
||||
parent: 1
|
||||
- uid: 52
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,-1.5
|
||||
parent: 1
|
||||
- uid: 53
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,-2.5
|
||||
parent: 1
|
||||
- uid: 54
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 1.5,-2.5
|
||||
parent: 1
|
||||
- uid: 55
|
||||
components:
|
||||
- type: Transform
|
||||
pos: 2.5,-1.5
|
||||
parent: 1
|
||||
- proto: WallShuttleDiagonal
|
||||
entities:
|
||||
- uid: 56
|
||||
components:
|
||||
- type: Transform
|
||||
rot: -1.5707963267948966 rad
|
||||
pos: 2.5,3.5
|
||||
parent: 1
|
||||
- uid: 57
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 2.5,-2.5
|
||||
parent: 1
|
||||
- uid: 58
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: -1.5,-2.5
|
||||
parent: 1
|
||||
- uid: 59
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -1.5,3.5
|
||||
parent: 1
|
||||
- proto: WindowReinforcedDirectional
|
||||
entities:
|
||||
- uid: 60
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 1.5707963267948966 rad
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- uid: 61
|
||||
components:
|
||||
- type: Transform
|
||||
rot: -1.5707963267948966 rad
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
- uid: 62
|
||||
components:
|
||||
- type: Transform
|
||||
rot: 3.141592653589793 rad
|
||||
pos: 0.5,-1.5
|
||||
parent: 1
|
||||
...
|
||||
@@ -146,15 +146,15 @@
|
||||
category: cargoproduct-category-name-service
|
||||
group: market
|
||||
|
||||
- type: cargoProduct
|
||||
id: CrateVendingMachineRestockSalvageEquipment
|
||||
icon:
|
||||
sprite: Objects/Specific/Service/vending_machine_restock.rsi
|
||||
state: base
|
||||
product: CrateVendingMachineRestockSalvageEquipmentFilled
|
||||
cost: 1500
|
||||
category: cargoproduct-category-name-engineering
|
||||
group: market
|
||||
#- type: cargoProduct # DeltaV: Salvage vendor doesn't have stock anymore
|
||||
# id: CrateVendingMachineRestockSalvageEquipment
|
||||
# icon:
|
||||
# sprite: Objects/Specific/Service/vending_machine_restock.rsi
|
||||
# state: base
|
||||
# product: CrateVendingMachineRestockSalvageEquipmentFilled
|
||||
# cost: 1000
|
||||
# category: cargoproduct-category-name-engineering
|
||||
# group: market
|
||||
|
||||
- type: cargoProduct
|
||||
id: CrateVendingMachineRestockSecTech
|
||||
|
||||
@@ -154,16 +154,15 @@
|
||||
id: VendingMachineRestockRobustSoftdrinks
|
||||
amount: 2
|
||||
|
||||
- type: entity
|
||||
id: CrateVendingMachineRestockSalvageEquipmentFilled
|
||||
parent: CrateGenericSteel
|
||||
name: Salvage restock crate
|
||||
description: Contains a restock box for the salvage vendor.
|
||||
components:
|
||||
- type: EntityTableContainerFill
|
||||
containers:
|
||||
entity_storage:
|
||||
id: VendingMachineRestockSalvageEquipment
|
||||
#- type: entity # DeltaV: Salvage vendor doesn't have stock anymore
|
||||
# id: CrateVendingMachineRestockSalvageEquipmentFilled
|
||||
# parent: CrateGenericSteel
|
||||
# name: Salvage restock crate
|
||||
# description: Contains a restock box for the salvage vendor.
|
||||
# components:
|
||||
# - type: StorageFill
|
||||
# contents:
|
||||
# - id: VendingMachineRestockSalvageEquipment
|
||||
|
||||
- type: entity
|
||||
id: CrateVendingMachineRestockSecTechFilled
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
id: LockerFillSalvageSpecialist
|
||||
table: !type:AllSelector
|
||||
children:
|
||||
- id: Pickaxe
|
||||
- id: WeaponProtoKineticAccelerator
|
||||
- id: FlashlightSeclite
|
||||
- id: ClothingEyesGlassesMeson
|
||||
- id: ClothingBeltUtilityFilled
|
||||
- id: SurvivalKnife
|
||||
- id: HandheldGPSBasic
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- id: BoxFolderQmClipboard
|
||||
- id: BoxQMCircuitboards
|
||||
- id: BoxQMStamps
|
||||
- id: MiningShuttleConsoleCircuitboard
|
||||
- id: CigPackGreen
|
||||
prob: 0.50
|
||||
- id: ClothingHeadsetAltCargo
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
- type: entity
|
||||
parent: ClothingBackpackDuffelSalvage
|
||||
id: ClothingBackpackDuffelSalvageConscription
|
||||
name: mining conscription kit
|
||||
description: A duffel bag containing everything a crewmember needs to support a shaft miner in the field.
|
||||
components:
|
||||
- type: StorageFill
|
||||
contents:
|
||||
- id: ClothingEyesGlassesMeson
|
||||
- id: MineralScanner
|
||||
- id: OreBag
|
||||
- id: ClothingUniformJumpsuitSalvageSpecialist
|
||||
- id: EncryptionKeyCargo
|
||||
- id: ClothingMaskGasExplorer
|
||||
- id: SalvageIDCard
|
||||
- id: WeaponProtoKineticAccelerator
|
||||
- id: SurvivalKnife
|
||||
- id: FlashlightSeclite
|
||||
@@ -0,0 +1,53 @@
|
||||
- type: shopInventory
|
||||
id: SalvageVendorInventory
|
||||
listings:
|
||||
# TODO: marker beacons 1/10/30 for 10 each
|
||||
- id: DrinkWhiskeyBottleFull
|
||||
cost: 100
|
||||
- id: DrinkAbsintheBottleFull
|
||||
cost: 100
|
||||
- id: CigarGold
|
||||
cost: 150
|
||||
- id: Soap
|
||||
cost: 200
|
||||
- id: SeismicCharge
|
||||
cost: 250
|
||||
- id: WeaponGrapplingGun
|
||||
cost: 300
|
||||
# TODO: laser pointer 300, toy facehugger 300
|
||||
# TODO: stabilizing serum for 400
|
||||
- id: FultonBeacon
|
||||
cost: 400
|
||||
# TODO: bluespace shelter capsule for 400
|
||||
- id: ClothingEyesGlassesGarMeson
|
||||
cost: 500
|
||||
- id: ClothingBeltSalvageWebbing
|
||||
cost: 500
|
||||
- id: MedkitBruteFilled
|
||||
cost: 600
|
||||
- id: MedkitBurnFilled
|
||||
cost: 600
|
||||
# TODO: salvage 5g, 3 implants and a locator for 600
|
||||
# TODO: wormhole jaunter for 750
|
||||
- id: WeaponCrusher
|
||||
cost: 750
|
||||
- id: WeaponProtoKineticAccelerator
|
||||
cost: 750
|
||||
- id: AdvancedMineralScanner
|
||||
cost: 800
|
||||
# TODO: resonator for 800
|
||||
- id: Fulton
|
||||
cost: 1000
|
||||
# TODO: lazarus injector for 1k
|
||||
- id: ClothingBackpackDuffelSalvageConscription
|
||||
cost: 1500
|
||||
- id: SpaceCash1000
|
||||
cost: 2000
|
||||
# TODO: super resonator for 2500
|
||||
# TODO: jump boots for 2500
|
||||
- id: ClothingOuterHardsuitSalvage
|
||||
cost: 3000
|
||||
# TODO: luxury shelter capsule for 3k
|
||||
# TODO: luxury elite bar capsule for 10k
|
||||
# TODO: pka mods
|
||||
# TODO: mining drone stuff
|
||||
@@ -0,0 +1,7 @@
|
||||
- type: entity
|
||||
parent: ClothingEyesGlassesGar
|
||||
id: ClothingEyesGlassesGarMeson
|
||||
name: gar mesons
|
||||
description: Do the impossible, see the invisible!
|
||||
components:
|
||||
- type: EyeProtection
|
||||
@@ -0,0 +1,10 @@
|
||||
- type: entity
|
||||
parent: BaseComputerCircuitboard
|
||||
id: MiningShuttleConsoleCircuitboard
|
||||
name: mining shuttle console board
|
||||
description: A printed circuit board for a mining shuttle console.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: cpu_supply
|
||||
- type: ComputerBoard
|
||||
prototype: ComputerShuttleMining
|
||||
7
Resources/Prototypes/DeltaV/Entities/Stations/base.yml
Normal file
7
Resources/Prototypes/DeltaV/Entities/Stations/base.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
- type: entity
|
||||
abstract: true
|
||||
id: BaseStationLavaland
|
||||
components:
|
||||
- type: StationPlanetSpawner
|
||||
planet: Lavaland
|
||||
gridPath: /Maps/Nonstations/DeltaV/lavaland_mining_base.yml
|
||||
@@ -0,0 +1,24 @@
|
||||
# this goes on lavaland, unlimited
|
||||
- type: entity
|
||||
parent: AirlockGlassShuttle
|
||||
id: AirlockExternalGlassShuttleMining
|
||||
suffix: External, Mining, Glass, Docking, Locked
|
||||
components:
|
||||
- type: PriorityDock
|
||||
tag: DockMining
|
||||
- type: ContainerFill
|
||||
containers:
|
||||
board: [ DoorElectronicsExternal ]
|
||||
|
||||
# 1 per map, this spawns the mining shuttle
|
||||
- type: entity
|
||||
parent: AirlockExternalGlassShuttleMining
|
||||
id: AirlockExternalGlassShuttleMiningFilled
|
||||
suffix: Mining, Filled, Locked
|
||||
components:
|
||||
- type: GridFill
|
||||
path: /Maps/Shuttles/DeltaV/mining.yml
|
||||
addComponents:
|
||||
- type: IFF
|
||||
flags:
|
||||
- HideLabel
|
||||
@@ -0,0 +1,50 @@
|
||||
- type: entity
|
||||
abstract: true
|
||||
parent: BaseComputer
|
||||
id: BaseComputerDocking
|
||||
components:
|
||||
- type: Sprite
|
||||
layers:
|
||||
- map: [ "computerLayerBody" ]
|
||||
state: computer
|
||||
- map: [ "computerLayerKeyboard" ]
|
||||
state: generic_keyboard
|
||||
- map: [ "computerLayerScreen" ]
|
||||
state: shuttle
|
||||
- map: ["computerLayerKeys" ]
|
||||
state: generic_keys
|
||||
- map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
|
||||
state: generic_panel_open
|
||||
- type: ActivatableUI
|
||||
key: enum.DockingConsoleUiKey.Key
|
||||
- type: UserInterface
|
||||
interfaces:
|
||||
enum.DockingConsoleUiKey.Key:
|
||||
type: DockingConsoleBoundUserInterface
|
||||
enum.WiresUiKey.Key:
|
||||
type: WiresBoundUserInterface
|
||||
- type: WorldLoader
|
||||
radius: 256
|
||||
- type: DockingConsole
|
||||
- type: PointLight
|
||||
radius: 1.5
|
||||
energy: 1.6
|
||||
color: "#43ccb5"
|
||||
|
||||
- type: entity
|
||||
parent: BaseComputerDocking
|
||||
id: ComputerShuttleMining
|
||||
name: mining shuttle console
|
||||
description: Used to pilot the mining shuttle to and from the mining base.
|
||||
components:
|
||||
- type: DockingConsole
|
||||
windowTitle: mining-console-window-title
|
||||
dockTag: DockMining
|
||||
shuttleWhitelist:
|
||||
components:
|
||||
- MiningShuttle
|
||||
- type: Computer
|
||||
board: MiningShuttleConsoleCircuitboard
|
||||
- type: AccessReader
|
||||
access:
|
||||
- [ Salvage ]
|
||||
7
Resources/Prototypes/DeltaV/Wires/layouts.yml
Normal file
7
Resources/Prototypes/DeltaV/Wires/layouts.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
- type: wireLayout
|
||||
id: ShopVendor
|
||||
wires:
|
||||
- !type:AiInteractWireAction
|
||||
- !type:PowerWireAction
|
||||
- !type:AccessWireAction
|
||||
- !type:LogWireAction
|
||||
2
Resources/Prototypes/DeltaV/tags.yml
Normal file
2
Resources/Prototypes/DeltaV/tags.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: Tag
|
||||
id: DockMining
|
||||
@@ -25,6 +25,7 @@
|
||||
- WhitelistChameleonIdCard
|
||||
- type: StealTarget
|
||||
stealGroup: IDCard
|
||||
- type: MiningPoints # DeltaV
|
||||
|
||||
#IDs with layers
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
slots:
|
||||
- belt
|
||||
- type: Item
|
||||
size: Ginormous
|
||||
size: Huge # DeltaV: Was Ginormous, lets it fit in conscription bag
|
||||
- type: Storage
|
||||
maxItemSize: Normal
|
||||
grid:
|
||||
|
||||
@@ -363,6 +363,7 @@
|
||||
- state: refill_sec
|
||||
|
||||
- type: entity
|
||||
abstract: true # DeltaV: Salvage vendor doesn't have stock anymore
|
||||
parent: BaseVendingMachineRestock
|
||||
id: VendingMachineRestockSalvageEquipment
|
||||
name: Salvage Vendor restock box
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
- BaseStationAllEventsEligible
|
||||
- BaseStationNanotrasen
|
||||
- BaseStationDeliveries
|
||||
- BaseStationLavaland # DeltaV
|
||||
categories: [ HideSpawnMenu ]
|
||||
components:
|
||||
- type: Transform
|
||||
|
||||
@@ -603,6 +603,10 @@
|
||||
staticPacks:
|
||||
- OreSmelting
|
||||
- RGlassSmelting
|
||||
- type: MiningPoints # DeltaV - Source of mining points for miners
|
||||
transferSound:
|
||||
path: /Audio/Effects/Cargo/ping.ogg
|
||||
- type: MiningPointsLathe # DeltaV
|
||||
|
||||
- type: entity
|
||||
parent: OreProcessor
|
||||
|
||||
@@ -1464,12 +1464,12 @@
|
||||
name: Salvage Vendor
|
||||
description: A dwarf's best friend!
|
||||
components:
|
||||
- type: VendingMachine
|
||||
pack: SalvageEquipmentInventory
|
||||
offState: off
|
||||
brokenState: broken
|
||||
normalState: normal-unshaded
|
||||
denyState: deny-unshaded
|
||||
#- type: VendingMachine # DeltaV: Use mining points instead of limited stock
|
||||
# pack: SalvageEquipmentInventory
|
||||
# offState: off
|
||||
# brokenState: broken
|
||||
# normalState: normal-unshaded
|
||||
# denyState: deny-unshaded
|
||||
- type: Sprite
|
||||
sprite: Structures/Machines/VendingMachines/mining.rsi
|
||||
layers:
|
||||
@@ -1484,6 +1484,21 @@
|
||||
radius: 1.5
|
||||
energy: 3.0
|
||||
color: "#b89f25"
|
||||
- type: ShopVendor # DeltaV
|
||||
pack: SalvageVendorInventory
|
||||
offState: off
|
||||
brokenState: broken
|
||||
normalState: normal-unshaded
|
||||
denyState: deny-unshaded
|
||||
- type: PointsVendor # DeltaV
|
||||
- type: UserInterface # DeltaV: Replace vending machine BUI with shop vendor
|
||||
interfaces:
|
||||
enum.VendingMachineUiKey.Key:
|
||||
type: ShopVendorBoundUserInterface
|
||||
enum.WiresUiKey.Key:
|
||||
type: WiresBoundUserInterface
|
||||
- type: Wires # DeltaV: Use shop vendor wires layout
|
||||
layoutId: ShopVendor
|
||||
- type: AccessReader
|
||||
access: [["Salvage"]]
|
||||
- type: GuideHelp
|
||||
|
||||
@@ -656,13 +656,18 @@
|
||||
startNode: start
|
||||
targetNode: Catwalk
|
||||
category: construction-category-structures
|
||||
conditions:
|
||||
- !type:TileNotBlocked
|
||||
failIfSpace: false
|
||||
- !type:TileType
|
||||
targets:
|
||||
- Lattice
|
||||
- Plating
|
||||
description: Just like a lattice. Except it looks better.
|
||||
# DeltaV - This prevented building catwalk over lava
|
||||
#conditions:
|
||||
#- !type:TileNotBlocked
|
||||
# failIfSpace: false
|
||||
#- !type:TileType
|
||||
# targets:
|
||||
# - Lattice
|
||||
# - Plating
|
||||
icon:
|
||||
sprite: Structures/catwalk.rsi
|
||||
state: catwalk_preview
|
||||
objectType: Structure
|
||||
placementMode: SnapgridCenter
|
||||
canBuildInImpassable: false
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
id: SheetSteel
|
||||
result: SheetSteel1
|
||||
completetime: 0
|
||||
miningPoints: 1 # DeltaV
|
||||
materials:
|
||||
RawIron: 100
|
||||
Coal: 30
|
||||
@@ -18,6 +19,7 @@
|
||||
id: SheetGlass1
|
||||
result: SheetGlass1
|
||||
completetime: 0
|
||||
miningPoints: 1 # DeltaV
|
||||
materials:
|
||||
RawQuartz: 100
|
||||
|
||||
@@ -43,6 +45,7 @@
|
||||
id: SheetRGlassRaw
|
||||
result: SheetRGlass1
|
||||
completetime: 0
|
||||
miningPoints: 1 # DeltaV: not using float so unlucky, dont print this anyway
|
||||
materials:
|
||||
RawQuartz: 100
|
||||
RawIron: 50
|
||||
@@ -61,6 +64,7 @@
|
||||
id: SheetPGlass1
|
||||
result: SheetPGlass1
|
||||
completetime: 0
|
||||
miningPoints: 16 # DeltaV
|
||||
materials:
|
||||
RawQuartz: 100
|
||||
RawPlasma: 100
|
||||
@@ -77,6 +81,7 @@
|
||||
id: SheetRPGlass1
|
||||
result: SheetRPGlass1
|
||||
completetime: 0
|
||||
miningPoints: 16 # DeltaV
|
||||
materials:
|
||||
RawQuartz: 100
|
||||
RawPlasma: 100
|
||||
@@ -97,6 +102,7 @@
|
||||
id: SheetPlasma1
|
||||
result: SheetPlasma1
|
||||
completetime: 0
|
||||
miningPoints: 15 # DeltaV
|
||||
materials:
|
||||
RawPlasma: 100
|
||||
|
||||
@@ -111,6 +117,7 @@
|
||||
id: SheetPlasteel1
|
||||
result: SheetPlasteel1
|
||||
completetime: 0
|
||||
miningPoints: 17 # DeltaV
|
||||
materials:
|
||||
RawPlasma: 100
|
||||
RawIron: 200 #Twice as durable as steel, Twice the material cost
|
||||
@@ -136,6 +143,7 @@
|
||||
id: SheetUGlass1
|
||||
result: SheetUGlass1
|
||||
completetime: 0
|
||||
miningPoints: 31 # DeltaV
|
||||
materials:
|
||||
RawUranium: 100
|
||||
RawQuartz: 100
|
||||
@@ -152,6 +160,7 @@
|
||||
id: SheetRUGlass1
|
||||
result: SheetRUGlass1
|
||||
completetime: 0
|
||||
miningPoints: 31 # DeltaV
|
||||
materials:
|
||||
RawUranium: 100
|
||||
RawQuartz: 100
|
||||
@@ -193,6 +202,7 @@
|
||||
id: MaterialDiamond
|
||||
result: MaterialDiamond1
|
||||
completetime: 0
|
||||
miningPoints: 50 # DeltaV
|
||||
materials:
|
||||
RawDiamond: 100
|
||||
|
||||
@@ -200,6 +210,7 @@
|
||||
id: SheetUranium1
|
||||
result: SheetUranium1
|
||||
completetime: 0
|
||||
miningPoints: 30 # DeltaV
|
||||
materials:
|
||||
RawUranium: 100
|
||||
|
||||
@@ -207,6 +218,7 @@
|
||||
id: IngotGold1
|
||||
result: IngotGold1
|
||||
completetime: 0
|
||||
miningPoints: 18 # DeltaV
|
||||
materials:
|
||||
RawGold: 100
|
||||
|
||||
@@ -214,6 +226,7 @@
|
||||
id: IngotSilver1
|
||||
result: IngotSilver1
|
||||
completetime: 0
|
||||
miningPoints: 16 # DeltaV
|
||||
materials:
|
||||
RawSilver: 100
|
||||
|
||||
@@ -229,6 +242,7 @@
|
||||
id: MaterialBananium1
|
||||
result: MaterialBananium1
|
||||
completetime: 0
|
||||
miningPoints: 60 # DeltaV
|
||||
materials:
|
||||
RawBananium: 100
|
||||
|
||||
|
||||
26
Resources/Prototypes/planets.yml
Normal file
26
Resources/Prototypes/planets.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- type: planet
|
||||
id: Lavaland
|
||||
biome: Lava
|
||||
mapName: shuttle-destination-lavaland
|
||||
mapLight: "#A34931"
|
||||
addedComponents:
|
||||
- type: FTLDestination
|
||||
whitelist:
|
||||
components:
|
||||
- MiningShuttle
|
||||
atmosphere:
|
||||
volume: 2500
|
||||
temperature: 353.15 # 80C
|
||||
moles: # 120kPa, 14% O2 (unbreathable)
|
||||
- 14.38346
|
||||
- 88.35554
|
||||
biomeMarkerLayers:
|
||||
- OreIron
|
||||
- OreQuartz
|
||||
- OreCoal
|
||||
- OreGold
|
||||
- OreSilver
|
||||
- OrePlasma
|
||||
- OreUranium
|
||||
- OreDiamond
|
||||
- OreArtifactFragment
|
||||
@@ -535,6 +535,9 @@ LightTree04: LightTree
|
||||
LightTree05: LightTree
|
||||
LightTree06: LightTree
|
||||
|
||||
# 2024-12-22
|
||||
VendingMachineRestockSalvageEquipment: null
|
||||
|
||||
# 2024-12-28
|
||||
DrinkIrishCarBomb: DrinkIrishSlammer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user