Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Lavaland real #1067

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f0936df
Lavaland. (#1303)
Roudenn Feb 22, 2025
1982af8
localization
Roudenn Feb 22, 2025
e0c6e26
small fix
Roudenn Feb 22, 2025
9124891
Betrayal knife (#1452)
Aviu00 Jan 30, 2025
64cfe71
plasma cutter (#495)
yglop Aug 15, 2024
d6b88f0
Migrate and fix things
Roudenn Feb 22, 2025
4493bfd
Guns dual wielding (#629)
BombasterDS Sep 12, 2024
ea3c2a0
Migrate
Roudenn Feb 22, 2025
7e4ee7d
Ported ore magnet from WhiteDream (#1082)
RatherUncreative Dec 9, 2024
c2c2ed8
9999 GAZILION TONS OF CONTENT!!!!!
Roudenn Feb 22, 2025
c294f73
Final fixes (finally)
Roudenn Feb 22, 2025
5046ad7
gotovo
Roudenn Feb 22, 2025
122f365
Cool lightning for hierophant
Roudenn Feb 22, 2025
2adf3cf
Update outpost_lavaland.yml
Roudenn Feb 22, 2025
e3a1e2a
Fix all maps?
Roudenn Feb 22, 2025
7907cc7
fix some
Roudenn Feb 22, 2025
b2d804a
PROBABLY fix tests
Roudenn Feb 22, 2025
4178d3b
фух
Roudenn Feb 22, 2025
8e1f8ec
онет
Roudenn Feb 22, 2025
19f3fa4
Update ruin_toyshop.yml
Roudenn Feb 22, 2025
d99ce38
Update backmen_aspid.yml
Roudenn Feb 22, 2025
4cd9949
Merge branch 'master' into lavaland-real
Roudenn Feb 22, 2025
a65a98e
Try fix tendril
Roudenn Feb 23, 2025
69fe3f7
Update LavalandPlanetSystem.cs
Roudenn Feb 23, 2025
32ca5c2
Merge branch 'master' into lavaland-real
Roudenn Feb 25, 2025
500ade4
dwarves feel ore (#1751)
pheenty Feb 24, 2025
c6cb7a1
Kinetic crusher buffs and tweaks (not mald trust) (#1745)
thebiggestbruh Feb 24, 2025
b7efdca
More Lavaland Tweaks (#1758)
gluesniffler Feb 24, 2025
2bf1deb
Lavaland Optimization (#1791)
Roudenn Feb 24, 2025
7818c18
yay fixes
Roudenn Feb 25, 2025
1efee70
забыр
Roudenn Feb 25, 2025
a40899b
Update lavaland_ruins.yml
Roudenn Feb 25, 2025
49e2cb8
Update explorer_suit.yml
Roudenn Feb 25, 2025
493a97d
Update shared.yml
Roudenn Feb 25, 2025
ea70320
Update lavaland_planets.yml
Roudenn Feb 25, 2025
aba990d
Update Dwarf.xml
Roudenn Feb 25, 2025
2a745a1
no station member
Roudenn Feb 26, 2025
8ca6202
Merge branch 'master' into lavaland-real
Roudenn Feb 26, 2025
be8fe70
Fix Lavaland tests (#1807)
Roudenn Feb 26, 2025
ca7fc69
quick fix
Roudenn Feb 27, 2025
70c03bf
Lavaland Procedural Rework!
Roudenn Feb 28, 2025
1ed2d66
Merge branch 'master' into lavaland-real
Roudenn Feb 28, 2025
b16fc15
Create LavalandGenerationTest.cs
Roudenn Feb 28, 2025
9d70b91
fix random things in tesst
Roudenn Feb 28, 2025
eda8641
Update LavalandGenerationTest.cs
Roudenn Feb 28, 2025
f955581
Update ore.yml (#1811)
starch70 Feb 25, 2025
3b960ab
Merge branch 'master' into lavaland-real
Roudenn Mar 1, 2025
d1eedeb
Fixes
Roudenn Mar 1, 2025
7b885b4
Fix Shelters
Roudenn Mar 1, 2025
83dfbaf
Balance & Localization fixes
Roudenn Mar 2, 2025
193e080
Update ruin_syndicate_base.yml
Roudenn Mar 2, 2025
c3de306
Merge branch 'master' into lavaland-real
Roudenn Mar 2, 2025
504b465
Merge branch 'master' into lavaland-real
Roudenn Mar 4, 2025
b2ee0d7
Fixes Lavaland Shuttle Issues (#1814)
jorgun Mar 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions Content.Client/Lathe/UI/LatheBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared._DV.Salvage; // DeltaV
using Content.Shared.Lathe;
using Content.Shared.Research.Components;
using JetBrains.Annotations;
Expand Down Expand Up @@ -31,6 +32,8 @@ protected override void Open()
{
SendMessage(new LatheQueueRecipeMessage(recipe, amount));
};

_menu.OnClaimMiningPoints += () => SendMessage(new LatheClaimMiningPointsMessage()); // DeltaV
}

protected override void UpdateState(BoundUserInterfaceState state)
Expand Down
6 changes: 6 additions & 0 deletions Content.Client/Lathe/UI/LatheMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
HorizontalExpand="True">
<ui:MaterialStorageControl Name="MaterialsList" SizeFlagsStretchRatio="8"/>
</BoxContainer>
<!-- 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>

Expand Down
43 changes: 43 additions & 0 deletions Content.Client/Lathe/UI/LatheMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
using System.Linq;
using System.Text;
using Content.Client.Materials;
using Content.Shared._DV.Salvage.Components; // DeltaV
using Content.Shared._DV.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.Timing; // DeltaV

namespace Content.Client.Lathe.UI;

[GenerateTypedNameReferences]
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;
public event Action? OnClaimMiningPoints; // DeltaV

public List<ProtoId<LatheRecipePrototype>> Recipes = new();

Expand All @@ -35,6 +42,8 @@ public sealed partial class LatheMenu : DefaultWindow

public EntityUid Entity;

private uint? _lastMiningPoints; // DeltaV: used to avoid Loc.GetString every frame

public LatheMenu()
{
RobustXamlLoader.Load(this);
Expand All @@ -43,6 +52,7 @@ public LatheMenu()
_spriteSystem = _entityManager.System<SpriteSystem>();
_lathe = _entityManager.System<LatheSystem>();
_materialStorage = _entityManager.System<MaterialStorageSystem>();
_miningPoints = _entityManager.System<MiningPointsSystem>(); // DeltaV

SearchBar.OnTextChanged += _ =>
{
Expand Down Expand Up @@ -70,9 +80,31 @@ public void SetEntity(EntityUid uid)
}
}

// 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();
Expand All @@ -83,6 +115,17 @@ protected override void Opened()
}
}

/// <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>
Expand Down
28 changes: 26 additions & 2 deletions Content.Client/Materials/UI/MaterialStorageControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Linq;
using Content.Shared.Materials;
using Content.Shared.Tag; // Goobstation
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;

using Robust.Shared.Prototypes;
namespace Content.Client.Materials.UI;

/// <summary>
Expand All @@ -14,6 +15,8 @@ namespace Content.Client.Materials.UI;
public sealed partial class MaterialStorageControl : ScrollContainer
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; // Goobstation
private readonly TagSystem _tagSystem; // Goobstation

private EntityUid? _owner;

Expand All @@ -23,6 +26,8 @@ public MaterialStorageControl()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

_tagSystem = _entityManager.System<TagSystem>(); // Goobstation
}

public void SetOwner(EntityUid owner)
Expand All @@ -44,7 +49,15 @@ protected override void FrameUpdate(FrameEventArgs args)
}

var canEject = materialStorage.CanEjectStoredMaterials;
var mats = materialStorage.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary();
// Goobstation start
Dictionary<string, int> storage;
Dictionary<string, int> mats;
storage = materialStorage.Storage.Select(pair => (pair.Key.Id, pair.Value)).ToDictionary();
mats = materialStorage.DisallowOreEjection
? FilterOutOres(storage)
: storage;

// Goobstation end
if (_currentMaterials.Equals(mats))
return;

Expand Down Expand Up @@ -89,4 +102,15 @@ protected override void FrameUpdate(FrameEventArgs args)
_currentMaterials = mats;
NoMatsLabel.Visible = MaterialList.ChildCount == 1;
}

private Dictionary<string, int> FilterOutOres(Dictionary<string, int> materials)
{
return materials.Where(pair =>
!(_prototypeManager.TryIndex<MaterialPrototype>(pair.Key, out var proto) &&
proto.StackEntity != null &&
_prototypeManager.TryIndex<EntityPrototype>(proto.StackEntity, out var entityProto) &&
entityProto.TryGetComponent<TagComponent>(out var tag) &&
_tagSystem.HasTag(tag, "Ore")))
.ToDictionary(pair => pair.Key, pair => pair.Value);
}
}
21 changes: 21 additions & 0 deletions Content.Client/Salvage/UI/SalvageMagnetBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Linq;
using Content.Client.Message;
using Content.Shared._DV.Salvage.Systems; // DeltaV
using Content.Shared.Salvage;
using Content.Shared.Salvage.Magnet;
using Robust.Client.Player; // DeltaV
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;

Expand All @@ -10,12 +12,16 @@ namespace Content.Client.Salvage.UI;
public sealed class SalvageMagnetBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _player = default!; // DeltaV

private readonly MiningPointsSystem _points; // DeltaV

private OfferingWindow? _window;

public SalvageMagnetBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this);
_points = _entManager.System<MiningPointsSystem>(); // DeltaV
}

protected override void Open()
Expand Down Expand Up @@ -61,6 +67,21 @@ protected override void UpdateState(BoundUserInterfaceState state)
});
};

