Skip to content

Commit

Permalink
EE Merge to Fix ChemMaster Demonic Possession + Shadowkin (#207)
Browse files Browse the repository at this point in the history
🆑 EE contributors
- add: Shadowkins can now be roundstart species again
- add: Shadowkins now have lungs, yippee! 
- add: Shadowkins now have organs with funny little descriptions
- add: Shadowkins now have a brand new and expanded list of names
- add: Shadowkins now have roundstart innate telepathy ability rather
than a whole new language for it.
- tweak: Shadowkins take more damage from heat, slash, and piercing
- tweak: Shadowkins are much more like their SS13 counterparters
- tweak: Shadowkins now have much better lore in their guidebook entry
- tweak: Shadowkins now have a more fleshed out language (to outside
observers)
- tweak: Shadowkins now can be mystagogue, mantis, chaplain, and
cataloguer
- tweak: Shadowkins must now have blackeye trait to play prisoner
- tweak: Shadowkins no longer have blackeye trait by default
- tweak: Shadowkins now take asphyxiation damage, albeit at half the
rate of others.
- tweak: Shadowkins now have a more pronounced snout.
- remove: Removed DarkSwap from Shadowkin roundstart
- fix: Fixed the demons of Gehenna possessing the ChemMaster
  • Loading branch information
sleepyyapril authored Jan 26, 2025
2 parents 9c47c1b + 96fd4f7 commit a877085
Show file tree
Hide file tree
Showing 31 changed files with 446 additions and 416 deletions.
82 changes: 13 additions & 69 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ public sealed partial class ChemMasterWindow : FancyWindow
public event Action<int>? OnTransferAmountChanged;
public readonly Button[] PillTypeButtons;

private Dictionary<string, ReagentCached> _reagents;
private Dictionary<string, ReagentCached> _pillReagents;
private const string TransferringAmountColor = "#ffffff";
private ReagentSortMethod _currentSortMethod = ReagentSortMethod.Alphabetical;
private ChemMasterBoundUserInterfaceState? _lastState;
private int _transferAmount = 50;
private bool _isOutput = false;

private const string PillsRsiPath = "/Textures/Objects/Specific/Chemistry/pills.rsi";

Expand All @@ -50,9 +47,6 @@ public ChemMasterWindow()
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

_reagents = new();
_pillReagents = new();

AmountLabel.HorizontalAlignment = HAlignment.Center;
AmountLineEdit.OnTextEntered += SetAmount;
AmountLineEdit.OnFocusExit += SetAmount;
Expand Down Expand Up @@ -372,43 +366,12 @@ private void BuildBufferInfo(ChemMasterBoundUserInterfaceState state)
};
bufferHBox.AddChild(bufferVol);

foreach (var reagent in _reagents.Keys)
{
if (state.BufferReagents.All(x => x.Reagent.Prototype != reagent))
_reagents.Remove(reagent);
}

// initialises rowCount to allow for striped rows
var rowCount = 0;
var bufferReagents = state.BufferReagents.OrderBy(x => x.Reagent.Prototype);

if (_currentSortMethod == ReagentSortMethod.Amount)
bufferReagents = bufferReagents.OrderByDescending(x => x.Quantity);

if (_currentSortMethod == ReagentSortMethod.Time)
{
bufferReagents = bufferReagents.OrderByDescending(
x =>
{
var exists = _reagents.TryGetValue(x.Reagent.Prototype, out var reagent);
return exists && reagent != null ? reagent.TimeAdded : DateTimeOffset.UtcNow;
});
}

foreach (var (reagentId, quantity) in bufferReagents)
{
_prototypeManager.TryIndex(reagentId.Prototype, out ReagentPrototype? proto);

var name = proto?.LocalizedName ?? Loc.GetString("chem-master-window-unknown-reagent-text");
var reagentColor = proto?.SubstanceColor ?? default(Color);
BufferInfo.Children.Add(BuildReagentRow(reagentColor, rowCount++, name, reagentId, quantity, true, true));
_reagents.TryGetValue(reagentId.Prototype, out var reagentCached);

var timeAdded = reagentCached?.TimeAdded ?? DateTimeOffset.UtcNow;
var cached = new ReagentCached(reagentId, timeAdded, quantity);

_reagents.Add(reagentId.Prototype, cached);
}
HandleBuffer(_currentSortMethod == ReagentSortMethod.Time ? state.BufferReagents : bufferReagents, false);
}

