Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Adds an innate mineral scanner to dwarves (new-frontiers-14#2112)
Browse files Browse the repository at this point in the history
* Adds an innate mining scanner to dwarves

* Edit dwarf guidebook, move cryo/dorf to _NF
  • Loading branch information
whatston3 authored Sep 29, 2024
1 parent 7df88c9 commit 09aba6e
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 15 deletions.
18 changes: 15 additions & 3 deletions Content.Shared/Mining/MiningScannerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared._NF.Mining.Components; // Frontier
using Content.Shared.Inventory;
using Content.Shared.Item.ItemToggle.Components;
using Content.Shared.Mining.Components;
Expand All @@ -8,7 +9,7 @@

namespace Content.Shared.Mining;

public sealed class MiningScannerSystem : EntitySystem
public sealed partial class MiningScannerSystem : EntitySystem // Frontier: partial
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly INetManager _net = default!;
Expand All @@ -22,6 +23,8 @@ public override void Initialize()
SubscribeLocalEvent<MiningScannerComponent, EntGotInsertedIntoContainerMessage>(OnInserted);
SubscribeLocalEvent<MiningScannerComponent, EntGotRemovedFromContainerMessage>(OnRemoved);
SubscribeLocalEvent<MiningScannerComponent, ItemToggledEvent>(OnToggled);

NFInitialize(); // Frontier
}

private void OnInserted(Entity<MiningScannerComponent> ent, ref EntGotInsertedIntoContainerMessage args)
Expand Down Expand Up @@ -85,8 +88,17 @@ public override void Update(float frameTime)
{
if (viewer.QueueRemoval)
{
RemCompDeferred(uid, viewer);
continue;
// Frontier: innate mining scanner
if (TryComp<InnateMiningScannerViewerComponent>(uid, out var innateViewer))
{
SetupInnateMiningViewerComponent((uid, innateViewer));
}
else
{
// End Frontier: innate mining scanner
RemCompDeferred(uid, viewer);
continue;
} // Frontier
}

if (_timing.CurTime < viewer.NextPingTime)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Content.Shared.Mining;

namespace Content.Shared._NF.Mining.Components;

[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(MiningScannerSystem))]
public sealed partial class InnateMiningScannerViewerComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
public float ViewRange;

[DataField, AutoNetworkedField]
public float AnimationDuration = 1.5f;

[DataField, AutoNetworkedField]
public TimeSpan PingDelay = TimeSpan.FromSeconds(5);

[DataField, AutoNetworkedField]
public SoundSpecifier? PingSound = null;

}
33 changes: 33 additions & 0 deletions Content.Shared/_NF/Mining/MiningScannerSystem.Innate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Content.Shared.Mining.Components;
using Content.Shared._NF.Mining.Components;

namespace Content.Shared.Mining;

public sealed partial class MiningScannerSystem : EntitySystem
{

/// <inheritdoc/>
public void NFInitialize()
{
SubscribeLocalEvent<InnateMiningScannerViewerComponent, ComponentStartup>(OnStartup);
}

private void OnStartup(Entity<InnateMiningScannerViewerComponent> ent, ref ComponentStartup args)
{
if (!HasComp<MiningScannerViewerComponent>(ent))
{
SetupInnateMiningViewerComponent(ent);
}
}

private void SetupInnateMiningViewerComponent(Entity<InnateMiningScannerViewerComponent> ent)
{
var comp = EnsureComp<MiningScannerViewerComponent>(ent);
comp.ViewRange = ent.Comp.ViewRange;
comp.PingDelay = ent.Comp.PingDelay;
comp.PingSound = ent.Comp.PingSound;
comp.QueueRemoval = false;
comp.NextPingTime = _timing.CurTime + ent.Comp.PingDelay;
Dirty(ent.Owner, comp);
}
}
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Species/dwarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: InnateMiningScannerViewer # Frontier
pingSound: null # Frontier
viewRange: 5 # Frontier