// Begin DeltaV Additions: Mining points cost for wrecks
if (offer.Cost > 0)
{
if (_player.LocalSession?.AttachedEntity is not {} user || !_points.UserHasPoints(user, offer.Cost))
option.Disabled = true;

var label = new Label
{
Text = Loc.GetString("salvage-magnet-mining-points-cost", ("points", offer.Cost)),
HorizontalAlignment = Control.HAlignment.Center
};
option.AddContent(label);
}
// End DeltaV Additions

switch (offer)
{
case AsteroidOffering asteroid:
Expand Down
24 changes: 17 additions & 7 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Linq;
using System.Numerics;
using Content.Client.Gameplay;
using Content.Shared._White.Blink;
using Content.Shared.CombatMode;
using Content.Shared.Effects;
using Content.Shared.Hands.Components;
Expand All @@ -9,6 +11,7 @@
using Content.Shared.Weapons.Melee.Components;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Wieldable.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand All @@ -30,6 +33,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
[Dependency] private readonly InputSystem _inputSystem = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly TransformSystem _transform = default!; // Goobstation

private EntityQuery<TransformComponent> _xformQuery;

Expand Down Expand Up @@ -90,6 +94,12 @@ public override void Update(float frameTime)

// TODO using targeted actions while combat mode is enabled should NOT trigger attacks.

// TODO: Need to make alt-fire melee its own component I guess?
// Melee and guns share a lot in the middle but share virtually nothing at the start and end so
// it's kinda tricky.
// I think as long as we make secondaries their own component it's probably fine
// as long as guncomp has an alt-use key then it shouldn't be too much of a PITA to deal with.

var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition);

