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

Airtanks & Batteries #14

Merged
merged 5 commits into from
Jan 25, 2025
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
2 changes: 1 addition & 1 deletion Content.Server/Light/EntitySystems/HandheldLightSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void TryUpdate(Entity<HandheldLightComponent> uid, float frameTime)
}

if (component.Activated && !_battery.TryUseCharge(batteryUid.Value, component.Wattage * frameTime, battery))
TurnOff(uid, false);
TurnOff(uid, true);

UpdateLevel(uid);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Power/Components/ChargerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed partial class ChargerComponent : Component
/// The charge rate of the charger, in watts
/// </summary>
[DataField("chargeRate")]
public float ChargeRate = 20.0f;
public float ChargeRate = 100.0f;

/// <summary>
/// The container ID that is holds the entities being charged.
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Power/EntitySystems/BatterySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ private void OnEmpPulse(EntityUid uid, BatteryComponent component, ref EmpPulseE

public float UseCharge(EntityUid uid, float value, BatteryComponent? battery = null)
{
if (value <= 0 || !Resolve(uid, ref battery) || battery.CurrentCharge == 0)
if (value <= 0 || !Resolve(uid, ref battery) || battery.CurrentCharge == 0)
return 0;

var newValue = Math.Clamp(0, battery.CurrentCharge - value, battery.MaxCharge);
var newValue = Math.Clamp(battery.CurrentCharge - value, 0, battery.MaxCharge);
var delta = newValue - battery.CurrentCharge;
battery.CurrentCharge = newValue;

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Atmos/Atmospherics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public static class Atmospherics
/// <summary>
/// This is calculated to help prevent singlecap bombs (Overpowered tritium/oxygen single tank bombs)
/// </summary>
public const float MinimumTritiumOxyburnEnergy = 143000f;
public const float MinimumTritiumOxyburnEnergy = 429000f;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sneakycode to make bombs more powerful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently that is correlated to the volume of the container or something, and there was a comment specifically to adjust that when adjusting tank volumes


public const float TritiumBurnOxyFactor = 100f;
public const float TritiumBurnTritFactor = 10f;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Light/Components/HandheldLightComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class HandheldLightComponent : Component

[ViewVariables(VVAccess.ReadWrite)]
[DataField("wattage")]
public float Wattage { get; set; } = .8f;
public float Wattage { get; set; } = .1f;

[DataField("turnOnSound")]
public SoundSpecifier TurnOnSound = new SoundPathSpecifier("/Audio/Items/flashlight_on.ogg");
Expand Down
64 changes: 32 additions & 32 deletions Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
- type: GasTank
outputPressure: 21.3
air:
# 31 minutes
volume: 5
# 31 minutes; 125 minutes full
volume: 20
moles:
- 2.051379050 # oxygen
temperature: 293.15
Expand All @@ -42,10 +42,10 @@
- type: GasTank
outputPressure: 21.3
air:
# 4 minutes
volume: 0.66
# 9.5 minutes
volume: 1.5
moles:
- 0.270782035 # oxygen
- 0.615413715 # oxygen
temperature: 293.15

- type: entity
Expand All @@ -56,11 +56,11 @@
- type: GasTank
outputPressure: 21.3
air:
# 4 minutes
volume: 0.66
# 9.5 minutes
volume: 1.5
moles:
- 0 # oxygen
- 0.270782035 # nitrogen
- 0.615413715 # nitrogen
temperature: 293.15


Expand All @@ -72,10 +72,10 @@
- type: GasTank
outputPressure: 21.3
air:
# 9 minutes
volume: 1.5
# 28 minutes
volume: 4.5
moles:
- 0.615413715 # oxygen
- 1.846241167 # oxygen
temperature: 293.15

- type: entity
Expand All @@ -86,11 +86,11 @@
- type: GasTank
outputPressure: 21.3
air:
# 9 minutes
volume: 1.5
# 28 minutes
volume: 4.5
moles:
- 0 # oxygen
- 0.615413715 # nitrogen
- 1.846241167 # nitrogen
temperature: 293.15


Expand All @@ -102,10 +102,10 @@
- type: GasTank
outputPressure: 21.3
air:
# 15 minutes
volume: 2.5
# 56 minutes
volume: 9
moles:
- 1.025689525 # oxygen
- 3.692482334 # oxygen
temperature: 293.15

- type: entity
Expand All @@ -116,11 +116,11 @@
- type: GasTank
outputPressure: 21.3
air:
# 15 minutes
volume: 2.5
# 56 minutes
volume: 9
moles:
- 0 # oxygen
- 1.025689525 # nitrogen
- 3.692482334 # nitrogen
temperature: 293.15

- type: entity
Expand All @@ -131,18 +131,18 @@
- type: GasTank
outputPressure: 22.4
air:
# 4 minutes
volume: 0.66
# 9 minutes
volume: 1.5
moles:
- 0.270782035 # 95% oxygen
- 0.584643029 # 95% oxygen
- 0 # nitrogen
- 0 # CO2
- 0 # plasma
- 0 # tritium
- 0 # water vapor
- 0 # ammonia
- 0.014251686 # 5% N2O
# 0.285033721 total
- 0.030770685 # 5% N2O
# 0.615413715 total
temperature: 293.15

- type: entity
Expand All @@ -153,8 +153,8 @@
- type: GasTank
outputPressure: 101.3
air:
# 6 minutes due to output pressure
volume: 5
# 6.5 minutes due to output pressure
volume: 20
moles:
- 0.451303391 # 22% oxygen
- 1.600075659 # 78% nitrogen
Expand All @@ -169,8 +169,8 @@
components:
- type: GasTank
air:
# 31 minutes
volume: 5
# 31 minutes; 125 minutes full
volume: 20
moles:
- 0 # oxygen not included
- 2.051379050 # nitrogen
Expand All @@ -191,7 +191,7 @@
outputPressure: 30.4
air:
# only 22 minutes due to pressure
volume: 5
volume: 20
moles:
- 1.435965335 # 70% oxygen
- 0 # nitrogen
Expand All @@ -213,8 +213,8 @@
- type: GasTank
outputPressure: 101.3
air:
# 6 minutes of agony
volume: 5
# 6.5 minutes of agony
volume: 20
moles:
- 0 # oxygen
- 0 # nitrogen
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
outputPressure: 21.3
air:
# If gas tank volume is changed, adjust MinimumTritiumOxyburnEnergy in Atmospherics.cs by the same proportions
volume: 5
volume: 20
temperature: 293.15
tankLowPressure: 30.0
- type: Explosive
Expand Down Expand Up @@ -103,7 +103,7 @@
sprite: Objects/Tanks/emergency.rsi
- type: GasTank
air:
volume: 0.66
volume: 1.5
temperature: 293.15
- type: Clothing
sprite: Objects/Tanks/emergency.rsi
Expand Down
34 changes: 17 additions & 17 deletions Resources/Prototypes/Entities/Structures/Power/apc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
- type: Appearance
- type: ApcVisuals
- type: Battery
maxCharge: 50000
startingCharge: 0
maxCharge: 1800000
startingCharge: 100000
- type: ExaminableBattery
- type: NodeContainer
examinable: true
Expand Down Expand Up @@ -92,10 +92,10 @@
graph: APC
node: apc
- type: PowerNetworkBattery
maxSupply: 10000
maxChargeRate: 5000
supplyRampTolerance: 1000
supplyRampRate: 500
maxSupply: 30000
maxChargeRate: 60000
supplyRampTolerance: 1500
supplyRampRate: 1000
- type: WallMount
- type: WiresPanel
- type: WiresVisuals
Expand Down Expand Up @@ -202,43 +202,43 @@
- type: entity
parent: BaseAPC
id: APCBasic
suffix: Basic, 50kW
suffix: Basic, 0.5kWh
components:
- type: Battery
maxCharge: 50000
startingCharge: 50000
maxCharge: 1800000
startingCharge: 100000
- type: BatteryDrinkerSource # Parkstation IPCs
maxAmount: 5000

- type: entity
parent: BaseAPC
id: APCHighCapacity
suffix: High Capacity, 100kW
suffix: High Capacity, 1.2kWh
components:
- type: Battery
maxCharge: 100000
maxCharge: 4320000
startingCharge: 100000
- type: BatteryDrinkerSource # Parkstation IPCs
maxAmount: 12000

- type: entity
parent: BaseAPC
id: APCSuperCapacity
suffix: Super Capacity, 150kW
suffix: Super Capacity, 1.8kWh
components:
- type: Battery
maxCharge: 150000
startingCharge: 150000
maxCharge: 6480000
startingCharge: 100000
- type: BatteryDrinkerSource # Parkstation IPCs
maxAmount: 18000

- type: entity
parent: BaseAPC
id: APCHyperCapacity
suffix: Hyper Capacity, 200kW
suffix: Hyper Capacity, 2.6kWh
components:
- type: Battery
maxCharge: 200000
startingCharge: 200000
maxCharge: 9360000
startingCharge: 100000
- type: BatteryDrinkerSource # Parkstation IPCs # Parkstation IPCs
maxAmount: 26000
16 changes: 8 additions & 8 deletions Resources/Prototypes/Entities/Structures/Power/smes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- type: Smes
- type: UpgradeBattery
maxChargeMultiplier: 2
baseMaxCharge: 8000000
baseMaxCharge: 90000000
- type: UpgradePowerSupplyRamping
scaling: Linear
supplyRampingMultiplier: 1
Expand Down Expand Up @@ -62,10 +62,10 @@
voltage: High
node: input
- type: PowerNetworkBattery
maxSupply: 150000
maxChargeRate: 5000
supplyRampTolerance: 5000
supplyRampRate: 1000
maxSupply: 500000
maxChargeRate: 1500000
supplyRampTolerance: 20000
supplyRampRate: 15000
- type: PointLight
radius: 1.5
energy: 1.6
Expand Down Expand Up @@ -100,11 +100,11 @@
- type: entity
parent: BaseSMES
id: SMESBasic
suffix: Basic, 8MW
suffix: Basic, 25kWh
components:
- type: Battery
maxCharge: 8000000
startingCharge: 8000000
maxCharge: 90000000
startingCharge: 18000000

- type: entity
parent: SMESBasic
Expand Down
Loading
Loading