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

Medical insurance tracking implant #339

Merged
merged 11 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Weapons.Ranged.Events;
using Content.Server.Station.Systems;

namespace Content.Server.Explosion.EntitySystems
{
Expand Down Expand Up @@ -61,6 +62,7 @@ public sealed partial class TriggerSystem : EntitySystem
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly RadioSystem _radioSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly StationSystem _station = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -167,8 +169,21 @@ private void HandleRattleTrigger(EntityUid uid, RattleComponent component, Trigg
var y = (int) pos.Y;
var posText = $"({x}, {y})";

var critMessage = Loc.GetString(component.CritMessage, ("user", implanted.ImplantedEntity.Value), ("position", posText));
var deathMessage = Loc.GetString(component.DeathMessage, ("user", implanted.ImplantedEntity.Value), ("position", posText));
// Gets station location of the implant
var station = _station.GetOwningStation(uid);
var stationName = station is null ? null : Name(station.Value);

if (!(stationName == null))
{
stationName += " ";
}
else
{
stationName = "";
}

var critMessage = Loc.GetString(component.CritMessage, ("user", implanted.ImplantedEntity.Value), ("grid", stationName!), ("position", posText));
var deathMessage = Loc.GetString(component.DeathMessage, ("user", implanted.ImplantedEntity.Value), ("grid", stationName!), ("position", posText));

if (!TryComp<MobStateComponent>(implanted.ImplantedEntity, out var mobstate))
return;
Expand Down
20 changes: 20 additions & 0 deletions Resources/Locale/en-US/_NF/paper/book-medical-insurance.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
book-medical-insurance = This form is a contract made with the medical frovider:
--------------------------------------------------------------------------------------
SECTION 1: Info
--------------------------------------------------------------------------------------
Full Name :
Race :
Blood Type :
Ship :

--------------------------------------------------------------------------------------
SECTION 2: Services
--------------------------------------------------------------------------------------
As part of our service we will attemp to come and aid you in the case of your medical implant going off.

(X) Revive = Up to 8k
(X) Clone = Up to 10k

In the case were unable to clone you, with your brain still intact, you also agree to be borged:

( ) Borg = Up to 20k
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-MedicalTrackingImplants = { ent-CrateMedicalTrackingImplants }
.desc = { ent-CrateMedicalTrackingImplants.desc }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-CrateMedicalTrackingImplants = Medical insurance tracking implants
.desc = Contains a handful of medical insurance tracking implanters. make sure to sign with a provider, or hope for an independent medical help.
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/implant/implant.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ scramble-implant-activated-popup = Your appearance shifts and changes!

## Implant Messages

deathrattle-implant-dead-message = {$user} has died at {$position}.
deathrattle-implant-critical-message = {$user} life signs critical, immediate assistance required at {$position}.
deathrattle-implant-dead-message = {$user} has died at {$grid}{$position}.
deathrattle-implant-critical-message = {$user} life signs critical, immediate assistance required at {$grid}{$position}.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
Bloodpack: 15
EpinephrineChemistryBottle: 9
Syringe: 15
BoxMedicalTrackingImplants: 15
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
transmitFrequencyId: SuitSensor
- type: StationLimitedNetwork
- type: WirelessNetworkConnection
range: 500
range: 10000
- type: TriggerOnMobstateChange
mobState:
- Critical
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/_NF/Catalog/Cargo/cargo_medical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- type: cargoProduct
id: MedicalTrackingImplant
icon:
sprite: Objects/Specific/Chemistry/syringe.rsi
state: syringe_base0
product: CrateMedicalTrackingImplants
cost: 1000
category: Medical
group: market
24 changes: 24 additions & 0 deletions Resources/Prototypes/_NF/Catalog/Fills/Boxes/general.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- type: entity
name: medical insurance tracking implant box
parent: BoxCardboard
id: BoxMedicalTrackingImplants
description: Medical insurance implant kit.
components:
- type: Item
size: 60
- type: StorageFill
contents:
- id: MedicalTrackingImplanter
amount: 1
- id: HandheldGPSBasic
amount: 1
- id: PaperMedicalInsurance
amount: 1
- type: Storage
capacity: 60
- type: Sprite
layers:
- state: box
- state: syringe
- type: VendPrice
price: 200 # Single Implant Box (5 are 1000)
8 changes: 8 additions & 0 deletions Resources/Prototypes/_NF/Catalog/Fills/Crates/medical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: entity
id: CrateMedicalTrackingImplants
parent: CrateMedical
components:
- type: StorageFill
contents:
- id: BoxMedicalTrackingImplants
amount: 5
9 changes: 9 additions & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Medical implanters

- type: entity
id: MedicalTrackingImplanter
name: medical insurance tracking implanter
parent: BaseImplantOnlyImplanter
components:
- type: Implanter
implant: MedicalTrackingImplant
29 changes: 29 additions & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Misc/paper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- type: entity
name: Medical insurance form
parent: Paper
id: PaperMedicalInsurance
description: 'Provide this papar for an insurance provider.'
components:
- type: Paper
contentSize: 10000
escapeFormatting: false
content: book-medical-insurance
- type: Sprite
sprite: Objects/Misc/bureaucracy.rsi
layers:
- state: paper
color: "#cccccc"
- state: paper_words
map: ["enum.PaperVisualLayers.Writing"]
color: "#cccccc" #aaaaaaaaaaaaaaaaaaaaaaa
visible: false
- state: paper_stamp-generic
map: ["enum.PaperVisualLayers.Stamp"]
visible: false
- type: PaperVisuals
backgroundImagePath: "/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"
contentImagePath: "/Textures/Interface/Paper/paper_content_lined.svg.96dpi.png"
backgroundModulate: "#cccccc"
contentImageModulate: "#cccccc"
backgroundPatchMargin: 16.0, 16.0, 16.0, 16.0
contentMargin: 16.0, 16.0, 16.0, 16.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#Medical implants

- type: entity
parent: BaseSubdermalImplant
id: MedicalTrackingImplant
name: medical insurance tracking implant
description: This implant has a tracking device attached to the suit sensor network, as well as a condition monitor for the Medical radio channel.
noSpawn: true
components:
- type: SubdermalImplant
- type: SuitSensor
randomMode: false
controlsLocked: true
mode: SensorCords
activationContainer: "implant"
- type: DeviceNetwork
deviceNetId: Wireless
transmitFrequencyId: SuitSensor
- type: StationLimitedNetwork
- type: WirelessNetworkConnection
range: 10000
- type: TriggerOnMobstateChange
mobState:
- Critical
- Dead
- type: Rattle
radioChannel: "Medical"
Loading