Skip to content

Commit

Permalink
inheritable vessels/POIs
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Dec 28, 2024
1 parent d7697fb commit eae589d
Show file tree
Hide file tree
Showing 112 changed files with 183 additions and 493 deletions.
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
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

- 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
6 changes: 1 addition & 5 deletions Resources/Prototypes/_NF/PointsOfInterest/edison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@
#
# - type: pointOfInterest
# id: Edison
# parent: BasePOI
# name: 'Edison Power Plant'
# minimumDistance: 3650
# maximumDistance: 6400
# spawnGamePreset: [ NFAdventure, NFPirate ]
# spawnGroup: Required
# gridPath: /Maps/_NF/POI/edison.yml
# addComponents:
# - type: IFF
# color: "#3737C8"
# readOnly: true
# - type: Shuttle
# angularDamping: 999999
# linearDamping: 999999

# - type: gameMap
# id: Edison
Expand Down
9 changes: 1 addition & 8 deletions Resources/Prototypes/_NF/PointsOfInterest/grifty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,12 @@
# Down at your local saloon
- type: pointOfInterest
id: Grifty
parent: BasePOI
name: "Grifty's Gas n Grub"
minimumDistance: 3250
maximumDistance: 5600
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: Scrapyard
gridPath: /Maps/_NF/POI/grifty.yml
addComponents:
- type: IFF
color: "#ffa600"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999

- type: gameMap
id: Grifty
Expand Down
6 changes: 1 addition & 5 deletions Resources/Prototypes/_NF/PointsOfInterest/lodge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@
# Provides higher end expeditionary ships and a space for vets to spawn in away from potential frontier shenanigans
- type: pointOfInterest
id: Lodge
parent: BasePOI
name: 'Expeditionary Lodge'
minimumDistance: 1650
maximumDistance: 3400
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: Required
gridPath: /Maps/_NF/POI/lodge.yml
addComponents:
- type: IFF
color: "#3737C8"
readOnly: true
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
- type: StationTransit

- type: gameMap
Expand Down
6 changes: 2 additions & 4 deletions Resources/Prototypes/_NF/PointsOfInterest/lpbravo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@
# just a little loot n shoot POI. Pretty much the second POI to even exist
- type: pointOfInterest
id: LPBravo
parent: BasePOI
name: 'Listening Point Bravo'
minimumDistance: 4000
maximumDistance: 6000
spawnGamePreset: [ NFAdventure, NFPirate ]
spawnGroup: SyndicateFOB
gridPath: /Maps/_NF/POI/lpbravo.yml
hideWarp: true
addComponents:
- type: IFF
color: "#C83737"
flags: [HideLabel, Hide]
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
readOnly: false
- type: SyndicateFOB # For pinpointer

- type: gameMap
Expand Down
Loading

0 comments on commit eae589d

Please sign in to comment.