private void BuildPillBufferInfo(ChemMasterBoundUserInterfaceState state)
Expand Down Expand Up @@ -436,42 +399,30 @@ private void BuildPillBufferInfo(ChemMasterBoundUserInterfaceState state)
};
bufferHBox.AddChild(bufferVol);

foreach (var reagent in _pillReagents.Keys)
{
if (state.BufferReagents.All(x => x.Reagent.Prototype != reagent))
_pillReagents.Remove(reagent);
}

// initialises rowCount to allow for striped rows
var rowCount = 0;
var bufferReagents = state.PillBufferReagents.OrderBy(x => x.Reagent.Prototype);

if (_currentSortMethod == ReagentSortMethod.Amount)
bufferReagents = bufferReagents.OrderByDescending(x => x.Quantity);

if (_currentSortMethod == ReagentSortMethod.Time)
{
bufferReagents = bufferReagents.OrderByDescending(
x =>
{
var exists = _pillReagents.TryGetValue(x.Reagent.Prototype, out var reagent);
return exists && reagent != null ? reagent.TimeAdded : DateTimeOffset.UtcNow;
});
}
HandleBuffer(_currentSortMethod == ReagentSortMethod.Time ? state.PillBufferReagents : bufferReagents, true);
}

foreach (var (reagentId, quantity) in bufferReagents)
private void HandleBuffer(IEnumerable<ReagentQuantity> reagents, bool pillBuffer)
{
var rowCount = 0;
foreach (var (reagentId, quantity) in reagents)
{
_prototypeManager.TryIndex(reagentId.Prototype, out ReagentPrototype? proto);

var name = proto?.LocalizedName ?? Loc.GetString("chem-master-window-unknown-reagent-text");
var reagentColor = proto?.SubstanceColor ?? default(Color);
PillBufferInfo.Children.Add(BuildReagentRow(reagentColor, rowCount++, name, reagentId, quantity, true, true));
_pillReagents.TryGetValue(reagentId.Prototype, out var reagentCached);

var timeAdded = reagentCached?.TimeAdded ?? DateTimeOffset.UtcNow;
var cached = new ReagentCached(reagentId, timeAdded, quantity);

_pillReagents.Add(reagentId.Prototype, cached);
if (pillBuffer)
PillBufferInfo.Children.Add(
BuildReagentRow(reagentColor, rowCount++, name, reagentId, quantity, true, true));
else
BufferInfo.Children.Add(
BuildReagentRow(reagentColor, rowCount++, name, reagentId, quantity, true, true));
}
}

Expand Down Expand Up @@ -604,13 +555,6 @@ public ReagentButton(string text, ReagentId id, bool isBuffer)
}
}

public sealed class ReagentCached(ReagentId id, DateTimeOffset timeAdded, FixedPoint2 quantity)
{
public ReagentId Id { get; set; } = id;
public DateTimeOffset TimeAdded { get; set; } = timeAdded;
public FixedPoint2 Quantity { get; set; } = quantity;
}

public enum ReagentSortMethod
{
Time,
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Abilities/Psionics/Abilities/DarkSwapSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ private void OnPowerUsed(DarkSwapActionEvent args)
}
}
}


1 change: 0 additions & 1 deletion Content.Server/Shadowkin/ShadowkinSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private void OnEyeColorChange(EntityUid uid, ShadowkinComponent component, EyeCo
return;

component.OldEyeColor = humanoid.EyeColor;
humanoid.EyeColor = component.BlackEyeColor;
Dirty(uid, humanoid);
}