- type: entity
parent: BaseSpeciesDummy
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Guidebook/medical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Medical Doctor
- Chemist
- Cloning
- Cryogenics
- Cryogenics # Note: Frontier changes inside

- type: guideEntry
id: Medical Doctor
Expand All @@ -21,7 +21,7 @@
- type: guideEntry
id: Cryogenics
name: guide-entry-cryogenics
text: "/ServerInfo/Guidebook/Medical/Cryogenics.xml"
text: "/ServerInfo/_NF/Guidebook/Medical/Cryogenics.xml" # Frontier: added _NF prefix

- type: guideEntry
id: Chemist
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Guidebook/species.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
children:
- Arachnid
- Diona
- Dwarf
- Dwarf # Note: Frontier changes inside
- Goblin # Frontier
- Human
- Moth
Expand All @@ -30,7 +30,7 @@
- type: guideEntry
id: Dwarf
name: species-name-dwarf
text: "/ServerInfo/Guidebook/Mobs/Dwarf.xml"
text: "/ServerInfo/_NF/Guidebook/Mobs/Dwarf.xml" # Frontier: moved to _NF folder

- type: guideEntry
id: Human
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_NF/Guidebook/species.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- type: guideEntry
id: Goblin
name: species-name-goblin
text: "/ServerInfo/_NF/Guidebook/Mobs/Goblin.xml"
text: "/ServerInfo/_NF/Guidebook/Mobs/Goblin.xml"
11 changes: 4 additions & 7 deletions Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@ Not every network will look like this, but hopefully, it's enough to give you th
An important thing to note, winter clothing (and hardsuits) will make cryogenic treatment less, or completely ineffective. Be sure to remove cold preventative clothing before placing people in the pod.

## Using the Pod

Once things have been set up, you're going to require cryogenic medications (all listed below). They each provide healing when a patient is chilled, and should be loaded into the pod directly with a beaker. Do note, patients won't begin to heal until they've chilled to the appropriate temperature, it may be worthwhile to wait a bit before placing a beaker inside.
Once things have been set up, you're going to require a specific medication, Cryoxadone. Cryoxadone heals all damage types when a patient is chilled, and can either be pre-administered (with a pill), or loaded into the cell directly with a beaker. Do note, patients won't begin to heal until they've chilled to the appropriate temperature, it may be worthwhile to wait a bit before placing a beaker inside.

## Additional Information:

The standard pressure for a gas pump is 100.325 kpa. Cryogenics medicines work at under 213K (150K for Opporozidone), but it is standard practice to set the freezer to 100K for faster freezing.

Cryo pods filter out each cryogenic medicine from the beaker in the pod, injecting a small, steady amount of each into the patient. This allows for medicine to be administered twice as efficiently than with injection or oral administration.
The standard pressure for a gas pump is 100.325 kpa. Cryoxadone works at under 170K, but it is standard practice to set the freezer to 100K for faster freezing.

<GuideReagentEmbed Reagent="Aloxadone"/>
<GuideReagentEmbed Reagent="Cryoxadone"/>
<GuideReagentEmbed Reagent="Doxarubixadone"/>
<GuideReagentEmbed Reagent="Dexalin"/>
<GuideReagentEmbed Reagent="Leporazine"/>
<GuideReagentEmbed Reagent="Necrosol"/>
<GuideReagentEmbed Reagent="Opporozidone"/>
<GuideReagentEmbed Reagent="Stelloxadone"/>
<GuideReagentEmbed Reagent="Traumoxadone"/>

</Document>
57 changes: 57 additions & 0 deletions Resources/ServerInfo/_NF/Guidebook/Medical/Cryogenics.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Document>
# Cryogenics
Cryogenics can be a bit daunting to understand, but hopefully, quick run through of this diagram, you'll learn how to work it! So, let's go over what each part does:

