-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
242 additions
and
35 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Content.Server.Traits.Assorted; | ||
|
||
/// <summary> | ||
/// This is used for the Blood Deficiency trait. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class BloodDeficiencyComponent : Component | ||
{ | ||
// <summary> | ||
// How much reagent of blood should be removed in each update interval? | ||
// </summary> | ||
[DataField(required: true)] | ||
public float BloodLossAmount; | ||
} |
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,23 @@ | ||
using Content.Server.Body.Systems; | ||
using Content.Server.Body.Components; | ||
using Content.Shared.Damage; | ||
|
||
namespace Content.Server.Traits.Assorted; | ||
|
||
public sealed class BloodDeficiencySystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<BloodDeficiencyComponent, ComponentStartup>(OnStartup); | ||
} | ||
|
||
private void OnStartup(EntityUid uid, BloodDeficiencyComponent component, ComponentStartup args) | ||
{ | ||
if (!TryComp<BloodstreamComponent>(uid, out var bloodstream)) | ||
return; | ||
|
||
bloodstream.HasBloodDeficiency = true; | ||
bloodstream.BloodDeficiencyLossAmount = component.BloodLossAmount; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
Content.Shared/Stunnable/StaminaDamageResistanceComponent.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,12 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Stunnable; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class StaminaDamageResistanceComponent : Component | ||
{ | ||
/// <summary> | ||
/// 1 - no reduction, 0 - full reduction | ||
/// </summary> | ||
[DataField] public float Coefficient = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Content.Shared.Damage.Events; | ||
using Content.Shared.Examine; | ||
using Content.Shared.Inventory; | ||
|
||
namespace Content.Shared.Stunnable; | ||
|
||
public sealed partial class StaminaDamageResistanceSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<StaminaDamageResistanceComponent, InventoryRelayedEvent<TakeStaminaDamageEvent>>(OnStaminaMeleeHit); | ||
SubscribeLocalEvent<StaminaDamageResistanceComponent, ExaminedEvent>(OnExamine); | ||
} | ||
|
||
private void OnStaminaMeleeHit(Entity<StaminaDamageResistanceComponent> ent, ref InventoryRelayedEvent<TakeStaminaDamageEvent> args) | ||
{ | ||
args.Args.Multiplier *= ent.Comp.Coefficient; | ||
} | ||
private void OnExamine(Entity<StaminaDamageResistanceComponent> ent, ref ExaminedEvent args) | ||
{ | ||
var percentage = (1 - ent.Comp.Coefficient) * 100; | ||
args.PushMarkup(Loc.GetString("armor-examine-stamina", ("num", percentage))); | ||
} | ||
} |
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
Oops, something went wrong.