Printable drills and constructable thrusters (#12943)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using Content.Server.Shuttles.Systems;
|
using Content.Server.Shuttles.Systems;
|
||||||
|
using Content.Shared.Construction.Prototypes;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
|
|
||||||
namespace Content.Server.Shuttles.Components
|
namespace Content.Server.Shuttles.Components
|
||||||
{
|
{
|
||||||
@@ -41,8 +43,10 @@ namespace Content.Server.Shuttles.Components
|
|||||||
public bool IsOn;
|
public bool IsOn;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("thrust")]
|
public float Thrust;
|
||||||
public float Thrust = 750f;
|
|
||||||
|
[DataField("baseThrust"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float BaseThrust = 750f;
|
||||||
|
|
||||||
[DataField("thrusterType")]
|
[DataField("thrusterType")]
|
||||||
public ThrusterType Type = ThrusterType.Linear;
|
public ThrusterType Type = ThrusterType.Linear;
|
||||||
@@ -68,6 +72,12 @@ namespace Content.Server.Shuttles.Components
|
|||||||
public List<EntityUid> Colliding = new();
|
public List<EntityUid> Colliding = new();
|
||||||
|
|
||||||
public bool Firing = false;
|
public bool Firing = false;
|
||||||
|
|
||||||
|
[DataField("machinePartThrust", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||||
|
public string MachinePartThrust = "Laser";
|
||||||
|
|
||||||
|
[DataField("partRatingThrustMultiplier")]
|
||||||
|
public float PartRatingThrustMultiplier = 1.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ThrusterType
|
public enum ThrusterType
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Content.Server.Audio;
|
using Content.Server.Audio;
|
||||||
|
using Content.Server.Construction;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Power.EntitySystems;
|
using Content.Server.Power.EntitySystems;
|
||||||
using Content.Server.Shuttles.Components;
|
using Content.Server.Shuttles.Components;
|
||||||
@@ -58,6 +59,9 @@ namespace Content.Server.Shuttles.Systems
|
|||||||
|
|
||||||
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
|
SubscribeLocalEvent<ThrusterComponent, ExaminedEvent>(OnThrusterExamine);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ThrusterComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||||
|
SubscribeLocalEvent<ThrusterComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||||
|
|
||||||
_mapManager.TileChanged += OnTileChange;
|
_mapManager.TileChanged += OnTileChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,6 +519,18 @@ namespace Content.Server.Shuttles.Systems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnRefreshParts(EntityUid uid, ThrusterComponent component, RefreshPartsEvent args)
|
||||||
|
{
|
||||||
|
var thrustRating = args.PartRatings[component.MachinePartThrust];
|
||||||
|
|
||||||
|
component.Thrust = component.BaseThrust * MathF.Pow(component.PartRatingThrustMultiplier, thrustRating - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUpgradeExamine(EntityUid uid, ThrusterComponent component, UpgradeExamineEvent args)
|
||||||
|
{
|
||||||
|
args.AddPercentageUpgrade("thruster-comp-upgrade-thrust", component.Thrust / component.BaseThrust);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|||||||
@@ -3,3 +3,5 @@ thruster-comp-disabled = The thruster is turned [color=red]off[/color].
|
|||||||
thruster-comp-nozzle-direction = The nozzle is facing [color=yellow]{$direction}[/color].
|
thruster-comp-nozzle-direction = The nozzle is facing [color=yellow]{$direction}[/color].
|
||||||
thruster-comp-nozzle-exposed = The nozzle [color=green]exposed[/color] to space.
|
thruster-comp-nozzle-exposed = The nozzle [color=green]exposed[/color] to space.
|
||||||
thruster-comp-nozzle-not-exposed = The nozzle [color=red]is not exposed[/color] to space.
|
thruster-comp-nozzle-not-exposed = The nozzle [color=red]is not exposed[/color] to space.
|
||||||
|
|
||||||
|
thruster-comp-upgrade-thrust = Thrust strength
|
||||||
|
|||||||
@@ -239,7 +239,7 @@
|
|||||||
- BasicResearch
|
- BasicResearch
|
||||||
unlockedRecipes:
|
unlockedRecipes:
|
||||||
- AppraisalTool
|
- AppraisalTool
|
||||||
#TODO- MiningDrill
|
- MiningDrill
|
||||||
- OreProcessorMachineCircuitboard
|
- OreProcessorMachineCircuitboard
|
||||||
|
|
||||||
- type: technology
|
- type: technology
|
||||||
@@ -256,8 +256,8 @@
|
|||||||
unlockedRecipes:
|
unlockedRecipes:
|
||||||
- ShuttleConsoleCircuitboard
|
- ShuttleConsoleCircuitboard
|
||||||
- RadarConsoleCircuitboard
|
- RadarConsoleCircuitboard
|
||||||
#TODO- Gyroscope
|
- ThrusterMachineCircuitboard
|
||||||
#TODO- Thruster
|
- GyroscopeMachineCircuitboard
|
||||||
|
|
||||||
- type: technology
|
- type: technology
|
||||||
name: technologies-ripley-technology
|
name: technologies-ripley-technology
|
||||||
@@ -359,6 +359,7 @@
|
|||||||
unlockedRecipes:
|
unlockedRecipes:
|
||||||
- RCD
|
- RCD
|
||||||
- RCDAmmo
|
- RCDAmmo
|
||||||
|
- PowerDrill
|
||||||
- SMESMachineCircuitboard
|
- SMESMachineCircuitboard
|
||||||
- PowerComputerCircuitboard
|
- PowerComputerCircuitboard
|
||||||
- GeneratorPlasmaMachineCircuitboard
|
- GeneratorPlasmaMachineCircuitboard
|
||||||
|
|||||||
@@ -449,6 +449,32 @@
|
|||||||
materialRequirements:
|
materialRequirements:
|
||||||
CableHV: 5
|
CableHV: 5
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: ThrusterMachineCircuitboard
|
||||||
|
parent: BaseMachineCircuitboard
|
||||||
|
name: thruster machine board
|
||||||
|
components:
|
||||||
|
- type: MachineBoard
|
||||||
|
prototype: Thruster
|
||||||
|
requirements:
|
||||||
|
Laser: 4
|
||||||
|
Capacitor: 1
|
||||||
|
materialRequirements:
|
||||||
|
Steel: 5
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: GyroscopeMachineCircuitboard
|
||||||
|
parent: BaseMachineCircuitboard
|
||||||
|
name: gyroscope machine board
|
||||||
|
components:
|
||||||
|
- type: MachineBoard
|
||||||
|
prototype: Gyroscope
|
||||||
|
requirements:
|
||||||
|
ScanningModule: 2
|
||||||
|
Capacitor: 1
|
||||||
|
materialRequirements:
|
||||||
|
Glass: 2
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: GeneratorUraniumMachineCircuitboard
|
id: GeneratorUraniumMachineCircuitboard
|
||||||
parent: BaseMachineCircuitboard
|
parent: BaseMachineCircuitboard
|
||||||
|
|||||||
@@ -167,6 +167,8 @@
|
|||||||
- CableStack
|
- CableStack
|
||||||
- CableMVStack
|
- CableMVStack
|
||||||
- CableHVStack
|
- CableHVStack
|
||||||
|
- PowerDrill
|
||||||
|
- MiningDrill
|
||||||
- ConveyorBeltAssembly
|
- ConveyorBeltAssembly
|
||||||
- AppraisalTool
|
- AppraisalTool
|
||||||
- RCDAmmo
|
- RCDAmmo
|
||||||
@@ -300,6 +302,8 @@
|
|||||||
- WallmountGeneratorAPUElectronics
|
- WallmountGeneratorAPUElectronics
|
||||||
- WallmountSubstationElectronics
|
- WallmountSubstationElectronics
|
||||||
- EmitterCircuitboard
|
- EmitterCircuitboard
|
||||||
|
- ThrusterMachineCircuitboard
|
||||||
|
- GyroscopeMachineCircuitboard
|
||||||
- GasRecyclerMachineCircuitboard
|
- GasRecyclerMachineCircuitboard
|
||||||
- SeedExtractorMachineCircuitboard
|
- SeedExtractorMachineCircuitboard
|
||||||
- AnalysisComputerCircuitboard
|
- AnalysisComputerCircuitboard
|
||||||
|
|||||||
@@ -44,9 +44,14 @@
|
|||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: Thruster
|
id: Thruster
|
||||||
parent: BaseThruster
|
parent: [ BaseThruster, ConstructibleMachine ]
|
||||||
components:
|
components:
|
||||||
- type: Thruster
|
- type: Thruster
|
||||||
|
- type: Machine
|
||||||
|
board: ThrusterMachineCircuitboard
|
||||||
|
- type: UpgradePowerDraw
|
||||||
|
powerDrawMultiplier: 0.75
|
||||||
|
scaling: Exponential
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Structures/Shuttles/thruster.rsi
|
sprite: Structures/Shuttles/thruster.rsi
|
||||||
layers:
|
layers:
|
||||||
@@ -85,12 +90,13 @@
|
|||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: Gyroscope
|
id: Gyroscope
|
||||||
parent: BaseThruster
|
parent: [ BaseThruster, ConstructibleMachine ]
|
||||||
components:
|
components:
|
||||||
- type: Thruster
|
- type: Thruster
|
||||||
thrusterType: Angular
|
thrusterType: Angular
|
||||||
requireSpace: false
|
requireSpace: false
|
||||||
thrust: 5000
|
baseThrust: 5000
|
||||||
|
machinePartThrust: ScanningModule
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
# Listen I'm not the biggest fan of the sprite but it was the most appropriate thing I could find.
|
# Listen I'm not the biggest fan of the sprite but it was the most appropriate thing I could find.
|
||||||
sprite: Structures/Shuttles/gyroscope.rsi
|
sprite: Structures/Shuttles/gyroscope.rsi
|
||||||
@@ -114,28 +120,36 @@
|
|||||||
autoRot: true
|
autoRot: true
|
||||||
offset: "0, 0.1" # shine from the top, not bottom of the computer
|
offset: "0, 0.1" # shine from the top, not bottom of the computer
|
||||||
color: "#4246b3"
|
color: "#4246b3"
|
||||||
|
- type: Machine
|
||||||
|
board: GyroscopeMachineCircuitboard
|
||||||
|
- type: UpgradePowerDraw
|
||||||
|
powerDrawMultiplier: 0.75
|
||||||
|
scaling: Exponential
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 2000
|
price: 2000
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: DebugGyroscope
|
id: DebugGyroscope
|
||||||
parent: Gyroscope
|
parent: BaseThruster
|
||||||
suffix: DEBUG
|
suffix: DEBUG
|
||||||
components:
|
components:
|
||||||
- type: Thruster
|
- type: Thruster
|
||||||
requireSpace: false
|
thrusterType: Angular
|
||||||
- type: ApcPowerReceiver
|
requireSpace: false
|
||||||
needsPower: false
|
baseThrust: 5000
|
||||||
powerLoad: 0
|
- type: ApcPowerReceiver
|
||||||
- type: Sprite
|
needsPower: false
|
||||||
sprite: Structures/Shuttles/gyroscope.rsi
|
powerLoad: 0
|
||||||
layers:
|
- type: Sprite
|
||||||
- state: base
|
sprite: Structures/Shuttles/gyroscope.rsi
|
||||||
map: ["enum.ThrusterVisualLayers.Base"]
|
snapCardinals: true
|
||||||
- state: thrust
|
layers:
|
||||||
map: ["enum.ThrusterVisualLayers.ThrustOn"]
|
- state: base
|
||||||
shader: unshaded
|
map: ["enum.ThrusterVisualLayers.Base"]
|
||||||
- state: thrust_burn_unshaded
|
- state: thrust
|
||||||
map: ["enum.ThrusterVisualLayers.ThrustingUnshaded"]
|
map: ["enum.ThrusterVisualLayers.ThrustOn"]
|
||||||
shader: unshaded
|
shader: unshaded
|
||||||
offset: 0, 1
|
- state: thrust_burn_unshaded
|
||||||
|
map: ["enum.ThrusterVisualLayers.ThrustingUnshaded"]
|
||||||
|
shader: unshaded
|
||||||
|
offset: 0, 1
|
||||||
|
|||||||
@@ -491,6 +491,24 @@
|
|||||||
Steel: 100
|
Steel: 100
|
||||||
Glass: 900
|
Glass: 900
|
||||||
|
|
||||||
|
- type: latheRecipe
|
||||||
|
id: ThrusterMachineCircuitboard
|
||||||
|
icon: { sprite: Objects/Misc/module.rsi, state: id_mod }
|
||||||
|
result: ThrusterMachineCircuitboard
|
||||||
|
completetime: 4
|
||||||
|
materials:
|
||||||
|
Steel: 100
|
||||||
|
Glass: 900
|
||||||
|
|
||||||
|
- type: latheRecipe
|
||||||
|
id: GyroscopeMachineCircuitboard
|
||||||
|
icon: { sprite: Objects/Misc/module.rsi, state: id_mod }
|
||||||
|
result: GyroscopeMachineCircuitboard
|
||||||
|
completetime: 4
|
||||||
|
materials:
|
||||||
|
Steel: 100
|
||||||
|
Glass: 900
|
||||||
|
|
||||||
- type: latheRecipe
|
- type: latheRecipe
|
||||||
id: GasRecyclerMachineCircuitboard
|
id: GasRecyclerMachineCircuitboard
|
||||||
icon: { sprite: Objects/Misc/module.rsi, state: id_mod }
|
icon: { sprite: Objects/Misc/module.rsi, state: id_mod }
|
||||||
|
|||||||
@@ -201,3 +201,14 @@
|
|||||||
Steel: 650
|
Steel: 650
|
||||||
Plastic: 150
|
Plastic: 150
|
||||||
Gold: 50
|
Gold: 50
|
||||||
|
|
||||||
|
- type: latheRecipe
|
||||||
|
id: MiningDrill
|
||||||
|
icon:
|
||||||
|
sprite: Objects/Tools/handdrill.rsi
|
||||||
|
state: handdrill
|
||||||
|
result: MiningDrill
|
||||||
|
completetime: 3
|
||||||
|
materials:
|
||||||
|
Steel: 500
|
||||||
|
Plastic: 100
|
||||||
|
|||||||
Reference in New Issue
Block a user