Skip to content

Commit

Permalink
Revert "kill machine parts + migrate machine part spawners to salvage…
Browse files Browse the repository at this point in the history
… loot spawner (#23752)"

This reverts commit df1d8c3
  • Loading branch information
Cheackraze committed Feb 2, 2024
1 parent 3ec6eed commit b55fa9e
Show file tree
Hide file tree
Showing 10 changed files with 364 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,34 @@ public async Task ChangeMachine()
await Interact(Bin1, Bin1, Bin1, Manipulator1, Glass, Screw);
AssertPrototype("Autolathe");
}

[Test]
public async Task UpgradeLathe()
{
// Partially deconstruct a protolathe.
await SpawnTarget(Protolathe);
var serverTarget = SEntMan.GetEntity(Target!.Value);

// Initially has all quality-1 parts.
foreach (var part in SConstruction.GetAllParts(serverTarget))
{
Assert.That(part.Rating, Is.EqualTo(1));
}

// Partially deconstruct lathe
await Interact(Screw, Pry, Pry);
AssertPrototype(MachineFrame);

// Reconstruct with better parts.
await Interact(ProtolatheBoard, Bin4, Bin4, Manipulator4, Manipulator4, Beaker, Beaker);
await Interact(Screw);
AssertPrototype(Protolathe);

// Query now returns higher quality parts.
foreach (var part in SConstruction.GetAllParts(SEntMan.GetEntity(Target!.Value)))
{
Assert.That(part.Rating, Is.EqualTo(4));
}
}
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

namespace Content.IntegrationTests.Tests.Interaction;

// This partial class contains various constant prototype IDs common to interaction tests.
Expand Down Expand Up @@ -27,8 +28,12 @@ public abstract partial class InteractionTest

// Parts
protected const string Bin1 = "MatterBinStockPart";
protected const string Bin4 = "BluespaceMatterBinStockPart";
protected const string Cap1 = "CapacitorStockPart";
protected const string Cap4 = "QuadraticCapacitorStockPart";
protected const string Manipulator1 = "MicroManipulatorStockPart";
protected const string Manipulator4 = "FemtoManipulatorStockPart";
protected const string Battery1 = "PowerCellSmall";
protected const string Battery4 = "PowerCellHyper";
}

37 changes: 21 additions & 16 deletions Resources/Prototypes/Entities/Markers/Spawners/Random/salvage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
- sprite: Objects/Misc/stock_parts.rsi
state: advanced_matter_bin
- type: RandomSpawner
prototypes: #Frontier TODO: bring these back to the actual good parts
- CapacitorStockPart
- MicroManipulatorStockPart
- MatterBinStockPart
prototypes:
- AdvancedCapacitorStockPart
- NanoManipulatorStockPart
- AdvancedMatterBinStockPart
offset: 0.0

- type: entity
Expand All @@ -89,10 +89,15 @@
- sprite: Objects/Misc/stock_parts.rsi
state: super_matter_bin
- type: RandomSpawner
prototypes: #Frontier TODO: bring these back to the actual good parts
- CapacitorStockPart
- MicroManipulatorStockPart
- MatterBinStockPart
rarePrototypes:
- QuadraticCapacitorStockPart
- FemtoManipulatorStockPart
- BluespaceMatterBinStockPart
rareChance: 0.05
prototypes:
- SuperCapacitorStockPart
- PicoManipulatorStockPart
- SuperMatterBinStockPart
chance: 0.95
offset: 0.0

Expand All @@ -107,10 +112,10 @@
- sprite: Objects/Misc/stock_parts.rsi
state: super_matter_bin
- type: RandomSpawner
prototypes: #Frontier TODO: bring these back to the actual good parts
- CapacitorStockPart
- MicroManipulatorStockPart
- MatterBinStockPart
prototypes:
- SuperCapacitorStockPart
- PicoManipulatorStockPart
- SuperMatterBinStockPart
offset: 0.0

- type: entity
Expand All @@ -124,10 +129,10 @@
- sprite: Objects/Misc/stock_parts.rsi
state: bluespace_matter_bin
- type: RandomSpawner
prototypes: #Frontier TODO: bring these back to the actual good parts
- CapacitorStockPart
- MicroManipulatorStockPart
- MatterBinStockPart
prototypes:
- QuadraticCapacitorStockPart
- PicoManipulatorStockPart
- BluespaceMatterBinStockPart
offset: 0.0

- type: entity
Expand Down
181 changes: 181 additions & 0 deletions Resources/Prototypes/Entities/Objects/Misc/machine_parts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
guides:
- MachineUpgrading

# Rating 1

- type: entity
id: CapacitorStockPart
name: capacitor
Expand Down Expand Up @@ -54,3 +56,182 @@
- type: MachinePart
part: MatterBin
rating: 1

# Rating 2

- type: entity
id: AdvancedCapacitorStockPart
name: advanced capacitor
parent: CapacitorStockPart
description: An advanced capacitor used in the construction of a variety of devices.
suffix: Rating 2
components:
- type: Sprite
state: adv_capacitor
- type: MachinePart
rating: 2

- type: entity
id: NanoManipulatorStockPart
name: advanced manipulator
parent: MicroManipulatorStockPart
description: An advanced manipulator used in the construction of a variety of devices.
suffix: Rating 2
components:
- type: Sprite
state: nano_mani
- type: MachinePart
rating: 2

- type: entity
id: AdvancedMatterBinStockPart
name: advanced matter bin
parent: MatterBinStockPart
description: An advanced matter bin used in the construction of a variety of devices.
suffix: Rating 2
components:
- type: Sprite
state: advanced_matter_bin
- type: MachinePart
rating: 2