if (mousePos.MapId == MapId.Nullspace)
Expand All @@ -107,28 +117,28 @@ public override void Update(float frameTime)
{
coordinates = TransformSystem.ToCoordinates(_map.GetMap(mousePos.MapId), mousePos);
}

// If the gun has AltFireComponent, it can be used to attack.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
if (!TryComp<AltFireMeleeComponent>(weaponUid, out var altFireComponent) || altDown != BoundKeyState.Down)
return;

switch(altFireComponent.AttackType)
{
case AltFireAttackType.Light:
ClientLightAttack(entity, mousePos, coordinates, weaponUid, weapon);
break;

case AltFireAttackType.Heavy:
ClientHeavyAttack(entity, coordinates, weaponUid, weapon);
break;

case AltFireAttackType.Disarm:
ClientDisarm(entity, mousePos, coordinates);
break;
}

return;
}

Expand Down Expand Up @@ -222,7 +232,7 @@ private void ClientHeavyAttack(EntityUid user, EntityCoordinates coordinates, En
var entities = GetNetEntityList(ArcRayCast(userPos, direction.ToWorldAngle(), component.Angle, distance, userXform.MapID, user).ToList());
RaisePredictiveEvent(new HeavyAttackEvent(GetNetEntity(meleeUid), entities.GetRange(0, Math.Min(MaxTargets, entities.Count)), GetNetCoordinates(coordinates)));
}

private void ClientDisarm(EntityUid attacker, MapCoordinates mousePos, EntityCoordinates coordinates)
{
EntityUid? target = null;
Expand All @@ -232,7 +242,7 @@ private void ClientDisarm(EntityUid attacker, MapCoordinates mousePos, EntityCoo

RaisePredictiveEvent(new DisarmAttackEvent(GetNetEntity(target), GetNetCoordinates(coordinates)));
}

private void ClientLightAttack(EntityUid attacker, MapCoordinates mousePos, EntityCoordinates coordinates, EntityUid weaponUid, MeleeWeaponComponent meleeComponent)
{
var attackerPos = TransformSystem.GetMapCoordinates(attacker);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Content.Shared._DV.Salvage;
using Robust.Client.UserInterface;

namespace Content.Client._DV.Salvage.UI;

public sealed class MiningVoucherBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private MiningVoucherMenu? _menu;

public MiningVoucherBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_menu = this.CreateWindow<MiningVoucherMenu>();
_menu.SetEntity(Owner);
_menu.OnSelected += i =>
{
SendMessage(new MiningVoucherSelectMessage(i));
Close();
};
}
}
10 changes: 10 additions & 0 deletions Content.Client/_DV/Salvage/UI/MiningVoucherMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ui:RadialMenu xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
BackButtonStyleClass="RadialMenuBackButton"
CloseButtonStyleClass="RadialMenuCloseButton"
VerticalExpand="True"
HorizontalExpand="True"
MinSize="450 450">
<!-- Populated in SetEntity -->
<ui:RadialContainer Name="Main" VerticalExpand="True" HorizontalExpand="True" InitialRadius="64"/>
</ui:RadialMenu>
Loading
Loading