- Air in: Air comes in here through the distro or an air tank, giving those inside something to breathe, and the freezer something to chill.
- Gas pump: Limits the network pressure, so those in the tube aren't crushed.
- Freezer: Chills the air, and by extension, patients in the tube, so Cryoxadone can activate.
- Gas filters: Removes waste gas (Carbon Dioxide and Nitrous Oxide) from the loop.
- Air out: Waste gasses go here, either into a storage tank, or into the waste network.
<Box>
<GuideEntityEmbed Entity="GasPipeBend" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeStraight" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeStraight" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeBend" Rotation="0"/>
<GuideEntityEmbed Entity="CryoPod" Caption="cryo pod" Rotation="0"/>
<GuideEntityEmbed Entity="GasThermoMachineFreezerEnabled" Rotation="0"/>
</Box>
<Box>
<GuideEntityEmbed Entity="GasPipeBend" Rotation="180"/>
<GuideEntityEmbed Entity="GasFilterFlipped" Rotation="90"/>
<GuideEntityEmbed Entity="GasFilterFlipped" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeTJunction" Rotation="180"/>
<GuideEntityEmbed Entity="GasPipeTJunction" Rotation="180"/>
<GuideEntityEmbed Entity="GasPipeTJunction" Rotation="270"/>
</Box>
<Box>
<GuideEntityEmbed Entity="GasPort" Caption="air out" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeTJunction" Rotation="180"/>
<GuideEntityEmbed Entity="GasPipeBend" Rotation="270"/>
<GuideEntityEmbed Entity="GasPort" Caption="air in" Rotation="90"/>
<GuideEntityEmbed Entity="GasPressurePump" Rotation="90"/>
<GuideEntityEmbed Entity="GasPipeBend" Rotation="270"/>
</Box>

Not every network will look like this, but hopefully, it's enough to give you the basic gist of how it's functioning.

An important thing to note, winter clothing (and hardsuits) will make cryogenic treatment less, or completely ineffective. Be sure to remove cold preventative clothing before placing people in the pod.

## Using the Pod

Once things have been set up, you're going to require cryogenic medications (all listed below). They each provide healing when a patient is chilled, and should be loaded into the pod directly with a beaker. Do note, patients won't begin to heal until they've chilled to the appropriate temperature, it may be worthwhile to wait a bit before placing a beaker inside.

## Additional Information:

The standard pressure for a gas pump is 100.325 kpa. Cryogenics medicines work at under 213K (150K for Opporozidone), but it is standard practice to set the freezer to 100K for faster freezing.

Cryo pods filter out each cryogenic medicine from the beaker in the pod, injecting a small, steady amount of each into the patient. This allows for medicine to be administered twice as efficiently than with injection or oral administration.

<GuideReagentEmbed Reagent="Aloxadone"/>
<GuideReagentEmbed Reagent="Cryoxadone"/>
<GuideReagentEmbed Reagent="Doxarubixadone"/>
<GuideReagentEmbed Reagent="Necrosol"/>
<GuideReagentEmbed Reagent="Opporozidone"/>
<GuideReagentEmbed Reagent="Stelloxadone"/>
<GuideReagentEmbed Reagent="Traumoxadone"/>

</Document>
18 changes: 18 additions & 0 deletions Resources/ServerInfo/_NF/Guidebook/Mobs/Dwarf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Document>
# Dwarves

<Box>
<GuideEntityEmbed Entity="MobDwarf" Caption=""/>
</Box>

An industrious species, dwarves are similar to humans in most respect, but tolerate alcohol better and are healed by it.

<Box>
<GuideEntityEmbed Entity="WallRockChromiteDiamond" Caption=""/>
<GuideEntityEmbed Entity="WallRockBasaltBananium" Caption=""/>
<GuideEntityEmbed Entity="WallRockBluespace" Caption=""/>
</Box>

A dwarf instinctively knows where the choice ore veins are, and can sense the presence of ore up to 5 meters away.

</Document>

0 comments on commit 09aba6e

Please sign in to comment.