-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into per-character-consent-menu
- Loading branch information
Showing
21 changed files
with
522 additions
and
53 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
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
29 changes: 29 additions & 0 deletions
29
Content.Server/FloofStation/Traits/Components/VampirismComponent.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,29 @@ | ||
using Content.Server.Body.Components; | ||
using Content.Shared.Body.Prototypes; | ||
using Content.Shared.Whitelist; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Floofstation.Traits.Components; | ||
|
||
/// <summary> | ||
/// Enables the mob to suck blood from other mobs to replenish its own saturation. | ||
/// Must be fully initialized before being added to a mob. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class VampirismComponent : Component | ||
{ | ||
[DataField] | ||
public HashSet<ProtoId<MetabolizerTypePrototype>> MetabolizerPrototypes = new() { "Vampiric", "Animal" }; | ||
|
||
/// <summary> | ||
/// A whitelist for what special-digestible-required foods the vampire's stomach is capable of eating. | ||
/// </summary> | ||
[DataField] | ||
public EntityWhitelist? SpecialDigestible = null; | ||
|
||
[DataField] | ||
public TimeSpan SuccDelay = TimeSpan.FromSeconds(1); | ||
|
||
[DataField] | ||
public float UnitsToSucc = 10; | ||
} |
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,51 @@ | ||
using Content.Server.Body.Components; | ||
using Content.Server.Floofstation.Traits.Components; | ||
using Content.Server.Vampiric; | ||
using Content.Shared.Body.Components; | ||
using Content.Shared.Body.Systems; | ||
|
||
namespace Content.Server.Floofstation.Traits; | ||
|
||
public sealed class VampirismSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedBodySystem _body = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<VampirismComponent, MapInitEvent>(OnInitVampire); | ||
} | ||
|
||
private void OnInitVampire(Entity<VampirismComponent> ent, ref MapInitEvent args) | ||
{ | ||
EnsureBloodSucker(ent); | ||
|
||
if (!TryComp<BodyComponent>(ent, out var body) | ||
|| !_body.TryGetBodyOrganComponents<MetabolizerComponent>(ent, out var comps, body)) | ||
return; | ||
|
||
foreach (var (metabolizer, organ) in comps) | ||
{ | ||
if (!TryComp<StomachComponent>(organ.Owner, out var stomach)) | ||
continue; | ||
|
||
metabolizer.MetabolizerTypes = ent.Comp.MetabolizerPrototypes; | ||
|
||
if (ent.Comp.SpecialDigestible is {} whitelist) | ||
stomach.SpecialDigestible = whitelist; | ||
} | ||
} | ||
|
||
private void EnsureBloodSucker(Entity<VampirismComponent> uid) | ||
{ | ||
if (HasComp<BloodSuckerComponent>(uid)) | ||
return; | ||
|
||
AddComp(uid, new BloodSuckerComponent | ||
{ | ||
Delay = uid.Comp.SuccDelay, | ||
InjectWhenSucc = false, // The code for it is deprecated, might wanna make it inject something when (if?) it gets reworked | ||
UnitsToSucc = uid.Comp.UnitsToSucc, | ||
WebRequired = false | ||
}); | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ | |
- Shoukou | ||
- Tortuga | ||
- TheHive | ||
- Submarine | ||
- Saltern | ||
- Glacier |
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 |
---|---|---|
|
@@ -64,3 +64,4 @@ | |
Musician: [ 1, 3 ] | ||
Boxer: [ 2, 4 ] | ||
Reporter: [ 2, 4 ] | ||
Passenger: [ -1, -1 ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,5 @@ | |
Clown: [ 1, 1 ] | ||
Mime: [ 1, 1 ] | ||
Musician: [ 1, 2 ] | ||
Passenger: [ -1, -1 ] | ||
|
Oops, something went wrong.