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

Inheritable Vessel and POI Prototypes #2632

Merged
merged 11 commits into from
Dec 28, 2024
10 changes: 0 additions & 10 deletions Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
using Content.Server.StationRecords.Systems;
using Content.Shared.Database;
using Content.Shared.Preferences;
using Content.Shared.Shuttles.Components;
using static Content.Shared.Shipyard.Components.ShuttleDeedComponent;
using Content.Server.Shuttles.Components;
using Content.Server.Station.Components;
Expand All @@ -38,7 +37,6 @@
using Content.Shared.UserInterface;
using Robust.Shared.Audio.Systems;
using Content.Shared.Access;
using Content.Shared.Tiles;
using Content.Server._NF.Smuggling.Components;
using Content.Shared._NF.ShuttleRecords;
using Content.Server.StationEvents.Components;
Expand Down Expand Up @@ -203,14 +201,6 @@ private void OnPurchaseMessage(EntityUid shipyardConsoleUid, ShipyardConsoleComp
shuttleStation = _station.InitializeNewStation(stationProto.Stations[vessel.ID], gridUids);
var metaData = MetaData((EntityUid)shuttleStation);
name = metaData.EntityName;
_shuttle.SetIFFColor(shuttleUid, new Color
{
R = 10,
G = 50,
B = 100,
A = 100
});
_shuttle.AddIFFFlag(shuttleUid, IFFFlags.IsPlayerShuttle);
}

if (TryComp<AccessComponent>(targetId, out var newCap))
Expand Down
13 changes: 11 additions & 2 deletions Content.Server/_NF/GameRule/PointOfInterestPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
using Content.Server.GameTicking.Presets;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
using Robust.Shared.Utility;

namespace Content.Server._NF.GameRule;

/// <summary>
/// Describes information for a single point of interest to be spawned in the world
/// </summary>
[Prototype("pointOfInterest")]
[Prototype]
[Serializable]
public sealed partial class PointOfInterestPrototype : IPrototype
public sealed partial class PointOfInterestPrototype : IPrototype, IInheritingPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;

[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<PointOfInterestPrototype>))]
public string[]? Parents { get; private set; }

[NeverPushInheritance]
[AbstractDataField]
public bool Abstract { get; private set; }

/// <summary>
/// The name of this point of interest
/// </summary>
Expand Down Expand Up @@ -48,6 +56,7 @@ public sealed partial class PointOfInterestPrototype : IPrototype
/// Components to be added to any spawned grids.
/// </summary>
[DataField]
[AlwaysPushInheritance]
public ComponentRegistry AddComponents { get; set; } = new();

/// <summary>
Expand Down
27 changes: 18 additions & 9 deletions Content.Shared/Shipyard/Prototypes/VesselPrototype.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
using Content.Shared.Guidebook;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
using Robust.Shared.Utility;

namespace Content.Shared.Shipyard.Prototypes;

[Prototype("vessel")]
public sealed class VesselPrototype : IPrototype
[Prototype]
public sealed class VesselPrototype : IPrototype, IInheritingPrototype
{
[IdDataField]
public string ID { get; } = default!;

[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<VesselPrototype>))]
public string[]? Parents { get; private set; }

[NeverPushInheritance]
[AbstractDataField]
public bool Abstract { get; private set; }

/// <summary>
/// Vessel name.
/// </summary>
[DataField("name")] public string Name = string.Empty;
[DataField] public string Name = string.Empty;

/// <summary>
/// Short description of the vessel.
/// </summary>
[DataField("description")] public string Description = string.Empty;
[DataField] public string Description = string.Empty;

/// <summary>
/// The price of the vessel
/// </summary>
[DataField("price", required: true)]
[DataField(required: true)]
public int Price;

/// <summary>
/// The size of the vessel. (e.g. Small, Medium, Large etc.)
/// </summary>
[DataField("category", required: true)]
[DataField(required: true)]
public VesselSize Category = VesselSize.Small;

/// <summary>
/// The shipyard listing that the vessel should be in. (e.g. Civilian, Syndicate, Contraband etc.)
/// </summary>
[DataField("group", required: true)]
[DataField(required: true)]
public ShipyardConsoleUiKey Group = ShipyardConsoleUiKey.Shipyard;

/// <summary>
Expand All @@ -53,7 +61,7 @@ public sealed class VesselPrototype : IPrototype
/// <summary>
/// The access required to buy the product. (e.g. Command, Mail, Bailiff, etc.)
/// </summary>
[DataField("access")]
[DataField]
public string Access = string.Empty;

/// Frontier - Add this field for the MapChecker script.
Expand All @@ -66,7 +74,7 @@ public sealed class VesselPrototype : IPrototype
/// <summary>
/// Relative directory path to the given shuttle, i.e. `/Maps/Shuttles/yourshittle.yml`
/// </summary>
[DataField("shuttlePath", required: true)]
[DataField(required: true)]
public ResPath ShuttlePath = default!;

/// <summary>
Expand All @@ -85,6 +93,7 @@ public sealed class VesselPrototype : IPrototype
/// Components to be added to any spawned grids.
/// </summary>
[DataField]
[AlwaysPushInheritance]
public ComponentRegistry AddComponents { get; set; } = new();
}

