Skip to content

Commit

Permalink
Merge branch 'master' into Rainbow-crayon-port
Browse files Browse the repository at this point in the history
  • Loading branch information
Avalon-Proto authored Dec 20, 2024
2 parents 02fd429 + c34c044 commit 59240e7
Show file tree
Hide file tree
Showing 50 changed files with 809 additions and 137 deletions.
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.DeltaV.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
8 changes: 6 additions & 2 deletions Content.Server/Salvage/SalvageSystem.Magnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void OnMagnetClaim(EntityUid uid, SalvageMagnetComponent component, ref
return;
}

TakeMagnetOffer((station.Value, dataComp), args.Index, (uid, component));
TakeMagnetOffer((station.Value, dataComp), args.Index, (uid, component), args.Actor); // DeltaV: pass the user entity
}

private void OnMagnetStartup(EntityUid uid, SalvageMagnetComponent component, ComponentStartup args)
Expand Down Expand Up @@ -250,11 +250,15 @@ private void UpdateMagnetUIs(Entity<SalvageMagnetDataComponent> data)
}
}

private async Task TakeMagnetOffer(Entity<SalvageMagnetDataComponent> data, int index, Entity<SalvageMagnetComponent> magnet)
private async Task TakeMagnetOffer(Entity<SalvageMagnetDataComponent> data, int index, Entity<SalvageMagnetComponent> magnet, EntityUid user) // DeltaV: add user param
{
var seed = data.Comp.Offered[index];

var offering = GetSalvageOffering(seed);
// Begin DeltaV Addition: make wrecks cost mining points to pull
if (offering.Cost > 0 && !(_points.TryFindIdCard(user) is {} idCard && _points.RemovePoints(idCard, offering.Cost)))
return;
// End DeltaV Addition
var salvMap = _mapSystem.CreateMap();
var salvMapXform = Transform(salvMap);

Expand Down
2 changes: 2 additions & 0 deletions Content.Server/Salvage/SalvageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Server.Construction;
using Content.Server.GameTicking;
using Content.Server.Radio.EntitySystems;
using Content.Shared.DeltaV.Salvage.Systems; // DeltaV
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
Expand Down Expand Up @@ -52,6 +53,7 @@ public sealed partial class SalvageSystem : SharedSalvageSystem
[Dependency] private readonly LabelSystem _labelSystem = default!;
[Dependency] private readonly MapLoaderSystem _map = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly MiningPointsSystem _points = default!; // DeltaV
[Dependency] private readonly RadioSystem _radioSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
Expand Down
11 changes: 11 additions & 0 deletions Content.Shared/DeltaV/Salvage/Systems/MiningPointsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ private void OnClaimMiningPoints(Entity<MiningPointsLatheComponent> ent, ref Lat
return (idCard, comp);
}

/// <summary>
/// Returns true if the user has at least some number of points on their ID card.
/// </summary>
public bool UserHasPoints(EntityUid user, uint points)
{
if (TryFindIdCard(user)?.Comp is not {} comp)
return false;

return comp.Points >= points;
}

/// <summary>
/// Removes points from a holder, returning true if it succeeded.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/Salvage/Magnet/AsteroidOffering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public record struct AsteroidOffering : ISalvageMagnetOffering
/// Calculated marker layers for the asteroid.
/// </summary>
public Dictionary<string, int> MarkerLayers;

uint ISalvageMagnetOffering.Cost => 0; // DeltaV
}
2 changes: 2 additions & 0 deletions Content.Shared/Salvage/Magnet/DebrisOffering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ namespace Content.Shared.Salvage.Magnet;
public record struct DebrisOffering : ISalvageMagnetOffering
{
public string Id;

uint ISalvageMagnetOffering.Cost => 0; // DeltaV: Debris is a very good source of materials for the station, so no cost
}
7 changes: 5 additions & 2 deletions Content.Shared/Salvage/Magnet/ISalvageMagnetOffering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ namespace Content.Shared.Salvage.Magnet;

