-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stamina Damage Resistance Real (#679)
# Description Added stamina damage resistance, acts the same way as armor does. Call this shock resistance if you wish Just attach StaminaDamageResistance component to an entity with a set multiplier and have fun. Made all hardsuits 25% stun resistant by default. With some variety, e.g. nukie, ERT, captain, HoS suits are 50%, DS are 90%, etc. etc. This will not remove stuneta but it will make it more difficult to stamcrit a traitor or such. Some armor/batong ratios that you need to hit before the target is stamcritted: 0% - 3 batong hits 25% - 4 batong hits 50% - 6 batong hits 75% - 12 batong hits 90% - 28 batong hits 100% - ![image](https://github.com/user-attachments/assets/da147676-520b-4e3c-b027-ef9dc6a7394b) # Changelog :cl: - add: Added different stamina damage resistance to hardsuits. --------- Co-authored-by: whateverusername0 <whateveremail>
- Loading branch information
1 parent
cb3ddd4
commit 55aa822
Showing
11 changed files
with
128 additions
and
26 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
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
Oops, something went wrong.