Expand Down
3 changes: 0 additions & 3 deletions Resources/Maps/_NF/Shuttles/BlackMarket/barnacle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
color: '#FFC000FF'
flags: HideLabel
- type: OccluderTree
- type: Shuttle
- type: GridPathfinding
Expand Down
2 changes: 0 additions & 2 deletions Resources/Maps/_NF/Shuttles/BlackMarket/bocakillo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
flags: HideLabel
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
Expand Down
2 changes: 0 additions & 2 deletions Resources/Maps/_NF/Shuttles/BlackMarket/falcon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
flags: HideLabel
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
Expand Down
2 changes: 0 additions & 2 deletions Resources/Maps/_NF/Shuttles/BlackMarket/menace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
flags: HideLabel
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
Expand Down
3 changes: 0 additions & 3 deletions Resources/Maps/_NF/Shuttles/BlackMarket/schooner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
color: '#FFC000FF'
flags: HideLabel
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
Expand Down
3 changes: 0 additions & 3 deletions Resources/Maps/_NF/Shuttles/Syndicate/hunter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ entities:
bodyType: Dynamic
- type: Fixtures
fixtures: {}
- type: IFF
color: '#FFC000FF'
flags: HideLabel
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
Expand Down
3 changes: 0 additions & 3 deletions Resources/Maps/_NF/Shuttles/Syndicate/infiltrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,6 @@ entities:
id: syndlogo8
decals:
19: 0,-6
- type: IFF
color: '#FFC000FF'
flags: HideLabel
- type: OccluderTree
- type: Shuttle
- type: RadiationGridResistance
Expand Down
9 changes: 1 addition & 8 deletions Resources/Prototypes/_NF/PointsOfInterest/anomalousgeode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,12 @@
# The local Science lab
- type: pointOfInterest
id: AnomalousGeode
parent: BasePOI
name: 'Anomalous Geode'
minimumDistance: 2100
maximumDistance: 3800
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: ScienceLab
gridPath: /Maps/_NF/POI/anomalousgeode.yml
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999

- type: gameMap
id: AnomalousGeode
Expand Down
9 changes: 1 addition & 8 deletions Resources/Prototypes/_NF/PointsOfInterest/anomalouslab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,12 @@
# The local Science lab
- type: pointOfInterest
id: AnomalousLab
parent: BasePOI
name: 'Anomalous Lab'
minimumDistance: 2100
maximumDistance: 3800
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: ScienceLab
gridPath: /Maps/_NF/POI/anomalouslab.yml
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999

- type: gameMap
id: AnomalousLab
Expand Down
7 changes: 1 addition & 6 deletions Resources/Prototypes/_NF/PointsOfInterest/bahamamamas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@
# I want to lie, shipwrecked and comatose, drinking fresh mango juice.
- type: pointOfInterest
id: Bahama
parent: BasePOI
name: "Bahama Mama's"
minimumDistance: 1200
maximumDistance: 2900
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: RestStop
gridPath: /Maps/_NF/POI/bahama.yml
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
- type: StationTransit

dvir001 marked this conversation as resolved.
Show resolved Hide resolved
- type: gameMap
Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/_NF/PointsOfInterest/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- type: pointOfInterest
id: BasePOI
abstract: true
minimumDistance: 2000 # Some sane defaults
maximumDistance: 4000
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: Optional
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
9 changes: 1 addition & 8 deletions Resources/Prototypes/_NF/PointsOfInterest/caseys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@
# Down at your local saloon
- type: pointOfInterest
id: CaseysCasino
parent: BasePOI
name: "Crazy Casey's Casino"
minimumDistance: 3250
maximumDistance: 5600
spawnGamePreset: [ NFAdventure, NFPirate ]
gridPath: /Maps/_NF/POI/caseyscasino.yml
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999

- type: gameMap
id: CaseysCasino
Expand Down
8 changes: 2 additions & 6 deletions Resources/Prototypes/_NF/PointsOfInterest/courthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@
#
- type: pointOfInterest
id: Courthouse
parent: BasePOI
name: "Courthouse"
minimumDistance: 1150
maximumDistance: 2050
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: Required
gridPath: /Maps/_NF/POI/courthouse.yml
addComponents:
- type: IFF
color: "#8e6444"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
color: "#ae7d57"

- type: gameMap
id: Courthouse
Expand Down
5 changes: 2 additions & 3 deletions Resources/Prototypes/_NF/PointsOfInterest/cove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Byarr
- type: pointOfInterest
id: Cove
parent: BasePOI
name: Pirate Cove
minimumDistance: 10000
maximumDistance: 15000
Expand All @@ -21,9 +22,7 @@
- type: IFF
color: "#C83737"
flags: [HideLabel]
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
readOnly: false

- type: gameMap
id: Cove
Expand Down
12 changes: 2 additions & 10 deletions Resources/Prototypes/_NF/PointsOfInterest/depots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,29 @@
# Basic Cargo Depot selling point for economy and great wealth
- type: pointOfInterest
id: CargoDepot
parent: BasePOI
name: Cargo Depot
minimumDistance: 4500
maximumDistance: 6000
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: CargoDepot
gridPath: /Maps/_NF/POI/cargodepot.yml
addComponents:
- type: IFF
color: "#37C837"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
- type: ProtectedGrid
preventArtifactTriggers: true

- type: pointOfInterest
id: CargoDepotAlt
parent: BasePOI
name: Cargo Depot
minimumDistance: 4500
maximumDistance: 6000
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: CargoDepot
gridPath: /Maps/_NF/POI/cargodepotalt.yml
addComponents:
- type: IFF
color: "#37C837"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
- type: ProtectedGrid
preventArtifactTriggers: true

Expand Down
Loading
Loading