public interface ISalvageMagnetOffering
{

}
/// <summary>
/// DeltaV: How many mining points this offering costs to accept.
/// </summary>
public uint Cost { get; }
}
2 changes: 2 additions & 0 deletions Content.Shared/Salvage/Magnet/SalvageOffering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ namespace Content.Shared.Salvage.Magnet;
public record struct SalvageOffering : ISalvageMagnetOffering
{
public SalvageMapPrototype SalvageMap;

uint ISalvageMagnetOffering.Cost => 1000; // DeltaV: Station gets next to no benefit from you pulling wrecks, force you to mine first.
}
98 changes: 51 additions & 47 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
Entries:
- author: deltanedas
changes:
- message: Reworked Submarine's atmos, notably the TEG is now good, easy to set
up and has a guide next to it.
type: Tweak
id: 298
time: '2024-03-28T15:27:57.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/1022
- author: FluffiestFloof
changes:
- message: Felinids, Harpies and Vulpkanin should now Weh accordingly.
type: Fix
id: 299
time: '2024-03-28T18:27:42.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/992
- author: deltanedas
changes:
- message: Reworked Shoukou's atmospherics setup. The Gas Recycler is now usable
among other things.
type: Tweak
id: 300
time: '2024-04-03T02:10:51.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/1049
- author: rosieposieeee
changes:
- message: Submarine has, once again, had some minor issues quashed, and small improvements
made. Go check out the park!
type: Tweak
id: 301
time: '2024-04-03T19:44:14.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/1053
- author: NullWanderer
changes:
- message: Merged master, please report bugs or regressions
type: Add
- message: Mail containing books has been temporarily removed
type: Remove
id: 302
time: '2024-04-09T07:49:38.080075+00:00'
url: null
- author: deltanedas
changes:
- message: Lighthouse is BACK!
type: Add
id: 303
time: '2024-04-09T07:49:38.080495+00:00'
url: null
- author: Adrian16199
changes:
- message: Added new horn designs for onis.
Expand Down Expand Up @@ -3821,3 +3774,54 @@
id: 797
time: '2024-12-19T04:55:03.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2304
- author: deltanedas
changes:
- message: Pulling wrecks on the salvage magnet now costs mining points. GO MINE!!!
type: Tweak
id: 798
time: '2024-12-20T05:28:43.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2457
- author: makyo
changes:
- message: round restart time
type: Tweak
id: 799
time: '2024-12-20T05:31:37.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2229
- author: deltanedas
changes:
- message: Removed vent fauna (spiders, slimes, snakes) events pending rework.
type: Remove
id: 800
time: '2024-12-20T05:34:54.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2474
- author: deltanedas
changes:
- message: Changed Salvage Weapons to be a tier 2 tech, Experimental Salvage Weaponry.
type: Tweak
- message: Crusher weapons are researchable again, PKA is roundstart.
type: Tweak
- message: Added the Fauna Protection Module for borgs, it has a PKA and crusher
dagger.
type: Add
id: 801
time: '2024-12-20T05:38:08.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2077
- author: Stop-Signs
changes:
- message: sleepers will no longer receive nukies as kill targets
type: Fix
id: 802
time: '2024-12-20T17:22:58.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2483
- author: alterae
changes:
- message: Added coats, hats, scarves, and shoes to the Psychologist's loadout options.
type: Add
- message: Added three new Psychologist job titles.
type: Add
- message: Psychologist now spawns with a folder.
type: Tweak
id: 803
time: '2024-12-20T18:49:04.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2459
5 changes: 3 additions & 2 deletions Resources/ConfigPresets/DeltaV/horizon.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[game]
hostname = "[EN][MRP] Delta-v (Ψ) | Horizon [US East 3]"
soft_max_players = 80
hostname = "[EN][MRP] Delta-v (Ψ) | Horizon [US East 3]"
soft_max_players = 80
round_restart_time = 300

[vote]
preset_enabled = true
Expand Down
5 changes: 3 additions & 2 deletions Resources/ConfigPresets/DeltaV/periapsis.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[game]
hostname = "[EN][MRP] Delta-v (Ψ) | Periapsis [US East 2]"
soft_max_players = 50
hostname = "[EN][MRP] Delta-v (Ψ) | Periapsis [US East 2]"
soft_max_players = 50
round_restart_time = 300