Expand Down
18 changes: 18 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10804,3 +10804,21 @@ Entries:
id: 6768
time: '2025-01-26T02:13:32.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/1660
- author: SX-7
changes:
- type: Fix
message: Fixed typos in guidebook entry for tajara
- type: Fix
message: Temperature related fixes for tajara
id: 6769
time: '2025-01-26T12:51:39.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/1664
- author: sleepyyapril
changes:
- type: Fix
message: >-
ChemMaster no longer loses your last added progress because of a silly
goose move.
id: 6770
time: '2025-01-26T15:44:04.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/1663
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_EE/chat/chat-language.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
chat-language-NalRasan-name = Nal'rasan
chat-language-SiikTajr-name = Siik'tajr
chat-language-SiikMaas-name = Siik'maas
chat-language-YaSsa-name = Ya'ssa
chat-language-Delvahii-name = Delvahii
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/language/languages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ language-Sign-name = Tau-Ceti Basic Sign Language
language-Sign-description = TCB-SL for short, this sign language is prevalent among mute and deaf people.
language-Marish-name = Marish
language-Marish-description = An inherently empathetic language, conveying emotions with a single word; spoken effortlessly by Shadowkins, though nearly impossible to learn or replicate.
language-Marish-description = A language spoken only by Shadowkin, one that is unable to be replicated by normal tongues.
language-ValyrianStandard-name = Valyrian Standard
language-ValyrianStandard-description =
Expand Down
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,7 @@ trait-name-ThermographicVision = CyberEyes Module: Thermographic Scanner
trait-description-ThermographicVision =
Your CyberEyes have been enhanced with a Thermographic Scanner. When enabled, it captures a snapshot of the user's surroundings, while highlighting all
biological life forms. It can even detect individuals through the walls of a station.
trait-name-ShadowkinBlackeye = Blackeye
trait-description-ShadowkinBlackeye =
You lose your special Shadowkin powers & respect amongst your peers, in return for some points. Effectively, you are only a Shadowkin in name, not in practice.
23 changes: 19 additions & 4 deletions Resources/Prototypes/Body/Organs/shadowkin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- type: entity
id: OrganShadowkinBrain
parent: OrganHumanBrain
description: "Oops, I should put this back where I found it."
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand All @@ -9,7 +10,7 @@
- type: entity
id: OrganShadowkinEyes
parent: OrganHumanEyes
description: I see beyond anything you ever will!
description: "I see beyond anything you ever will!"
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand All @@ -19,15 +20,27 @@
- type: entity
id: OrganShadowkinEars
parent: OrganHumanEars
description: Hey, listen!
description: "Hey, listen!"
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
state: ears

- type: entity
id: OrganShadowkinCore
parent: OrganHumanLungs
description: "What is this thing?"
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
layers:
- state: core


- type: entity
id: OrganShadowkinTongue
parent: OrganHumanTongue
description: "What does this do again?"
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand All @@ -37,6 +50,7 @@
- type: entity
id: OrganShadowkinAppendix
parent: OrganHumanAppendix
description: "I think it does nothing..."
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand All @@ -47,6 +61,7 @@
- type: entity
id: OrganShadowkinHeart
parent: OrganHumanHeart
description: "Oops, I think this belongs to someone!"
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand Down Expand Up @@ -101,7 +116,7 @@
- type: entity
id: OrganShadowkinKidneys
parent: OrganHumanKidneys
description: Give the kid their knees back, please, this is the third time this week.
description: "Give the kid their knees back, please, this is the third time this week."
components:
- type: Sprite
sprite: Mobs/Species/Shadowkin/organs.rsi
Expand All @@ -110,4 +125,4 @@
- type: Metabolizer
maxReagents: 5
metabolizerTypes: [Shadowkin]
removeEmpty: true
removeEmpty: true
1 change: 1 addition & 0 deletions Resources/Prototypes/Body/Prototypes/shadowkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
stomach: OrganShadowkinStomach
liver: OrganShadowkinLiver
kidneys: OrganShadowkinKidneys
lungs: OrganShadowkinCore
right arm:
part: RightArmShadowkin
connections:
Expand Down
9 changes: 2 additions & 7 deletions Resources/Prototypes/Damage/modifier_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,11 @@
- type: damageModifierSet
id: Shadowkin
coefficients:
Blunt: 0.95
Slash: 1.2
Piercing: 1.1
Asphyxiation: 0
Cold: 0.75
Asphyxiation: 0.5
Cold: 0.8
Heat: 1.2
Cellular: 0.25
Bloodloss: 1.35
Shock: 1.25
Radiation: 1.3

- type: damageModifierSet
id: Plasmaman
Expand Down
Loading

0 comments on commit a877085

Please sign in to comment.