forked from Simple-Station/Einstein-Engines
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Trait Functions (PushMarkup & AddArmor) (Simple-Station#1253)
# Description This PR effectively "Reworks" several of the Bionic Traits through use of new modular TraitFunctions. These being, **TraitPushDescription**: Ensures that an entity has the new ExtendDescriptionComponent, then writes to said component. ExtendDescriptionComponent serves as a new highly modular "One stop shop" for any system wanting to add text to the shift-click examine window. It even accepts arguments for text color, font size, and whether or not a person must be standing within touching distance to "See" the provided texts. It accepts arbitrarily any number of descriptions. **TraitAddArmor**: This takes advantage of a new functionality for the DamageableSystem, whereby entities are able to have more than one DamageModifierSet. This allows arbitrarily any number of traits to add as many modifier sets as desired, without fear of any compatibility issues. These can be both negative and positive, and as Skubman has pointed out, this can also be used to create negative traits that make a character more vulnerable to a given damage type! Additionally, most of the Bionics Traits have been reworked. CyberEyes has been split into two modules, one for the base implant, and one for the Flash Protection. Dermal Armor has been reworked using TraitAddArmor, so that it no longer replaces your original modifier set, and instead stacks multiplicatively with whatever your original species modifier set was. Thus, it can now be taken by any species. # TODO <details><summary><h1>Media</h1></summary> <p> TraitPushDescription ![image](https://github.com/user-attachments/assets/4661671a-6f20-4cb1-9fad-41c36f7ad79e) TraitAddArmor ![image](https://github.com/user-attachments/assets/bbc823e1-73bf-471d-b5f6-ef8cdf35c746) </p> </details> # Changelog :cl: - add: Five new functions for the Trait System, AddArmor, PushDescription, ModifyMobThresholds, AddSolutionContainer, and ModifyStamina. - tweak: CyberEyes Basic System has been split, now Flash Protection is a separate module. - add: Dermal Armor no longer replaces your original species damage resistances. It now stacks multiplicatively with your original resistances. - tweak: Dermal Armor can now be taken by any species, not just Humans. - add: Dermal Armor, and Bionic Arms can now be revealed by a close examination. Shift click on someone within touching distance will reveal if they have these "Obvious" cyberware. --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: Remuchi <[email protected]>
- Loading branch information
Showing
11 changed files
with
256 additions
and
48 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
11 changes: 0 additions & 11 deletions
11
Content.Shared/Traits/Assorted/Components/CyberEyesComponent.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
Content.Shared/Traits/Assorted/Components/ExtendDescriptionComponent.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 Robust.Shared.Serialization; | ||
|
||
namespace Content.Shared.Traits.Assorted.Components; | ||
|
||
[Serializable, NetSerializable, DataDefinition] | ||
public sealed partial class DescriptionExtension | ||
{ | ||
[DataField] | ||
public string Description = ""; | ||
|
||
[DataField] | ||
public int FontSize = 12; | ||
|
||
[DataField] | ||
public string Color = "#ffffff"; | ||
|
||
[DataField] | ||
public bool RequireDetailRange = true; | ||
} | ||
|
||
[RegisterComponent] | ||
public sealed partial class ExtendDescriptionComponent : Component | ||
{ | ||
/// <summary> | ||
/// The list of all descriptions to add to an entity when examined at close range. | ||
/// </summary> | ||
[DataField] | ||
public List<DescriptionExtension> DescriptionList = new(); | ||
} |
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
Content.Shared/Traits/Assorted/Systems/ExtendDescriptionSystem.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,27 @@ | ||
using Content.Shared.Examine; | ||
using Content.Shared.Traits.Assorted.Components; | ||
|
||
namespace Content.Shared.Traits.Assorted.Systems; | ||
|
||
public sealed class ExtendDescriptionSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<ExtendDescriptionComponent, ExaminedEvent>(OnExamined); | ||
} | ||
|
||
private void OnExamined(EntityUid uid, ExtendDescriptionComponent component, ExaminedEvent args) | ||
{ | ||
if (component.DescriptionList.Count <= 0) | ||
return; | ||
|
||
foreach (var desc in component.DescriptionList) | ||
{ | ||
if (!args.IsInDetailsRange && desc.RequireDetailRange) | ||
continue; | ||
|
||
args.PushMarkup($"[font size ={desc.FontSize}][color={desc.Color}]{Loc.GetString(desc.Description, ("entity", uid))}[/color][/font]"); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
examine-cybereyes-message = {CAPITALIZE(POSS-ADJ($entity))} eyes shine with a faint inner light. | ||
examine-dermal-armor-message = {CAPITALIZE(POSS-ADJ($entity))} skin seems to be made of a sturdy, yet flexible plastic. | ||
examine-bionic-arm-message = {CAPITALIZE(POSS-ADJ($entity))} limbs emit an ever present faint chirp of servomotors. |
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