[server]
rules_file = "DeltaVRuleset"
Expand Down
47 changes: 47 additions & 0 deletions Resources/Locale/en-US/deltav/flavors/flavor-profiles.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,53 @@ flavor-complex-candy-bubblegum = like bubble gum
flavor-complex-double-ice-cream = like ice cream, twice
flavor-complex-drgibbbloodred = like severe malpractice
## Delta-V additional drink flavors
flavor-complex-absinthe = like green death
flavor-complex-blue-curacao = like fermented oranges
flavor-complex-deadrum = like a botched murder
flavor-complex-n-t-cahors = five hundred dollars too expensive
flavor-complex-poison-wine = like a dark velvet
flavor-complex-acidspit = like stomach acid
flavor-complex-allies-cocktail = like wartime camaraderie
flavor-complex-amasec = like a smoking gun
flavor-complex-andalusia = like summer
flavor-complex-b52 = like a nuclear arms race
flavor-complex-bahama-mama = like a tropical vacation
flavor-complex-barefoot = like berry-picking, but without the shoes
flavor-complex-booger = like no one is watching
flavor-complex-brave-bull = like you're seeing red
flavor-complex-demons-blood = like brimstone
flavor-complex-devils-kiss = like temptation
flavor-complex-doctors-delight = like a medical miracle
flavor-complex-driest-martini = like a dry sense of humor
flavor-complex-erika-surprise = like a green dream, perfect for a warm day
flavor-complex-gin-fizz = like a fizzy lemon
flavor-complex-gildlager = like a spicy secret told over spring break
flavor-complex-grog = like a day on the high seas
flavor-complex-hippies-delight = like, totally trippy, man
flavor-complex-hooch = like homemade firewater
flavor-complex-irish-cream = like whiskey and cream
flavor-complex-kira-special = kawaii
flavor-complex-manhattan = dark and mysterious
flavor-complex-manhattan-project = like two minutes to midnight
flavor-complex-margarita = like a paradise in space
flavor-complex-martini = like a sense of humor
flavor-complex-mojito = minty fresh, and a little sweet
flavor-complex-neurotoxin = like a trip to the ER
flavor-complex-patron = like luxury
flavor-complex-red-mead = like fermented honey with a splash of blood
flavor-complex-rewriter = like an all-nighter
flavor-complex-sbiten = like you'll need a glass of milk
flavor-complex-silencer = like a broken vow
flavor-complex-snow-white = like a mistake
flavor-complex-sui-dream = like a fruit salad, perfect for the working lady
flavor-complex-syndicate-bomb = like it will blow your mind
flavor-complex-toxins-special = like a plasma fire
flavor-complex-vodka-martini = shaken, not stirred
flavor-complex-vodka-tonic = like depression in denial
flavor-complex-kvass = like bread tossed into a blender
flavor-complex-mothamphetamine = like there are buzzing wings in your mouth
candy-flavor-profile = This one is supposed to taste {$flavor}.
candy-flavor-profile-multiple = This one is supposed to taste {$flavors} and {$lastFlavor}.
candy-flavor-profile-unknown = You have no idea what this one is supposed to taste like.
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/deltav/job/job-names.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ job-alt-title-fool = Fool
job-alt-title-hygiene-technician = Hygiene Technician
job-alt-title-psychiatrist = Psychiatrist
job-alt-title-social-worker = Social Worker
job-alt-title-therapist = Therapist
# Role timers
JobMedicalBorg = Medical Cyborg
JobCourier = Courier
Expand Down
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/deltav/markings/moth.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
marking-MothWingsClassicSelene = Wings (Selene, Classic)
marking-MothWingsSelene-selene_primary = Primary
marking-MothWingsSelene-selene_secondary = Secondary
marking-MothWingsSelene-selene_tertiary = Tertiary
marking-MothWingsSelene = Wings (Selene)
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/deltav/preferences/loadout-groups.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ loadout-group-medical-doctor-neck = Medical Doctor neck
loadout-group-medical-intern-id-delta = Medical Intern PDA
loadout-group-psychologist-head = Psychologist head
loadout-group-psychologist-outerclothing = Psychologist outer clothing
loadout-group-psychologist-shoes = Psychologist shoes
loadout-group-psychologist-id-delta = Psychologist PDA
# Miscellaneous
loadout-group-scarfs = Scarf
Expand Down
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/deltav/salvage/salvage-magnet.ftl
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
salvage-map-wreck-size-unknown = [color=purple]Unidentified[/color]
salvage-magnet-mining-points-cost = Cost: {$points} Mining Points
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/research/technologies.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ research-technology-portable-fission = Portable Fission
research-technology-space-scanning = Space Scanning
research-technology-excavation = Mass Excavation
research-technology-salvage-weapons = Salvage Weapons
research-technology-draconic-munitions = Draconic Munitions
research-technology-uranium-munitions = Uranium Munitions
research-technology-explosive-technology = Explosive Technology
Expand All @@ -32,6 +31,7 @@ research-technology-nonlethal-ammunition = Nonlethal Ammunition
research-technology-practice-ammunition = Practice Ammunition
research-technology-concentrated-laser-weaponry = Concentrated Laser Weaponry
research-technology-wave-particle-harnessing = Wave Particle Harnessing
research-technology-experimental-salvage-weaponry = Experimental Salvage Weaponry
research-technology-advanced-riot-control = Advanced Riot Control
research-technology-portable-microfusion-weaponry = Portable Microfusion Weaponry
research-technology-experimental-battery-ammo = Experimental Battery Ammo
Expand Down
Loading

0 comments on commit 59240e7

Please sign in to comment.