Skip to content

Commit

Permalink
Merge pull request space-wizards#184 from Pixeltheaertist/jellidfix
Browse files Browse the repository at this point in the history
Jellidfix
  • Loading branch information
Pixeltheaertist authored Jan 29, 2025
2 parents 9acacad + 15975ec commit 920b38b
Show file tree
Hide file tree
Showing 48 changed files with 334 additions and 55 deletions.
36 changes: 25 additions & 11 deletions Content.Server/Jellids/JellidDrawSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Damage.Systems;
using Content.Shared.Damage;
using Content.Shared.Alert;

namespace Content.Server.Jellid.Systems
{
public sealed class JellidDrawSystem : EntitySystem
{
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly AlertsSystem _alerts = default!;

public float DrainAmount;

Expand All @@ -24,21 +26,33 @@ public override void Initialize()
}
private void OnChargeChanged(Entity<JellidComponent> entity, ref ChargeChangedEvent args)
{
float DamageCharge = 120f;
if (TryComp<BatteryComponent>(entity.Owner, out var battery) &&
battery.CurrentCharge < DamageCharge)
if (TryComp<BatteryComponent>(entity.Owner, out var battery))
{
if (Charging)
var AlertCharge = 300f;
if (battery.CurrentCharge <= AlertCharge)
{
return;
_alerts.ShowAlert(entity.Owner, battery.NoBatteryAlert);
}
else
else
{
_alerts.ClearAlert(entity.Owner, battery.NoBatteryAlert);
}

float DamageCharge = 20f;
if (battery.CurrentCharge < DamageCharge)
{
var damage = new DamageSpecifier
{
DamageDict = { ["Slash"] = 1.5f }
};
_damageable.TryChangeDamage(entity.Owner, damage, origin: entity.Owner);
if (Charging)
{
return;
}
else
{
var damage = new DamageSpecifier
{
DamageDict = { ["Slash"] = 0.1f }
};
_damageable.TryChangeDamage(entity.Owner, damage, origin: entity.Owner);
}
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion Content.Server/Power/Components/BatteryComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Server.Power.EntitySystems;
using Content.Shared.Alert;
using Robust.Shared.Prototypes;

namespace Content.Server.Power.Components
{
Expand All @@ -18,6 +20,9 @@ public partial class BatteryComponent : Component
[DataField]
public float MaxCharge;

[DataField]
public ProtoId<AlertPrototype> NoBatteryAlert = "JellidBatteryNone";

/// <summary>
/// Current charge of the battery in joules (ie. watt seconds)
/// </summary>
Expand All @@ -36,4 +41,4 @@ public partial class BatteryComponent : Component
/// </summary>
[ByRefEvent]
public readonly record struct ChargeChangedEvent(float Charge, float MaxCharge);
}
}
7 changes: 5 additions & 2 deletions Content.Server/Power/EntitySystems/BatterySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ public override void Update(float frameTime)
var query = EntityQueryEnumerator<BatterySelfRechargerComponent, BatteryComponent>();
while (query.MoveNext(out var uid, out var comp, out var batt))
{
if (!comp.AutoRecharge || IsFull(uid, batt))
continue;
if (!comp.IgnoreFull)
{
if (!comp.AutoRecharge || IsFull(uid, batt))
continue;
}

if (comp.AutoRechargePause)
{
Expand Down
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/alerts/alerts.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ alerts-battery-desc = If your battery depletes, you will be unable to use your a
alerts-no-battery-name = No Battery
alerts-no-battery-desc = You don't have a battery, rendering you unable to charge or use your abilities.
jellid-alerts-no-battery-name = Low Energy
jellid-alerts-no-battery-desc = You're feeling dangerously [color=red]drained[/color]. Find something with a [color=yellow]Battery[/color] to charge up.
alerts-internals-name = Toggle internals
alerts-internals-desc = Toggles your gas tank internals on or off.
Expand Down
11 changes: 10 additions & 1 deletion Resources/Prototypes/Alerts/alerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,19 @@
category: Battery
icons:
- sprite: /Textures/Interface/Alerts/battery.rsi
state: battery-none
state: battery1
name: alerts-no-battery-name
description: alerts-no-battery-desc

- type: alert
id: JellidBatteryNone
category: Battery
icons:
- sprite: /Textures/Interface/Alerts/battery.rsi
state: battery0
name: jellid-alerts-no-battery-name
description: jellid-alerts-no-battery-desc

- type: alert
id: Internals
category: Internals
Expand Down
43 changes: 39 additions & 4 deletions Resources/Prototypes/Catalog/Fills/Items/gas_tanks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@
temperature: 293.15

- type: entity
id: TP14WaterTankFilled
name: water tank
parent: OxygenTank
id: TP14WaterTankEmergencyFilled
name: emergency water tank
parent: EmergencyFunnyOxygenTank
suffix: Filled
components:
- type: GasTank
Expand All @@ -182,7 +182,42 @@
- 0
- 0
- 0
- 2.051379050 # oxygen
- 2.051379050
temperature: 293.15

- type: entity
id: TP14WaterTankFilled
name: water tank
parent: OxygenTank
suffix: Filled
description: A robust tank designed to store sea water
components:
- type: Clothing
quickEquip: false
slots:
- back
- suitStorage
sprite: Objects/Tanks/water.rsi
- type: Sprite
sprite: Objects/Tanks/water.rsi
- type: Item
sprite: Objects/Tanks/water.rsi
- type: GasTank
outputPressure: 21.3
air:
# 31 minutes
volume: 5
moles:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 2.051379050
temperature: 293.15

- type: entity
Expand Down
34 changes: 21 additions & 13 deletions Resources/Prototypes/Entities/Clothing/Masks/masks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@
Piercing: 0.95
Heat: 0.95

- type: entity
parent: ClothingMaskPullableBase
id: ClothingMaskBreathMedicalSecurity
name: medical mask
description: A close-fitting sterile mask that can be connected to an air supply.
components:
- type: Item
size: Tiny
- type: Sprite
sprite: Clothing/Mask/medical.rsi
- type: Clothing
sprite: Clothing/Mask/medical.rsi
- type: BreathMask

- type: entity
parent: ClothingMaskPullableBase
id: ClothingMaskBreathMedical
Expand All @@ -139,24 +153,18 @@
- WhitelistChameleon

- type: entity
parent: ClothingMaskBreathMedical
id: ClothingMaskBreathMedicalSecurity
name: military-style medical mask
description: A medical mask with a small layer of protection against damage and viruses, similar to the one used in the medical units of the first corporate war.
parent: ClothingMaskBase
id: ClothingMaskBreathNeck
name: lung-adaption apparatus
description: A series of tubes that connects from a tank to the wearer's lungs. Allows more comfortable use. After putting on, of course.
components:
- type: Item
size: Tiny
- type: Sprite
sprite: Clothing/Mask/medicalsecurity.rsi
sprite: Clothing/Mask/neckapparatus.rsi
- type: Clothing
sprite: Clothing/Mask/medicalsecurity.rsi
- type: Armor
modifiers:
coefficients:
Blunt: 0.95
Slash: 0.95
Piercing: 0.95
Heat: 0.95
sprite: Clothing/Mask/neckapparatus.rsi
- type: BreathMask

- type: entity
parent: ClothingMaskPullableBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- type: entity
abstract: true
parent: Clothing
parent: [ Clothing, AllowSuitStorageClothingGasTanks ]
id: ClothingOuterBase
components:
- type: Clothing
Expand All @@ -9,6 +9,7 @@
- type: Sprite
state: icon


- type: entity
abstract: true
parent: ClothingOuterBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
bodyPart: Hair
markingCategory: Hair
speciesRestriction: [Jellid]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Mobs/Customization/Jellid.rsi
state: head_mantle
5 changes: 2 additions & 3 deletions Resources/Prototypes/Entities/Mobs/Species/jellid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
- type: IgnitionSource
temperature: 700
ignited: true
- type: Firestarter
- type: AlwaysHot
- type: TemperatureProtection
coefficient: 0.6
Expand Down Expand Up @@ -76,10 +75,10 @@
- type: Respirator
damage:
types:
Slash: 4
Slash: 2
damageRecovery:
types:
Slash: -0.3 # hopefully shouldn't be OP
Slash: -0.05 # hopefully shouldn't be OP
maxSaturation: 15
gaspEmote: Scream
- type: Inventory
Expand Down
6 changes: 6 additions & 0 deletions Resources/Prototypes/Guidebook/species.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
- Reptilian
- SlimePerson
- Vox
- Jellid

- type: guideEntry
id: Jellid
name: species-name-jellid
text: "/ServerInfo/Guidebook/Mobs/Jellid.xml"

- type: guideEntry
id: Arachnid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Similar to human, but no shoes, like Diona
- type: inventoryTemplate
id: jellid
slots:
Expand Down Expand Up @@ -115,3 +114,10 @@
uiWindowPos: 3,0
strippingWindowPos: 0,5
displayName: Back
- name: shoes
slotTexture: shoes
slotFlags: FEET
stripTime: 3
uiWindowPos: 1,0
strippingWindowPos: 1,3
displayName: Shoes
Loading

0 comments on commit 920b38b

Please sign in to comment.