# Rating 3

- type: entity
id: SuperCapacitorStockPart
name: super capacitor
parent: CapacitorStockPart
description: A super capacitor used in the construction of a variety of devices.
suffix: Rating 3
components:
- type: Sprite
state: super_capacitor
- type: MachinePart
rating: 3

- type: entity
id: PicoManipulatorStockPart
name: super manipulator
parent: MicroManipulatorStockPart
description: A super manipulator used in the construction of a variety of devices.
suffix: Rating 3
components:
- type: Sprite
state: pico_mani
- type: MachinePart
rating: 3

- type: entity
id: SuperMatterBinStockPart
name: super matter bin
parent: MatterBinStockPart
description: A super matter bin used in the construction of a variety of devices.
suffix: Rating 3
components:
- type: Sprite
state: super_matter_bin
- type: MachinePart
rating: 3

# Rating 4

- type: entity
id: QuadraticCapacitorStockPart
name: bluespace capacitor
parent: CapacitorStockPart
description: A bluespace capacitor used in the construction of a variety of devices.
suffix: Rating 4
components:
- type: Sprite
state: quadratic_capacitor
- type: MachinePart
rating: 4

- type: entity
id: FemtoManipulatorStockPart
name: bluespace manipulator
parent: MicroManipulatorStockPart
description: A bluespace manipulator used in the construction of a variety of devices.
suffix: Rating 4
components:
- type: Sprite
state: femto_mani
- type: MachinePart
rating: 4

- type: entity
id: BluespaceMatterBinStockPart
name: bluespace matter bin
parent: MatterBinStockPart
description: A bluespace matter bin used in the construction of a variety of devices.
suffix: Rating 4
components:
- type: Sprite
state: bluespace_matter_bin
- type: MachinePart
rating: 4

# Subspace stock parts (REMOVE THESE)

- type: entity
id: AnsibleSubspaceStockPart
name: subspace ansible
parent: BaseStockPart
description: A compact module capable of sensing extradimensional activity.
components:
- type: Sprite
state: subspace_ansible

- type: entity
id: FilterSubspaceStockPart
name: hyperwave filter
parent: BaseStockPart
description: A tiny device capable of filtering and converting super-intense radiowaves.
components:
- type: Sprite
state: hyperwave_filter

- type: entity
id: AmplifierSubspaceStockPart
name: subspace amplifier
parent: BaseStockPart
description: A compact micro-machine capable of amplifying weak subspace transmissions.
components:
- type: Sprite
state: subspace_amplifier

- type: entity
id: TreatmentSubspaceStockPart
name: subspace treatment disk
parent: BaseStockPart
description: A compact micro-machine capable of stretching out hyper-compressed radio waves.
components:
- type: Sprite
state: treatment_disk

- type: entity
id: AnalyzerSubspaceStockPart
name: subspace wavelength analyzer
parent: BaseStockPart
description: A sophisticated analyzer capable of analyzing cryptic subspace wavelengths.
components:
- type: Sprite
state: wavelength_analyzer

- type: entity
id: CrystalSubspaceStockPart
name: ansible crystal
parent: BaseStockPart
description: A crystal made from pure glass used to transmit laser databursts to subspace.
components:
- type: Sprite
state: ansible_crystal

- type: entity
id: TransmitterSubspaceStockPart
name: subspace transmitter
parent: BaseStockPart
description: A large piece of equipment used to open a window into the subspace dimension.
components:
- type: Sprite
state: subspace_transmitter
6 changes: 6 additions & 0 deletions Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@
- PillCanister
- ChemistryEmptyBottle01
- Drone
- AdvancedCapacitorStockPart
- AdvancedMatterBinStockPart
- NanoManipulatorStockPart
- SuperCapacitorStockPart
- SuperMatterBinStockPart
- PicoManipulatorStockPart
- AdvMopItem
- WeaponSprayNozzle
- ClothingBackpackWaterTank
Expand Down
60 changes: 60 additions & 0 deletions Resources/Prototypes/Recipes/Lathes/Parts.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Rating 1
- type: latheRecipe
id: CapacitorStockPart
result: CapacitorStockPart
Expand All @@ -21,3 +22,62 @@
materials:
Steel: 50
Plastic: 50

#Rating 2
- type: latheRecipe
id: AdvancedCapacitorStockPart
result: AdvancedCapacitorStockPart
completetime: 3
materials:
Steel: 80
Plastic: 80
Plasma: 75

- type: latheRecipe
id: AdvancedMatterBinStockPart
result: AdvancedMatterBinStockPart
completetime: 3
materials:
Steel: 80
Plastic: 80
Plasma: 75

- type: latheRecipe
id: NanoManipulatorStockPart
result: NanoManipulatorStockPart
completetime: 3
materials:
Steel: 80
Plastic: 80
Plasma: 75

#Rating 3
- type: latheRecipe
id: SuperCapacitorStockPart
result: SuperCapacitorStockPart
completetime: 3
materials:
Steel: 150
Plastic: 150
Plasma: 75
Gold: 75

- type: latheRecipe
id: SuperMatterBinStockPart
result: SuperMatterBinStockPart
completetime: 3
materials:
Steel: 150
Plastic: 150
Plasma: 75
Gold: 75

- type: latheRecipe
id: PicoManipulatorStockPart
result: PicoManipulatorStockPart
completetime: 3
materials:
Steel: 150
Plastic: 150
Plasma: 75
Gold: 75
Loading

0 comments on commit b55fa9e

Please sign in to comment.