forked from DeltaV-Station/Delta-v
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
they did surgery on a fish (DeltaV-Station#889)
* add breathing immunity and organ status effects * they did surgery on a fish * fix error for installing parts on non-humanoids --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
- Loading branch information
1 parent
67b0a95
commit a778a9b
Showing
15 changed files
with
189 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Content.Server/_Shitmed/Body/Organ/StatusEffectOrganComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Content.Shared.StatusEffect; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; | ||
|
||
namespace Content.Server._Shitmed.Body.Organ; | ||
|
||
[RegisterComponent, Access(typeof(StatusEffectOrganSystem))] | ||
[AutoGenerateComponentPause] | ||
public sealed partial class StatusEffectOrganComponent : Component | ||
{ | ||
/// <summary> | ||
/// List of status effects and components to refresh while the organ is installed. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public Dictionary<ProtoId<StatusEffectPrototype>, string> Refresh = new(); | ||
|
||
/// <summary> | ||
/// How long to wait between each refresh. | ||
/// Effects can only last at most this long once the organ is removed. | ||
/// </summary> | ||
[DataField] | ||
public TimeSpan Delay = TimeSpan.FromSeconds(5); | ||
|
||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField] | ||
public TimeSpan NextUpdate = TimeSpan.Zero; | ||
} |
33 changes: 33 additions & 0 deletions
33
Content.Server/_Shitmed/Body/Organ/StatusEffectOrganSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Content.Shared.Body.Organ; | ||
using Content.Shared.StatusEffect; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Server._Shitmed.Body.Organ; | ||
|
||
public sealed class StatusEffectOrganSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly StatusEffectsSystem _effects = default!; | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<StatusEffectOrganComponent, OrganComponent>(); | ||
var now = _timing.CurTime; | ||
while (query.MoveNext(out var uid, out var comp, out var organ)) | ||
{ | ||
if (now < comp.NextUpdate || organ.Body is not {} body) | ||
continue; | ||
|
||
comp.NextUpdate = now + comp.Delay; | ||
if (!TryComp<StatusEffectsComponent>(body, out var effects)) | ||
continue; | ||
|
||
foreach (var (key, component) in comp.Refresh) | ||
{ | ||
_effects.TryAddStatusEffect(body, key, comp.Delay, refresh: true, component, effects); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Content.Shared/_Shitmed/Body/Components/BreathingImmunityComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Content.Shared._Shitmed.Body.Components; | ||
|
||
/// <summary> | ||
/// GoobStation: Disables a mobs need for air when this component is added. | ||
/// It will neither breathe nor take airloss damage. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class BreathingImmunityComponent : Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Resources/Prototypes/_Goobstation/Body/Organs/Animal/space.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- type: entity | ||
parent: OrganAnimalLungs | ||
id: OrganSpaceAnimalLungs | ||
name: space animal lungs | ||
components: | ||
- type: StatusEffectOrgan | ||
refresh: | ||
BreathingImmunity: BreathingImmunity | ||
|
||
- type: entity | ||
parent: OrganAnimalHeart | ||
id: OrganSpaceAnimalHeart | ||
name: space animal heart | ||
components: | ||
- type: StatusEffectOrgan | ||
refresh: | ||
PressureImmunity: PressureImmunity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Resources/Prototypes/_Goobstation/Body/Prototypes/Animal/carp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- type: body | ||
id: Carp | ||
name: carp | ||
root: torso | ||
slots: | ||
torso: | ||
part: TorsoAnimal | ||
connections: | ||
- tail | ||
organs: | ||
lungs: OrganSpaceAnimalLungs # Immunity to airloss | ||
stomach: OrganAnimalStomach | ||
liver: OrganAnimalLiver | ||
heart: OrganSpaceAnimalHeart # Immunity to cold | ||
kidneys: OrganAnimalKidneys | ||
tail: | ||
part: TailCarp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- type: statusEffect | ||
id: BreathingImmunity | ||
alwaysAllowed: true # Used by space animal lungs to work on anything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Resources/Textures/_Goobstation/Mobs/Aliens/Carps/carp_parts.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from and modified by deltanedas (github) for GoobStation", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "tail" | ||
}, | ||
{ | ||
"name": "torso" | ||
} | ||
] | ||
} |
Binary file added
BIN
+244 Bytes
Resources/Textures/_Goobstation/Mobs/Aliens/Carps/carp_parts.rsi/tail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+479 Bytes
Resources/Textures/_Goobstation/Mobs/Aliens/Carps/carp_parts.rsi/torso.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.