Skip to content

Commit

Permalink
Adds PKA & Jetpack Module for Salvage Cyborgs (#550)
Browse files Browse the repository at this point in the history
# Description

Gives salvage borgs a special jetpack module with half of the capacity
of a normal mini-jetpack. Granting them about 2 minutes of thrust, which
allows them to be more useful in space, partake in some rescue missions
and to some extent be independent for a limited amount of time if
something happens to the salvagers.

It also adds a PKA module, which gives them a PKA which can't be
wielded, leading to a hilarious accuracy penalty.

---

<details><summary><h1>Media</h1></summary>
<p>

Demo of the Modules
[![Crafting demo, basic
usage](https://i.ytimg.com/vi/k6xbEAtudVA/maxresdefault.jpg)](https://youtu.be/k6xbEAtudVA
"PKA/Jetpack Borg Demo")

Stormtrooper aim vs dragon AI
[![Soloing space dragon AI, ft. stormtrooper
aim](https://i.ytimg.com/vi/0e8iXbtD-Pc/maxresdefault.jpg)](https://www.youtube.com/watch?v=0e8iXbtD-Pc
"Stormtrooper vs Space Dragon AI")

Refillable jetpack module demo
[![Refilling
jetpack](https://i.ytimg.com/vi/y7Ie81NV2QM/maxresdefault.jpg)](https://youtu.be/y7Ie81NV2QM
"Refill showcase of the jetpack module")
</p>
</details>

---

# Changelog

:cl:
- add: Added an unlockable PKA and Jetpack module to Salvage Cyborgs

---------

Signed-off-by: gluesniffler <[email protected]>
  • Loading branch information
gluesniffler committed Aug 6, 2024
1 parent f177d7d commit 1141f26
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Lock;
using Content.Server.Silicons.Borgs.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
Expand Down Expand Up @@ -91,6 +92,10 @@ private void DirtyUI(EntityUid uid,
if (canister.GasTankSlot.Item != null)
{
var tank = canister.GasTankSlot.Item.Value;
if (TryComp<BorgJetpackComponent>(tank, out var jetpack) && jetpack.JetpackUid.HasValue)
{
tank = jetpack.JetpackUid.Value;
}
var tankComponent = Comp<GasTankComponent>(tank);
tankLabel = Name(tank);
tankPressure = tankComponent.Air.Pressure;
Expand Down Expand Up @@ -163,7 +168,12 @@ private void OnCanisterUpdated(EntityUid uid, GasCanisterComponent canister, ref
{
if (canister.GasTankSlot.Item != null)
{
var gasTank = Comp<GasTankComponent>(canister.GasTankSlot.Item.Value);
var tank = canister.GasTankSlot.Item;
if (TryComp<BorgJetpackComponent>(tank, out var jetpack) && jetpack.JetpackUid.HasValue)
{
tank = jetpack.JetpackUid.Value;
}
var gasTank = Comp<GasTankComponent>(tank.Value);
_atmos.ReleaseGasTo(canister.Air, gasTank.Air, canister.ReleasePressure);
}
else
Expand Down Expand Up @@ -233,7 +243,19 @@ private void OnCanisterInsertAttempt(EntityUid uid, GasCanisterComponent compone
if (args.Slot.ID != component.ContainerName || args.User == null)
return;

if (!TryComp<GasTankComponent>(args.Item, out var gasTank) || gasTank.IsValveOpen)
var tank = args.Item;

if (TryComp<BorgJetpackComponent>(tank, out var jetpack))
{
if (!jetpack.JetpackUid.HasValue)
{
args.Cancelled = true;
return;
}
tank = jetpack.JetpackUid.Value;
}

if (!TryComp<GasTankComponent>(tank, out var gasTank) || gasTank.IsValveOpen)
{
args.Cancelled = true;
return;
Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Hands.Components;
using Content.Shared.Interaction.Components;
using Content.Shared.Silicons.Borgs.Components;
using Content.Server.Silicons.Borgs.Components;
using Robust.Shared.Containers;

namespace Content.Server.Silicons.Borgs;
Expand Down Expand Up @@ -190,6 +191,10 @@ private void ProvideItems(EntityUid chassis, EntityUid uid, BorgChassisComponent
if (!component.ItemsCreated)
{
item = Spawn(itemProto, xform.Coordinates);
if (TryComp<BorgJetpackComponent>(uid, out var module))
{
module.JetpackUid = item;
}
}
else
{
Expand Down
12 changes: 12 additions & 0 deletions Content.Server/Silicons/Borgs/Components/BorgJetpackComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Robust.Shared.GameStates;

namespace Content.Server.Silicons.Borgs.Components;

/// <summary>
/// Server side indicator for a jetpack module. Used as conditional for inserting in canisters.
/// </summary>
[RegisterComponent]
public sealed partial class BorgJetpackComponent : Component
{
public EntityUid? JetpackUid = null;
}
1 change: 1 addition & 0 deletions Resources/Locale/en-US/research/technologies.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ research-technology-shuttlecraft = Shuttlecraft
research-technology-ripley-aplu = Ripley APLU
research-technology-advanced-atmospherics = Advanced Atmospherics
research-technology-advanced-tools = Advanced Tools
research-technology-mechanized-salvaging = Mechanized Salvaging
research-technology-super-powercells = Super Powercells
research-technology-bluespace-storage = Bluespace Storage
research-technology-portable-fission = Portable Fission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,34 @@
- Crowbar
- RadioHandheld

- type: entity
id: BorgModuleJetpack
parent: [ BaseBorgModuleCargo, BaseProviderBorgModule ]
name: jetpack cyborg module
description: A piece of tech that gives cyborgs new abilities. Needs to be loaded by a cyborg before you can refill the jetpack.
components:
- type: Sprite
layers:
- state: cargo
- state: icon-jetpack
- type: BorgJetpack
- type: ItemBorgModule
items:
- JetpackMicroFilled

- type: entity
id: BorgModulePka
parent: [ BaseBorgModuleCargo, BaseProviderBorgModule ]
name: proto kinetic accelerator cyborg module
components:
- type: Sprite
layers:
- state: cargo
- state: icon-pka
- type: ItemBorgModule
items:
- WeaponProtoKineticAccelerator

- type: entity
id: BorgModuleGrapplingGun
parent: [ BaseBorgModuleCargo, BaseProviderBorgModule ]
Expand Down
40 changes: 40 additions & 0 deletions Resources/Prototypes/Entities/Objects/Tools/jetpacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,43 @@
moles:
- 1.025689525 # oxygen
- 1.025689525 # nitrogen

#Empty micro - Used in the Cyborg module, visually the same as mini jetpack.
- type: entity
id: JetpackMicro
parent: BaseJetpack
name: micro jetpack
suffix: Empty
components:
- type: Item
sprite: Objects/Tanks/Jetpacks/mini.rsi
- type: Sprite
sprite: Objects/Tanks/Jetpacks/mini.rsi
- type: Clothing
sprite: Objects/Tanks/Jetpacks/mini.rsi
slots:
- Back
- suitStorage
- Belt
- type: GasTank
outputPressure: 42.6
air:
volume: 0.75


# Filled micro
- type: entity
id: JetpackMicroFilled
parent: JetpackMicro
name: micro jetpack
suffix: Filled
components:
- type: GasTank
outputPressure: 42.6
air:
# 2 minutes of thrust
volume: 0.75
temperature: 293.15
moles:
- 0.153853429 # oxygen
- 0.153853429 # nitrogen
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@
- BorgModuleAdvancedTool
- BorgModuleGPS
- BorgModuleRCD
- BorgModuleJetpack
- BorgModulePka
- BorgModuleArtifact
- BorgModuleAnomaly
- BorgModuleGardening
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
whitelist:
components:
- GasTank
- BorgJetpack
- type: StaticPrice
price: 1000
- type: AccessReader
Expand Down
24 changes: 24 additions & 0 deletions Resources/Prototypes/Recipes/Lathes/robotics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -612,3 +612,27 @@
Steel: 250
Glass: 250
Plastic: 250

- type: latheRecipe
id: BorgModulePka
result: BorgModulePka
category: Robotics
completetime: 3
materials:
Steel: 1000
Glass: 500
Plastic: 500
Silver: 100

- type: latheRecipe
id: BorgModuleJetpack
result: BorgModuleJetpack
category: Robotics
completetime: 3
materials:
Steel: 250
Glass: 250
Plastic: 250
Gold: 100
Plasma: 1000

13 changes: 13 additions & 0 deletions Resources/Prototypes/Research/industrial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@
- BorgModuleAdvancedTool
- BorgModuleRCD

- type: technology
id: MechanizedSalvaging
name: research-technology-mechanized-salvaging
icon:
sprite: Mobs/Silicon/chassis.rsi
state: miner
discipline: Industrial
tier: 2
cost: 10000
recipeUnlocks:
- BorgModulePka
- BorgModuleJetpack

# Tier 3

- type: technology
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
{
"name": "icon-harvesting"
},
{
"name": "icon-jetpack"
},
{
"name": "icon-light-replacer"
},
Expand All @@ -79,6 +82,9 @@
{
"name": "icon-pen"
},
{
"name": "icon-pka"
},
{
"name": "icon-radiation"
},
Expand Down

0 comments on commit 1141f26

Please sign in to comment.