Fix zombie eye appearance (#19427)
This commit is contained in:
@@ -133,12 +133,15 @@ namespace Content.Server.Zombies
|
|||||||
{
|
{
|
||||||
//store some values before changing them in case the humanoid get cloned later
|
//store some values before changing them in case the humanoid get cloned later
|
||||||
zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor;
|
zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor;
|
||||||
|
zombiecomp.BeforeZombifiedEyeColor = huApComp.EyeColor;
|
||||||
zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers);
|
zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers);
|
||||||
if (TryComp<BloodstreamComponent>(target, out var stream))
|
if (TryComp<BloodstreamComponent>(target, out var stream))
|
||||||
zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent;
|
zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent;
|
||||||
|
|
||||||
_humanoidAppearance.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp);
|
_humanoidAppearance.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp);
|
||||||
_humanoidAppearance.SetBaseLayerColor(target, HumanoidVisualLayers.Eyes, zombiecomp.EyeColor, humanoid: huApComp);
|
|
||||||
|
// Messing with the eye layer made it vanish upon cloning, and also it didn't even appear right
|
||||||
|
huApComp.EyeColor = zombiecomp.EyeColor;
|
||||||
|
|
||||||
// this might not resync on clone?
|
// this might not resync on clone?
|
||||||
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Tail, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
_humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Tail, zombiecomp.BaseLayerExternal, humanoid: huApComp);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using Content.Shared.Zombies;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
using Content.Shared.Humanoid;
|
||||||
|
|
||||||
namespace Content.Server.Zombies
|
namespace Content.Server.Zombies
|
||||||
{
|
{
|
||||||
@@ -256,7 +257,11 @@ namespace Content.Server.Zombies
|
|||||||
_humanoidAppearance.SetBaseLayerColor(target, layer, info.Color);
|
_humanoidAppearance.SetBaseLayerColor(target, layer, info.Color);
|
||||||
_humanoidAppearance.SetBaseLayerId(target, layer, info.ID);
|
_humanoidAppearance.SetBaseLayerId(target, layer, info.ID);
|
||||||
}
|
}
|
||||||
_humanoidAppearance.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor);
|
if(TryComp<HumanoidAppearanceComponent>(target, out var appcomp))
|
||||||
|
{
|
||||||
|
appcomp.EyeColor = zombiecomp.BeforeZombifiedEyeColor;
|
||||||
|
}
|
||||||
|
_humanoidAppearance.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor, false);
|
||||||
_bloodstream.ChangeBloodReagent(target, zombiecomp.BeforeZombifiedBloodReagent);
|
_bloodstream.ChangeBloodReagent(target, zombiecomp.BeforeZombifiedBloodReagent);
|
||||||
|
|
||||||
_metaData.SetEntityName(target, zombiecomp.BeforeZombifiedEntityName);
|
_metaData.SetEntityName(target, zombiecomp.BeforeZombifiedEntityName);
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ public sealed partial class ZombieComponent : Component
|
|||||||
[DataField("beforeZombifiedSkinColor")]
|
[DataField("beforeZombifiedSkinColor")]
|
||||||
public Color BeforeZombifiedSkinColor;
|
public Color BeforeZombifiedSkinColor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The eye color of the humanoid to restore in case of cloning
|
||||||
|
/// </summary>
|
||||||
|
[DataField("beforeZombifiedEyeColor")]
|
||||||
|
public Color BeforeZombifiedEyeColor;
|
||||||
|
|
||||||
[DataField("emoteId", customTypeSerializer: typeof(PrototypeIdSerializer<EmoteSoundsPrototype>))]
|
[DataField("emoteId", customTypeSerializer: typeof(PrototypeIdSerializer<EmoteSoundsPrototype>))]
|
||||||
public string? EmoteSoundsId = "Zombie";
|
public string? EmoteSoundsId = "Zombie";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user